diff --git a/c-api/init_config.po b/c-api/init_config.po index 1d6b52d796..603221f0cb 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-18 00:20+0000\n" +"POT-Creation-Date: 2026-06-17 00:45+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -29,13 +29,13 @@ msgstr "PyInitConfig C API" msgid "Python can be initialized with :c:func:`Py_InitializeFromInitConfig`." msgstr "Python 可以使用 :c:func:`Py_InitializeFromInitConfig` 來初始化。" -#: ../../c-api/init_config.rst:19 ../../c-api/init_config.rst:650 +#: ../../c-api/init_config.rst:19 ../../c-api/init_config.rst:654 msgid "" "The :c:func:`Py_RunMain` function can be used to write a customized Python " "program." msgstr "" -#: ../../c-api/init_config.rst:22 ../../c-api/init_config.rst:653 +#: ../../c-api/init_config.rst:22 ../../c-api/init_config.rst:657 msgid "" "See also :ref:`Initialization, Finalization, and Threads `." msgstr "" @@ -44,7 +44,7 @@ msgstr "" msgid ":pep:`741` \"Python Configuration C API\"." msgstr "" -#: ../../c-api/init_config.rst:29 ../../c-api/init_config.rst:660 +#: ../../c-api/init_config.rst:29 ../../c-api/init_config.rst:664 msgid "Example" msgstr "範例" @@ -1086,22 +1086,28 @@ msgid "" "arguments ``name``, ``value``." msgstr "" -#: ../../c-api/init_config.rst:630 +#: ../../c-api/init_config.rst:626 +msgid "" +"The function now replaces :data:`sys.flags` (create a new object), instead " +"of modifying :data:`sys.flags` in-place." +msgstr "" + +#: ../../c-api/init_config.rst:634 msgid "PyConfig C API" msgstr "PyConfig C API" -#: ../../c-api/init_config.rst:634 +#: ../../c-api/init_config.rst:638 msgid "" "Python can be initialized with :c:func:`Py_InitializeFromConfig` and the :c:" "type:`PyConfig` structure. It can be preinitialized with :c:func:" "`Py_PreInitialize` and the :c:type:`PyPreConfig` structure." msgstr "" -#: ../../c-api/init_config.rst:638 +#: ../../c-api/init_config.rst:642 msgid "There are two kinds of configuration:" msgstr "" -#: ../../c-api/init_config.rst:640 +#: ../../c-api/init_config.rst:644 msgid "" "The :ref:`Python Configuration ` can be used to build a " "customized Python which behaves as the regular Python. For example, " @@ -1109,7 +1115,7 @@ msgid "" "Python." msgstr "" -#: ../../c-api/init_config.rst:645 +#: ../../c-api/init_config.rst:649 msgid "" "The :ref:`Isolated Configuration ` can be used to embed " "Python into an application. It isolates Python from the system. For example, " @@ -1117,15 +1123,15 @@ msgid "" "no signal handler is registered." msgstr "" -#: ../../c-api/init_config.rst:656 +#: ../../c-api/init_config.rst:660 msgid ":pep:`587` \"Python Initialization Configuration\"." msgstr "" -#: ../../c-api/init_config.rst:662 +#: ../../c-api/init_config.rst:666 msgid "Example of customized Python always running in isolated mode::" msgstr "" -#: ../../c-api/init_config.rst:664 +#: ../../c-api/init_config.rst:668 msgid "" "int main(int argc, char **argv)\n" "{\n" @@ -1161,144 +1167,144 @@ msgid "" "}" msgstr "" -#: ../../c-api/init_config.rst:699 +#: ../../c-api/init_config.rst:703 msgid "PyWideStringList" msgstr "PyWideStringList" -#: ../../c-api/init_config.rst:703 +#: ../../c-api/init_config.rst:707 msgid "List of ``wchar_t*`` strings." msgstr "``wchar_t*`` 字串串列。" -#: ../../c-api/init_config.rst:705 +#: ../../c-api/init_config.rst:709 msgid "" "If *length* is non-zero, *items* must be non-``NULL`` and all strings must " "be non-``NULL``." msgstr "" -#: ../../c-api/init_config.rst:710 +#: ../../c-api/init_config.rst:714 msgid "Methods:" msgstr "方法:" -#: ../../c-api/init_config.rst:714 +#: ../../c-api/init_config.rst:718 msgid "Append *item* to *list*." msgstr "" -#: ../../c-api/init_config.rst:716 ../../c-api/init_config.rst:727 +#: ../../c-api/init_config.rst:720 ../../c-api/init_config.rst:731 msgid "Python must be preinitialized to call this function." msgstr "" -#: ../../c-api/init_config.rst:720 +#: ../../c-api/init_config.rst:724 msgid "Insert *item* into *list* at *index*." msgstr "" -#: ../../c-api/init_config.rst:722 +#: ../../c-api/init_config.rst:726 msgid "" "If *index* is greater than or equal to *list* length, append *item* to " "*list*." msgstr "" -#: ../../c-api/init_config.rst:725 +#: ../../c-api/init_config.rst:729 msgid "*index* must be greater than or equal to ``0``." msgstr "" -#: ../../c-api/init_config.rst:731 ../../c-api/init_config.rst:751 -#: ../../c-api/init_config.rst:858 ../../c-api/init_config.rst:1177 +#: ../../c-api/init_config.rst:735 ../../c-api/init_config.rst:755 +#: ../../c-api/init_config.rst:862 ../../c-api/init_config.rst:1181 msgid "Structure fields:" msgstr "" -#: ../../c-api/init_config.rst:735 +#: ../../c-api/init_config.rst:739 msgid "List length." msgstr "串列長度。" -#: ../../c-api/init_config.rst:739 +#: ../../c-api/init_config.rst:743 msgid "List items." msgstr "" -#: ../../c-api/init_config.rst:742 +#: ../../c-api/init_config.rst:746 msgid "PyStatus" msgstr "PyStatus" -#: ../../c-api/init_config.rst:746 +#: ../../c-api/init_config.rst:750 msgid "" "Structure to store an initialization function status: success, error or exit." msgstr "" -#: ../../c-api/init_config.rst:749 +#: ../../c-api/init_config.rst:753 msgid "For an error, it can store the C function name which created the error." msgstr "" -#: ../../c-api/init_config.rst:755 +#: ../../c-api/init_config.rst:759 msgid "Exit code. Argument passed to ``exit()``." msgstr "" -#: ../../c-api/init_config.rst:759 +#: ../../c-api/init_config.rst:763 msgid "Error message." msgstr "錯誤訊息。" -#: ../../c-api/init_config.rst:763 +#: ../../c-api/init_config.rst:767 msgid "Name of the function which created an error, can be ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:767 +#: ../../c-api/init_config.rst:771 msgid "Functions to create a status:" msgstr "建立狀態的函式:" -#: ../../c-api/init_config.rst:771 +#: ../../c-api/init_config.rst:775 msgid "Success." msgstr "成功。" -#: ../../c-api/init_config.rst:775 +#: ../../c-api/init_config.rst:779 msgid "Initialization error with a message." msgstr "附帶訊息的初始化錯誤。" -#: ../../c-api/init_config.rst:777 +#: ../../c-api/init_config.rst:781 msgid "*err_msg* must not be ``NULL``." msgstr "*err_msg* 不可為 ``NULL``。" -#: ../../c-api/init_config.rst:781 +#: ../../c-api/init_config.rst:785 msgid "Memory allocation failure (out of memory)." msgstr "" -#: ../../c-api/init_config.rst:785 +#: ../../c-api/init_config.rst:789 msgid "Exit Python with the specified exit code." msgstr "以指定的退出代號退出 Python。" -#: ../../c-api/init_config.rst:787 +#: ../../c-api/init_config.rst:791 msgid "Functions to handle a status:" msgstr "處理狀態的函式:" -#: ../../c-api/init_config.rst:791 +#: ../../c-api/init_config.rst:795 msgid "" "Is the status an error or an exit? If true, the exception must be handled; " "by calling :c:func:`Py_ExitStatusException` for example." msgstr "" -#: ../../c-api/init_config.rst:796 +#: ../../c-api/init_config.rst:800 msgid "Is the result an error?" msgstr "" -#: ../../c-api/init_config.rst:800 +#: ../../c-api/init_config.rst:804 msgid "Is the result an exit?" msgstr "" -#: ../../c-api/init_config.rst:804 +#: ../../c-api/init_config.rst:808 msgid "" "Call ``exit(exitcode)`` if *status* is an exit. Print the error message and " "exit with a non-zero exit code if *status* is an error. Must only be called " "if ``PyStatus_Exception(status)`` is non-zero." msgstr "" -#: ../../c-api/init_config.rst:809 +#: ../../c-api/init_config.rst:813 msgid "" "Internally, Python uses macros which set ``PyStatus.func``, whereas " "functions to create a status set ``func`` to ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:812 +#: ../../c-api/init_config.rst:816 msgid "Example::" msgstr "範例: ::" -#: ../../c-api/init_config.rst:814 +#: ../../c-api/init_config.rst:818 msgid "" "PyStatus alloc(void **ptr, size_t size)\n" "{\n" @@ -1340,203 +1346,203 @@ msgstr "" " return 0;\n" "}" -#: ../../c-api/init_config.rst:836 +#: ../../c-api/init_config.rst:840 msgid "PyPreConfig" msgstr "PyPreConfig" -#: ../../c-api/init_config.rst:840 +#: ../../c-api/init_config.rst:844 msgid "Structure used to preinitialize Python." msgstr "" -#: ../../c-api/init_config.rst:844 +#: ../../c-api/init_config.rst:848 msgid "Function to initialize a preconfiguration:" msgstr "" -#: ../../c-api/init_config.rst:848 +#: ../../c-api/init_config.rst:852 msgid "" "Initialize the preconfiguration with :ref:`Python Configuration `." msgstr "" -#: ../../c-api/init_config.rst:853 +#: ../../c-api/init_config.rst:857 msgid "" "Initialize the preconfiguration with :ref:`Isolated Configuration `." msgstr "" -#: ../../c-api/init_config.rst:862 +#: ../../c-api/init_config.rst:866 msgid "Name of the Python memory allocators:" msgstr "" -#: ../../c-api/init_config.rst:864 +#: ../../c-api/init_config.rst:868 msgid "" "``PYMEM_ALLOCATOR_NOT_SET`` (``0``): don't change memory allocators (use " "defaults)." msgstr "" -#: ../../c-api/init_config.rst:866 +#: ../../c-api/init_config.rst:870 msgid "" "``PYMEM_ALLOCATOR_DEFAULT`` (``1``): :ref:`default memory allocators " "`." msgstr "" -#: ../../c-api/init_config.rst:868 +#: ../../c-api/init_config.rst:872 msgid "" "``PYMEM_ALLOCATOR_DEBUG`` (``2``): :ref:`default memory allocators ` with :ref:`debug hooks `." msgstr "" -#: ../../c-api/init_config.rst:871 +#: ../../c-api/init_config.rst:875 msgid "``PYMEM_ALLOCATOR_MALLOC`` (``3``): use ``malloc()`` of the C library." msgstr "" -#: ../../c-api/init_config.rst:872 +#: ../../c-api/init_config.rst:876 msgid "" "``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): force usage of ``malloc()`` with :" "ref:`debug hooks `." msgstr "" -#: ../../c-api/init_config.rst:874 +#: ../../c-api/init_config.rst:878 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC`` (``5``): :ref:`Python pymalloc memory allocator " "`." msgstr "" -#: ../../c-api/init_config.rst:876 +#: ../../c-api/init_config.rst:880 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`Python pymalloc memory " "allocator ` with :ref:`debug hooks `." msgstr "" -#: ../../c-api/init_config.rst:879 +#: ../../c-api/init_config.rst:883 msgid "" "``PYMEM_ALLOCATOR_MIMALLOC`` (``6``): use ``mimalloc``, a fast malloc " "replacement." msgstr "" -#: ../../c-api/init_config.rst:881 +#: ../../c-api/init_config.rst:885 msgid "" "``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` (``7``): use ``mimalloc``, a fast malloc " "replacement with :ref:`debug hooks `." msgstr "" -#: ../../c-api/init_config.rst:885 +#: ../../c-api/init_config.rst:889 msgid "" "``PYMEM_ALLOCATOR_PYMALLOC`` and ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` are not " "supported if Python is :option:`configured using --without-pymalloc <--" "without-pymalloc>`." msgstr "" -#: ../../c-api/init_config.rst:889 +#: ../../c-api/init_config.rst:893 msgid "" "``PYMEM_ALLOCATOR_MIMALLOC`` and ``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` are not " "supported if Python is :option:`configured using --without-mimalloc <--" "without-mimalloc>` or if the underlying atomic support isn't available." msgstr "" -#: ../../c-api/init_config.rst:894 +#: ../../c-api/init_config.rst:898 msgid "See :ref:`Memory Management `." msgstr "請見\\ :ref:`記憶體管理 `。" -#: ../../c-api/init_config.rst:896 +#: ../../c-api/init_config.rst:900 msgid "Default: ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "預設:``PYMEM_ALLOCATOR_NOT_SET``。" -#: ../../c-api/init_config.rst:900 +#: ../../c-api/init_config.rst:904 msgid "Set the LC_CTYPE locale to the user preferred locale." msgstr "" -#: ../../c-api/init_config.rst:902 +#: ../../c-api/init_config.rst:906 msgid "" "If equals to ``0``, set :c:member:`~PyPreConfig.coerce_c_locale` and :c:" "member:`~PyPreConfig.coerce_c_locale_warn` members to ``0``." msgstr "" -#: ../../c-api/init_config.rst:905 ../../c-api/init_config.rst:916 +#: ../../c-api/init_config.rst:909 ../../c-api/init_config.rst:920 msgid "See the :term:`locale encoding`." msgstr "請見 :term:`locale encoding`。" -#: ../../c-api/init_config.rst:907 ../../c-api/init_config.rst:962 -#: ../../c-api/init_config.rst:1333 +#: ../../c-api/init_config.rst:911 ../../c-api/init_config.rst:966 +#: ../../c-api/init_config.rst:1337 msgid "Default: ``1`` in Python config, ``0`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:911 +#: ../../c-api/init_config.rst:915 msgid "If equals to ``2``, coerce the C locale." msgstr "" -#: ../../c-api/init_config.rst:913 +#: ../../c-api/init_config.rst:917 msgid "" "If equals to ``1``, read the LC_CTYPE locale to decide if it should be " "coerced." msgstr "" -#: ../../c-api/init_config.rst:918 ../../c-api/init_config.rst:924 +#: ../../c-api/init_config.rst:922 ../../c-api/init_config.rst:928 msgid "Default: ``-1`` in Python config, ``0`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:922 +#: ../../c-api/init_config.rst:926 msgid "If non-zero, emit a warning if the C locale is coerced." msgstr "" -#: ../../c-api/init_config.rst:928 +#: ../../c-api/init_config.rst:932 msgid "" ":ref:`Python Development Mode `: see :c:member:`PyConfig.dev_mode`." msgstr "" -#: ../../c-api/init_config.rst:931 ../../c-api/init_config.rst:1342 -#: ../../c-api/init_config.rst:1398 ../../c-api/init_config.rst:1892 +#: ../../c-api/init_config.rst:935 ../../c-api/init_config.rst:1346 +#: ../../c-api/init_config.rst:1402 ../../c-api/init_config.rst:1896 msgid "Default: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:935 +#: ../../c-api/init_config.rst:939 msgid "Isolated mode: see :c:member:`PyConfig.isolated`." msgstr "" -#: ../../c-api/init_config.rst:937 ../../c-api/init_config.rst:1569 +#: ../../c-api/init_config.rst:941 ../../c-api/init_config.rst:1573 msgid "Default: ``0`` in Python mode, ``1`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:941 +#: ../../c-api/init_config.rst:945 msgid "If non-zero:" msgstr "如果不為 0:" -#: ../../c-api/init_config.rst:943 +#: ../../c-api/init_config.rst:947 msgid "Set :c:member:`PyPreConfig.utf8_mode` to ``0``," msgstr "將 :c:member:`PyPreConfig.utf8_mode` 設為 ``0``、" -#: ../../c-api/init_config.rst:944 +#: ../../c-api/init_config.rst:948 msgid "Set :c:member:`PyConfig.filesystem_encoding` to ``\"mbcs\"``," msgstr "將 :c:member:`PyConfig.filesystem_encoding` 設為 ``\"mbcs\"``、" -#: ../../c-api/init_config.rst:945 +#: ../../c-api/init_config.rst:949 msgid "Set :c:member:`PyConfig.filesystem_errors` to ``\"replace\"``." msgstr "將 :c:member:`PyConfig.filesystem_errors` 設為 ``\"replace\"``。" -#: ../../c-api/init_config.rst:947 +#: ../../c-api/init_config.rst:951 msgid "" "Initialized from the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable value." msgstr "" -#: ../../c-api/init_config.rst:950 ../../c-api/init_config.rst:1583 +#: ../../c-api/init_config.rst:954 ../../c-api/init_config.rst:1587 msgid "" "Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for " "Windows specific code." msgstr "" -#: ../../c-api/init_config.rst:953 ../../c-api/init_config.rst:1281 -#: ../../c-api/init_config.rst:1288 ../../c-api/init_config.rst:1355 -#: ../../c-api/init_config.rst:1487 ../../c-api/init_config.rst:1505 -#: ../../c-api/init_config.rst:1519 ../../c-api/init_config.rst:1586 -#: ../../c-api/init_config.rst:1600 ../../c-api/init_config.rst:1660 -#: ../../c-api/init_config.rst:1712 ../../c-api/init_config.rst:1774 -#: ../../c-api/init_config.rst:1828 ../../c-api/init_config.rst:1857 -#: ../../c-api/init_config.rst:1971 ../../c-api/init_config.rst:2018 +#: ../../c-api/init_config.rst:957 ../../c-api/init_config.rst:1285 +#: ../../c-api/init_config.rst:1292 ../../c-api/init_config.rst:1359 +#: ../../c-api/init_config.rst:1491 ../../c-api/init_config.rst:1509 +#: ../../c-api/init_config.rst:1523 ../../c-api/init_config.rst:1590 +#: ../../c-api/init_config.rst:1604 ../../c-api/init_config.rst:1664 +#: ../../c-api/init_config.rst:1716 ../../c-api/init_config.rst:1778 +#: ../../c-api/init_config.rst:1832 ../../c-api/init_config.rst:1861 +#: ../../c-api/init_config.rst:1975 ../../c-api/init_config.rst:2022 msgid "Default: ``0``." msgstr "預設:``0``。" -#: ../../c-api/init_config.rst:957 +#: ../../c-api/init_config.rst:961 msgid "" "If non-zero, :c:func:`Py_PreInitializeFromArgs` and :c:func:" "`Py_PreInitializeFromBytesArgs` parse their ``argv`` argument the same way " @@ -1544,95 +1550,95 @@ msgid "" "Arguments `." msgstr "" -#: ../../c-api/init_config.rst:966 +#: ../../c-api/init_config.rst:970 msgid "" "Use :ref:`environment variables `? See :c:member:`PyConfig." "use_environment`." msgstr "" -#: ../../c-api/init_config.rst:969 ../../c-api/init_config.rst:1933 +#: ../../c-api/init_config.rst:973 ../../c-api/init_config.rst:1937 msgid "Default: ``1`` in Python config and ``0`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:973 +#: ../../c-api/init_config.rst:977 msgid "If non-zero, enable the :ref:`Python UTF-8 Mode `." msgstr "" -#: ../../c-api/init_config.rst:975 +#: ../../c-api/init_config.rst:979 msgid "" "Set to ``0`` or ``1`` by the :option:`-X utf8 <-X>` command line option and " "the :envvar:`PYTHONUTF8` environment variable." msgstr "" -#: ../../c-api/init_config.rst:978 +#: ../../c-api/init_config.rst:982 msgid "Also set to ``1`` if the ``LC_CTYPE`` locale is ``C`` or ``POSIX``." msgstr "" -#: ../../c-api/init_config.rst:980 +#: ../../c-api/init_config.rst:984 msgid "Default: ``-1`` in Python config and ``0`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:986 +#: ../../c-api/init_config.rst:990 msgid "Preinitialize Python with PyPreConfig" msgstr "" -#: ../../c-api/init_config.rst:988 +#: ../../c-api/init_config.rst:992 msgid "The preinitialization of Python:" msgstr "" -#: ../../c-api/init_config.rst:990 +#: ../../c-api/init_config.rst:994 msgid "Set the Python memory allocators (:c:member:`PyPreConfig.allocator`)" msgstr "" -#: ../../c-api/init_config.rst:991 +#: ../../c-api/init_config.rst:995 msgid "Configure the LC_CTYPE locale (:term:`locale encoding`)" msgstr "" -#: ../../c-api/init_config.rst:992 +#: ../../c-api/init_config.rst:996 msgid "" "Set the :ref:`Python UTF-8 Mode ` (:c:member:`PyPreConfig." "utf8_mode`)" msgstr "" -#: ../../c-api/init_config.rst:995 +#: ../../c-api/init_config.rst:999 msgid "" "The current preconfiguration (``PyPreConfig`` type) is stored in " "``_PyRuntime.preconfig``." msgstr "" -#: ../../c-api/init_config.rst:998 +#: ../../c-api/init_config.rst:1002 msgid "Functions to preinitialize Python:" msgstr "" -#: ../../c-api/init_config.rst:1002 ../../c-api/init_config.rst:1008 -#: ../../c-api/init_config.rst:1017 +#: ../../c-api/init_config.rst:1006 ../../c-api/init_config.rst:1012 +#: ../../c-api/init_config.rst:1021 msgid "Preinitialize Python from *preconfig* preconfiguration." msgstr "" -#: ../../c-api/init_config.rst:1004 ../../c-api/init_config.rst:1013 -#: ../../c-api/init_config.rst:1022 +#: ../../c-api/init_config.rst:1008 ../../c-api/init_config.rst:1017 +#: ../../c-api/init_config.rst:1026 msgid "*preconfig* must not be ``NULL``." msgstr "*preconfig* 不可為 ``NULL``。" -#: ../../c-api/init_config.rst:1010 +#: ../../c-api/init_config.rst:1014 msgid "" "Parse *argv* command line arguments (bytes strings) if :c:member:" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -#: ../../c-api/init_config.rst:1019 +#: ../../c-api/init_config.rst:1023 msgid "" "Parse *argv* command line arguments (wide strings) if :c:member:" "`~PyPreConfig.parse_argv` of *preconfig* is non-zero." msgstr "" -#: ../../c-api/init_config.rst:1024 ../../c-api/init_config.rst:2041 +#: ../../c-api/init_config.rst:1028 ../../c-api/init_config.rst:2045 msgid "" "The caller is responsible to handle exceptions (error or exit) using :c:func:" "`PyStatus_Exception` and :c:func:`Py_ExitStatusException`." msgstr "" -#: ../../c-api/init_config.rst:1027 +#: ../../c-api/init_config.rst:1031 msgid "" "For :ref:`Python Configuration ` (:c:func:" "`PyPreConfig_InitPythonConfig`), if Python is initialized with command line " @@ -1642,7 +1648,7 @@ msgid "" "`Python UTF-8 Mode `." msgstr "" -#: ../../c-api/init_config.rst:1034 +#: ../../c-api/init_config.rst:1038 msgid "" "``PyMem_SetAllocator()`` can be called after :c:func:`Py_PreInitialize` and " "before :c:func:`Py_InitializeFromConfig` to install a custom memory " @@ -1650,7 +1656,7 @@ msgid "" "`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "" -#: ../../c-api/init_config.rst:1039 +#: ../../c-api/init_config.rst:1043 msgid "" "Python memory allocation functions like :c:func:`PyMem_RawMalloc` must not " "be used before the Python preinitialization, whereas calling directly " @@ -1658,13 +1664,13 @@ msgid "" "not be called before the Python preinitialization." msgstr "" -#: ../../c-api/init_config.rst:1044 +#: ../../c-api/init_config.rst:1048 msgid "" "Example using the preinitialization to enable the :ref:`Python UTF-8 Mode " "`::" msgstr "" -#: ../../c-api/init_config.rst:1047 +#: ../../c-api/init_config.rst:1051 msgid "" "PyStatus status;\n" "PyPreConfig preconfig;\n" @@ -1684,84 +1690,84 @@ msgid "" "Py_Finalize();" msgstr "" -#: ../../c-api/init_config.rst:1066 +#: ../../c-api/init_config.rst:1070 msgid "PyConfig" msgstr "PyConfig" -#: ../../c-api/init_config.rst:1070 +#: ../../c-api/init_config.rst:1074 msgid "Structure containing most parameters to configure Python." msgstr "" -#: ../../c-api/init_config.rst:1072 +#: ../../c-api/init_config.rst:1076 msgid "" "When done, the :c:func:`PyConfig_Clear` function must be used to release the " "configuration memory." msgstr "" -#: ../../c-api/init_config.rst:1077 +#: ../../c-api/init_config.rst:1081 msgid "Structure methods:" msgstr "" -#: ../../c-api/init_config.rst:1081 +#: ../../c-api/init_config.rst:1085 msgid "" "Initialize configuration with the :ref:`Python Configuration `." msgstr "" -#: ../../c-api/init_config.rst:1086 +#: ../../c-api/init_config.rst:1090 msgid "" "Initialize configuration with the :ref:`Isolated Configuration `." msgstr "" -#: ../../c-api/init_config.rst:1091 +#: ../../c-api/init_config.rst:1095 msgid "Copy the wide character string *str* into ``*config_str``." msgstr "" -#: ../../c-api/init_config.rst:1093 ../../c-api/init_config.rst:1100 -#: ../../c-api/init_config.rst:1107 ../../c-api/init_config.rst:1115 -#: ../../c-api/init_config.rst:1121 ../../c-api/init_config.rst:1138 +#: ../../c-api/init_config.rst:1097 ../../c-api/init_config.rst:1104 +#: ../../c-api/init_config.rst:1111 ../../c-api/init_config.rst:1119 +#: ../../c-api/init_config.rst:1125 ../../c-api/init_config.rst:1142 msgid ":ref:`Preinitialize Python ` if needed." msgstr "" -#: ../../c-api/init_config.rst:1097 +#: ../../c-api/init_config.rst:1101 msgid "" "Decode *str* using :c:func:`Py_DecodeLocale` and set the result into " "``*config_str``." msgstr "" -#: ../../c-api/init_config.rst:1104 +#: ../../c-api/init_config.rst:1108 msgid "" "Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) " "from the *argv* list of wide character strings." msgstr "" -#: ../../c-api/init_config.rst:1111 +#: ../../c-api/init_config.rst:1115 msgid "" "Set command line arguments (:c:member:`~PyConfig.argv` member of *config*) " "from the *argv* list of bytes strings. Decode bytes using :c:func:" "`Py_DecodeLocale`." msgstr "" -#: ../../c-api/init_config.rst:1119 +#: ../../c-api/init_config.rst:1123 msgid "Set the list of wide strings *list* to *length* and *items*." msgstr "" -#: ../../c-api/init_config.rst:1125 +#: ../../c-api/init_config.rst:1129 msgid "Read all Python configuration." msgstr "讀取所有 Python 配置。" -#: ../../c-api/init_config.rst:1127 +#: ../../c-api/init_config.rst:1131 msgid "Fields which are already initialized are left unchanged." msgstr "已經初始化的欄位將保持不變。" -#: ../../c-api/init_config.rst:1129 +#: ../../c-api/init_config.rst:1133 msgid "" "Fields for :ref:`path configuration ` are no longer " "calculated or modified when calling this function, as of Python 3.11." msgstr "" -#: ../../c-api/init_config.rst:1132 ../../c-api/init_config.rst:1689 +#: ../../c-api/init_config.rst:1136 ../../c-api/init_config.rst:1693 msgid "" "The :c:func:`PyConfig_Read` function only parses :c:member:`PyConfig.argv` " "arguments once: :c:member:`PyConfig.parse_argv` is set to ``2`` after " @@ -1770,25 +1776,25 @@ msgid "" "as Python options." msgstr "" -#: ../../c-api/init_config.rst:1140 +#: ../../c-api/init_config.rst:1144 msgid "" "The :c:member:`PyConfig.argv` arguments are now only parsed once, :c:member:" "`PyConfig.parse_argv` is set to ``2`` after arguments are parsed, and " "arguments are only parsed if :c:member:`PyConfig.parse_argv` equals ``1``." msgstr "" -#: ../../c-api/init_config.rst:1146 +#: ../../c-api/init_config.rst:1150 msgid "" ":c:func:`PyConfig_Read` no longer calculates all paths, and so fields listed " "under :ref:`Python Path Configuration ` may no longer be " "updated until :c:func:`Py_InitializeFromConfig` is called." msgstr "" -#: ../../c-api/init_config.rst:1154 +#: ../../c-api/init_config.rst:1158 msgid "Release configuration memory." msgstr "" -#: ../../c-api/init_config.rst:1156 +#: ../../c-api/init_config.rst:1160 msgid "" "Most ``PyConfig`` methods :ref:`preinitialize Python ` if needed. " "In that case, the Python preinitialization configuration (:c:type:" @@ -1797,23 +1803,23 @@ msgid "" "before calling a :c:type:`PyConfig` method:" msgstr "" -#: ../../c-api/init_config.rst:1162 +#: ../../c-api/init_config.rst:1166 msgid ":c:member:`PyConfig.dev_mode`" msgstr ":c:member:`PyConfig.dev_mode`" -#: ../../c-api/init_config.rst:1163 +#: ../../c-api/init_config.rst:1167 msgid ":c:member:`PyConfig.isolated`" msgstr ":c:member:`PyConfig.isolated`" -#: ../../c-api/init_config.rst:1164 +#: ../../c-api/init_config.rst:1168 msgid ":c:member:`PyConfig.parse_argv`" msgstr ":c:member:`PyConfig.parse_argv`" -#: ../../c-api/init_config.rst:1165 +#: ../../c-api/init_config.rst:1169 msgid ":c:member:`PyConfig.use_environment`" msgstr ":c:member:`PyConfig.use_environment`" -#: ../../c-api/init_config.rst:1167 +#: ../../c-api/init_config.rst:1171 msgid "" "Moreover, if :c:func:`PyConfig_SetArgv` or :c:func:`PyConfig_SetBytesArgv` " "is used, this method must be called before other methods, since the " @@ -1821,13 +1827,13 @@ msgid "" "member:`~PyConfig.parse_argv` is non-zero)." msgstr "" -#: ../../c-api/init_config.rst:1172 +#: ../../c-api/init_config.rst:1176 msgid "" "The caller of these methods is responsible to handle exceptions (error or " "exit) using ``PyStatus_Exception()`` and ``Py_ExitStatusException()``." msgstr "" -#: ../../c-api/init_config.rst:1185 +#: ../../c-api/init_config.rst:1189 msgid "" "Set :data:`sys.argv` command line arguments based on :c:member:`~PyConfig." "argv`. These parameters are similar to those passed to the program's :c:" @@ -1837,434 +1843,434 @@ msgid "" "entry in :c:member:`~PyConfig.argv` can be an empty string." msgstr "" -#: ../../c-api/init_config.rst:1193 +#: ../../c-api/init_config.rst:1197 msgid "" "Set :c:member:`~PyConfig.parse_argv` to ``1`` to parse :c:member:`~PyConfig." "argv` the same way the regular Python parses Python command line arguments " "and then to strip Python arguments from :c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:1198 +#: ../../c-api/init_config.rst:1202 msgid "" "If :c:member:`~PyConfig.argv` is empty, an empty string is added to ensure " "that :data:`sys.argv` always exists and is never empty." msgstr "" -#: ../../c-api/init_config.rst:1201 ../../c-api/init_config.rst:1228 -#: ../../c-api/init_config.rst:1242 ../../c-api/init_config.rst:1252 -#: ../../c-api/init_config.rst:1363 ../../c-api/init_config.rst:1372 -#: ../../c-api/init_config.rst:1383 ../../c-api/init_config.rst:1474 -#: ../../c-api/init_config.rst:1630 ../../c-api/init_config.rst:1731 -#: ../../c-api/init_config.rst:1750 ../../c-api/init_config.rst:1765 -#: ../../c-api/init_config.rst:1782 ../../c-api/init_config.rst:1795 -#: ../../c-api/init_config.rst:1803 ../../c-api/init_config.rst:1817 -#: ../../c-api/init_config.rst:1920 +#: ../../c-api/init_config.rst:1205 ../../c-api/init_config.rst:1232 +#: ../../c-api/init_config.rst:1246 ../../c-api/init_config.rst:1256 +#: ../../c-api/init_config.rst:1367 ../../c-api/init_config.rst:1376 +#: ../../c-api/init_config.rst:1387 ../../c-api/init_config.rst:1478 +#: ../../c-api/init_config.rst:1634 ../../c-api/init_config.rst:1735 +#: ../../c-api/init_config.rst:1754 ../../c-api/init_config.rst:1769 +#: ../../c-api/init_config.rst:1786 ../../c-api/init_config.rst:1799 +#: ../../c-api/init_config.rst:1807 ../../c-api/init_config.rst:1821 +#: ../../c-api/init_config.rst:1924 msgid "Default: ``NULL``." msgstr "預設值:``NULL``。" -#: ../../c-api/init_config.rst:1203 +#: ../../c-api/init_config.rst:1207 msgid "See also the :c:member:`~PyConfig.orig_argv` member." msgstr "另請參閱 :c:member:`~PyConfig.orig_argv` 成員。" -#: ../../c-api/init_config.rst:1207 +#: ../../c-api/init_config.rst:1211 msgid "" "If equals to zero, ``Py_RunMain()`` prepends a potentially unsafe path to :" "data:`sys.path` at startup:" msgstr "" -#: ../../c-api/init_config.rst:1210 +#: ../../c-api/init_config.rst:1214 msgid "" "If :c:member:`argv[0] ` is equal to ``L\"-m\"`` (``python -m " "module``), prepend the current working directory." msgstr "" -#: ../../c-api/init_config.rst:1212 +#: ../../c-api/init_config.rst:1216 msgid "" "If running a script (``python script.py``), prepend the script's directory. " "If it's a symbolic link, resolve symbolic links." msgstr "" -#: ../../c-api/init_config.rst:1214 +#: ../../c-api/init_config.rst:1218 msgid "" "Otherwise (``python -c code`` and ``python``), prepend an empty string, " "which means the current working directory." msgstr "" -#: ../../c-api/init_config.rst:1217 +#: ../../c-api/init_config.rst:1221 msgid "" "Set to ``1`` by the :option:`-P` command line option and the :envvar:" "`PYTHONSAFEPATH` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1220 +#: ../../c-api/init_config.rst:1224 msgid "Default: ``0`` in Python config, ``1`` in isolated config." msgstr "" -#: ../../c-api/init_config.rst:1226 +#: ../../c-api/init_config.rst:1230 msgid ":data:`sys.base_exec_prefix`." msgstr ":data:`sys.base_exec_prefix`。" -#: ../../c-api/init_config.rst:1230 ../../c-api/init_config.rst:1244 -#: ../../c-api/init_config.rst:1254 ../../c-api/init_config.rst:1374 -#: ../../c-api/init_config.rst:1385 ../../c-api/init_config.rst:1647 -#: ../../c-api/init_config.rst:1733 +#: ../../c-api/init_config.rst:1234 ../../c-api/init_config.rst:1248 +#: ../../c-api/init_config.rst:1258 ../../c-api/init_config.rst:1378 +#: ../../c-api/init_config.rst:1389 ../../c-api/init_config.rst:1651 +#: ../../c-api/init_config.rst:1737 msgid "Part of the :ref:`Python Path Configuration ` output." msgstr "" -#: ../../c-api/init_config.rst:1232 +#: ../../c-api/init_config.rst:1236 msgid "See also :c:member:`PyConfig.exec_prefix`." msgstr "也請見 :c:member:`PyConfig.exec_prefix`" -#: ../../c-api/init_config.rst:1236 +#: ../../c-api/init_config.rst:1240 msgid "Python base executable: :data:`sys._base_executable`." msgstr "" -#: ../../c-api/init_config.rst:1238 +#: ../../c-api/init_config.rst:1242 msgid "Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable." msgstr "由 :envvar:`__PYVENV_LAUNCHER__` 環境變數設定。" -#: ../../c-api/init_config.rst:1240 +#: ../../c-api/init_config.rst:1244 msgid "Set from :c:member:`PyConfig.executable` if ``NULL``." msgstr "如果為 ``NULL``,則從 :c:member:`PyConfig.executable` 設定。" -#: ../../c-api/init_config.rst:1246 +#: ../../c-api/init_config.rst:1250 msgid "See also :c:member:`PyConfig.executable`." msgstr "也請見 :c:member:`PyConfig.executable`" -#: ../../c-api/init_config.rst:1250 +#: ../../c-api/init_config.rst:1254 msgid ":data:`sys.base_prefix`." msgstr ":data:`sys.base_prefix`。" -#: ../../c-api/init_config.rst:1256 +#: ../../c-api/init_config.rst:1260 msgid "See also :c:member:`PyConfig.prefix`." msgstr "也請見 :c:member:`PyConfig.prefix`" -#: ../../c-api/init_config.rst:1260 +#: ../../c-api/init_config.rst:1264 msgid "" "If equals to ``0`` and :c:member:`~PyConfig.configure_c_stdio` is non-zero, " "disable buffering on the C streams stdout and stderr." msgstr "" -#: ../../c-api/init_config.rst:1263 +#: ../../c-api/init_config.rst:1267 msgid "" "Set to ``0`` by the :option:`-u` command line option and the :envvar:" "`PYTHONUNBUFFERED` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1266 +#: ../../c-api/init_config.rst:1270 msgid "stdin is always opened in buffered mode." msgstr "" -#: ../../c-api/init_config.rst:1268 ../../c-api/init_config.rst:1301 -#: ../../c-api/init_config.rst:1845 ../../c-api/init_config.rst:2003 +#: ../../c-api/init_config.rst:1272 ../../c-api/init_config.rst:1305 +#: ../../c-api/init_config.rst:1849 ../../c-api/init_config.rst:2007 msgid "Default: ``1``." msgstr "預設值:``1``。" -#: ../../c-api/init_config.rst:1272 +#: ../../c-api/init_config.rst:1276 msgid "" "If equals to ``1``, issue a warning when comparing :class:`bytes` or :class:" "`bytearray` with :class:`str`, or comparing :class:`bytes` with :class:`int`." msgstr "" -#: ../../c-api/init_config.rst:1276 +#: ../../c-api/init_config.rst:1280 msgid "" "If equal or greater to ``2``, raise a :exc:`BytesWarning` exception in these " "cases." msgstr "" -#: ../../c-api/init_config.rst:1279 +#: ../../c-api/init_config.rst:1283 msgid "Incremented by the :option:`-b` command line option." msgstr "" -#: ../../c-api/init_config.rst:1285 +#: ../../c-api/init_config.rst:1289 msgid "" "If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io." "TextIOWrapper` uses its default encoding. See :ref:`io-encoding-warning` for " "details." msgstr "" -#: ../../c-api/init_config.rst:1294 +#: ../../c-api/init_config.rst:1298 msgid "" "If equals to ``0``, disables the inclusion of the end line and column " "mappings in code objects. Also disables traceback printing carets to " "specific error locations." msgstr "" -#: ../../c-api/init_config.rst:1298 +#: ../../c-api/init_config.rst:1302 msgid "" "Set to ``0`` by the :envvar:`PYTHONNODEBUGRANGES` environment variable and " "by the :option:`-X no_debug_ranges <-X>` command line option." msgstr "" -#: ../../c-api/init_config.rst:1307 +#: ../../c-api/init_config.rst:1311 msgid "" "Control the validation behavior of hash-based ``.pyc`` files: value of the :" "option:`--check-hash-based-pycs` command line option." msgstr "" -#: ../../c-api/init_config.rst:1310 +#: ../../c-api/init_config.rst:1314 msgid "Valid values:" msgstr "有效值:" -#: ../../c-api/init_config.rst:1312 +#: ../../c-api/init_config.rst:1316 msgid "" "``L\"always\"``: Hash the source file for invalidation regardless of value " "of the 'check_source' flag." msgstr "" -#: ../../c-api/init_config.rst:1314 +#: ../../c-api/init_config.rst:1318 msgid "``L\"never\"``: Assume that hash-based pycs always are valid." msgstr "" -#: ../../c-api/init_config.rst:1315 +#: ../../c-api/init_config.rst:1319 msgid "" "``L\"default\"``: The 'check_source' flag in hash-based pycs determines " "invalidation." msgstr "" -#: ../../c-api/init_config.rst:1318 +#: ../../c-api/init_config.rst:1322 msgid "Default: ``L\"default\"``." msgstr "預設:``L\"default\"``。" -#: ../../c-api/init_config.rst:1320 +#: ../../c-api/init_config.rst:1324 msgid "See also :pep:`552` \"Deterministic pycs\"." msgstr "" -#: ../../c-api/init_config.rst:1324 +#: ../../c-api/init_config.rst:1328 msgid "If non-zero, configure C standard streams:" msgstr "" -#: ../../c-api/init_config.rst:1326 +#: ../../c-api/init_config.rst:1330 msgid "" "On Windows, set the binary mode (``O_BINARY``) on stdin, stdout and stderr." msgstr "" -#: ../../c-api/init_config.rst:1328 +#: ../../c-api/init_config.rst:1332 msgid "" "If :c:member:`~PyConfig.buffered_stdio` equals zero, disable buffering of " "stdin, stdout and stderr streams." msgstr "" -#: ../../c-api/init_config.rst:1330 +#: ../../c-api/init_config.rst:1334 msgid "" "If :c:member:`~PyConfig.interactive` is non-zero, enable stream buffering on " "stdin and stdout (only stdout on Windows)." msgstr "" -#: ../../c-api/init_config.rst:1337 +#: ../../c-api/init_config.rst:1341 msgid "If non-zero, enable the :ref:`Python Development Mode `." msgstr "" -#: ../../c-api/init_config.rst:1339 +#: ../../c-api/init_config.rst:1343 msgid "" "Set to ``1`` by the :option:`-X dev <-X>` option and the :envvar:" "`PYTHONDEVMODE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1346 +#: ../../c-api/init_config.rst:1350 msgid "Dump Python references?" msgstr "" -#: ../../c-api/init_config.rst:1348 +#: ../../c-api/init_config.rst:1352 msgid "If non-zero, dump all objects which are still alive at exit." msgstr "" -#: ../../c-api/init_config.rst:1350 +#: ../../c-api/init_config.rst:1354 msgid "Set to ``1`` by the :envvar:`PYTHONDUMPREFS` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1352 +#: ../../c-api/init_config.rst:1356 msgid "" "Needs a special build of Python with the ``Py_TRACE_REFS`` macro defined: " "see the :option:`configure --with-trace-refs option <--with-trace-refs>`." msgstr "" -#: ../../c-api/init_config.rst:1359 +#: ../../c-api/init_config.rst:1363 msgid "Filename where to dump Python references." msgstr "" -#: ../../c-api/init_config.rst:1361 +#: ../../c-api/init_config.rst:1365 msgid "Set by the :envvar:`PYTHONDUMPREFSFILE` environment variable." msgstr "由 :envvar:`PYTHONDUMPREFSFILE` 環境變數設定。" -#: ../../c-api/init_config.rst:1369 +#: ../../c-api/init_config.rst:1373 msgid "" "The site-specific directory prefix where the platform-dependent Python files " "are installed: :data:`sys.exec_prefix`." msgstr "" -#: ../../c-api/init_config.rst:1376 +#: ../../c-api/init_config.rst:1380 msgid "See also :c:member:`PyConfig.base_exec_prefix`." msgstr "也請見 :c:member:`PyConfig.base_exec_prefix`" -#: ../../c-api/init_config.rst:1380 +#: ../../c-api/init_config.rst:1384 msgid "" "The absolute path of the executable binary for the Python interpreter: :data:" "`sys.executable`." msgstr "" -#: ../../c-api/init_config.rst:1387 +#: ../../c-api/init_config.rst:1391 msgid "See also :c:member:`PyConfig.base_executable`." msgstr "也請見 :c:member:`PyConfig.base_executable`" -#: ../../c-api/init_config.rst:1391 +#: ../../c-api/init_config.rst:1395 msgid "Enable faulthandler?" msgstr "啟用 faulthandler?" -#: ../../c-api/init_config.rst:1393 +#: ../../c-api/init_config.rst:1397 msgid "If non-zero, call :func:`faulthandler.enable` at startup." msgstr "如果非零,則在啟動時呼叫 :func:`faulthandler.enable`。" -#: ../../c-api/init_config.rst:1395 +#: ../../c-api/init_config.rst:1399 msgid "" "Set to ``1`` by :option:`-X faulthandler <-X>` and the :envvar:" "`PYTHONFAULTHANDLER` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1402 +#: ../../c-api/init_config.rst:1406 msgid "" ":term:`Filesystem encoding `: :func:" "`sys.getfilesystemencoding`." msgstr "" -#: ../../c-api/init_config.rst:1405 +#: ../../c-api/init_config.rst:1409 msgid "On macOS, Android and VxWorks: use ``\"utf-8\"`` by default." msgstr "" -#: ../../c-api/init_config.rst:1407 +#: ../../c-api/init_config.rst:1411 msgid "" "On Windows: use ``\"utf-8\"`` by default, or ``\"mbcs\"`` if :c:member:" "`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is non-" "zero." msgstr "" -#: ../../c-api/init_config.rst:1411 +#: ../../c-api/init_config.rst:1415 msgid "Default encoding on other platforms:" msgstr "其他平台的預設編碼:" -#: ../../c-api/init_config.rst:1413 +#: ../../c-api/init_config.rst:1417 msgid "``\"utf-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." msgstr "如果 :c:member:`PyPreConfig.utf8_mode` 非零,則為 ``\"utf-8\"``。" -#: ../../c-api/init_config.rst:1414 +#: ../../c-api/init_config.rst:1418 msgid "" "``\"ascii\"`` if Python detects that ``nl_langinfo(CODESET)`` announces the " "ASCII encoding, whereas the ``mbstowcs()`` function decodes from a different " "encoding (usually Latin1)." msgstr "" -#: ../../c-api/init_config.rst:1417 +#: ../../c-api/init_config.rst:1421 msgid "``\"utf-8\"`` if ``nl_langinfo(CODESET)`` returns an empty string." msgstr "" -#: ../../c-api/init_config.rst:1418 +#: ../../c-api/init_config.rst:1422 msgid "" "Otherwise, use the :term:`locale encoding`: ``nl_langinfo(CODESET)`` result." msgstr "" -#: ../../c-api/init_config.rst:1421 +#: ../../c-api/init_config.rst:1425 msgid "" "At Python startup, the encoding name is normalized to the Python codec name. " "For example, ``\"ANSI_X3.4-1968\"`` is replaced with ``\"ascii\"``." msgstr "" -#: ../../c-api/init_config.rst:1424 +#: ../../c-api/init_config.rst:1428 msgid "See also the :c:member:`~PyConfig.filesystem_errors` member." msgstr "另請參閱 :c:member:`~PyConfig.filesystem_errors` 成員。" -#: ../../c-api/init_config.rst:1428 +#: ../../c-api/init_config.rst:1432 msgid "" ":term:`Filesystem error handler `: :" "func:`sys.getfilesystemencodeerrors`." msgstr "" -#: ../../c-api/init_config.rst:1431 +#: ../../c-api/init_config.rst:1435 msgid "" "On Windows: use ``\"surrogatepass\"`` by default, or ``\"replace\"`` if :c:" "member:`~PyPreConfig.legacy_windows_fs_encoding` of :c:type:`PyPreConfig` is " "non-zero." msgstr "" -#: ../../c-api/init_config.rst:1435 +#: ../../c-api/init_config.rst:1439 msgid "On other platforms: use ``\"surrogateescape\"`` by default." msgstr "其他平台:預設使用 ``\"surrogateescape\"``。" -#: ../../c-api/init_config.rst:1437 +#: ../../c-api/init_config.rst:1441 msgid "Supported error handlers:" msgstr "支援的錯誤處理器:" -#: ../../c-api/init_config.rst:1439 +#: ../../c-api/init_config.rst:1443 msgid "``\"strict\"``" msgstr "``\"strict\"``" -#: ../../c-api/init_config.rst:1440 +#: ../../c-api/init_config.rst:1444 msgid "``\"surrogateescape\"``" msgstr "``\"surrogateescape\"``" -#: ../../c-api/init_config.rst:1441 +#: ../../c-api/init_config.rst:1445 msgid "``\"surrogatepass\"`` (only supported with the UTF-8 encoding)" msgstr "``\"surrogatepass\"``\\ (僅支援 UTF-8 編碼)" -#: ../../c-api/init_config.rst:1443 +#: ../../c-api/init_config.rst:1447 msgid "See also the :c:member:`~PyConfig.filesystem_encoding` member." msgstr "另請參閱 :c:member:`~PyConfig.filesystem_encoding` 成員。" -#: ../../c-api/init_config.rst:1447 +#: ../../c-api/init_config.rst:1451 msgid "If non-zero, use frozen modules." msgstr "如果非零,則使用凍結模組。" -#: ../../c-api/init_config.rst:1449 +#: ../../c-api/init_config.rst:1453 msgid "Set by the :envvar:`PYTHON_FROZEN_MODULES` environment variable." msgstr "由 :envvar:`PYTHON_FROZEN_MODULES` 環境變數設定。" -#: ../../c-api/init_config.rst:1451 +#: ../../c-api/init_config.rst:1455 msgid "" "Default: ``1`` in a release build, or ``0`` in a :ref:`debug build `." msgstr "" -#: ../../c-api/init_config.rst:1457 +#: ../../c-api/init_config.rst:1461 msgid "Randomized hash function seed." msgstr "" -#: ../../c-api/init_config.rst:1459 +#: ../../c-api/init_config.rst:1463 msgid "" "If :c:member:`~PyConfig.use_hash_seed` is zero, a seed is chosen randomly at " "Python startup, and :c:member:`~PyConfig.hash_seed` is ignored." msgstr "" -#: ../../c-api/init_config.rst:1462 +#: ../../c-api/init_config.rst:1466 msgid "Set by the :envvar:`PYTHONHASHSEED` environment variable." msgstr "由 :envvar:`PYTHONHASHSEED` 環境變數設定。" -#: ../../c-api/init_config.rst:1464 +#: ../../c-api/init_config.rst:1468 msgid "" "Default *use_hash_seed* value: ``-1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:1469 +#: ../../c-api/init_config.rst:1473 msgid "" "Set the default Python \"home\" directory, that is, the location of the " "standard Python libraries (see :envvar:`PYTHONHOME`)." msgstr "" -#: ../../c-api/init_config.rst:1472 +#: ../../c-api/init_config.rst:1476 msgid "Set by the :envvar:`PYTHONHOME` environment variable." msgstr "由 :envvar:`PYTHONHOME` 環境變數設定。" -#: ../../c-api/init_config.rst:1476 ../../c-api/init_config.rst:1612 -#: ../../c-api/init_config.rst:1632 ../../c-api/init_config.rst:1721 -#: ../../c-api/init_config.rst:1752 +#: ../../c-api/init_config.rst:1480 ../../c-api/init_config.rst:1616 +#: ../../c-api/init_config.rst:1636 ../../c-api/init_config.rst:1725 +#: ../../c-api/init_config.rst:1756 msgid "Part of the :ref:`Python Path Configuration ` input." msgstr "" -#: ../../c-api/init_config.rst:1480 +#: ../../c-api/init_config.rst:1484 msgid "" "If ``1``, profile import time. If ``2``, include additional output that " "indicates when an imported module has already been loaded." msgstr "" -#: ../../c-api/init_config.rst:1484 +#: ../../c-api/init_config.rst:1488 msgid "" "Set by the :option:`-X importtime <-X>` option and the :envvar:" "`PYTHONPROFILEIMPORTTIME` environment variable." @@ -2272,15 +2278,15 @@ msgstr "" "由 :option:`-X importtime <-X>` 選項與 :envvar:`PYTHONPROFILEIMPORTTIME` 環境" "變數設定。" -#: ../../c-api/init_config.rst:1491 +#: ../../c-api/init_config.rst:1495 msgid "Added support for ``import_time = 2``" msgstr "新增對 ``import_time = 2`` 的支援" -#: ../../c-api/init_config.rst:1495 +#: ../../c-api/init_config.rst:1499 msgid "Enter interactive mode after executing a script or a command." msgstr "在執行腳本或命令後進入互動模式。" -#: ../../c-api/init_config.rst:1497 +#: ../../c-api/init_config.rst:1501 msgid "" "If greater than ``0``, enable inspect: when a script is passed as first " "argument or the -c option is used, enter interactive mode after executing " @@ -2288,30 +2294,30 @@ msgid "" "a terminal." msgstr "" -#: ../../c-api/init_config.rst:1502 +#: ../../c-api/init_config.rst:1506 msgid "" "Incremented by the :option:`-i` command line option. Set to ``1`` if the :" "envvar:`PYTHONINSPECT` environment variable is non-empty." msgstr "" -#: ../../c-api/init_config.rst:1509 +#: ../../c-api/init_config.rst:1513 msgid "Install Python signal handlers?" msgstr "" -#: ../../c-api/init_config.rst:1511 ../../c-api/init_config.rst:1695 -#: ../../c-api/init_config.rst:1719 ../../c-api/init_config.rst:1955 +#: ../../c-api/init_config.rst:1515 ../../c-api/init_config.rst:1699 +#: ../../c-api/init_config.rst:1723 ../../c-api/init_config.rst:1959 msgid "Default: ``1`` in Python mode, ``0`` in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:1515 +#: ../../c-api/init_config.rst:1519 msgid "If greater than ``0``, enable the interactive mode (REPL)." msgstr "" -#: ../../c-api/init_config.rst:1517 +#: ../../c-api/init_config.rst:1521 msgid "Incremented by the :option:`-i` command line option." msgstr "" -#: ../../c-api/init_config.rst:1523 +#: ../../c-api/init_config.rst:1527 msgid "" "Configures the :ref:`integer string conversion length limitation " "`. An initial value of ``-1`` means the value will be " @@ -2321,47 +2327,47 @@ msgid "" "str_digits_check_threshold`) are unsupported and will produce an error." msgstr "" -#: ../../c-api/init_config.rst:1531 +#: ../../c-api/init_config.rst:1535 msgid "" "Configured by the :option:`-X int_max_str_digits <-X>` command line flag or " "the :envvar:`PYTHONINTMAXSTRDIGITS` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1534 +#: ../../c-api/init_config.rst:1538 msgid "" "Default: ``-1`` in Python mode. 4300 (:data:`sys.int_info." "default_max_str_digits`) in isolated mode." msgstr "" -#: ../../c-api/init_config.rst:1541 +#: ../../c-api/init_config.rst:1545 msgid "" "If the value of :c:member:`~PyConfig.cpu_count` is not ``-1`` then it will " "override the return values of :func:`os.cpu_count`, :func:`os." "process_cpu_count`, and :func:`multiprocessing.cpu_count`." msgstr "" -#: ../../c-api/init_config.rst:1545 +#: ../../c-api/init_config.rst:1549 msgid "" "Configured by the :samp:`-X cpu_count={n|default}` command line flag or the :" "envvar:`PYTHON_CPU_COUNT` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1548 ../../c-api/init_config.rst:1909 +#: ../../c-api/init_config.rst:1552 ../../c-api/init_config.rst:1913 msgid "Default: ``-1``." msgstr "預設值:``1``。" -#: ../../c-api/init_config.rst:1554 +#: ../../c-api/init_config.rst:1558 msgid "If greater than ``0``, enable isolated mode:" msgstr "" -#: ../../c-api/init_config.rst:1556 +#: ../../c-api/init_config.rst:1560 msgid "" "Set :c:member:`~PyConfig.safe_path` to ``1``: don't prepend a potentially " "unsafe path to :data:`sys.path` at Python startup, such as the current " "directory, the script's directory or an empty string." msgstr "" -#: ../../c-api/init_config.rst:1560 +#: ../../c-api/init_config.rst:1564 msgid "" "Set :c:member:`~PyConfig.use_environment` to ``0``: ignore ``PYTHON`` " "environment variables." @@ -2369,77 +2375,77 @@ msgstr "" "將 :c:member:`~PyConfig.use_environment` 設定為 ``0``:忽略 ``PYTHON`` 環境變" "數。" -#: ../../c-api/init_config.rst:1562 +#: ../../c-api/init_config.rst:1566 msgid "" "Set :c:member:`~PyConfig.user_site_directory` to ``0``: don't add the user " "site directory to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1564 +#: ../../c-api/init_config.rst:1568 msgid "" "Python REPL doesn't import :mod:`readline` nor enable default readline " "configuration on interactive prompts." msgstr "" -#: ../../c-api/init_config.rst:1567 +#: ../../c-api/init_config.rst:1571 msgid "Set to ``1`` by the :option:`-I` command line option." msgstr "" -#: ../../c-api/init_config.rst:1571 +#: ../../c-api/init_config.rst:1575 msgid "" "See also the :ref:`Isolated Configuration ` and :c:" "member:`PyPreConfig.isolated`." msgstr "" -#: ../../c-api/init_config.rst:1576 +#: ../../c-api/init_config.rst:1580 msgid "" "If non-zero, use :class:`io.FileIO` instead of :class:`!io." "_WindowsConsoleIO` for :data:`sys.stdin`, :data:`sys.stdout` and :data:`sys." "stderr`." msgstr "" -#: ../../c-api/init_config.rst:1580 +#: ../../c-api/init_config.rst:1584 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." msgstr "" -#: ../../c-api/init_config.rst:1588 +#: ../../c-api/init_config.rst:1592 msgid "See also the :pep:`528` (Change Windows console encoding to UTF-8)." msgstr "" -#: ../../c-api/init_config.rst:1592 +#: ../../c-api/init_config.rst:1596 msgid "" "If non-zero, dump statistics on :ref:`Python pymalloc memory allocator " "` at exit." msgstr "" -#: ../../c-api/init_config.rst:1595 +#: ../../c-api/init_config.rst:1599 msgid "Set to ``1`` by the :envvar:`PYTHONMALLOCSTATS` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1597 +#: ../../c-api/init_config.rst:1601 msgid "" "The option is ignored if Python is :option:`configured using the --without-" "pymalloc option <--without-pymalloc>`." msgstr "" -#: ../../c-api/init_config.rst:1604 +#: ../../c-api/init_config.rst:1608 msgid "Platform library directory name: :data:`sys.platlibdir`." msgstr "" -#: ../../c-api/init_config.rst:1606 +#: ../../c-api/init_config.rst:1610 msgid "Set by the :envvar:`PYTHONPLATLIBDIR` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1608 +#: ../../c-api/init_config.rst:1612 msgid "" "Default: value of the ``PLATLIBDIR`` macro which is set by the :option:" "`configure --with-platlibdir option <--with-platlibdir>` (default: " "``\"lib\"``, or ``\"DLLs\"`` on Windows)." msgstr "" -#: ../../c-api/init_config.rst:1616 +#: ../../c-api/init_config.rst:1620 msgid "" "This macro is now used on Windows to locate the standard library extension " "modules, typically under ``DLLs``. However, for compatibility, note that " @@ -2447,21 +2453,21 @@ msgid "" "and virtual environments." msgstr "" -#: ../../c-api/init_config.rst:1625 +#: ../../c-api/init_config.rst:1629 msgid "" "Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` (:" "data:`os.pathsep`)." msgstr "" -#: ../../c-api/init_config.rst:1628 +#: ../../c-api/init_config.rst:1632 msgid "Set by the :envvar:`PYTHONPATH` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1637 +#: ../../c-api/init_config.rst:1641 msgid "Module search paths: :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1639 +#: ../../c-api/init_config.rst:1643 msgid "" "If :c:member:`~PyConfig.module_search_paths_set` is equal to ``0``, :c:func:" "`Py_InitializeFromConfig` will replace :c:member:`~PyConfig." @@ -2469,41 +2475,41 @@ msgid "" "to ``1``." msgstr "" -#: ../../c-api/init_config.rst:1644 +#: ../../c-api/init_config.rst:1648 msgid "" "Default: empty list (``module_search_paths``) and ``0`` " "(``module_search_paths_set``)." msgstr "" -#: ../../c-api/init_config.rst:1651 +#: ../../c-api/init_config.rst:1655 msgid "Compilation optimization level:" msgstr "" -#: ../../c-api/init_config.rst:1653 +#: ../../c-api/init_config.rst:1657 msgid "``0``: Peephole optimizer, set ``__debug__`` to ``True``." msgstr "" -#: ../../c-api/init_config.rst:1654 +#: ../../c-api/init_config.rst:1658 msgid "``1``: Level 0, remove assertions, set ``__debug__`` to ``False``." msgstr "" -#: ../../c-api/init_config.rst:1655 +#: ../../c-api/init_config.rst:1659 msgid "``2``: Level 1, strip docstrings." msgstr "" -#: ../../c-api/init_config.rst:1657 +#: ../../c-api/init_config.rst:1661 msgid "" "Incremented by the :option:`-O` command line option. Set to the :envvar:" "`PYTHONOPTIMIZE` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:1664 +#: ../../c-api/init_config.rst:1668 msgid "" "The list of the original command line arguments passed to the Python " "executable: :data:`sys.orig_argv`." msgstr "" -#: ../../c-api/init_config.rst:1667 +#: ../../c-api/init_config.rst:1671 msgid "" "If :c:member:`~PyConfig.orig_argv` list is empty and :c:member:`~PyConfig." "argv` is not a list only containing an empty string, :c:func:`PyConfig_Read` " @@ -2512,441 +2518,441 @@ msgid "" "parse_argv` is non-zero)." msgstr "" -#: ../../c-api/init_config.rst:1674 +#: ../../c-api/init_config.rst:1678 msgid "" "See also the :c:member:`~PyConfig.argv` member and the :c:func:" "`Py_GetArgcArgv` function." msgstr "" -#: ../../c-api/init_config.rst:1677 ../../c-api/init_config.rst:1990 -#: ../../c-api/init_config.rst:2009 +#: ../../c-api/init_config.rst:1681 ../../c-api/init_config.rst:1994 +#: ../../c-api/init_config.rst:2013 msgid "Default: empty list." msgstr "" -#: ../../c-api/init_config.rst:1683 +#: ../../c-api/init_config.rst:1687 msgid "Parse command line arguments?" msgstr "" -#: ../../c-api/init_config.rst:1685 +#: ../../c-api/init_config.rst:1689 msgid "" "If equals to ``1``, parse :c:member:`~PyConfig.argv` the same way the " "regular Python parses :ref:`command line arguments `, and " "strip Python arguments from :c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:1697 +#: ../../c-api/init_config.rst:1701 msgid "" "The :c:member:`PyConfig.argv` arguments are now only parsed if :c:member:" "`PyConfig.parse_argv` equals to ``1``." msgstr "" -#: ../../c-api/init_config.rst:1703 +#: ../../c-api/init_config.rst:1707 msgid "" "Parser debug mode. If greater than ``0``, turn on parser debugging output " "(for expert only, depending on compilation options)." msgstr "" -#: ../../c-api/init_config.rst:1706 +#: ../../c-api/init_config.rst:1710 msgid "" "Incremented by the :option:`-d` command line option. Set to the :envvar:" "`PYTHONDEBUG` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:1709 ../../c-api/init_config.rst:1814 +#: ../../c-api/init_config.rst:1713 ../../c-api/init_config.rst:1818 msgid "" "Needs a :ref:`debug build of Python ` (the ``Py_DEBUG`` macro " "must be defined)." msgstr "" -#: ../../c-api/init_config.rst:1716 +#: ../../c-api/init_config.rst:1720 msgid "" "If non-zero, calculation of path configuration is allowed to log warnings " "into ``stderr``. If equals to ``0``, suppress these warnings." msgstr "" -#: ../../c-api/init_config.rst:1723 +#: ../../c-api/init_config.rst:1727 msgid "Now also applies on Windows." msgstr "現在也適用於 Windows。" -#: ../../c-api/init_config.rst:1728 +#: ../../c-api/init_config.rst:1732 msgid "" "The site-specific directory prefix where the platform independent Python " "files are installed: :data:`sys.prefix`." msgstr "" -#: ../../c-api/init_config.rst:1735 +#: ../../c-api/init_config.rst:1739 msgid "See also :c:member:`PyConfig.base_prefix`." msgstr "也請見 :c:member:`PyConfig.base_prefix`" -#: ../../c-api/init_config.rst:1739 +#: ../../c-api/init_config.rst:1743 msgid "" "Program name used to initialize :c:member:`~PyConfig.executable` and in " "early error messages during Python initialization." msgstr "" -#: ../../c-api/init_config.rst:1742 +#: ../../c-api/init_config.rst:1746 msgid "On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set." msgstr "" -#: ../../c-api/init_config.rst:1743 +#: ../../c-api/init_config.rst:1747 msgid "" "If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use :envvar:" "`__PYVENV_LAUNCHER__` environment variable if set." msgstr "" -#: ../../c-api/init_config.rst:1745 +#: ../../c-api/init_config.rst:1749 msgid "" "Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and non-empty." msgstr "" -#: ../../c-api/init_config.rst:1747 +#: ../../c-api/init_config.rst:1751 msgid "" "Otherwise, use ``L\"python\"`` on Windows, or ``L\"python3\"`` on other " "platforms." msgstr "" -#: ../../c-api/init_config.rst:1756 +#: ../../c-api/init_config.rst:1760 msgid "" "Directory where cached ``.pyc`` files are written: :data:`sys." "pycache_prefix`." msgstr "" -#: ../../c-api/init_config.rst:1759 +#: ../../c-api/init_config.rst:1763 msgid "" "Set by the :option:`-X pycache_prefix=PATH <-X>` command line option and " "the :envvar:`PYTHONPYCACHEPREFIX` environment variable. The command-line " "option takes precedence." msgstr "" -#: ../../c-api/init_config.rst:1763 +#: ../../c-api/init_config.rst:1767 msgid "If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``." msgstr "" -#: ../../c-api/init_config.rst:1769 +#: ../../c-api/init_config.rst:1773 msgid "" "Quiet mode. If greater than ``0``, don't display the copyright and version " "at Python startup in interactive mode." msgstr "" -#: ../../c-api/init_config.rst:1772 +#: ../../c-api/init_config.rst:1776 msgid "Incremented by the :option:`-q` command line option." msgstr "" -#: ../../c-api/init_config.rst:1778 +#: ../../c-api/init_config.rst:1782 msgid "Value of the :option:`-c` command line option." msgstr "" -#: ../../c-api/init_config.rst:1780 ../../c-api/init_config.rst:1801 +#: ../../c-api/init_config.rst:1784 ../../c-api/init_config.rst:1805 msgid "Used by :c:func:`Py_RunMain`." msgstr "被 :c:func:`Py_RunMain` 使用。" -#: ../../c-api/init_config.rst:1786 +#: ../../c-api/init_config.rst:1790 msgid "" "Filename passed on the command line: trailing command line argument without :" "option:`-c` or :option:`-m`. It is used by the :c:func:`Py_RunMain` function." msgstr "" -#: ../../c-api/init_config.rst:1790 +#: ../../c-api/init_config.rst:1794 msgid "" "For example, it is set to ``script.py`` by the ``python3 script.py arg`` " "command line." msgstr "" -#: ../../c-api/init_config.rst:1793 +#: ../../c-api/init_config.rst:1797 msgid "See also the :c:member:`PyConfig.skip_source_first_line` option." msgstr "也請見 :c:member:`PyConfig.skip_source_first_line` 選項。" -#: ../../c-api/init_config.rst:1799 +#: ../../c-api/init_config.rst:1803 msgid "Value of the :option:`-m` command line option." msgstr "" -#: ../../c-api/init_config.rst:1807 +#: ../../c-api/init_config.rst:1811 msgid "" "``package.module`` path to module that should be imported before ``site.py`` " "is run." msgstr "" -#: ../../c-api/init_config.rst:1810 +#: ../../c-api/init_config.rst:1814 msgid "" "Set by the :option:`-X presite=package.module <-X>` command-line option and " "the :envvar:`PYTHON_PRESITE` environment variable. The command-line option " "takes precedence." msgstr "" -#: ../../c-api/init_config.rst:1821 +#: ../../c-api/init_config.rst:1825 msgid "" "Show total reference count at exit (excluding :term:`immortal` objects)?" msgstr "" -#: ../../c-api/init_config.rst:1823 +#: ../../c-api/init_config.rst:1827 msgid "Set to ``1`` by :option:`-X showrefcount <-X>` command line option." msgstr "" -#: ../../c-api/init_config.rst:1825 +#: ../../c-api/init_config.rst:1829 msgid "" "Needs a :ref:`debug build of Python ` (the ``Py_REF_DEBUG`` " "macro must be defined)." msgstr "" -#: ../../c-api/init_config.rst:1832 +#: ../../c-api/init_config.rst:1836 msgid "Import the :mod:`site` module at startup?" msgstr "" -#: ../../c-api/init_config.rst:1834 +#: ../../c-api/init_config.rst:1838 msgid "" "If equal to zero, disable the import of the module site and the site-" "dependent manipulations of :data:`sys.path` that it entails." msgstr "" -#: ../../c-api/init_config.rst:1837 +#: ../../c-api/init_config.rst:1841 msgid "" "Also disable these manipulations if the :mod:`site` module is explicitly " "imported later (call :func:`site.main` if you want them to be triggered)." msgstr "" -#: ../../c-api/init_config.rst:1840 +#: ../../c-api/init_config.rst:1844 msgid "Set to ``0`` by the :option:`-S` command line option." msgstr "" -#: ../../c-api/init_config.rst:1842 +#: ../../c-api/init_config.rst:1846 msgid "" ":data:`sys.flags.no_site ` is set to the inverted value of :c:" "member:`~PyConfig.site_import`." msgstr "" -#: ../../c-api/init_config.rst:1849 +#: ../../c-api/init_config.rst:1853 msgid "" "If non-zero, skip the first line of the :c:member:`PyConfig.run_filename` " "source." msgstr "" -#: ../../c-api/init_config.rst:1852 +#: ../../c-api/init_config.rst:1856 msgid "" "It allows the usage of non-Unix forms of ``#!cmd``. This is intended for a " "DOS specific hack only." msgstr "" -#: ../../c-api/init_config.rst:1855 +#: ../../c-api/init_config.rst:1859 msgid "Set to ``1`` by the :option:`-x` command line option." msgstr "" -#: ../../c-api/init_config.rst:1862 +#: ../../c-api/init_config.rst:1866 msgid "" "Encoding and encoding errors of :data:`sys.stdin`, :data:`sys.stdout` and :" "data:`sys.stderr` (but :data:`sys.stderr` always uses " "``\"backslashreplace\"`` error handler)." msgstr "" -#: ../../c-api/init_config.rst:1866 +#: ../../c-api/init_config.rst:1870 msgid "" "Use the :envvar:`PYTHONIOENCODING` environment variable if it is non-empty." msgstr "" -#: ../../c-api/init_config.rst:1869 +#: ../../c-api/init_config.rst:1873 msgid "Default encoding:" msgstr "預設編碼:" -#: ../../c-api/init_config.rst:1871 +#: ../../c-api/init_config.rst:1875 msgid "``\"UTF-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." msgstr "如果 :c:member:`PyPreConfig.utf8_mode` 非零,則為 ``\"UTF-8\"``。" -#: ../../c-api/init_config.rst:1872 +#: ../../c-api/init_config.rst:1876 msgid "Otherwise, use the :term:`locale encoding`." msgstr "否則使用 :term:`locale encoding`。" -#: ../../c-api/init_config.rst:1874 +#: ../../c-api/init_config.rst:1878 msgid "Default error handler:" msgstr "" -#: ../../c-api/init_config.rst:1876 +#: ../../c-api/init_config.rst:1880 msgid "On Windows: use ``\"surrogateescape\"``." msgstr "在 Windows 上:使用 ``\"surrogateescape\"``。" -#: ../../c-api/init_config.rst:1877 +#: ../../c-api/init_config.rst:1881 msgid "" "``\"surrogateescape\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero, or " "if the LC_CTYPE locale is \"C\" or \"POSIX\"." msgstr "" -#: ../../c-api/init_config.rst:1879 +#: ../../c-api/init_config.rst:1883 msgid "``\"strict\"`` otherwise." msgstr "" -#: ../../c-api/init_config.rst:1881 +#: ../../c-api/init_config.rst:1885 msgid "See also :c:member:`PyConfig.legacy_windows_stdio`." msgstr "也請見 :c:member:`PyConfig.legacy_windows_stdio`。" -#: ../../c-api/init_config.rst:1885 +#: ../../c-api/init_config.rst:1889 msgid "Enable tracemalloc?" msgstr "" -#: ../../c-api/init_config.rst:1887 +#: ../../c-api/init_config.rst:1891 msgid "If non-zero, call :func:`tracemalloc.start` at startup." msgstr "" -#: ../../c-api/init_config.rst:1889 +#: ../../c-api/init_config.rst:1893 msgid "" "Set by :option:`-X tracemalloc=N <-X>` command line option and by the :" "envvar:`PYTHONTRACEMALLOC` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1896 +#: ../../c-api/init_config.rst:1900 msgid "Enable the Linux ``perf`` profiler support?" msgstr "要啟用 Linux ``perf`` 分析器支援嗎?" -#: ../../c-api/init_config.rst:1898 +#: ../../c-api/init_config.rst:1902 msgid "If equals to ``1``, enable support for the Linux ``perf`` profiler." msgstr "如果等於 ``1``,則啟用對 Linux ``perf`` 分析器的支援。" -#: ../../c-api/init_config.rst:1900 +#: ../../c-api/init_config.rst:1904 msgid "" "If equals to ``2``, enable support for the Linux ``perf`` profiler with " "DWARF JIT support." msgstr "" "如果等於 ``2``,則啟用有 DWARF JIT 支援的 Linux ``perf`` 分析器的支援。" -#: ../../c-api/init_config.rst:1903 +#: ../../c-api/init_config.rst:1907 msgid "" "Set to ``1`` by :option:`-X perf <-X>` command-line option and the :envvar:" "`PYTHONPERFSUPPORT` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1906 +#: ../../c-api/init_config.rst:1910 msgid "" "Set to ``2`` by the :option:`-X perf_jit <-X>` command-line option and the :" "envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1912 +#: ../../c-api/init_config.rst:1916 msgid "See :ref:`perf_profiling` for more information." msgstr "更多資訊請參見 :ref:`perf_profiling`。" -#: ../../c-api/init_config.rst:1918 +#: ../../c-api/init_config.rst:1922 msgid "Directory of the Python standard library." msgstr "" -#: ../../c-api/init_config.rst:1926 +#: ../../c-api/init_config.rst:1930 msgid "Use :ref:`environment variables `?" msgstr "" -#: ../../c-api/init_config.rst:1928 +#: ../../c-api/init_config.rst:1932 msgid "" "If equals to zero, ignore the :ref:`environment variables `." msgstr "" -#: ../../c-api/init_config.rst:1931 +#: ../../c-api/init_config.rst:1935 msgid "Set to ``0`` by the :option:`-E` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1937 +#: ../../c-api/init_config.rst:1941 msgid "" "If non-zero, ``stdout`` and ``stderr`` will be redirected to the system log." msgstr "" -#: ../../c-api/init_config.rst:1940 +#: ../../c-api/init_config.rst:1944 msgid "Only available on macOS 10.12 and later, and on iOS." msgstr "" -#: ../../c-api/init_config.rst:1942 +#: ../../c-api/init_config.rst:1946 msgid "" "Default: ``0`` (don't use the system log) on macOS; ``1`` on iOS (use the " "system log)." msgstr "" -#: ../../c-api/init_config.rst:1949 +#: ../../c-api/init_config.rst:1953 msgid "If non-zero, add the user site directory to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1951 +#: ../../c-api/init_config.rst:1955 msgid "Set to ``0`` by the :option:`-s` and :option:`-I` command line options." msgstr "" -#: ../../c-api/init_config.rst:1953 +#: ../../c-api/init_config.rst:1957 msgid "Set to ``0`` by the :envvar:`PYTHONNOUSERSITE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:1959 +#: ../../c-api/init_config.rst:1963 msgid "" "Verbose mode. If greater than ``0``, print a message each time a module is " "imported, showing the place (filename or built-in module) from which it is " "loaded." msgstr "" -#: ../../c-api/init_config.rst:1963 +#: ../../c-api/init_config.rst:1967 msgid "" "If greater than or equal to ``2``, print a message for each file that is " "checked for when searching for a module. Also provides information on module " "cleanup at exit." msgstr "" -#: ../../c-api/init_config.rst:1967 +#: ../../c-api/init_config.rst:1971 msgid "Incremented by the :option:`-v` command line option." msgstr "" -#: ../../c-api/init_config.rst:1969 +#: ../../c-api/init_config.rst:1973 msgid "Set by the :envvar:`PYTHONVERBOSE` environment variable value." msgstr "" -#: ../../c-api/init_config.rst:1975 +#: ../../c-api/init_config.rst:1979 msgid "" "Options of the :mod:`warnings` module to build warnings filters, lowest to " "highest priority: :data:`sys.warnoptions`." msgstr "" -#: ../../c-api/init_config.rst:1978 +#: ../../c-api/init_config.rst:1982 msgid "" "The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse " "order: the last :c:member:`PyConfig.warnoptions` item becomes the first item " "of :data:`warnings.filters` which is checked first (highest priority)." msgstr "" -#: ../../c-api/init_config.rst:1983 +#: ../../c-api/init_config.rst:1987 msgid "" "The :option:`-W` command line options adds its value to :c:member:`~PyConfig." "warnoptions`, it can be used multiple times." msgstr "" -#: ../../c-api/init_config.rst:1986 +#: ../../c-api/init_config.rst:1990 msgid "" "The :envvar:`PYTHONWARNINGS` environment variable can also be used to add " "warning options. Multiple options can be specified, separated by commas (``," "``)." msgstr "" -#: ../../c-api/init_config.rst:1994 +#: ../../c-api/init_config.rst:1998 msgid "" "If equal to ``0``, Python won't try to write ``.pyc`` files on the import of " "source modules." msgstr "" -#: ../../c-api/init_config.rst:1997 +#: ../../c-api/init_config.rst:2001 msgid "" "Set to ``0`` by the :option:`-B` command line option and the :envvar:" "`PYTHONDONTWRITEBYTECODE` environment variable." msgstr "" -#: ../../c-api/init_config.rst:2000 +#: ../../c-api/init_config.rst:2004 msgid "" ":data:`sys.dont_write_bytecode` is initialized to the inverted value of :c:" "member:`~PyConfig.write_bytecode`." msgstr "" -#: ../../c-api/init_config.rst:2007 +#: ../../c-api/init_config.rst:2011 msgid "Values of the :option:`-X` command line options: :data:`sys._xoptions`." msgstr "" -#: ../../c-api/init_config.rst:2013 +#: ../../c-api/init_config.rst:2017 msgid "If non-zero, write performance statistics at Python exit." msgstr "" -#: ../../c-api/init_config.rst:2015 +#: ../../c-api/init_config.rst:2019 msgid "" "Need a special build with the ``Py_STATS`` macro: see :option:`--enable-" "pystats`." msgstr "" -#: ../../c-api/init_config.rst:2020 +#: ../../c-api/init_config.rst:2024 msgid "" "If :c:member:`~PyConfig.parse_argv` is non-zero, :c:member:`~PyConfig.argv` " "arguments are parsed the same way the regular Python parses :ref:`command " @@ -2954,27 +2960,27 @@ msgid "" "c:member:`~PyConfig.argv`." msgstr "" -#: ../../c-api/init_config.rst:2025 +#: ../../c-api/init_config.rst:2029 msgid "" "The :c:member:`~PyConfig.xoptions` options are parsed to set other options: " "see the :option:`-X` command line option." msgstr "" -#: ../../c-api/init_config.rst:2030 +#: ../../c-api/init_config.rst:2034 msgid "The ``show_alloc_count`` field has been removed." msgstr "" -#: ../../c-api/init_config.rst:2036 +#: ../../c-api/init_config.rst:2040 msgid "Initialization with PyConfig" msgstr "" -#: ../../c-api/init_config.rst:2038 +#: ../../c-api/init_config.rst:2042 msgid "" "Initializing the interpreter from a populated configuration struct is " "handled by calling :c:func:`Py_InitializeFromConfig`." msgstr "" -#: ../../c-api/init_config.rst:2044 +#: ../../c-api/init_config.rst:2048 msgid "" "If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:" "func:`PyImport_ExtendInittab` are used, they must be set or called after " @@ -2983,17 +2989,17 @@ msgid "" "`PyImport_ExtendInittab` must be called before each Python initialization." msgstr "" -#: ../../c-api/init_config.rst:2051 +#: ../../c-api/init_config.rst:2055 msgid "" "The current configuration (``PyConfig`` type) is stored in " "``PyInterpreterState.config``." msgstr "" -#: ../../c-api/init_config.rst:2054 +#: ../../c-api/init_config.rst:2058 msgid "Example setting the program name::" msgstr "" -#: ../../c-api/init_config.rst:2056 +#: ../../c-api/init_config.rst:2060 msgid "" "void init_python(void)\n" "{\n" @@ -3047,7 +3053,7 @@ msgstr "" " Py_ExitStatusException(status);\n" "}" -#: ../../c-api/init_config.rst:2082 +#: ../../c-api/init_config.rst:2086 msgid "" "More complete example modifying the default configuration, read the " "configuration, and then override some parameters. Note that since 3.11, many " @@ -3056,7 +3062,7 @@ msgid "" "called will be left unchanged by initialization::" msgstr "" -#: ../../c-api/init_config.rst:2089 +#: ../../c-api/init_config.rst:2093 msgid "" "PyStatus init_python(const char *program_name)\n" "{\n" @@ -3111,18 +3117,18 @@ msgid "" "}" msgstr "" -#: ../../c-api/init_config.rst:2145 +#: ../../c-api/init_config.rst:2149 msgid "Isolated Configuration" msgstr "" -#: ../../c-api/init_config.rst:2147 +#: ../../c-api/init_config.rst:2151 msgid "" ":c:func:`PyPreConfig_InitIsolatedConfig` and :c:func:" "`PyConfig_InitIsolatedConfig` functions create a configuration to isolate " "Python from the system. For example, to embed Python into an application." msgstr "" -#: ../../c-api/init_config.rst:2152 +#: ../../c-api/init_config.rst:2156 msgid "" "This configuration ignores global configuration variables, environment " "variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) " @@ -3130,115 +3136,115 @@ msgid "" "LC_CTYPE locale are left unchanged. Signal handlers are not installed." msgstr "" -#: ../../c-api/init_config.rst:2157 +#: ../../c-api/init_config.rst:2161 msgid "" "Configuration files are still used with this configuration to determine " "paths that are unspecified. Ensure :c:member:`PyConfig.home` is specified to " "avoid computing the default path configuration." msgstr "" -#: ../../c-api/init_config.rst:2165 +#: ../../c-api/init_config.rst:2169 msgid "Python Configuration" msgstr "" -#: ../../c-api/init_config.rst:2167 +#: ../../c-api/init_config.rst:2171 msgid "" ":c:func:`PyPreConfig_InitPythonConfig` and :c:func:" "`PyConfig_InitPythonConfig` functions create a configuration to build a " "customized Python which behaves as the regular Python." msgstr "" -#: ../../c-api/init_config.rst:2171 +#: ../../c-api/init_config.rst:2175 msgid "" "Environments variables and command line arguments are used to configure " "Python, whereas global configuration variables are ignored." msgstr "" -#: ../../c-api/init_config.rst:2174 +#: ../../c-api/init_config.rst:2178 msgid "" "This function enables C locale coercion (:pep:`538`) and :ref:`Python UTF-8 " "Mode ` (:pep:`540`) depending on the LC_CTYPE locale, :envvar:" "`PYTHONUTF8` and :envvar:`PYTHONCOERCECLOCALE` environment variables." msgstr "" -#: ../../c-api/init_config.rst:2183 +#: ../../c-api/init_config.rst:2187 msgid "Python Path Configuration" msgstr "Python 路徑配置" -#: ../../c-api/init_config.rst:2185 +#: ../../c-api/init_config.rst:2189 msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:2187 +#: ../../c-api/init_config.rst:2191 msgid "Path configuration inputs:" msgstr "" -#: ../../c-api/init_config.rst:2189 +#: ../../c-api/init_config.rst:2193 msgid ":c:member:`PyConfig.home`" msgstr ":c:member:`PyConfig.home`" -#: ../../c-api/init_config.rst:2190 +#: ../../c-api/init_config.rst:2194 msgid ":c:member:`PyConfig.platlibdir`" msgstr ":c:member:`PyConfig.platlibdir`" -#: ../../c-api/init_config.rst:2191 +#: ../../c-api/init_config.rst:2195 msgid ":c:member:`PyConfig.pathconfig_warnings`" msgstr ":c:member:`PyConfig.pathconfig_warnings`" -#: ../../c-api/init_config.rst:2192 +#: ../../c-api/init_config.rst:2196 msgid ":c:member:`PyConfig.program_name`" msgstr ":c:member:`PyConfig.program_name`" -#: ../../c-api/init_config.rst:2193 +#: ../../c-api/init_config.rst:2197 msgid ":c:member:`PyConfig.pythonpath_env`" msgstr ":c:member:`PyConfig.pythonpath_env`" -#: ../../c-api/init_config.rst:2194 +#: ../../c-api/init_config.rst:2198 msgid "current working directory: to get absolute paths" msgstr "" -#: ../../c-api/init_config.rst:2195 +#: ../../c-api/init_config.rst:2199 msgid "" "``PATH`` environment variable to get the program full path (from :c:member:" "`PyConfig.program_name`)" msgstr "" -#: ../../c-api/init_config.rst:2197 +#: ../../c-api/init_config.rst:2201 msgid "``__PYVENV_LAUNCHER__`` environment variable" msgstr "``__PYVENV_LAUNCHER__`` 環境變數" -#: ../../c-api/init_config.rst:2198 +#: ../../c-api/init_config.rst:2202 msgid "" "(Windows only) Application paths in the registry under " "\"Software\\Python\\PythonCore\\X.Y\\PythonPath\" of HKEY_CURRENT_USER and " "HKEY_LOCAL_MACHINE (where X.Y is the Python version)." msgstr "" -#: ../../c-api/init_config.rst:2202 +#: ../../c-api/init_config.rst:2206 msgid "Path configuration output fields:" msgstr "" -#: ../../c-api/init_config.rst:2204 +#: ../../c-api/init_config.rst:2208 msgid ":c:member:`PyConfig.base_exec_prefix`" msgstr ":c:member:`PyConfig.base_exec_prefix`" -#: ../../c-api/init_config.rst:2205 +#: ../../c-api/init_config.rst:2209 msgid ":c:member:`PyConfig.base_executable`" msgstr ":c:member:`PyConfig.base_executable`" -#: ../../c-api/init_config.rst:2206 +#: ../../c-api/init_config.rst:2210 msgid ":c:member:`PyConfig.base_prefix`" msgstr ":c:member:`PyConfig.base_prefix`" -#: ../../c-api/init_config.rst:2207 +#: ../../c-api/init_config.rst:2211 msgid ":c:member:`PyConfig.exec_prefix`" msgstr ":c:member:`PyConfig.exec_prefix`" -#: ../../c-api/init_config.rst:2208 +#: ../../c-api/init_config.rst:2212 msgid ":c:member:`PyConfig.executable`" msgstr ":c:member:`PyConfig.executable`" -#: ../../c-api/init_config.rst:2209 +#: ../../c-api/init_config.rst:2213 msgid "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" @@ -3246,11 +3252,11 @@ msgstr "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" -#: ../../c-api/init_config.rst:2211 +#: ../../c-api/init_config.rst:2215 msgid ":c:member:`PyConfig.prefix`" msgstr ":c:member:`PyConfig.prefix`" -#: ../../c-api/init_config.rst:2213 +#: ../../c-api/init_config.rst:2217 msgid "" "If at least one \"output field\" is not set, Python calculates the path " "configuration to fill unset fields. If :c:member:`~PyConfig." @@ -3259,7 +3265,7 @@ msgid "" "module_search_paths_set` is set to ``1``." msgstr "" -#: ../../c-api/init_config.rst:2219 +#: ../../c-api/init_config.rst:2223 msgid "" "It is possible to completely ignore the function calculating the default " "path configuration by setting explicitly all path configuration output " @@ -3269,52 +3275,52 @@ msgid "" "modification." msgstr "" -#: ../../c-api/init_config.rst:2226 +#: ../../c-api/init_config.rst:2230 msgid "" "Set :c:member:`~PyConfig.pathconfig_warnings` to ``0`` to suppress warnings " "when calculating the path configuration (Unix only, Windows does not log any " "warning)." msgstr "" -#: ../../c-api/init_config.rst:2229 +#: ../../c-api/init_config.rst:2233 msgid "" "If :c:member:`~PyConfig.base_prefix` or :c:member:`~PyConfig." "base_exec_prefix` fields are not set, they inherit their value from :c:" "member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` respectively." msgstr "" -#: ../../c-api/init_config.rst:2233 +#: ../../c-api/init_config.rst:2237 msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" msgstr ":c:func:`Py_RunMain` 和 :c:func:`Py_Main` 會修改 :data:`sys.path`:" -#: ../../c-api/init_config.rst:2235 +#: ../../c-api/init_config.rst:2239 msgid "" "If :c:member:`~PyConfig.run_filename` is set and is a directory which " "contains a ``__main__.py`` script, prepend :c:member:`~PyConfig." "run_filename` to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:2238 +#: ../../c-api/init_config.rst:2242 msgid "If :c:member:`~PyConfig.isolated` is zero:" msgstr "如果 :c:member:`~PyConfig.isolated` 為零:" -#: ../../c-api/init_config.rst:2240 +#: ../../c-api/init_config.rst:2244 msgid "" "If :c:member:`~PyConfig.run_module` is set, prepend the current directory " "to :data:`sys.path`. Do nothing if the current directory cannot be read." msgstr "" -#: ../../c-api/init_config.rst:2242 +#: ../../c-api/init_config.rst:2246 msgid "" "If :c:member:`~PyConfig.run_filename` is set, prepend the directory of the " "filename to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:2244 +#: ../../c-api/init_config.rst:2248 msgid "Otherwise, prepend an empty string to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:2246 +#: ../../c-api/init_config.rst:2250 msgid "" "If :c:member:`~PyConfig.site_import` is non-zero, :data:`sys.path` can be " "modified by the :mod:`site` module. If :c:member:`~PyConfig." @@ -3323,43 +3329,43 @@ msgid "" "data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:2252 +#: ../../c-api/init_config.rst:2256 msgid "The following configuration files are used by the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:2254 +#: ../../c-api/init_config.rst:2258 msgid "``pyvenv.cfg``" msgstr "``pyvenv.cfg``" -#: ../../c-api/init_config.rst:2255 +#: ../../c-api/init_config.rst:2259 msgid "``._pth`` file (ex: ``python._pth``)" msgstr "" -#: ../../c-api/init_config.rst:2256 +#: ../../c-api/init_config.rst:2260 msgid "``pybuilddir.txt`` (Unix only)" msgstr "``pybuilddir.txt``\\ (僅限 Unix)" -#: ../../c-api/init_config.rst:2258 +#: ../../c-api/init_config.rst:2262 msgid "If a ``._pth`` file is present:" msgstr "" -#: ../../c-api/init_config.rst:2260 +#: ../../c-api/init_config.rst:2264 msgid "Set :c:member:`~PyConfig.isolated` to ``1``." msgstr "將 :c:member:`~PyConfig.isolated` 設定為 ``1``。" -#: ../../c-api/init_config.rst:2261 +#: ../../c-api/init_config.rst:2265 msgid "Set :c:member:`~PyConfig.use_environment` to ``0``." msgstr "將 :c:member:`~PyConfig.use_environment` 設定為 ``0``。" -#: ../../c-api/init_config.rst:2262 +#: ../../c-api/init_config.rst:2266 msgid "Set :c:member:`~PyConfig.site_import` to ``0``." msgstr "將 :c:member:`~PyConfig.site_import` 設定為 ``0``。" -#: ../../c-api/init_config.rst:2263 +#: ../../c-api/init_config.rst:2267 msgid "Set :c:member:`~PyConfig.safe_path` to ``1``." msgstr "將 :c:member:`~PyConfig.safe_path` 設定為 ``1``。" -#: ../../c-api/init_config.rst:2265 +#: ../../c-api/init_config.rst:2269 msgid "" "If :c:member:`~PyConfig.home` is not set and a ``pyvenv.cfg`` file is " "present in the same directory as :c:member:`~PyConfig.executable`, or its " @@ -3370,42 +3376,42 @@ msgid "" "more information." msgstr "" -#: ../../c-api/init_config.rst:2273 +#: ../../c-api/init_config.rst:2277 msgid "" "The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" "`PyConfig.base_executable`." msgstr "" -#: ../../c-api/init_config.rst:2278 +#: ../../c-api/init_config.rst:2282 msgid "" ":c:member:`~PyConfig.prefix`, and :c:member:`~PyConfig.exec_prefix`, are now " "set to the ``pyvenv.cfg`` directory. This was previously done by :mod:" "`site`, therefore affected by :option:`-S`." msgstr "" -#: ../../c-api/init_config.rst:2284 +#: ../../c-api/init_config.rst:2288 msgid "Py_GetArgcArgv()" msgstr "Py_GetArgcArgv()" -#: ../../c-api/init_config.rst:2288 +#: ../../c-api/init_config.rst:2292 msgid "Get the original command line arguments, before Python modified them." msgstr "" -#: ../../c-api/init_config.rst:2290 +#: ../../c-api/init_config.rst:2294 msgid "See also :c:member:`PyConfig.orig_argv` member." msgstr "也請參與 :c:member:`PyConfig.orig_argv` 成員。" -#: ../../c-api/init_config.rst:2293 +#: ../../c-api/init_config.rst:2297 msgid "Delaying main module execution" msgstr "" -#: ../../c-api/init_config.rst:2295 +#: ../../c-api/init_config.rst:2299 msgid "" "In some embedding use cases, it may be desirable to separate interpreter " "initialization from the execution of the main module." msgstr "" -#: ../../c-api/init_config.rst:2298 +#: ../../c-api/init_config.rst:2302 msgid "" "This separation can be achieved by setting ``PyConfig.run_command`` to the " "empty string during initialization (to prevent the interpreter from dropping " @@ -3413,10 +3419,10 @@ msgid "" "main module code using ``__main__.__dict__`` as the global namespace." msgstr "" -#: ../../c-api/init_config.rst:1181 +#: ../../c-api/init_config.rst:1185 msgid "main()" msgstr "main()" -#: ../../c-api/init_config.rst:1181 +#: ../../c-api/init_config.rst:1185 msgid "argv (in module sys)" msgstr "" diff --git a/c-api/long.po b/c-api/long.po index 9e87f06193..468517062a 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-04-23 00:30+0000\n" +"POT-Creation-Date: 2026-06-06 15:51+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -92,16 +92,16 @@ msgid "" "``NULL`` on failure." msgstr "" -#: ../../c-api/long.rst:77 +#: ../../c-api/long.rst:76 msgid "" -"Return a new :c:type:`PyLongObject` object from a signed C :c:expr:`int32_t` " -"or :c:expr:`int64_t`, or ``NULL`` with an exception set on failure." +"Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long " +"long`, or ``NULL`` on failure." msgstr "" -#: ../../c-api/long.rst:86 +#: ../../c-api/long.rst:83 msgid "" -"Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long " -"long`, or ``NULL`` on failure." +"Return a new :c:type:`PyLongObject` object from a signed C :c:expr:`int32_t` " +"or :c:expr:`int64_t`, or ``NULL`` with an exception set on failure." msgstr "" #: ../../c-api/long.rst:93 diff --git a/c-api/memory.po b/c-api/memory.po index a251c41f9c..7686b4d133 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-03-12 00:16+0000\n" +"POT-Creation-Date: 2026-06-11 00:43+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -105,8 +105,8 @@ msgid "" "certain circumstances, the Python memory manager may or may not trigger " "appropriate actions, like garbage collection, memory compaction or other " "preventive procedures. Note that by using the C library allocator as shown " -"in the previous example, the allocated memory for the I/O buffer escapes " -"completely the Python memory manager." +"in the previous example, the allocated memory for the I/O buffer completely " +"escapes the Python memory manager." msgstr "" #: ../../c-api/memory.rst:88 @@ -222,9 +222,9 @@ msgstr "" #: ../../c-api/memory.rst:164 ../../c-api/memory.rst:242 #: ../../c-api/memory.rst:375 msgid "" -"Allocates *nelem* elements each whose size in bytes is *elsize* and returns " -"a pointer of type :c:expr:`void*` to the allocated memory, or ``NULL`` if " -"the request fails. The memory is initialized to zeros." +"Allocates *nelem* elements each of size *elsize* bytes and returns a pointer " +"of type :c:expr:`void*` to the allocated memory, or ``NULL`` if the request " +"fails. The memory is initialized to zeros." msgstr "" #: ../../c-api/memory.rst:168 diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 55ab6ac1ca..3cb8536133 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-03-19 00:23+0000\n" +"POT-Creation-Date: 2026-06-09 00:37+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -4286,8 +4286,8 @@ msgstr "" #: ../../c-api/typeobj.rst:3047 msgid "" -"Check if the request can be met. If not, raise :exc:`BufferError`, set :c:" -"expr:`view->obj` to ``NULL`` and return ``-1``." +"Check if the request can be met. If not, raise :exc:`BufferError`, set " +"``view->obj`` to ``NULL`` and return ``-1``." msgstr "" #: ../../c-api/typeobj.rst:3050 @@ -4299,8 +4299,7 @@ msgid "Increment an internal counter for the number of exports." msgstr "" #: ../../c-api/typeobj.rst:3054 -msgid "" -"Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`." +msgid "Set ``view->obj`` to *exporter* and increment ``view->obj``." msgstr "" #: ../../c-api/typeobj.rst:3056 @@ -4350,14 +4349,14 @@ msgstr "" #: ../../c-api/typeobj.rst:3079 msgid "" -"Re-export: Each member of the tree acts as the exporting object and sets :c:" -"expr:`view->obj` to a new reference to itself." +"Re-export: Each member of the tree acts as the exporting object and sets " +"``view->obj`` to a new reference to itself." msgstr "" #: ../../c-api/typeobj.rst:3082 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " -"Here, :c:expr:`view->obj` will be a new reference to the root object." +"Here, ``view->obj`` will be a new reference to the root object." msgstr "" #: ../../c-api/typeobj.rst:3086 @@ -4434,7 +4433,7 @@ msgstr "" #: ../../c-api/typeobj.rst:3137 msgid "" -"This function MUST NOT decrement :c:expr:`view->obj`, since that is done " +"This function MUST NOT decrement ``view->obj``, since that is done " "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" diff --git a/c-api/weakref.po b/c-api/weakref.po index a6cc855273..f20eee57aa 100644 --- a/c-api/weakref.po +++ b/c-api/weakref.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-13 00:15+0000\n" +"POT-Creation-Date: 2026-06-11 00:43+0000\n" "PO-Revision-Date: 2017-09-22 18:26+0000\n" "Last-Translator: Leon H.\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -61,8 +61,8 @@ msgid "" "a callable object that receives notification when *ob* is garbage collected; " "it should accept a single parameter, which will be the weak reference object " "itself. *callback* may also be ``None`` or ``NULL``. If *ob* is not a " -"weakly referenceable object, or if *callback* is not callable, ``None``, or " -"``NULL``, this will return ``NULL`` and raise :exc:`TypeError`." +"weakly referenceable object, this will raise :exc:`TypeError` and return " +"``NULL``." msgstr "" #: ../../c-api/weakref.rst:49 ../../c-api/weakref.rst:65 @@ -79,8 +79,8 @@ msgid "" "can be a callable object that receives notification when *ob* is garbage " "collected; it should accept a single parameter, which will be the weak " "reference object itself. *callback* may also be ``None`` or ``NULL``. If " -"*ob* is not a weakly referenceable object, or if *callback* is not callable, " -"``None``, or ``NULL``, this will return ``NULL`` and raise :exc:`TypeError`." +"*ob* weakly referenceable object, this will raise :exc:`TypeError` and " +"return ``NULL``." msgstr "" #: ../../c-api/weakref.rst:71 diff --git a/deprecations/index.po b/deprecations/index.po index f22ca94423..990a7117b6 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-18 00:20+0000\n" +"POT-Creation-Date: 2026-06-12 00:46+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -95,27 +95,10 @@ msgid "``load_module()`` method: use ``exec_module()`` instead." msgstr "``load_module()`` method:請改用 ``exec_module()``。" #: ../../deprecations/pending-removal-in-3.15.rst:36 -msgid ":class:`locale`:" -msgstr ":class:`locale`:" - -#: ../../deprecations/pending-removal-in-3.15.rst:38 -msgid "" -"The :func:`~locale.getdefaultlocale` function has been deprecated since " -"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" -"`90817`), but has been postponed to Python 3.15. Use :func:`~locale." -"getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " -"instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" -msgstr "" -":func:`~locale.getdefaultlocale` 已在 Python 3.11 中被棄用,原本計劃在 " -"Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :func:" -"`~locale.getlocale`、:func:`~locale.setlocale` 和 :func:`~locale." -"getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" - -#: ../../deprecations/pending-removal-in-3.15.rst:46 msgid ":mod:`pathlib`:" msgstr ":mod:`pathlib`:" -#: ../../deprecations/pending-removal-in-3.15.rst:48 +#: ../../deprecations/pending-removal-in-3.15.rst:38 msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows." @@ -123,11 +106,11 @@ msgstr "" ":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請用 :func:`os.path." "isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:52 +#: ../../deprecations/pending-removal-in-3.15.rst:42 msgid ":mod:`platform`:" msgstr ":mod:`platform`:" -#: ../../deprecations/pending-removal-in-3.15.rst:54 +#: ../../deprecations/pending-removal-in-3.15.rst:44 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " @@ -136,12 +119,12 @@ msgstr "" "自 Python 3.13 起,:func:`~platform.java_ver` 已被棄用。此函式僅對 Jython 支" "援有用,具有令人困惑的 API,基本上未經測試。" -#: ../../deprecations/pending-removal-in-3.15.rst:58 +#: ../../deprecations/pending-removal-in-3.15.rst:48 #: ../../deprecations/pending-removal-in-3.16.rst:96 msgid ":mod:`sysconfig`:" msgstr ":mod:`sysconfig`:" -#: ../../deprecations/pending-removal-in-3.15.rst:60 +#: ../../deprecations/pending-removal-in-3.15.rst:50 msgid "" "The *check_home* argument of :func:`sysconfig.is_python_build` has been " "deprecated since Python 3.12." @@ -149,11 +132,11 @@ msgstr "" ":func:`sysconfig.is_python_build` 的 *check_home* 引數自 Python 3.12 起已被棄" "用。" -#: ../../deprecations/pending-removal-in-3.15.rst:63 +#: ../../deprecations/pending-removal-in-3.15.rst:53 msgid ":mod:`threading`:" msgstr ":mod:`threading`:" -#: ../../deprecations/pending-removal-in-3.15.rst:65 +#: ../../deprecations/pending-removal-in-3.15.rst:55 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -164,11 +147,11 @@ msgstr "" "起,傳遞任何引數的用法已被棄用,因為 Python 版本不允許任何引數,但 C 版本允許" "任意數量的位置或關鍵字引數,並忽略每個引數。" -#: ../../deprecations/pending-removal-in-3.15.rst:71 +#: ../../deprecations/pending-removal-in-3.15.rst:61 msgid ":mod:`types`:" msgstr ":mod:`types`:" -#: ../../deprecations/pending-removal-in-3.15.rst:73 +#: ../../deprecations/pending-removal-in-3.15.rst:63 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -180,12 +163,12 @@ msgstr "" "exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev 於 :gh:" "`101866` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:80 +#: ../../deprecations/pending-removal-in-3.15.rst:70 #: ../../deprecations/pending-removal-in-3.17.rst:26 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" -#: ../../deprecations/pending-removal-in-3.15.rst:82 +#: ../../deprecations/pending-removal-in-3.15.rst:72 msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." "NamedTuple` classes (for example, ``Point = NamedTuple(\"Point\", x=int, " @@ -196,7 +179,7 @@ msgstr "" "(``Point = NamedTuple(\"Point\", x=int, y=int)``) 已自 Python 3.13 棄用。請改" "用基於類別的語法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:88 +#: ../../deprecations/pending-removal-in-3.15.rst:78 msgid "" "When using the functional syntax of :class:`~typing.TypedDict`\\s, failing " "to pass a value to the *fields* parameter (``TD = TypedDict(\"TD\")``) or " @@ -209,7 +192,7 @@ msgstr "" "None)``) 的做法自 Python 3.13 起已被棄用。請使用 ``class TD(TypedDict): " "pass`` 或 ``TD = TypedDict(\"TD\", {})`` 來建立具有零個欄位的 TypedDict。" -#: ../../deprecations/pending-removal-in-3.15.rst:95 +#: ../../deprecations/pending-removal-in-3.15.rst:85 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " @@ -219,11 +202,11 @@ msgstr "" "用。在 :mod:`typing` 模組中使用了八年之後,它尚未得到任何主要型別檢查器的支" "援。" -#: ../../deprecations/pending-removal-in-3.15.rst:100 +#: ../../deprecations/pending-removal-in-3.15.rst:90 msgid ":mod:`wave`:" msgstr ":mod:`wave`:" -#: ../../deprecations/pending-removal-in-3.15.rst:102 +#: ../../deprecations/pending-removal-in-3.15.rst:92 msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." "Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" @@ -233,11 +216,11 @@ msgstr "" "`~wave.Wave_read.getmark`、:meth:`!setmark` 和 :meth:`~wave.Wave_read." "getmarkers` 方法自 Python 3.13 被棄用。" -#: ../../deprecations/pending-removal-in-3.15.rst:107 +#: ../../deprecations/pending-removal-in-3.15.rst:97 msgid ":mod:`zipimport`:" msgstr ":mod:`zipimport`:" -#: ../../deprecations/pending-removal-in-3.15.rst:109 +#: ../../deprecations/pending-removal-in-3.15.rst:99 msgid "" ":meth:`~zipimport.zipimporter.load_module` has been deprecated since Python " "3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead. (Contributed " @@ -1610,5 +1593,20 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" +#~ msgid ":class:`locale`:" +#~ msgstr ":class:`locale`:" + +#~ msgid "" +#~ "The :func:`~locale.getdefaultlocale` function has been deprecated since " +#~ "Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" +#~ "`90817`), but has been postponed to Python 3.15. Use :func:`~locale." +#~ "getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " +#~ "instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" +#~ msgstr "" +#~ ":func:`~locale.getdefaultlocale` 已在 Python 3.11 中被棄用,原本計劃在 " +#~ "Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :func:" +#~ "`~locale.getlocale`、:func:`~locale.setlocale` 和 :func:`~locale." +#~ "getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" + #~ msgid "Delegation of ``int()`` to ``__trunc__()`` method." #~ msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。" diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po index 685616d1ee..f10a108a9b 100644 --- a/deprecations/pending-removal-in-3.15.po +++ b/deprecations/pending-removal-in-3.15.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-18 00:20+0000\n" +"POT-Creation-Date: 2026-06-12 00:46+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-" @@ -87,27 +87,10 @@ msgid "``load_module()`` method: use ``exec_module()`` instead." msgstr "``load_module()`` method:請改用 ``exec_module()``。" #: ../../deprecations/pending-removal-in-3.15.rst:36 -msgid ":class:`locale`:" -msgstr ":class:`locale`:" - -#: ../../deprecations/pending-removal-in-3.15.rst:38 -msgid "" -"The :func:`~locale.getdefaultlocale` function has been deprecated since " -"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" -"`90817`), but has been postponed to Python 3.15. Use :func:`~locale." -"getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " -"instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" -msgstr "" -":func:`~locale.getdefaultlocale` 已在 Python 3.11 中被棄用,原本計劃在 " -"Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :func:" -"`~locale.getlocale`、:func:`~locale.setlocale` 和 :func:`~locale." -"getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" - -#: ../../deprecations/pending-removal-in-3.15.rst:46 msgid ":mod:`pathlib`:" msgstr ":mod:`pathlib`:" -#: ../../deprecations/pending-removal-in-3.15.rst:48 +#: ../../deprecations/pending-removal-in-3.15.rst:38 msgid "" ":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" "func:`os.path.isreserved` to detect reserved paths on Windows." @@ -115,11 +98,11 @@ msgstr "" ":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請用 :func:`os.path." "isreserved` 來偵測 Windows 上的保留路徑。" -#: ../../deprecations/pending-removal-in-3.15.rst:52 +#: ../../deprecations/pending-removal-in-3.15.rst:42 msgid ":mod:`platform`:" msgstr ":mod:`platform`:" -#: ../../deprecations/pending-removal-in-3.15.rst:54 +#: ../../deprecations/pending-removal-in-3.15.rst:44 msgid "" ":func:`~platform.java_ver` has been deprecated since Python 3.13. This " "function is only useful for Jython support, has a confusing API, and is " @@ -128,11 +111,11 @@ msgstr "" "自 Python 3.13 起,:func:`~platform.java_ver` 已被棄用。此函式僅對 Jython 支" "援有用,具有令人困惑的 API,基本上未經測試。" -#: ../../deprecations/pending-removal-in-3.15.rst:58 +#: ../../deprecations/pending-removal-in-3.15.rst:48 msgid ":mod:`sysconfig`:" msgstr ":mod:`sysconfig`:" -#: ../../deprecations/pending-removal-in-3.15.rst:60 +#: ../../deprecations/pending-removal-in-3.15.rst:50 msgid "" "The *check_home* argument of :func:`sysconfig.is_python_build` has been " "deprecated since Python 3.12." @@ -140,11 +123,11 @@ msgstr "" ":func:`sysconfig.is_python_build` 的 *check_home* 引數自 Python 3.12 起已被棄" "用。" -#: ../../deprecations/pending-removal-in-3.15.rst:63 +#: ../../deprecations/pending-removal-in-3.15.rst:53 msgid ":mod:`threading`:" msgstr ":mod:`threading`:" -#: ../../deprecations/pending-removal-in-3.15.rst:65 +#: ../../deprecations/pending-removal-in-3.15.rst:55 msgid "" ":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " "arguments has been deprecated since Python 3.14, as the Python version does " @@ -155,11 +138,11 @@ msgstr "" "起,傳遞任何引數的用法已被棄用,因為 Python 版本不允許任何引數,但 C 版本允許" "任意數量的位置或關鍵字引數,並忽略每個引數。" -#: ../../deprecations/pending-removal-in-3.15.rst:71 +#: ../../deprecations/pending-removal-in-3.15.rst:61 msgid ":mod:`types`:" msgstr ":mod:`types`:" -#: ../../deprecations/pending-removal-in-3.15.rst:73 +#: ../../deprecations/pending-removal-in-3.15.rst:63 msgid "" ":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " "deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " @@ -171,11 +154,11 @@ msgstr "" "exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev 於 :gh:" "`101866` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.15.rst:80 +#: ../../deprecations/pending-removal-in-3.15.rst:70 msgid ":mod:`typing`:" msgstr ":mod:`typing`:" -#: ../../deprecations/pending-removal-in-3.15.rst:82 +#: ../../deprecations/pending-removal-in-3.15.rst:72 msgid "" "The undocumented keyword argument syntax for creating :class:`~typing." "NamedTuple` classes (for example, ``Point = NamedTuple(\"Point\", x=int, " @@ -186,7 +169,7 @@ msgstr "" "(``Point = NamedTuple(\"Point\", x=int, y=int)``) 已自 Python 3.13 棄用。請改" "用基於類別的語法或函式語法 (functional syntax)。" -#: ../../deprecations/pending-removal-in-3.15.rst:88 +#: ../../deprecations/pending-removal-in-3.15.rst:78 msgid "" "When using the functional syntax of :class:`~typing.TypedDict`\\s, failing " "to pass a value to the *fields* parameter (``TD = TypedDict(\"TD\")``) or " @@ -199,7 +182,7 @@ msgstr "" "None)``) 的做法自 Python 3.13 起已被棄用。請使用 ``class TD(TypedDict): " "pass`` 或 ``TD = TypedDict(\"TD\", {})`` 來建立具有零個欄位的 TypedDict。" -#: ../../deprecations/pending-removal-in-3.15.rst:95 +#: ../../deprecations/pending-removal-in-3.15.rst:85 msgid "" "The :func:`typing.no_type_check_decorator` decorator function has been " "deprecated since Python 3.13. After eight years in the :mod:`typing` module, " @@ -209,11 +192,11 @@ msgstr "" "用。在 :mod:`typing` 模組中使用了八年之後,它尚未得到任何主要型別檢查器的支" "援。" -#: ../../deprecations/pending-removal-in-3.15.rst:100 +#: ../../deprecations/pending-removal-in-3.15.rst:90 msgid ":mod:`wave`:" msgstr ":mod:`wave`:" -#: ../../deprecations/pending-removal-in-3.15.rst:102 +#: ../../deprecations/pending-removal-in-3.15.rst:92 msgid "" "The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." "Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" @@ -223,11 +206,11 @@ msgstr "" "`~wave.Wave_read.getmark`、:meth:`!setmark` 和 :meth:`~wave.Wave_read." "getmarkers` 方法自 Python 3.13 被棄用。" -#: ../../deprecations/pending-removal-in-3.15.rst:107 +#: ../../deprecations/pending-removal-in-3.15.rst:97 msgid ":mod:`zipimport`:" msgstr ":mod:`zipimport`:" -#: ../../deprecations/pending-removal-in-3.15.rst:109 +#: ../../deprecations/pending-removal-in-3.15.rst:99 msgid "" ":meth:`~zipimport.zipimporter.load_module` has been deprecated since Python " "3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead. (Contributed " @@ -236,3 +219,18 @@ msgstr "" ":meth:`~zipimport.zipimporter.load_module` 自 Python 3.10 被棄用。請改用 :" "meth:`~zipimport.zipimporter.exec_module`。(由 Jiahao Li 於 :gh:`125746` 貢" "獻。)" + +#~ msgid ":class:`locale`:" +#~ msgstr ":class:`locale`:" + +#~ msgid "" +#~ "The :func:`~locale.getdefaultlocale` function has been deprecated since " +#~ "Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" +#~ "`90817`), but has been postponed to Python 3.15. Use :func:`~locale." +#~ "getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " +#~ "instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" +#~ msgstr "" +#~ ":func:`~locale.getdefaultlocale` 已在 Python 3.11 中被棄用,原本計劃在 " +#~ "Python 3.13 中移除 (:gh:`90817`),但被延後至 Python 3.15。請改用 :func:" +#~ "`~locale.getlocale`、:func:`~locale.setlocale` 和 :func:`~locale." +#~ "getencoding`。 (由 Hugo van Kemenade 於 :gh:`111187` 貢獻。)" diff --git a/howto/functional.po b/howto/functional.po index 8e186ab544..2aa28eb15a 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-11-30 00:16+0000\n" +"POT-Creation-Date: 2026-06-08 00:43+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-" @@ -1642,7 +1642,7 @@ msgid "" ">>> functools.reduce(operator.concat, [])\n" "Traceback (most recent call last):\n" " ...\n" -"TypeError: reduce() of empty sequence with no initial value\n" +"TypeError: reduce() of empty iterable with no initial value\n" ">>> functools.reduce(operator.mul, [1, 2, 3], 1)\n" "6\n" ">>> functools.reduce(operator.mul, [], 1)\n" @@ -1654,7 +1654,7 @@ msgstr "" ">>> functools.reduce(operator.concat, [])\n" "Traceback (most recent call last):\n" " ...\n" -"TypeError: reduce() of empty sequence with no initial value\n" +"TypeError: reduce() of empty iterable with no initial value\n" ">>> functools.reduce(operator.mul, [1, 2, 3], 1)\n" "6\n" ">>> functools.reduce(operator.mul, [], 1)\n" diff --git a/library/argparse.po b/library/argparse.po index cf709f732a..d3b4e1f3b7 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-04-15 00:29+0000\n" +"POT-Creation-Date: 2026-06-10 00:43+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-" @@ -264,7 +264,7 @@ msgstr "新增 *exit_on_error* 參數。" msgid "*suggest_on_error* and *color* parameters were added." msgstr "新增 *suggest_on_error* 和 *color* 參數。" -#: ../../library/argparse.rst:137 ../../library/argparse.rst:696 +#: ../../library/argparse.rst:137 ../../library/argparse.rst:695 msgid "The following sections describe how each of these are used." msgstr "以下各節描述了這些參數的使用方式。" @@ -876,14 +876,11 @@ msgstr "" #: ../../library/argparse.rst:445 msgid "" -"Empty lines are treated as empty strings (``''``), which are allowed as " -"values but not as arguments. Empty lines that are read as arguments will " -"result in an \"unrecognized arguments\" error." +"Each line is treated as a single argument, so an empty line is read as an " +"empty string (``''``)." msgstr "" -"空行會被視為空字串 (``''``),可以作為值但不能作為引數。若空行被讀取為引數,會" -"導致 \"unrecognized arguments\" 錯誤。" -#: ../../library/argparse.rst:449 +#: ../../library/argparse.rst:448 msgid "" ":class:`ArgumentParser` uses :term:`filesystem encoding and error handler` " "to read the file containing arguments." @@ -891,7 +888,7 @@ msgstr "" ":class:`ArgumentParser` 使用\\ :term:`檔案系統編碼和錯誤處理函式 `\\ 來讀取包含引數的檔案。" -#: ../../library/argparse.rst:452 +#: ../../library/argparse.rst:451 msgid "" "The ``fromfile_prefix_chars=`` argument defaults to ``None``, meaning that " "arguments will never be treated as file references." @@ -899,7 +896,7 @@ msgstr "" "``fromfile_prefix_chars=`` 引數預設值為 ``None``,意味著引數永遠不會被視為檔" "案參照。" -#: ../../library/argparse.rst:455 +#: ../../library/argparse.rst:454 msgid "" ":class:`ArgumentParser` changed encoding and errors to read arguments files " "from default (e.g. :func:`locale.getpreferredencoding(False) `。在 Windows 上引數檔案應使用 UTF-8 而非 ANSI 字" "碼頁編碼。" -#: ../../library/argparse.rst:463 +#: ../../library/argparse.rst:462 msgid "argument_default" msgstr "argument_default" -#: ../../library/argparse.rst:465 +#: ../../library/argparse.rst:464 msgid "" "Generally, argument defaults are specified either by passing a default to :" "meth:`~ArgumentParser.add_argument` or by calling the :meth:`~ArgumentParser." @@ -935,7 +932,7 @@ msgstr "" "`ArgumentParser` 來完成。例如若要全域地抑制 :meth:`~ArgumentParser." "parse_args` 呼叫時的屬性建立,我們可以提供 ``argument_default=SUPPRESS``: ::" -#: ../../library/argparse.rst:474 +#: ../../library/argparse.rst:473 msgid "" ">>> parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)\n" ">>> parser.add_argument('--foo')\n" @@ -953,11 +950,11 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace()" -#: ../../library/argparse.rst:485 +#: ../../library/argparse.rst:484 msgid "allow_abbrev" msgstr "allow_abbrev" -#: ../../library/argparse.rst:487 +#: ../../library/argparse.rst:486 msgid "" "Normally, when you pass an argument list to the :meth:`~ArgumentParser." "parse_args` method of an :class:`ArgumentParser`, it :ref:`recognizes " @@ -967,11 +964,11 @@ msgstr "" "parse_args` 方法時,它會通常會\\ :ref:`辨識為長選項的縮寫 `。" -#: ../../library/argparse.rst:491 +#: ../../library/argparse.rst:490 msgid "This feature can be disabled by setting ``allow_abbrev`` to ``False``::" msgstr "可以透過將 ``allow_abbrev`` 設為 ``False`` 來停用此功能: ::" -#: ../../library/argparse.rst:493 +#: ../../library/argparse.rst:492 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', allow_abbrev=False)\n" ">>> parser.add_argument('--foobar', action='store_true')\n" @@ -987,11 +984,11 @@ msgstr "" "usage: PROG [-h] [--foobar] [--foonley]\n" "PROG: error: unrecognized arguments: --foon" -#: ../../library/argparse.rst:504 +#: ../../library/argparse.rst:503 msgid "conflict_handler" msgstr "conflict_handler" -#: ../../library/argparse.rst:506 +#: ../../library/argparse.rst:505 msgid "" ":class:`ArgumentParser` objects do not allow two actions with the same " "option string. By default, :class:`ArgumentParser` objects raise an " @@ -1002,7 +999,7 @@ msgstr "" "下,如果嘗試建立一個使用已存在選項字串的引數,:class:`ArgumentParser` 物件會" "引發例外: ::" -#: ../../library/argparse.rst:511 +#: ../../library/argparse.rst:510 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-f', '--foo', help='old foo help')\n" @@ -1018,7 +1015,7 @@ msgstr "" " ..\n" "ArgumentError: argument --foo: conflicting option string(s): --foo" -#: ../../library/argparse.rst:518 +#: ../../library/argparse.rst:517 msgid "" "Sometimes (e.g. when using parents_) it may be useful to simply override any " "older arguments with the same option string. To get this behavior, the " @@ -1029,7 +1026,7 @@ msgstr "" "要得到此行為,可以將值 ``'resolve'`` 提供給 :class:`ArgumentParser` 的 " "``conflict_handler=`` 引數: ::" -#: ../../library/argparse.rst:523 +#: ../../library/argparse.rst:522 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', " "conflict_handler='resolve')\n" @@ -1055,7 +1052,7 @@ msgstr "" " -f FOO old foo help\n" " --foo FOO new foo help" -#: ../../library/argparse.rst:534 +#: ../../library/argparse.rst:533 msgid "" "Note that :class:`ArgumentParser` objects only remove an action if all of " "its option strings are overridden. So, in the example above, the old ``-f/--" @@ -1066,11 +1063,11 @@ msgstr "" "物件才會移除該 action。因此在上面的範例中,舊的 ``-f/--foo`` action 會保留為 " "``-f`` action,因為只有 ``--foo`` 選項字串被覆寫。" -#: ../../library/argparse.rst:541 +#: ../../library/argparse.rst:540 msgid "add_help" msgstr "add_help" -#: ../../library/argparse.rst:543 +#: ../../library/argparse.rst:542 msgid "" "By default, :class:`ArgumentParser` objects add an option which simply " "displays the parser's help message. If ``-h`` or ``--help`` is supplied at " @@ -1080,7 +1077,7 @@ msgstr "" "明訊息。如果在命令列上提供了 ``-h`` 或 ``--help``,將會印出 :class:`!" "ArgumentParser` 的說明。" -#: ../../library/argparse.rst:547 +#: ../../library/argparse.rst:546 msgid "" "Occasionally, it may be useful to disable the addition of this help option. " "This can be achieved by passing ``False`` as the ``add_help=`` argument to :" @@ -1089,7 +1086,7 @@ msgstr "" "停用自動加入的幫助說明選項 (help option) 有時可能很有用。可以透過將 " "``False`` 作為 ``add_help=`` 引數傳給 :class:`ArgumentParser` 來達成: ::" -#: ../../library/argparse.rst:551 +#: ../../library/argparse.rst:550 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> parser.add_argument('--foo', help='foo help')\n" @@ -1107,7 +1104,7 @@ msgstr "" "options:\n" " --foo FOO foo help" -#: ../../library/argparse.rst:559 +#: ../../library/argparse.rst:558 msgid "" "The help option is typically ``-h/--help``. The exception to this is if the " "``prefix_chars=`` is specified and does not include ``-``, in which case ``-" @@ -1118,7 +1115,7 @@ msgstr "" "包含 ``-``,此時 ``-h`` 和 ``--help`` 不是有效的選項。在這種情況下," "``prefix_chars`` 中的第一個字元會用作幫助說明選項的前綴: ::" -#: ../../library/argparse.rst:565 +#: ../../library/argparse.rst:564 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='+/')\n" ">>> parser.print_help()\n" @@ -1134,11 +1131,11 @@ msgstr "" "options:\n" " +h, ++help show this help message and exit" -#: ../../library/argparse.rst:574 +#: ../../library/argparse.rst:573 msgid "exit_on_error" msgstr "exit_on_error" -#: ../../library/argparse.rst:576 +#: ../../library/argparse.rst:575 msgid "" "Normally, when you pass an invalid argument list to the :meth:" "`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, it will " @@ -1148,7 +1145,7 @@ msgstr "" "parse_args` 方法時,它通常會向 :data:`sys.stderr` 印出一個\\ *訊息*\\ 並以狀" "態碼 2 退出。" -#: ../../library/argparse.rst:580 +#: ../../library/argparse.rst:579 msgid "" "If the user would like to catch errors manually, the feature can be enabled " "by setting ``exit_on_error`` to ``False``::" @@ -1156,7 +1153,7 @@ msgstr "" "如果使用者想要手動捕捉錯誤,可以透過將 ``exit_on_error`` 設為 ``False`` 來啟" "用此功能: ::" -#: ../../library/argparse.rst:583 +#: ../../library/argparse.rst:582 msgid "" ">>> parser = argparse.ArgumentParser(exit_on_error=False)\n" ">>> parser.add_argument('--integers', type=int)\n" @@ -1182,11 +1179,11 @@ msgstr "" "...\n" "Catching an argumentError" -#: ../../library/argparse.rst:596 +#: ../../library/argparse.rst:595 msgid "suggest_on_error" msgstr "suggest_on_error" -#: ../../library/argparse.rst:598 +#: ../../library/argparse.rst:597 msgid "" "By default, when a user passes an invalid argument choice or subparser " "name, :class:`ArgumentParser` will exit with error info and list the " @@ -1197,7 +1194,7 @@ msgstr "" "`ArgumentParser` 會帶著錯誤資訊退出,並將允許的引數選擇(如果有指定的話)或子" "剖析器名稱列為錯誤訊息的一部分。" -#: ../../library/argparse.rst:602 +#: ../../library/argparse.rst:601 msgid "" "If the user would like to enable suggestions for mistyped argument choices " "and subparser names, the feature can be enabled by setting " @@ -1208,7 +1205,7 @@ msgstr "" "``suggest_on_error`` 設為 ``True`` 來啟用此功能。請注意,這僅適用於指定的選擇" "皆為字串的引數: ::" -#: ../../library/argparse.rst:607 +#: ../../library/argparse.rst:606 msgid "" ">>> parser = argparse.ArgumentParser(suggest_on_error=True)\n" ">>> parser.add_argument('--action', choices=['debug', 'dryrun'])\n" @@ -1224,7 +1221,7 @@ msgstr "" "tester.py: error: argument --action: invalid choice: 'debugg', maybe you " "meant 'debug'? (choose from debug, dryrun)" -#: ../../library/argparse.rst:613 +#: ../../library/argparse.rst:612 msgid "" "If you're writing code that needs to be compatible with older Python " "versions and want to opportunistically use ``suggest_on_error`` when it's " @@ -1235,7 +1232,7 @@ msgstr "" "``suggest_on_error`` 可用時伺機使用它,你可以在初始化剖析器後將其設為屬性,而" "非使用關鍵字引數: ::" -#: ../../library/argparse.rst:618 +#: ../../library/argparse.rst:617 msgid "" ">>> parser = argparse.ArgumentParser(description='Process some integers.')\n" ">>> parser.suggest_on_error = True" @@ -1243,11 +1240,11 @@ msgstr "" ">>> parser = argparse.ArgumentParser(description='Process some integers.')\n" ">>> parser.suggest_on_error = True" -#: ../../library/argparse.rst:625 +#: ../../library/argparse.rst:624 msgid "color" msgstr "color" -#: ../../library/argparse.rst:627 +#: ../../library/argparse.rst:626 msgid "" "By default, the help message is printed in color using `ANSI escape " "sequences `__. If you want " @@ -1260,7 +1257,7 @@ msgstr "" "你的本地環境中 `\\ 停用它,或是透過將 ``color`` " "設為 ``False`` 在引數剖析器本身停用: ::" -#: ../../library/argparse.rst:633 +#: ../../library/argparse.rst:632 msgid "" ">>> parser = argparse.ArgumentParser(description='Process some integers.',\n" "... color=False)\n" @@ -1276,7 +1273,7 @@ msgstr "" "... help='an integer for the accumulator')\n" ">>> parser.parse_args(['--help'])" -#: ../../library/argparse.rst:640 +#: ../../library/argparse.rst:639 msgid "" "Note that when ``color=True``, colored output depends on both environment " "variables and terminal capabilities. However, if ``color=False``, colored " @@ -1287,7 +1284,7 @@ msgstr "" "``color=False``,即使設定了 ``FORCE_COLOR`` 之類的環境變數,彩色輸出也是會被" "停用。" -#: ../../library/argparse.rst:647 +#: ../../library/argparse.rst:646 msgid "" "Error messages will include color codes when redirecting stderr to a file. " "To avoid this, set the |NO_COLOR|_ or :envvar:`PYTHON_COLORS` environment " @@ -1297,11 +1294,11 @@ msgstr "" "NO_COLOR|_ 或 :envvar:`PYTHON_COLORS` 環境變數(例如 ``NO_COLOR=1 python " "script.py 2> errors.txt``)。" -#: ../../library/argparse.rst:656 +#: ../../library/argparse.rst:655 msgid "The add_argument() method" msgstr "add_argument() 方法" -#: ../../library/argparse.rst:662 +#: ../../library/argparse.rst:661 msgid "" "Define how a single command-line argument should be parsed. Each parameter " "has its own more detailed description below, but in short they are:" @@ -1309,7 +1306,7 @@ msgstr "" "定義單個命令列引數應如何被剖析。每個參數在下面都有更詳細的描述,簡而言之它們" "是:" -#: ../../library/argparse.rst:665 +#: ../../library/argparse.rst:664 msgid "" "`name or flags`_ - Either a name or a list of option strings, e.g. ``'foo'`` " "or ``'-f', '--foo'``." @@ -1317,69 +1314,69 @@ msgstr "" "`name or flags`_ - 一個名稱或選項字串的串列,例如 ``'foo'`` 或 ``'-f', '--" "foo'``。" -#: ../../library/argparse.rst:668 +#: ../../library/argparse.rst:667 msgid "" "action_ - The basic type of action to be taken when this argument is " "encountered at the command line." msgstr "action_ - 在命令列遇到此引數時要執行的基本 action 類型。" -#: ../../library/argparse.rst:671 +#: ../../library/argparse.rst:670 msgid "nargs_ - The number of command-line arguments that should be consumed." msgstr "nargs_ - 應消耗的命令列引數數量。" -#: ../../library/argparse.rst:673 +#: ../../library/argparse.rst:672 msgid "" "const_ - A constant value required by some action_ and nargs_ selections." msgstr "const_ - 某些 action_ 和 nargs_ 選擇所需的常數值。" -#: ../../library/argparse.rst:675 +#: ../../library/argparse.rst:674 msgid "" "default_ - The value produced if the argument is absent from the command " "line and if it is absent from the namespace object." msgstr "default_ - 如果引數不在命令列中且不在命名空間物件中時所產生的值。" -#: ../../library/argparse.rst:678 +#: ../../library/argparse.rst:677 msgid "" "type_ - The type to which the command-line argument should be converted." msgstr "type_ - 命令列引數應轉換成的型別。" -#: ../../library/argparse.rst:680 +#: ../../library/argparse.rst:679 msgid "choices_ - A sequence of the allowable values for the argument." msgstr "choices_ - 引數允許值的序列。" -#: ../../library/argparse.rst:682 +#: ../../library/argparse.rst:681 msgid "" "required_ - Whether or not the command-line option may be omitted (optionals " "only)." msgstr "required_ - 命令列選項是否可省略(僅限可選引數)。" -#: ../../library/argparse.rst:685 +#: ../../library/argparse.rst:684 msgid "help_ - A brief description of what the argument does." msgstr "help_ - 引數功能的簡短描述。" -#: ../../library/argparse.rst:687 +#: ../../library/argparse.rst:686 msgid "metavar_ - A name for the argument in usage messages." msgstr "metavar_ - 引數在用法訊息中的名稱。" -#: ../../library/argparse.rst:689 +#: ../../library/argparse.rst:688 msgid "" "dest_ - The name of the attribute to be added to the object returned by :" "meth:`parse_args`." msgstr "dest_ - 要加入到 :meth:`parse_args` 回傳物件中的屬性名稱。" -#: ../../library/argparse.rst:692 +#: ../../library/argparse.rst:691 msgid "deprecated_ - Whether or not use of the argument is deprecated." msgstr "deprecated_ - 引數的使用是否已被棄用。" -#: ../../library/argparse.rst:694 +#: ../../library/argparse.rst:693 msgid "The method returns an :class:`Action` object representing the argument." msgstr "" -#: ../../library/argparse.rst:702 +#: ../../library/argparse.rst:701 msgid "name or flags" msgstr "name or flags" -#: ../../library/argparse.rst:704 +#: ../../library/argparse.rst:703 msgid "" "The :meth:`~ArgumentParser.add_argument` method must know whether an " "optional argument, like ``-f`` or ``--foo``, or a positional argument, like " @@ -1392,23 +1389,23 @@ msgstr "" "`~ArgumentParser.add_argument` 的第一個引數必須是一系列旗標或一個簡單的引數名" "稱。" -#: ../../library/argparse.rst:710 +#: ../../library/argparse.rst:709 msgid "For example, an optional argument could be created like::" msgstr "例如,可選引數可以像這樣建立: ::" -#: ../../library/argparse.rst:712 +#: ../../library/argparse.rst:711 msgid ">>> parser.add_argument('-f', '--foo')" msgstr ">>> parser.add_argument('-f', '--foo')" -#: ../../library/argparse.rst:714 +#: ../../library/argparse.rst:713 msgid "while a positional argument could be created like::" msgstr "而位置引數可以像這樣建立: ::" -#: ../../library/argparse.rst:716 +#: ../../library/argparse.rst:715 msgid ">>> parser.add_argument('bar')" msgstr ">>> parser.add_argument('bar')" -#: ../../library/argparse.rst:718 +#: ../../library/argparse.rst:717 msgid "" "When :meth:`~ArgumentParser.parse_args` is called, optional arguments will " "be identified by the ``-`` prefix, and the remaining arguments will be " @@ -1417,7 +1414,7 @@ msgstr "" "當呼叫 :meth:`~ArgumentParser.parse_args` 時,可選引數會透過 ``-`` 前綴來辨" "識,其餘的引數則假設為位置引數: ::" -#: ../../library/argparse.rst:722 +#: ../../library/argparse.rst:721 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-f', '--foo')\n" @@ -1441,7 +1438,7 @@ msgstr "" "usage: PROG [-h] [-f FOO] bar\n" "PROG: error: the following arguments are required: bar" -#: ../../library/argparse.rst:733 +#: ../../library/argparse.rst:732 msgid "" "By default, :mod:`!argparse` automatically handles the internal naming and " "display names of arguments, simplifying the process without requiring " @@ -1455,7 +1452,7 @@ msgstr "" "dest_ 參數預設為引數名稱,以底線 ``_`` 取代連字號 ``-``。metavar_ 參數預設為" "大寫的名稱。例如: ::" -#: ../../library/argparse.rst:741 +#: ../../library/argparse.rst:740 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo-bar')\n" @@ -1479,11 +1476,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo-bar FOO-BAR" -#: ../../library/argparse.rst:756 +#: ../../library/argparse.rst:755 msgid "action" msgstr "action" -#: ../../library/argparse.rst:758 +#: ../../library/argparse.rst:757 msgid "" ":class:`ArgumentParser` objects associate command-line arguments with " "actions. These actions can do just about anything with the command-line " @@ -1497,13 +1494,13 @@ msgstr "" "meth:`~ArgumentParser.parse_args` 回傳的物件中。``action`` 關鍵字引數指定命令" "列引數應如何被處理。提供的 action 有:" -#: ../../library/argparse.rst:764 +#: ../../library/argparse.rst:763 msgid "" "``'store'`` - This just stores the argument's value. This is the default " "action." msgstr "``'store'`` - 這只是儲存引數的值。這是預設的 action。" -#: ../../library/argparse.rst:767 +#: ../../library/argparse.rst:766 msgid "" "``'store_const'`` - This stores the value specified by the const_ keyword " "argument; note that the const_ keyword argument defaults to ``None``. The " @@ -1514,7 +1511,7 @@ msgstr "" "引數預設為 ``None``。``'store_const'`` action 最常與指定某種旗標的可選引數一" "起使用。例如: ::" -#: ../../library/argparse.rst:772 +#: ../../library/argparse.rst:771 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_const', const=42)\n" @@ -1526,7 +1523,7 @@ msgstr "" ">>> parser.parse_args(['--foo'])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:777 +#: ../../library/argparse.rst:776 msgid "" "``'store_true'`` and ``'store_false'`` - These are special cases of " "``'store_const'`` that respectively store the values ``True`` and ``False`` " @@ -1535,7 +1532,7 @@ msgstr "" "``'store_true'`` 和 ``'store_false'`` - 這些是 ``'store_const'`` 的特殊情況," "分別儲存值 ``True`` 和 ``False``,預設值為 ``False`` 和 ``True``: ::" -#: ../../library/argparse.rst:782 +#: ../../library/argparse.rst:781 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -1551,7 +1548,7 @@ msgstr "" ">>> parser.parse_args('--foo --bar'.split())\n" "Namespace(foo=True, bar=False, baz=True)" -#: ../../library/argparse.rst:789 +#: ../../library/argparse.rst:788 msgid "" "``'append'`` - This appends each argument value to a list. It is useful for " "allowing an option to be specified multiple times. If the default value is a " @@ -1563,7 +1560,7 @@ msgstr "" "很有用。如果預設值是一個非空的串列,剖析後的值會以預設串列的元素開始,命令列" "的任何值則會附加在那些預設值之後。使用範例: ::" -#: ../../library/argparse.rst:795 +#: ../../library/argparse.rst:794 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='append', default=['0'])\n" @@ -1575,7 +1572,7 @@ msgstr "" ">>> parser.parse_args('--foo 1 --foo 2'.split())\n" "Namespace(foo=['0', '1', '2'])" -#: ../../library/argparse.rst:800 +#: ../../library/argparse.rst:799 msgid "" "``'append_const'`` - This appends the value specified by the const_ keyword " "argument to a list; note that the const_ keyword argument defaults to " @@ -1586,7 +1583,7 @@ msgstr "" "意 const_ 關鍵字引數預設為 ``None``。``'append_const'`` action 通常在多個引數" "需要將常數儲存到同一個串列時很有用。例如: ::" -#: ../../library/argparse.rst:806 +#: ../../library/argparse.rst:805 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--str', dest='types', action='append_const', " @@ -1604,7 +1601,7 @@ msgstr "" ">>> parser.parse_args('--str --int'.split())\n" "Namespace(types=[, ])" -#: ../../library/argparse.rst:812 +#: ../../library/argparse.rst:811 msgid "" "``'extend'`` - This appends each item from a multi-value argument to a list. " "The ``'extend'`` action is typically used with the nargs_ keyword argument " @@ -1617,7 +1614,7 @@ msgstr "" "``None``\\ (預設值)或 ``'?'`` 時,引數字串的每個字元都會被附加到串列中。使" "用範例: ::" -#: ../../library/argparse.rst:820 +#: ../../library/argparse.rst:819 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", " @@ -1633,14 +1630,14 @@ msgstr "" "\"f4\"])\n" "Namespace(foo=['f1', 'f2', 'f3', 'f4'])" -#: ../../library/argparse.rst:827 +#: ../../library/argparse.rst:826 msgid "" "``'count'`` - This counts the number of times an argument occurs. For " "example, this is useful for increasing verbosity levels::" msgstr "" "``'count'`` - 這會計算引數出現的次數。例如,這對於增加詳細程度等級很有用: ::" -#: ../../library/argparse.rst:830 +#: ../../library/argparse.rst:829 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--verbose', '-v', action='count', default=0)\n" @@ -1652,11 +1649,11 @@ msgstr "" ">>> parser.parse_args(['-vvv'])\n" "Namespace(verbose=3)" -#: ../../library/argparse.rst:835 +#: ../../library/argparse.rst:834 msgid "Note, the *default* will be ``None`` unless explicitly set to *0*." msgstr "請注意,除非明確設為 *0*,否則 *default* 將為 ``None``。" -#: ../../library/argparse.rst:837 +#: ../../library/argparse.rst:836 msgid "" "``'help'`` - This prints a complete help message for all the options in the " "current parser and then exits. By default a help action is automatically " @@ -1667,7 +1664,7 @@ msgstr "" "下,help action 會自動加入到剖析器。有關輸出如何建立的詳情,請參閱 :class:" "`ArgumentParser`。" -#: ../../library/argparse.rst:842 +#: ../../library/argparse.rst:841 msgid "" "``'version'`` - This expects a ``version=`` keyword argument in the :meth:" "`~ArgumentParser.add_argument` call, and prints version information and " @@ -1676,7 +1673,7 @@ msgstr "" "``'version'`` - 這預期在 :meth:`~ArgumentParser.add_argument` 呼叫中有一個 " "``version=`` 關鍵字引數,並在被呼叫時印出版本資訊並退出: ::" -#: ../../library/argparse.rst:846 +#: ../../library/argparse.rst:845 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -1692,7 +1689,7 @@ msgstr "" ">>> parser.parse_args(['--version'])\n" "PROG 2.0" -#: ../../library/argparse.rst:852 +#: ../../library/argparse.rst:851 msgid "" "You may also specify an arbitrary action by passing an :class:`Action` " "subclass (e.g. :class:`BooleanOptionalAction`) or other object that " @@ -1705,7 +1702,7 @@ msgstr "" "action(例如 ``'store'``、``'append'``、``'extend'`` 或 ``nargs`` 不為零的自" "訂 action)可用於位置引數。" -#: ../../library/argparse.rst:858 +#: ../../library/argparse.rst:857 msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " "overriding the :meth:`!__call__` method and optionally the :meth:`!__init__` " @@ -1718,11 +1715,11 @@ msgstr "" "使用 :meth:`~ArgumentParser.register` 方法註冊自訂 action,並透過它們的註冊名" "稱來參照。" -#: ../../library/argparse.rst:863 +#: ../../library/argparse.rst:862 msgid "An example of a custom action::" msgstr "自訂 action 的範例: ::" -#: ../../library/argparse.rst:865 +#: ../../library/argparse.rst:864 msgid "" ">>> class FooAction(argparse.Action):\n" "... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" @@ -1760,15 +1757,15 @@ msgstr "" ">>> args\n" "Namespace(bar='1', foo='2')" -#: ../../library/argparse.rst:883 +#: ../../library/argparse.rst:882 msgid "For more details, see :class:`Action`." msgstr "更多詳情請見 :class:`Action`。" -#: ../../library/argparse.rst:889 +#: ../../library/argparse.rst:888 msgid "nargs" msgstr "nargs" -#: ../../library/argparse.rst:891 +#: ../../library/argparse.rst:890 msgid "" ":class:`ArgumentParser` objects usually associate a single command-line " "argument with a single action to be taken. The ``nargs`` keyword argument " @@ -1780,14 +1777,14 @@ msgstr "" "來。``nargs`` 關鍵字引數會將不同數量的命令列引數與單個 action 關聯。另請參閱" "\\ :ref:`specifying-ambiguous-arguments`。支援的值有:" -#: ../../library/argparse.rst:896 +#: ../../library/argparse.rst:895 msgid "" "``N`` (an integer). ``N`` arguments from the command line will be gathered " "together into a list. For example::" msgstr "" "``N``\\ (一個整數)。命令列中的 ``N`` 個引數會被收集到一個串列中。例如: ::" -#: ../../library/argparse.rst:899 +#: ../../library/argparse.rst:898 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs=2)\n" @@ -1801,7 +1798,7 @@ msgstr "" ">>> parser.parse_args('c --foo a b'.split())\n" "Namespace(bar=['c'], foo=['a', 'b'])" -#: ../../library/argparse.rst:905 +#: ../../library/argparse.rst:904 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." @@ -1809,7 +1806,7 @@ msgstr "" "請注意 ``nargs=1`` 會產生一個只有一個項目的串列。這與預設情況不同,預設情況下" "項目會單獨產生。" -#: ../../library/argparse.rst:910 +#: ../../library/argparse.rst:909 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 " @@ -1823,7 +1820,7 @@ msgstr "" "選項字串存在但後面沒有跟著命令列引數,在這種情況下會產生 const_ 的值。以下是" "這個情況的範例: ::" -#: ../../library/argparse.rst:917 +#: ../../library/argparse.rst:916 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" @@ -1845,13 +1842,13 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(bar='d', foo='d')" -#: ../../library/argparse.rst:927 +#: ../../library/argparse.rst:926 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " "output files::" msgstr "``nargs='?'`` 比較常見的用途之一是允許可選的輸入和輸出檔案: ::" -#: ../../library/argparse.rst:930 +#: ../../library/argparse.rst:929 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', nargs='?')\n" @@ -1873,7 +1870,7 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(infile=None, outfile=None)" -#: ../../library/argparse.rst:942 +#: ../../library/argparse.rst:941 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 " @@ -1884,7 +1881,7 @@ msgstr "" "``nargs='*'`` 的位置引數通常沒有太大意義,但多個 ``nargs='*'`` 的可選引數是可" "能的。例如: ::" -#: ../../library/argparse.rst:947 +#: ../../library/argparse.rst:946 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', nargs='*')\n" @@ -1900,7 +1897,7 @@ 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:956 +#: ../../library/argparse.rst:955 msgid "" "``'+'``. Just like ``'*'``, all command-line arguments present are gathered " "into a list. Additionally, an error message will be generated if there " @@ -1909,7 +1906,7 @@ msgstr "" "``'+'``。與 ``'*'`` 一樣,所有存在的命令列引數都會被收集到一個串列中。此外," "如果沒有至少一個命令列引數存在就會產生一個錯誤訊息。例如: ::" -#: ../../library/argparse.rst:960 +#: ../../library/argparse.rst:959 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('foo', nargs='+')\n" @@ -1927,7 +1924,7 @@ msgstr "" "usage: PROG [-h] foo [foo ...]\n" "PROG: error: the following arguments are required: foo" -#: ../../library/argparse.rst:968 +#: ../../library/argparse.rst:967 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " @@ -1939,11 +1936,11 @@ msgstr "" "意味著會消耗單個命令列引數並產生單個項目(而非串列)。不消耗命令列引數的 " "action(例如 ``'store_const'``)會設定 ``nargs=0``。" -#: ../../library/argparse.rst:978 +#: ../../library/argparse.rst:977 msgid "const" msgstr "const" -#: ../../library/argparse.rst:980 +#: ../../library/argparse.rst:979 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 " @@ -1953,7 +1950,7 @@ msgstr "" ":meth:`~ArgumentParser.add_argument` 的 ``const`` 引數用於保存不從命令列讀取" "但為各種 :class:`ArgumentParser` action 所需的常數值。它最常見的兩種用途是:" -#: ../../library/argparse.rst:984 +#: ../../library/argparse.rst:983 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='store_const'`` or ``action='append_const'``. These actions add " @@ -1968,7 +1965,7 @@ msgstr "" "述。如果未向 :meth:`~ArgumentParser.add_argument` 提供 ``const``,它會接收預" "設值 ``None``。" -#: ../../library/argparse.rst:992 +#: ../../library/argparse.rst:991 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " @@ -1982,7 +1979,7 @@ msgstr "" "數。剖析命令列時,如果遇到選項字串但後面沒有命令列引數,會使用 ``const`` 的" "值。範例請參閱 nargs_ 描述。" -#: ../../library/argparse.rst:999 +#: ../../library/argparse.rst:998 msgid "" "``const=None`` by default, including when ``action='append_const'`` or " "``action='store_const'``." @@ -1990,11 +1987,11 @@ msgstr "" "``const=None`` 為預設值,包括當 ``action='append_const'`` 或 " "``action='store_const'`` 時。" -#: ../../library/argparse.rst:1006 +#: ../../library/argparse.rst:1005 msgid "default" msgstr "default" -#: ../../library/argparse.rst:1008 +#: ../../library/argparse.rst:1007 msgid "" "All optional arguments and some positional arguments may be omitted at the " "command line. The ``default`` keyword argument of :meth:`~ArgumentParser." @@ -2008,7 +2005,7 @@ msgstr "" "數不存在時應使用的值。對於可選引數,當選項字串不在命令列上時會使用 " "``default`` 值: ::" -#: ../../library/argparse.rst:1015 +#: ../../library/argparse.rst:1014 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -2024,14 +2021,14 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:1022 +#: ../../library/argparse.rst:1021 msgid "" "If the target namespace already has an attribute set, the action *default* " "will not overwrite it::" msgstr "" "如果目標命名空間已經設定了一個屬性,action 的 *default* 不會覆寫它: ::" -#: ../../library/argparse.rst:1025 +#: ../../library/argparse.rst:1024 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=42)\n" @@ -2043,7 +2040,7 @@ msgstr "" ">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" "Namespace(foo=101)" -#: ../../library/argparse.rst:1030 +#: ../../library/argparse.rst:1029 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_ " @@ -2054,7 +2051,7 @@ msgstr "" "果有提供 type_ 轉換引數,剖析器會在設定 :class:`Namespace` 回傳值的屬性之前先" "套用它。否則剖析器會直接使用該值: ::" -#: ../../library/argparse.rst:1035 +#: ../../library/argparse.rst:1034 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--length', default='10', type=int)\n" @@ -2068,7 +2065,7 @@ msgstr "" ">>> parser.parse_args()\n" "Namespace(length=10, width=10.5)" -#: ../../library/argparse.rst:1041 +#: ../../library/argparse.rst:1040 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" @@ -2076,7 +2073,7 @@ msgstr "" "對於 nargs_ 等於 ``?`` 或 ``*`` 的位置引數,當沒有命令列引數存在時會使用 " "``default`` 值: ::" -#: ../../library/argparse.rst:1044 +#: ../../library/argparse.rst:1043 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', nargs='?', default=42)\n" @@ -2092,7 +2089,14 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo=42)" -#: ../../library/argparse.rst:1051 +#: ../../library/argparse.rst:1050 +msgid "" +"Because ``nargs='*'`` gathers any supplied values into a list, an absent " +"positional argument yields an empty list (``[]``). Only a non-``None`` " +"*default* overrides this (so ``default=None`` still gives ``[]``)." +msgstr "" + +#: ../../library/argparse.rst:1054 msgid "" "For required_ arguments, the ``default`` value is ignored. For example, this " "applies to positional arguments with nargs_ values other than ``?`` or " @@ -2101,7 +2105,7 @@ msgstr "" "對於 required_ 引數,``default`` 值會被忽略。例如,這適用於 nargs_ 值不是 ``?" "`` 或 ``*`` 的位置引數,或是標記為 ``required=True`` 的可選引數。" -#: ../../library/argparse.rst:1055 +#: ../../library/argparse.rst:1058 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" @@ -2109,7 +2113,7 @@ msgstr "" "若有提供 ``default=argparse.SUPPRESS``,命令列引數不存在時就不會加入任何屬" "性: ::" -#: ../../library/argparse.rst:1058 +#: ../../library/argparse.rst:1061 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" @@ -2125,11 +2129,11 @@ msgstr "" ">>> parser.parse_args(['--foo', '1'])\n" "Namespace(foo='1')" -#: ../../library/argparse.rst:1069 +#: ../../library/argparse.rst:1072 msgid "type" msgstr "type" -#: ../../library/argparse.rst:1071 +#: ../../library/argparse.rst:1074 msgid "" "By default, the parser reads command-line arguments in as simple strings. " "However, quite often the command-line string should instead be interpreted " @@ -2141,7 +2145,7 @@ msgstr "" "一種型別,例如 :class:`float` 或 :class:`int`。:meth:`~ArgumentParser." "add_argument` 的 ``type`` 關鍵字允許執行任何必要的型別檢查和型別轉換。" -#: ../../library/argparse.rst:1077 +#: ../../library/argparse.rst:1080 msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." @@ -2149,7 +2153,7 @@ msgstr "" "如果 type_ 關鍵字與 default_ 關鍵字一起使用,型別轉換器只會在預設值為字串時套" "用。" -#: ../../library/argparse.rst:1080 +#: ../../library/argparse.rst:1083 msgid "" "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 " @@ -2162,11 +2166,11 @@ msgstr "" "`ArgumentTypeError`、:exc:`TypeError` 或 :exc:`ValueError`,剖析器會捕捉例外" "並顯示格式良好的錯誤訊息。其他例外型別則不處理。" -#: ../../library/argparse.rst:1086 +#: ../../library/argparse.rst:1089 msgid "Common built-in types and functions can be used as type converters:" msgstr "常見的內建型別和函式可以作為型別轉換器使用:" -#: ../../library/argparse.rst:1088 +#: ../../library/argparse.rst:1091 msgid "" "import argparse\n" "import pathlib\n" @@ -2188,11 +2192,11 @@ msgstr "" "parser.add_argument('code_point', type=ord)\n" "parser.add_argument('datapath', type=pathlib.Path)" -#: ../../library/argparse.rst:1100 +#: ../../library/argparse.rst:1103 msgid "User defined functions can be used as well:" msgstr "也可以用那些使用者定義的函式:" -#: ../../library/argparse.rst:1102 +#: ../../library/argparse.rst:1105 msgid "" ">>> def hyphenated(string):\n" "... return '-'.join([word[:4] for word in string.casefold().split()])\n" @@ -2210,7 +2214,7 @@ msgstr "" ">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" "Namespace(short_title='\"the-tale-of-two-citi')" -#: ../../library/argparse.rst:1112 +#: ../../library/argparse.rst:1115 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 " @@ -2219,7 +2223,7 @@ msgstr "" "不建議使用 :func:`bool` 函式作為型別轉換器。它所做的只是將空字串轉為 " "``False``,將非空字串轉為 ``True``。這通常不是期望的行為::" -#: ../../library/argparse.rst:1116 +#: ../../library/argparse.rst:1119 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> _ = parser.add_argument('--verbose', type=bool)\n" @@ -2231,13 +2235,13 @@ msgstr "" ">>> parser.parse_args(['--verbose', 'False'])\n" "Namespace(verbose=True)" -#: ../../library/argparse.rst:1121 +#: ../../library/argparse.rst:1124 msgid "" "See :class:`BooleanOptionalAction` or ``action='store_true'`` for common " "alternatives." msgstr "" -#: ../../library/argparse.rst:1124 +#: ../../library/argparse.rst:1127 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 " @@ -2247,7 +2251,7 @@ msgstr "" "一般而言,``type`` 關鍵字是一個便利功能,應只用於只會引發三種支援的例外之一的" "簡單轉換。任何更複雜的錯誤處理或資源管理都應在引數剖析之後的下游進行。" -#: ../../library/argparse.rst:1129 +#: ../../library/argparse.rst:1132 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." @@ -2258,7 +2262,7 @@ msgstr "" "好的報告。:exc:`~json.JSONDecodeError` 無法得到良好的格式化,而 :exc:" "`FileNotFoundError` 例外則完全不會處理。" -#: ../../library/argparse.rst:1134 +#: ../../library/argparse.rst:1137 msgid "" "Even :class:`~argparse.FileType` has its limitations for use with the " "``type`` keyword. If one argument uses :class:`~argparse.FileType` and then " @@ -2272,17 +2276,17 @@ msgstr "" "報告錯誤但檔案不會自動關閉。在這種情況下,最好等到剖析器執行完畢後,再使用 :" "keyword:`with` 陳述式來管理檔案。" -#: ../../library/argparse.rst:1141 +#: ../../library/argparse.rst:1144 msgid "" "For type checkers that simply check against a fixed set of values, consider " "using the choices_ keyword instead." msgstr "對於僅檢查固定值集合的型別檢查器,請考慮改用 choices_ 關鍵字。" -#: ../../library/argparse.rst:1148 +#: ../../library/argparse.rst:1151 msgid "choices" msgstr "choices" -#: ../../library/argparse.rst:1150 +#: ../../library/argparse.rst:1153 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* " @@ -2294,7 +2298,7 @@ msgstr "" "字引數傳給 :meth:`~ArgumentParser.add_argument` 來處理。剖析命令列時會檢查引" "數值,如果引數不是可接受的值之一,就會顯示錯誤訊息: ::" -#: ../../library/argparse.rst:1156 +#: ../../library/argparse.rst:1159 msgid "" ">>> parser = argparse.ArgumentParser(prog='game.py')\n" ">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" @@ -2314,7 +2318,7 @@ msgstr "" "game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" "'paper', 'scissors')" -#: ../../library/argparse.rst:1165 +#: ../../library/argparse.rst:1168 msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " "objects, :class:`tuple` objects, and custom sequences are all supported." @@ -2322,14 +2326,14 @@ msgstr "" "任何序列都可以作為 *choices* 值傳入,因此 :class:`list` 物件、:class:`tuple` " "物件和自訂序列都有被支援。" -#: ../../library/argparse.rst:1168 +#: ../../library/argparse.rst:1171 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." msgstr "" "不建議使用 :class:`enum.Enum`,因為很難控制它在用法、說明和錯誤訊息中的長相。" -#: ../../library/argparse.rst:1171 +#: ../../library/argparse.rst:1174 msgid "" "Note that *choices* are checked after any type_ conversions have been " "performed, so objects in *choices* should match the type_ specified. This " @@ -2339,7 +2343,7 @@ msgstr "" "物件應符合指定的 type_。這可能使 *choices* 在用法、說明或錯誤訊息中的長相看起" "來不尋常。" -#: ../../library/argparse.rst:1176 +#: ../../library/argparse.rst:1179 msgid "" "To keep *choices* user-friendly, consider a custom type wrapper that " "converts and formats values, or omit type_ and handle conversion in your " @@ -2348,7 +2352,7 @@ msgstr "" "若要保持 *choices* 對使用者友善,請考慮使用自訂型別包裝器來轉換和格式化值,或" "是省略 type_ 並在你的應用程式碼中處理轉換。" -#: ../../library/argparse.rst:1180 +#: ../../library/argparse.rst:1183 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 " @@ -2359,11 +2363,11 @@ msgstr "" "使用者永遠看不到 *dest* 參數。如果此顯示不理想(也許因為有很多選擇),只需指" "定一個明確的 metavar_。" -#: ../../library/argparse.rst:1189 +#: ../../library/argparse.rst:1192 msgid "required" msgstr "required" -#: ../../library/argparse.rst:1191 +#: ../../library/argparse.rst:1194 msgid "" "In general, the :mod:`!argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " @@ -2375,7 +2379,7 @@ msgstr "" "以為 :meth:`~ArgumentParser.add_argument` 的 ``required=`` 關鍵字引數指定 " "``True``: ::" -#: ../../library/argparse.rst:1196 +#: ../../library/argparse.rst:1199 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', required=True)\n" @@ -2393,7 +2397,7 @@ msgstr "" "usage: [-h] --foo FOO\n" ": error: the following arguments are required: --foo" -#: ../../library/argparse.rst:1204 +#: ../../library/argparse.rst:1207 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 " @@ -2402,7 +2406,7 @@ msgstr "" "如範例所示,如果一個選項被標記為 ``required``,:meth:`~ArgumentParser." "parse_args` 會在該選項不在命令列上時報告錯誤。" -#: ../../library/argparse.rst:1210 +#: ../../library/argparse.rst:1213 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." @@ -2410,11 +2414,11 @@ msgstr "" "必要選項一般認為是不良做法,因為使用者期望\\ *選項*\\ 是\\ *可選的*,因此應盡" "可能避免使用。" -#: ../../library/argparse.rst:1217 +#: ../../library/argparse.rst:1220 msgid "help" msgstr "help" -#: ../../library/argparse.rst:1219 +#: ../../library/argparse.rst:1222 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`` " @@ -2424,7 +2428,7 @@ msgstr "" "``help`` 值是一個包含引數簡短描述的字串。當使用者請求說明(通常是在命令列上使" "用 ``-h`` 或 ``--help``)時,這些 ``help`` 描述會與每個引數一起顯示。" -#: ../../library/argparse.rst:1224 +#: ../../library/argparse.rst:1227 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " @@ -2436,7 +2440,7 @@ msgstr "" "內容。可用的說明符號包括程式名稱 ``%(prog)s`` 以及 :meth:`~ArgumentParser." "add_argument` 的大多數關鍵字引數,例如 ``%(default)s``、``%(type)s`` 等: ::" -#: ../../library/argparse.rst:1229 +#: ../../library/argparse.rst:1232 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" @@ -2462,7 +2466,7 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1241 +#: ../../library/argparse.rst:1244 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." @@ -2470,7 +2474,7 @@ msgstr "" "由於 help 字串支援 %-格式化,如果你想讓文字 ``%`` 出現在 help 字串中,你必須" "將它跳脫為 ``%%``。" -#: ../../library/argparse.rst:1244 +#: ../../library/argparse.rst:1247 msgid "" ":mod:`!argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" @@ -2478,7 +2482,7 @@ msgstr "" ":mod:`!argparse` 支援透過將 ``help`` 值設為 ``argparse.SUPPRESS`` 來隱藏某些" "選項的說明條目: ::" -#: ../../library/argparse.rst:1247 +#: ../../library/argparse.rst:1250 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" @@ -2496,11 +2500,11 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1259 +#: ../../library/argparse.rst:1262 msgid "metavar" msgstr "metavar" -#: ../../library/argparse.rst:1261 +#: ../../library/argparse.rst:1264 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " "refer to each expected argument. By default, :class:`!ArgumentParser` " @@ -2517,7 +2521,7 @@ msgstr "" "值轉為大寫。因此,一個 ``dest='bar'`` 的位置引數稱為 ``bar``。一個應後接單一" "命令列引數的 ``--foo`` 可選引數稱為 ``FOO``。範例: ::" -#: ../../library/argparse.rst:1270 +#: ../../library/argparse.rst:1273 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2549,11 +2553,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO" -#: ../../library/argparse.rst:1285 +#: ../../library/argparse.rst:1288 msgid "An alternative name can be specified with ``metavar``::" msgstr "可以用 ``metavar`` 指定替代名稱: ::" -#: ../../library/argparse.rst:1287 +#: ../../library/argparse.rst:1290 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', metavar='YYY')\n" @@ -2585,7 +2589,7 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo YYY" -#: ../../library/argparse.rst:1302 +#: ../../library/argparse.rst:1305 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " @@ -2594,7 +2598,7 @@ msgstr "" "請注意 ``metavar`` 只會更改\\ *顯示*\\ 的名稱——:meth:`~ArgumentParser." "parse_args` 物件上的屬性名稱仍由 dest_ 值決定。" -#: ../../library/argparse.rst:1306 +#: ../../library/argparse.rst:1309 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " @@ -2603,7 +2607,7 @@ msgstr "" "不同的 ``nargs`` 值可能導致 metavar 被多次使用。提供一個元組給 ``metavar`` 可" "以為每個引數指定不同的顯示: ::" -#: ../../library/argparse.rst:1310 +#: ../../library/argparse.rst:1313 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', nargs=2)\n" @@ -2627,11 +2631,11 @@ msgstr "" " -x X X\n" " --foo bar baz" -#: ../../library/argparse.rst:1325 +#: ../../library/argparse.rst:1328 msgid "dest" msgstr "dest" -#: ../../library/argparse.rst:1327 +#: ../../library/argparse.rst:1330 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " @@ -2645,7 +2649,7 @@ msgstr "" "add_argument` 的 ``dest`` 關鍵字引數決定。對於位置引數 action,``dest`` 通常" "作為 :meth:`~ArgumentParser.add_argument` 的第一個引數提供: ::" -#: ../../library/argparse.rst:1334 +#: ../../library/argparse.rst:1337 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('bar')\n" @@ -2657,7 +2661,7 @@ msgstr "" ">>> parser.parse_args(['XXX'])\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1339 +#: ../../library/argparse.rst:1342 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -2674,7 +2678,7 @@ msgstr "" "的 ``-`` 字元來衍生。任何內部的 ``-`` 字元都會轉為 ``_`` 字元,以確保該字串是" "有效的屬性名稱。以下範例說明了此行為: ::" -#: ../../library/argparse.rst:1348 +#: ../../library/argparse.rst:1351 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" @@ -2692,11 +2696,11 @@ msgstr "" ">>> parser.parse_args('--foo 1 -y 2'.split())\n" "Namespace(foo_bar='1', x='2')" -#: ../../library/argparse.rst:1356 +#: ../../library/argparse.rst:1359 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "``dest`` 允許提供自訂的屬性名稱: ::" -#: ../../library/argparse.rst:1358 +#: ../../library/argparse.rst:1361 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', dest='bar')\n" @@ -2708,11 +2712,20 @@ msgstr "" ">>> parser.parse_args('--foo XXX'.split())\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1367 +#: ../../library/argparse.rst:1366 +msgid "" +"Multiple arguments may share the same ``dest``. By default, the value from " +"the last such argument given on the command line wins. Use " +"``action='append'`` to collect values from all of them into a list instead. " +"For conflicting *option strings* rather than ``dest`` names, see " +"conflict_handler_." +msgstr "" + +#: ../../library/argparse.rst:1374 msgid "deprecated" msgstr "deprecated" -#: ../../library/argparse.rst:1369 +#: ../../library/argparse.rst:1376 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 " @@ -2728,7 +2741,7 @@ msgstr "" "除。對於引數,如果 ``deprecated`` 為 ``True``,那麼使用該引數時會向 :data:" "`sys.stderr` 印出警告: ::" -#: ../../library/argparse.rst:1379 +#: ../../library/argparse.rst:1386 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='snake.py')\n" @@ -2748,11 +2761,11 @@ msgstr "" "snake.py: warning: option '--legs' is deprecated\n" "Namespace(legs=4)" -#: ../../library/argparse.rst:1392 +#: ../../library/argparse.rst:1399 msgid "Action classes" msgstr "Action 類別" -#: ../../library/argparse.rst:1394 +#: ../../library/argparse.rst:1401 msgid "" ":class:`!Action` classes implement the Action API, a callable which returns " "a callable which processes arguments from the command-line. Any object which " @@ -2763,7 +2776,7 @@ msgstr "" "命令列引數的可呼叫物件。任何遵循此 API 的物件都可以作為 ``action`` 參數傳給 :" "meth:`~ArgumentParser.add_argument`。" -#: ../../library/argparse.rst:1403 +#: ../../library/argparse.rst:1410 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 " @@ -2776,7 +2789,7 @@ msgstr "" "給 :meth:`ArgumentParser.add_argument` 的任何關鍵字引數(除了 ``action`` 本" "身)。" -#: ../../library/argparse.rst:1409 +#: ../../library/argparse.rst:1416 msgid "" "Instances of :class:`!Action` (or return value of any callable to the " "``action`` parameter) should have attributes :attr:`!dest`, :attr:`!" @@ -2789,7 +2802,7 @@ msgstr "" "attr:`!required`、:attr:`!help` 等屬性。確保這些屬性被定義的最簡單方式是呼" "叫 :meth:`!Action.__init__`。" -#: ../../library/argparse.rst:1417 +#: ../../library/argparse.rst:1424 msgid "" ":class:`!Action` instances should be callable, so subclasses must override " "the :meth:`!__call__` method, which should accept four parameters:" @@ -2797,12 +2810,12 @@ msgstr "" ":class:`!Action` 實例應該是可呼叫的,因此子類別必須覆寫 :meth:`!__call__` 方" "法,它應接受四個參數:" -#: ../../library/argparse.rst:1420 +#: ../../library/argparse.rst:1427 msgid "" "*parser* - The :class:`ArgumentParser` object which contains this action." msgstr "*parser* - 包含此 action 的 :class:`ArgumentParser` 物件。" -#: ../../library/argparse.rst:1422 +#: ../../library/argparse.rst:1429 msgid "" "*namespace* - The :class:`Namespace` object that will be returned by :meth:" "`~ArgumentParser.parse_args`. Most actions add an attribute to this object " @@ -2811,7 +2824,7 @@ msgstr "" "*namespace* - 將由 :meth:`~ArgumentParser.parse_args` 回傳的 :class:" "`Namespace` 物件。大多數 action 使用 :func:`setattr` 將屬性加入此物件。" -#: ../../library/argparse.rst:1426 +#: ../../library/argparse.rst:1433 msgid "" "*values* - The associated command-line arguments, with any type conversions " "applied. Type conversions are specified with the type_ keyword argument to :" @@ -2820,7 +2833,7 @@ msgstr "" "*values* - 相關聯的命令列引數,已套用任何型別轉換。型別轉換透過 :meth:" "`~ArgumentParser.add_argument` 的 type_ 關鍵字引數指定。" -#: ../../library/argparse.rst:1430 +#: ../../library/argparse.rst:1437 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 " @@ -2829,7 +2842,7 @@ msgstr "" "*option_string* - 用來呼叫此 action 的選項字串。``option_string`` 引數是可選" "的,如果 action 與位置引數關聯則不會出現。" -#: ../../library/argparse.rst:1434 +#: ../../library/argparse.rst:1441 msgid "" "The :meth:`!__call__` method may perform arbitrary actions, but will " "typically set attributes on the ``namespace`` based on ``dest`` and " @@ -2838,7 +2851,7 @@ msgstr "" ":meth:`!__call__` 方法可以執行任意動作,但通常會根據 ``dest`` 和 ``values`` " "在 ``namespace`` 上設定屬性。" -#: ../../library/argparse.rst:1439 +#: ../../library/argparse.rst:1446 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 " @@ -2849,7 +2862,7 @@ msgstr "" "並回傳一個字串,該字串會在印出程式用法時使用。如果未提供此方法,會使用合理的" "預設值。" -#: ../../library/argparse.rst:1445 +#: ../../library/argparse.rst:1452 msgid "" "A subclass of :class:`Action` for handling boolean flags with positive and " "negative options. Adding a single argument such as ``--foo`` automatically " @@ -2860,7 +2873,7 @@ msgstr "" "foo`` 這樣的單個引數會自動建立 ``--foo`` 和 ``--no-foo`` 選項,其分別儲存 " "``True`` 和 ``False``: ::" -#: ../../library/argparse.rst:1450 +#: ../../library/argparse.rst:1457 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -2874,18 +2887,18 @@ msgstr "" ">>> parser.parse_args(['--no-foo'])\n" "Namespace(foo=False)" -#: ../../library/argparse.rst:1460 +#: ../../library/argparse.rst:1467 msgid "The parse_args() method" msgstr "parse_args() 方法" -#: ../../library/argparse.rst:1464 +#: ../../library/argparse.rst:1471 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." msgstr "" "將引數字串轉換為物件並將它們指定為命名空間的屬性。回傳填充後的命名空間。" -#: ../../library/argparse.rst:1467 +#: ../../library/argparse.rst:1474 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " "created and how they are assigned. See the documentation for :meth:`!" @@ -2894,24 +2907,24 @@ msgstr "" "先前對 :meth:`add_argument` 的呼叫決定了確切建立什麼物件以及如何指定它們。詳" "情請參閱 :meth:`!add_argument` 的文件。" -#: ../../library/argparse.rst:1471 +#: ../../library/argparse.rst:1478 msgid "" "args_ - List of strings to parse. The default is taken from :data:`sys." "argv`." msgstr "args_ - 要剖析的字串串列。預設值取自 :data:`sys.argv`。" -#: ../../library/argparse.rst:1474 +#: ../../library/argparse.rst:1481 msgid "" "namespace_ - An object to take the attributes. The default is a new empty :" "class:`Namespace` object." msgstr "" "namespace_ - 接收屬性的物件。預設值是一個新的空 :class:`Namespace` 物件。" -#: ../../library/argparse.rst:1479 +#: ../../library/argparse.rst:1486 msgid "Option value syntax" msgstr "選項值語法" -#: ../../library/argparse.rst:1481 +#: ../../library/argparse.rst:1488 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, " @@ -2920,7 +2933,7 @@ msgstr "" ":meth:`~ArgumentParser.parse_args` 方法支援多種方式來指定選項的值(如果它接受" "值的話)。在最簡單的情況下,選項和它的值作為兩個獨立的引數傳入: ::" -#: ../../library/argparse.rst:1485 +#: ../../library/argparse.rst:1492 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2938,7 +2951,7 @@ msgstr "" ">>> parser.parse_args(['--foo', 'FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1493 +#: ../../library/argparse.rst:1500 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 " @@ -2947,7 +2960,7 @@ msgstr "" "對於長選項(名稱長度超過一個字元的選項),選項和值也可以作為單個命令列引數傳" "入,使用 ``=`` 來分隔它們: ::" -#: ../../library/argparse.rst:1497 +#: ../../library/argparse.rst:1504 msgid "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" @@ -2955,13 +2968,13 @@ msgstr "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1500 +#: ../../library/argparse.rst:1507 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "對於短選項(只有一個字元長的選項),選項和它的值可以串接在一起: ::" -#: ../../library/argparse.rst:1503 +#: ../../library/argparse.rst:1510 msgid "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" @@ -2969,7 +2982,7 @@ msgstr "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" -#: ../../library/argparse.rst:1506 +#: ../../library/argparse.rst:1513 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::" @@ -2977,7 +2990,7 @@ msgstr "" "如果只有最後一個選項需要值(或都不需要),多個短選項就可以被合併在一起、只使" "用一個 ``-`` 前綴: ::" -#: ../../library/argparse.rst:1509 +#: ../../library/argparse.rst:1516 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', action='store_true')\n" @@ -2993,11 +3006,11 @@ msgstr "" ">>> parser.parse_args(['-xyzZ'])\n" "Namespace(x=True, y=True, z='Z')" -#: ../../library/argparse.rst:1518 +#: ../../library/argparse.rst:1525 msgid "Invalid arguments" msgstr "無效引數" -#: ../../library/argparse.rst:1520 +#: ../../library/argparse.rst:1527 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -3008,7 +3021,7 @@ msgstr "" "的選項、無效的型別、無效的選項、錯誤的位置引數數量等。當遇到此類錯誤時,它會" "退出並印出錯誤及用法訊息: ::" -#: ../../library/argparse.rst:1525 +#: ../../library/argparse.rst:1532 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', type=int)\n" @@ -3048,11 +3061,11 @@ msgstr "" "usage: PROG [-h] [--foo FOO] [bar]\n" "PROG: error: extra arguments found: badger" -#: ../../library/argparse.rst:1546 +#: ../../library/argparse.rst:1553 msgid "Arguments containing ``-``" msgstr "包含 ``-`` 的引數" -#: ../../library/argparse.rst:1548 +#: ../../library/argparse.rst:1555 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -3069,7 +3082,7 @@ msgstr "" "位置引數只有在看起來像負數且剖析器中沒有看起來像負數的選項時,才可以用 ``-`` " "開頭: ::" -#: ../../library/argparse.rst:1556 +#: ../../library/argparse.rst:1563 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -3131,7 +3144,7 @@ msgstr "" "usage: PROG [-h] [-1 ONE] [foo]\n" "PROG: error: argument -1: expected one argument" -#: ../../library/argparse.rst:1586 +#: ../../library/argparse.rst:1593 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -3141,7 +3154,7 @@ msgstr "" "如果你有必須以 ``-`` 開頭且不像負數的位置引數,你可以插入偽引數 ``'--'``,它" "會告訴 :meth:`~ArgumentParser.parse_args` 在此之後的所有內容都是位置引數: ::" -#: ../../library/argparse.rst:1591 +#: ../../library/argparse.rst:1598 msgid "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" @@ -3149,7 +3162,7 @@ msgstr "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" -#: ../../library/argparse.rst:1594 +#: ../../library/argparse.rst:1601 msgid "" "See also :ref:`the argparse howto on ambiguous arguments ` for more details." @@ -3157,11 +3170,11 @@ msgstr "" "更多詳情請參閱 :ref:`argparse howto 中關於有歧義引數的說明 `。" -#: ../../library/argparse.rst:1600 +#: ../../library/argparse.rst:1607 msgid "Argument abbreviations (prefix matching)" msgstr "引數縮寫 (前綴匹配)" -#: ../../library/argparse.rst:1602 +#: ../../library/argparse.rst:1609 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "` allows long options to be abbreviated to a prefix, if the " @@ -3170,7 +3183,7 @@ msgstr "" ":meth:`~ArgumentParser.parse_args` 方法\\ :ref:`預設 `\\ 允許長" "選項被縮寫為前綴,只要縮寫是無歧義的(前綴匹配到唯一的選項): ::" -#: ../../library/argparse.rst:1606 +#: ../../library/argparse.rst:1613 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-bacon')\n" @@ -3194,7 +3207,7 @@ msgstr "" "usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" "PROG: error: ambiguous option: -ba could match -badger, -bacon" -#: ../../library/argparse.rst:1617 +#: ../../library/argparse.rst:1624 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``." @@ -3202,11 +3215,11 @@ msgstr "" "對於可能產生多個選項的引數會產生錯誤。可以透過將 :ref:`allow_abbrev` 設為 " "``False`` 來停用此功能。" -#: ../../library/argparse.rst:1623 +#: ../../library/argparse.rst:1630 msgid "Beyond ``sys.argv``" msgstr "``sys.argv`` 之外" -#: ../../library/argparse.rst:1625 +#: ../../library/argparse.rst:1632 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 " @@ -3217,7 +3230,7 @@ msgstr "" "這可以透過將字串串列傳給 :meth:`~ArgumentParser.parse_args` 來完成。這對於在" "互動式提示中測試很有用: ::" -#: ../../library/argparse.rst:1630 +#: ../../library/argparse.rst:1637 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\n" @@ -3243,11 +3256,11 @@ msgstr "" ">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" "Namespace(accumulate=, integers=[1, 2, 3, 4])" -#: ../../library/argparse.rst:1645 +#: ../../library/argparse.rst:1652 msgid "The Namespace object" msgstr "命名空間物件" -#: ../../library/argparse.rst:1649 +#: ../../library/argparse.rst:1656 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." @@ -3255,7 +3268,7 @@ msgstr "" ":meth:`~ArgumentParser.parse_args` 預設使用的簡單類別,用來建立保存屬性的物件" "並回傳它。" -#: ../../library/argparse.rst:1652 +#: ../../library/argparse.rst:1659 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 " @@ -3264,7 +3277,7 @@ msgstr "" "這個類別刻意保持簡單,只是一個具有可讀字串表示的 :class:`object` 子類別。如果" "你偏好以類字典的方式檢視屬性,可以使用標準 Python 慣用寫法 :func:`vars`: ::" -#: ../../library/argparse.rst:1656 +#: ../../library/argparse.rst:1663 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3278,7 +3291,7 @@ msgstr "" ">>> vars(args)\n" "{'foo': 'BAR'}" -#: ../../library/argparse.rst:1662 +#: ../../library/argparse.rst:1669 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. " @@ -3288,7 +3301,7 @@ msgstr "" "`Namespace` 物件也可能很有用。這可以透過指定 ``namespace=`` 關鍵字引數來達" "成: ::" -#: ../../library/argparse.rst:1666 +#: ../../library/argparse.rst:1673 msgid "" ">>> class C:\n" "... pass\n" @@ -3310,15 +3323,15 @@ msgstr "" ">>> c.foo\n" "'BAR'" -#: ../../library/argparse.rst:1678 +#: ../../library/argparse.rst:1685 msgid "Other utilities" msgstr "其他工具" -#: ../../library/argparse.rst:1681 +#: ../../library/argparse.rst:1688 msgid "Subcommands" msgstr "子命令" -#: ../../library/argparse.rst:1688 +#: ../../library/argparse.rst:1695 msgid "" "Many programs split up their functionality into a number of subcommands, for " "example, the ``svn`` program can invoke subcommands like ``svn checkout``, " @@ -3341,11 +3354,11 @@ msgstr "" "class:`!ArgumentParser` 建構函式引數,並回傳一個可以像往常一樣修改的 :class:" "`!ArgumentParser` 物件。" -#: ../../library/argparse.rst:1700 +#: ../../library/argparse.rst:1707 msgid "Description of parameters:" msgstr "參數的解釋:" -#: ../../library/argparse.rst:1702 +#: ../../library/argparse.rst:1709 msgid "" "*title* - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " @@ -3354,13 +3367,13 @@ msgstr "" "*title* - 說明輸出中子剖析器群組的標題;預設情況下,若有提供 description 則" "為 \"subcommands\",否則使用位置引數的標題" -#: ../../library/argparse.rst:1706 +#: ../../library/argparse.rst:1713 msgid "" "*description* - description for the sub-parser group in help output, by " "default ``None``" msgstr "*description* - 說明輸出中子剖析器群組的描述,預設為 ``None``" -#: ../../library/argparse.rst:1709 +#: ../../library/argparse.rst:1716 msgid "" "*prog* - usage information that will be displayed with subcommand help, by " "default the name of the program and any positional arguments before the " @@ -3369,7 +3382,7 @@ msgstr "" "*prog* - 將與子命令說明一起顯示的用法資訊,預設為程式名稱和子剖析器引數之前的" "任何位置引數" -#: ../../library/argparse.rst:1713 +#: ../../library/argparse.rst:1720 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`)" @@ -3377,29 +3390,29 @@ msgstr "" "*parser_class* - 將用來建立子剖析器實例的類別,預設為目前剖析器的類別(例如 :" "class:`ArgumentParser`)" -#: ../../library/argparse.rst:1716 +#: ../../library/argparse.rst:1723 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "action_ - 在命令列遇到此引數時要執行的基本 action 類型" -#: ../../library/argparse.rst:1719 +#: ../../library/argparse.rst:1726 msgid "" "dest_ - name of the attribute under which subcommand name will be stored; by " "default ``None`` and no value is stored" msgstr "dest_ - 用於儲存子命令名稱的屬性名稱;預設為 ``None`` 且不儲存任何值" -#: ../../library/argparse.rst:1722 +#: ../../library/argparse.rst:1729 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" msgstr "required_ - 是否必須提供子命令,預設為 ``False``\\ (在 3.7 中新增)" -#: ../../library/argparse.rst:1725 +#: ../../library/argparse.rst:1732 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "help_ - 說明輸出中子剖析器群組的說明,預設為 ``None``" -#: ../../library/argparse.rst:1727 +#: ../../library/argparse.rst:1734 msgid "" "metavar_ - string presenting available subcommands in help; by default it is " "``None`` and presents subcommands in form {cmd1, cmd2, ..}" @@ -3407,11 +3420,11 @@ msgstr "" "metavar_ - 在說明中呈現可用子命令的字串;預設為 ``None`` 並以 {cmd1, " "cmd2, ..} 的形式呈現子命令" -#: ../../library/argparse.rst:1730 +#: ../../library/argparse.rst:1737 msgid "Some example usage::" msgstr "一些使用範例: ::" -#: ../../library/argparse.rst:1732 +#: ../../library/argparse.rst:1739 msgid "" ">>> # create the top-level parser\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -3453,7 +3466,7 @@ msgstr "" ">>> parser.parse_args(['--foo', 'b', '--baz', 'Z'])\n" "Namespace(baz='Z', foo=True)" -#: ../../library/argparse.rst:1751 +#: ../../library/argparse.rst:1758 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 " @@ -3467,7 +3480,15 @@ msgstr "" "``foo`` 和 ``bar`` 屬性存在;當指定 ``b`` 命令時,只有 ``foo`` 和 ``baz`` 屬" "性存在。" -#: ../../library/argparse.rst:1758 +#: ../../library/argparse.rst:1765 +msgid "" +"If a subparser defines an argument with the same ``dest`` as the parent " +"parser, the two share a single namespace attribute, so the parent's value " +"won't be retained. Users should give them distinct ``dest`` values to keep " +"both." +msgstr "" + +#: ../../library/argparse.rst:1770 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 " @@ -3479,7 +3500,7 @@ msgstr "" "包含父剖析器或兄弟剖析器的訊息。(然而每個子剖析器命令的說明訊息可以透過如上" "所述向 :meth:`~_SubParsersAction.add_parser` 提供 ``help=`` 引數來給定。)" -#: ../../library/argparse.rst:1766 +#: ../../library/argparse.rst:1778 msgid "" ">>> parser.parse_args(['--help'])\n" "usage: PROG [-h] [--foo] {a,b} ...\n" @@ -3537,7 +3558,7 @@ msgstr "" " -h, --help show this help message and exit\n" " --baz {X,Y,Z} baz help" -#: ../../library/argparse.rst:1794 +#: ../../library/argparse.rst:1806 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " @@ -3546,7 +3567,7 @@ msgstr "" ":meth:`add_subparsers` 方法也支援 ``title`` 和 ``description`` 關鍵字引數。當" "任一者存在時,子剖析器的命令會在說明輸出中以自己的群組出現。例如: ::" -#: ../../library/argparse.rst:1798 +#: ../../library/argparse.rst:1810 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(title='subcommands',\n" @@ -3582,7 +3603,7 @@ msgstr "" "\n" " {foo,bar} additional help" -#: ../../library/argparse.rst:1815 +#: ../../library/argparse.rst:1827 msgid "" "Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional " "*aliases* argument, which allows multiple strings to refer to the same " @@ -3593,7 +3614,7 @@ msgstr "" "允許多個字串參照同一個子剖析器。這個範例像 ``svn`` 一樣,將 ``co`` 作為 " "``checkout`` 的簡寫別名: ::" -#: ../../library/argparse.rst:1820 +#: ../../library/argparse.rst:1832 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers()\n" @@ -3609,7 +3630,7 @@ msgstr "" ">>> parser.parse_args(['co', 'bar'])\n" "Namespace(foo='bar')" -#: ../../library/argparse.rst:1827 +#: ../../library/argparse.rst:1839 msgid "" ":meth:`~_SubParsersAction.add_parser` supports also an additional " "*deprecated* argument, which allows to deprecate the subparser." @@ -3617,7 +3638,7 @@ msgstr "" ":meth:`~_SubParsersAction.add_parser` 也支援一個額外的 *deprecated* 引數,它" "允許棄用子剖析器。" -#: ../../library/argparse.rst:1841 +#: ../../library/argparse.rst:1853 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 " @@ -3628,7 +3649,7 @@ msgstr "" "`set_defaults` 的呼叫結合,使每個子剖析器知道它應該執行哪個 Python 函式。例" "如: ::" -#: ../../library/argparse.rst:1846 +#: ../../library/argparse.rst:1858 msgid "" ">>> # subcommand functions\n" ">>> def foo(args):\n" @@ -3694,7 +3715,7 @@ msgstr "" ">>> args.func(args)\n" "((XYZYX))" -#: ../../library/argparse.rst:1878 +#: ../../library/argparse.rst:1890 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -3708,7 +3729,7 @@ msgstr "" "檢查被呼叫的子剖析器名稱,:meth:`add_subparsers` 呼叫的 ``dest`` 關鍵字引數可" "以達成此目的: ::" -#: ../../library/argparse.rst:1885 +#: ../../library/argparse.rst:1897 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" @@ -3728,21 +3749,21 @@ msgstr "" ">>> parser.parse_args(['2', 'frobble'])\n" "Namespace(subparser_name='2', y='frobble')" -#: ../../library/argparse.rst:1894 +#: ../../library/argparse.rst:1906 msgid "New *required* keyword-only parameter." msgstr "新增 *required* 僅限關鍵字參數。" -#: ../../library/argparse.rst:1897 +#: ../../library/argparse.rst:1909 msgid "" "Subparser's *prog* is no longer affected by a custom usage message in the " "main parser." msgstr "子剖析器的 *prog* 不再受主剖析器中自訂用法訊息的影響。" -#: ../../library/argparse.rst:1903 +#: ../../library/argparse.rst:1915 msgid "FileType objects" msgstr "FileType 物件" -#: ../../library/argparse.rst:1907 +#: ../../library/argparse.rst:1919 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " "argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" @@ -3755,7 +3776,7 @@ msgstr "" "衝區大小、編碼和錯誤處理開啟命令列引數作為檔案(更多詳情請參閱 :func:`open` " "函式): ::" -#: ../../library/argparse.rst:1913 +#: ../../library/argparse.rst:1925 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" @@ -3773,7 +3794,7 @@ msgstr "" "Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " "raw=<_io.FileIO name='raw.dat' mode='wb'>)" -#: ../../library/argparse.rst:1919 +#: ../../library/argparse.rst:1931 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " "convert this into :data:`sys.stdin` for readable :class:`FileType` objects " @@ -3783,7 +3804,7 @@ msgstr "" "件的 :data:`sys.stdin` 和可寫 :class:`FileType` 物件的 :data:`sys." "stdout`: ::" -#: ../../library/argparse.rst:1923 +#: ../../library/argparse.rst:1935 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" @@ -3795,7 +3816,7 @@ msgstr "" ">>> parser.parse_args(['-'])\n" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1930 +#: ../../library/argparse.rst:1942 msgid "" "If one argument uses *FileType* and then a subsequent argument fails, an " "error is reported but the file is not automatically closed. This can also " @@ -3807,15 +3828,15 @@ msgstr "" "自動關閉。這也可能覆蓋輸出檔案。在這種情況下,最好等到剖析器執行完畢後,再使" "用 :keyword:`with` 陳述式來管理檔案。" -#: ../../library/argparse.rst:1936 +#: ../../library/argparse.rst:1948 msgid "Added the *encoding* and *errors* parameters." msgstr "新增了 *encoding* 和 *errors* 參數。" -#: ../../library/argparse.rst:1943 +#: ../../library/argparse.rst:1955 msgid "Argument groups" msgstr "引數群組" -#: ../../library/argparse.rst:1948 +#: ../../library/argparse.rst:1960 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " @@ -3827,7 +3848,7 @@ msgstr "" "引數」和「選項」兩組。當引數有比此預設分組更好的概念性分組時,可以使用 :meth:" "`!add_argument_group` 方法建立適當的群組: ::" -#: ../../library/argparse.rst:1954 +#: ../../library/argparse.rst:1966 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group = parser.add_argument_group('group')\n" @@ -3851,7 +3872,7 @@ msgstr "" " bar bar help\n" " --foo FOO foo help" -#: ../../library/argparse.rst:1965 +#: ../../library/argparse.rst:1977 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" @@ -3867,7 +3888,7 @@ msgstr "" "引數。:meth:`!add_argument_group` 方法接受 *title* 和 *description* 引數,可" "以用來自訂此顯示: ::" -#: ../../library/argparse.rst:1973 +#: ../../library/argparse.rst:1985 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" @@ -3905,7 +3926,7 @@ msgstr "" "\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1991 +#: ../../library/argparse.rst:2003 msgid "" "The optional, keyword-only parameters argument_default_ and " "conflict_handler_ allow for finer-grained control of the behavior of the " @@ -3917,7 +3938,7 @@ msgstr "" "的行為進行更精細的控制。這些參數的意義與 :class:`ArgumentParser` 建構函式中的" "相同,但專門適用於引數群組而非整個剖析器。" -#: ../../library/argparse.rst:1996 +#: ../../library/argparse.rst:2008 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." @@ -3925,13 +3946,13 @@ msgstr "" "請注意,任何不在使用者定義群組中的引數會歸入一般的「位置引數」和「可選引數」" "區段。" -#: ../../library/argparse.rst:1999 +#: ../../library/argparse.rst:2011 msgid "" "Within each argument group, arguments are displayed in help output in the " "order in which they are added." msgstr "" -#: ../../library/argparse.rst:2002 +#: ../../library/argparse.rst:2014 msgid "" "Calling :meth:`add_argument_group` on an argument group now raises an " "exception. This nesting was never supported, often failed to work correctly, " @@ -3940,15 +3961,15 @@ msgstr "" "在引數群組上呼叫 :meth:`add_argument_group` 現在會引發例外。這種巢狀用法從未" "被支援,通常無法正確運作,是因為繼承而無意間被公開出來的。" -#: ../../library/argparse.rst:2007 +#: ../../library/argparse.rst:2019 msgid "Passing prefix_chars_ to :meth:`add_argument_group` is now deprecated." msgstr "將 prefix_chars_ 傳給 :meth:`add_argument_group` 的用法現在已棄用。" -#: ../../library/argparse.rst:2013 +#: ../../library/argparse.rst:2025 msgid "Mutual exclusion" msgstr "互斥" -#: ../../library/argparse.rst:2017 +#: ../../library/argparse.rst:2029 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 " @@ -3957,7 +3978,7 @@ msgstr "" "建立一個互斥群組。:mod:`!argparse` 會確保互斥群組中只有一個引數出現在命令列" "上: ::" -#: ../../library/argparse.rst:2021 +#: ../../library/argparse.rst:2033 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group()\n" @@ -3983,7 +4004,7 @@ msgstr "" "usage: PROG [-h] [--foo | --bar]\n" "PROG: error: argument --bar: not allowed with argument --foo" -#: ../../library/argparse.rst:2033 +#: ../../library/argparse.rst:2045 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " @@ -3992,7 +4013,7 @@ msgstr "" ":meth:`add_mutually_exclusive_group` 方法也接受一個 *required* 引數,用來指示" "至少需要一個互斥引數: ::" -#: ../../library/argparse.rst:2037 +#: ../../library/argparse.rst:2049 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group(required=True)\n" @@ -4010,7 +4031,7 @@ msgstr "" "usage: PROG [-h] (--foo | --bar)\n" "PROG: error: one of the arguments --foo --bar is required" -#: ../../library/argparse.rst:2045 +#: ../../library/argparse.rst:2057 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." @@ -4021,7 +4042,7 @@ msgstr "" "*title* 和 *description* 引數。然而互斥群組可以加入到具有標題和描述的引數群組" "中。例如: ::" -#: ../../library/argparse.rst:2051 +#: ../../library/argparse.rst:2063 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_argument_group('Group title', 'Group description')\n" @@ -4057,7 +4078,7 @@ msgstr "" " --foo FOO foo help\n" " --bar BAR bar help" -#: ../../library/argparse.rst:2068 +#: ../../library/argparse.rst:2080 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group now raises an exception. This nesting was " @@ -4068,11 +4089,11 @@ msgstr "" "`add_mutually_exclusive_group` 現在會引發例外。這種巢狀用法從未支援,通常無法" "正確運作,且是因為繼承而無意間被公開出來的。" -#: ../../library/argparse.rst:2076 +#: ../../library/argparse.rst:2088 msgid "Parser defaults" msgstr "剖析器預設值" -#: ../../library/argparse.rst:2080 +#: ../../library/argparse.rst:2092 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -4084,7 +4105,7 @@ msgstr "" "數 action 來決定。:meth:`set_defaults` 允許加入一些無需檢查命令列即可決定的額" "外屬性: ::" -#: ../../library/argparse.rst:2086 +#: ../../library/argparse.rst:2098 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', type=int)\n" @@ -4098,7 +4119,7 @@ msgstr "" ">>> parser.parse_args(['736'])\n" "Namespace(bar=42, baz='badger', foo=736)" -#: ../../library/argparse.rst:2092 +#: ../../library/argparse.rst:2104 msgid "" "Note that defaults can be set at both the parser level using :meth:" "`set_defaults` and at the argument level using :meth:`add_argument`. If both " @@ -4109,7 +4130,7 @@ msgstr "" "級使用 :meth:`add_argument` 設定。如果兩者都為同一個引數呼叫,會使用最後設定" "的預設值: ::" -#: ../../library/argparse.rst:2096 +#: ../../library/argparse.rst:2108 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='bar')\n" @@ -4123,7 +4144,7 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo='spam')" -#: ../../library/argparse.rst:2102 +#: ../../library/argparse.rst:2114 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " @@ -4132,7 +4153,7 @@ msgstr "" "在使用多個剖析器時,剖析器層級的預設值可能特別有用。請參閱 :meth:" "`~ArgumentParser.add_subparsers` 方法以了解這類範例。" -#: ../../library/argparse.rst:2108 +#: ../../library/argparse.rst:2120 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" @@ -4140,7 +4161,7 @@ msgstr "" "取得命名空間屬性的預設值,由 :meth:`~ArgumentParser.add_argument` 或 :meth:" "`~ArgumentParser.set_defaults` 設定: ::" -#: ../../library/argparse.rst:2112 +#: ../../library/argparse.rst:2124 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='badger')\n" @@ -4152,11 +4173,11 @@ msgstr "" ">>> parser.get_default('foo')\n" "'badger'" -#: ../../library/argparse.rst:2119 +#: ../../library/argparse.rst:2131 msgid "Printing help" msgstr "印出幫助訊息" -#: ../../library/argparse.rst:2121 +#: ../../library/argparse.rst:2133 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " @@ -4165,7 +4186,7 @@ msgstr "" "在大多數典型的應用程式中,:meth:`~ArgumentParser.parse_args` 會處理格式化和印" "出任何用法或錯誤訊息。然而,有幾個格式化方法可以使用:" -#: ../../library/argparse.rst:2127 +#: ../../library/argparse.rst:2139 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 " @@ -4174,7 +4195,7 @@ msgstr "" "印出 :class:`ArgumentParser` 在命令列上呼叫方式的簡短描述。如果 *file* 為 " "``None``,則假設為 :data:`sys.stdout`。" -#: ../../library/argparse.rst:2133 +#: ../../library/argparse.rst:2145 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " @@ -4183,20 +4204,20 @@ msgstr "" "印出說明訊息,包括程式用法和在 :class:`ArgumentParser` 中註冊的引數相關資訊。" "如果 *file* 為 ``None``,假設為 :data:`sys.stdout`。" -#: ../../library/argparse.rst:2137 +#: ../../library/argparse.rst:2149 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "這些方法也有變體,它們只回傳字串而非印出它:" -#: ../../library/argparse.rst:2142 +#: ../../library/argparse.rst:2154 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." msgstr "" "回傳一個字串,包含 :class:`ArgumentParser` 在命令列上的呼叫方式的簡短描述。" -#: ../../library/argparse.rst:2147 +#: ../../library/argparse.rst:2159 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." @@ -4204,11 +4225,11 @@ msgstr "" "回傳一個字串,包含說明訊息,包括程式用法和在 :class:`ArgumentParser` 中註冊的" "引數相關資訊。" -#: ../../library/argparse.rst:2152 +#: ../../library/argparse.rst:2164 msgid "Partial parsing" msgstr "部分剖析" -#: ../../library/argparse.rst:2156 +#: ../../library/argparse.rst:2168 msgid "" "Sometimes a script only needs to handle a specific set of command-line " "arguments, leaving any unrecognized arguments for another script or program. " @@ -4219,7 +4240,7 @@ msgstr "" "本或程式。在這些情況下,:meth:`~ArgumentParser.parse_known_args` 方法可能很有" "用。" -#: ../../library/argparse.rst:2161 +#: ../../library/argparse.rst:2173 msgid "" "This method works similarly to :meth:`~ArgumentParser.parse_args`, but it " "does not raise an error for extra, unrecognized arguments. Instead, it " @@ -4230,7 +4251,7 @@ msgstr "" "辨識的引數引發錯誤,而是會只剖析已知的引數並回傳一個包含填充後的命名空間和任" "何未辨識引數串列的二元素元組。" -#: ../../library/argparse.rst:2168 +#: ../../library/argparse.rst:2180 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -4244,7 +4265,7 @@ msgstr "" ">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" -#: ../../library/argparse.rst:2175 +#: ../../library/argparse.rst:2187 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" "`~ArgumentParser.parse_known_args`. The parser may consume an option even if " @@ -4255,11 +4276,11 @@ msgstr "" "parse_known_args`。即使選項只是其已知選項之一的前綴,剖析器也可能消耗它,而非" "將其留在剩餘引數串列中。" -#: ../../library/argparse.rst:2182 +#: ../../library/argparse.rst:2194 msgid "Customizing file parsing" msgstr "自訂檔案剖析" -#: ../../library/argparse.rst:2186 +#: ../../library/argparse.rst:2198 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -4270,7 +4291,7 @@ msgstr "" "*fromfile_prefix_chars* 關鍵字引數)每行讀取一個引數。可以覆寫 :meth:" "`convert_arg_line_to_args` 以進行更精細的讀取。" -#: ../../library/argparse.rst:2191 +#: ../../library/argparse.rst:2203 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. " @@ -4279,7 +4300,7 @@ msgstr "" "此方法接受單個引數 *arg_line*,它是從引數檔案讀取的字串。它回傳從此字串剖析出" "的引數串列。此方法對從引數檔案讀取的每一行依序呼叫一次。" -#: ../../library/argparse.rst:2195 +#: ../../library/argparse.rst:2207 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::" @@ -4287,7 +4308,7 @@ msgstr "" "此方法的一個有用覆寫是將每個以空格分隔的詞作為引數。以下範例示範了如何做到這" "一點: ::" -#: ../../library/argparse.rst:2198 +#: ../../library/argparse.rst:2210 msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" @@ -4297,11 +4318,17 @@ msgstr "" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" -#: ../../library/argparse.rst:2204 +#: ../../library/argparse.rst:2214 +msgid "" +"Note that with this override an argument can no longer contain spaces, since " +"each space-separated word becomes a separate argument." +msgstr "" + +#: ../../library/argparse.rst:2219 msgid "Exiting methods" msgstr "退出方法" -#: ../../library/argparse.rst:2208 +#: ../../library/argparse.rst:2223 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 " @@ -4311,7 +4338,7 @@ msgstr "" "`sys.stderr` 印出一個 *message*。使用者可以覆寫此方法來以不同方式處理這些步" "驟: ::" -#: ../../library/argparse.rst:2212 +#: ../../library/argparse.rst:2227 msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" " def exit(self, status=0, message=None):\n" @@ -4325,7 +4352,7 @@ msgstr "" " raise Exception(f'Exiting because of an error: {message}')\n" " exit(status)" -#: ../../library/argparse.rst:2220 +#: ../../library/argparse.rst:2235 msgid "" "This method prints a usage message, including the *message*, to :data:`sys." "stderr` and terminates the program with a status code of 2." @@ -4333,11 +4360,11 @@ msgstr "" "此方法將用法訊息(包含 *message*)印出到 :data:`sys.stderr`,並以狀態碼 2 終" "止程式。" -#: ../../library/argparse.rst:2225 +#: ../../library/argparse.rst:2240 msgid "Intermixed parsing" msgstr "交錯剖析" -#: ../../library/argparse.rst:2230 +#: ../../library/argparse.rst:2245 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -4348,7 +4375,7 @@ msgstr "" "parse_intermixed_args` 和 :meth:`~ArgumentParser." "parse_known_intermixed_args` 方法支援此剖析風格。" -#: ../../library/argparse.rst:2235 +#: ../../library/argparse.rst:2250 msgid "" "These parsers do not support all the :mod:`!argparse` features, and will " "raise exceptions if unsupported features are used. In particular, " @@ -4358,7 +4385,7 @@ msgstr "" "這些剖析器不支援所有 :mod:`!argparse` 功能,如果使用了不支援的功能會引發例" "外。特別是不支援子剖析器,以及同時包含可選引數和位置引數的互斥群組。" -#: ../../library/argparse.rst:2240 +#: ../../library/argparse.rst:2255 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -4369,7 +4396,7 @@ msgstr "" "`~ArgumentParser.parse_intermixed_args` 之間的差異:前者回傳 ``['2', '3']`` " "作為未剖析的引數,而後者將所有位置引數收集到 ``rest`` 中。 ::" -#: ../../library/argparse.rst:2246 +#: ../../library/argparse.rst:2261 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -4389,7 +4416,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:2255 +#: ../../library/argparse.rst:2270 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -4400,11 +4427,11 @@ msgstr "" "填充後的命名空間和剩餘引數字串的串列。:meth:`~ArgumentParser." "parse_intermixed_args` 在有任何剩餘未剖析的引數字串時會引發錯誤。" -#: ../../library/argparse.rst:2264 +#: ../../library/argparse.rst:2279 msgid "Registering custom types or actions" msgstr "註冊自訂型別或 action" -#: ../../library/argparse.rst:2268 +#: ../../library/argparse.rst:2283 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 " @@ -4415,7 +4442,7 @@ msgstr "" "用 :meth:`!register` 向剖析器註冊自訂 action 或型別,讓你可以透過註冊名稱而非" "可呼叫物件名稱來參照型別。" -#: ../../library/argparse.rst:2273 +#: ../../library/argparse.rst:2288 msgid "" "The :meth:`!register` method accepts three arguments - a *registry_name*, " "specifying the internal registry where the object will be stored (e.g., " @@ -4426,12 +4453,12 @@ msgstr "" "錄檔(例如 ``action``、``type``);*value*,用於註冊物件的鍵值;以及 object," "要註冊的可呼叫物件。" -#: ../../library/argparse.rst:2278 +#: ../../library/argparse.rst:2293 msgid "" "The following example shows how to register a custom type with a parser::" msgstr "以下範例展示如何向剖析器註冊自訂型別: ::" -#: ../../library/argparse.rst:2280 +#: ../../library/argparse.rst:2295 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -4459,42 +4486,50 @@ msgstr "" "usage: PROG [-h] [--foo FOO]\n" "PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'" -#: ../../library/argparse.rst:2292 +#: ../../library/argparse.rst:2307 msgid "Exceptions" msgstr "例外" -#: ../../library/argparse.rst:2296 +#: ../../library/argparse.rst:2311 msgid "An error from creating or using an argument (optional or positional)." msgstr "建立或使用引數(可選或位置引數)時的錯誤。" -#: ../../library/argparse.rst:2298 +#: ../../library/argparse.rst:2313 msgid "" "The string value of this exception is the message, augmented with " "information about the argument that caused it." msgstr "此例外的字串值是訊息,附帶了導致錯誤的引數的相關資訊。" -#: ../../library/argparse.rst:2303 +#: ../../library/argparse.rst:2318 msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "當將命令列字串轉換為型別時出錯時引發。" -#: ../../library/argparse.rst:2307 +#: ../../library/argparse.rst:2322 msgid "Guides and Tutorials" msgstr "指南與教學" -#: ../../library/argparse.rst:908 +#: ../../library/argparse.rst:907 msgid "? (question mark)" msgstr "? (問號)" -#: ../../library/argparse.rst:908 ../../library/argparse.rst:940 -#: ../../library/argparse.rst:954 +#: ../../library/argparse.rst:907 ../../library/argparse.rst:939 +#: ../../library/argparse.rst:953 msgid "in argparse module" msgstr "於 argparse 模組中" -#: ../../library/argparse.rst:940 +#: ../../library/argparse.rst:939 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../library/argparse.rst:954 +#: ../../library/argparse.rst:953 msgid "+ (plus)" msgstr "+ (加號)" + +#~ msgid "" +#~ "Empty lines are treated as empty strings (``''``), which are allowed as " +#~ "values but not as arguments. Empty lines that are read as arguments will " +#~ "result in an \"unrecognized arguments\" error." +#~ msgstr "" +#~ "空行會被視為空字串 (``''``),可以作為值但不能作為引數。若空行被讀取為引" +#~ "數,會導致 \"unrecognized arguments\" 錯誤。" diff --git a/library/asyncio-threading.po b/library/asyncio-threading.po new file mode 100644 index 0000000000..f1b502620f --- /dev/null +++ b/library/asyncio-threading.po @@ -0,0 +1,208 @@ +# Copyright (C) 2001 Python Software Foundation +# This file is distributed under the same license as the Python package. +# +msgid "" +msgstr "" +"Project-Id-Version: Python 3.14\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2026-06-11 00:43+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/asyncio-threading.rst:6 +msgid "asyncio and free-threaded Python" +msgstr "" + +#: ../../library/asyncio-threading.rst:8 +msgid "" +"asyncio uses an event loop as a scheduler to enable highly efficient " +"concurrency by switching between tasks to allow non-blocking I/O operations. " +"This results in better performance for I/O-bound use cases. It also allows " +"off-loading CPU-bound work to a thread or process pool, but that is still " +"limited by the :term:`global interpreter lock` in CPython." +msgstr "" + +#: ../../library/asyncio-threading.rst:15 +msgid "" +"However, in :ref:`free-threaded Python `, the " +"GIL is disabled and Python can run true multi-threaded code. This means that " +"asyncio can now take advantage of multiple CPU cores without the limitations " +"imposed by the GIL." +msgstr "" + +#: ../../library/asyncio-threading.rst:20 +msgid "" +"Since Python 3.14, asyncio has first-class support for free-threaded Python, " +"and the implementation of asyncio is safe to use in a multi-threaded " +"environment." +msgstr "" + +#: ../../library/asyncio-threading.rst:24 +msgid "" +"A single event loop on one core can handle many connections concurrently, " +"but the Python code that runs to handle each one still executes serially. " +"Once requests involve a non-trivial amount of per-request computation, that " +"handling becomes the bottleneck, and a single core can no longer keep up. " +"Combining asyncio with threads is most useful here: by running an event loop " +"per thread, the handling of different requests can run in parallel across " +"multiple CPU cores. It is also useful when you need to run blocking or CPU-" +"bound code from an asyncio application." +msgstr "" + +#: ../../library/asyncio-threading.rst:37 +msgid "" +"`Scaling asyncio on Free-Threaded Python `__, a blog post by Kumar Aditya " +"which explains the internal changes that make asyncio safe and efficient " +"under free-threaded Python, together with benchmarks of the resulting " +"improvements." +msgstr "" + +#: ../../library/asyncio-threading.rst:45 +msgid "Thread safety considerations" +msgstr "" + +#: ../../library/asyncio-threading.rst:47 +msgid "" +"While asyncio is designed to be thread-safe in a free-threaded Python " +"environment, there are still some considerations to keep in mind when using " +"asyncio with threads:" +msgstr "" + +#: ../../library/asyncio-threading.rst:51 +msgid "" +"**Event loop**: Each thread should have its own event loop which should not " +"be shared across threads. This ensures that the event loop can manage its " +"own tasks and callbacks without interference from other threads." +msgstr "" + +#: ../../library/asyncio-threading.rst:56 +msgid "" +"**Task management**: Tasks and futures created in one thread should not be " +"awaited or manipulated from another thread." +msgstr "" + +#: ../../library/asyncio-threading.rst:59 +msgid "" +"**Thread-safe APIs**: When interacting with asyncio from multiple threads, " +"it's important to use thread-safe APIs provided by asyncio, such as :func:" +"`asyncio.run_coroutine_threadsafe` for submitting coroutines to an event " +"loop from another thread. If you need to call a callback from a different " +"thread, you can use :meth:`loop.call_soon_threadsafe` to schedule it safely." +msgstr "" + +#: ../../library/asyncio-threading.rst:66 +msgid "" +"**Synchronization**: The synchronization primitives provided by asyncio " +"(like :class:`asyncio.Lock` and :class:`asyncio.Event`) are not designed to " +"be used across threads. If you need to synchronize between threads, you " +"should use the synchronization primitives from the :mod:`threading` module " +"instead." +msgstr "" + +#: ../../library/asyncio-threading.rst:74 +msgid "Using asyncio with threads" +msgstr "" + +#: ../../library/asyncio-threading.rst:76 +msgid "" +"asyncio supports running one event loop per thread, which allows you to take " +"advantage of multiple CPU cores in a free-threaded Python environment. Each " +"thread can run its own event loop, and tasks can be scheduled on those loops " +"independently." +msgstr "" + +#: ../../library/asyncio-threading.rst:81 +msgid "Here's an example of how to use asyncio with threads::" +msgstr "" + +#: ../../library/asyncio-threading.rst:83 +msgid "" +"import asyncio\n" +"import threading\n" +"\n" +"async def worker(name: str) -> None:\n" +" print(f\"Worker {name} starting\")\n" +" await asyncio.sleep(1)\n" +" print(f\"Worker {name} done\")\n" +"\n" +"def run_loop(name: str) -> None:\n" +" asyncio.run(worker(name))\n" +"\n" +"threads = [\n" +" threading.Thread(target=run_loop, args=(f\"T{i}\",))\n" +" for i in range(4)\n" +"]\n" +"for t in threads:\n" +" t.start()\n" +"for t in threads:\n" +" t.join()" +msgstr "" + +#: ../../library/asyncio-threading.rst:103 +msgid "" +"In this example, each thread creates its own event loop with :func:`asyncio." +"run` and runs a coroutine on it. The threads execute concurrently, and in a " +"free-threaded build they can run on separate CPU cores in parallel." +msgstr "" + +#: ../../library/asyncio-threading.rst:110 +msgid "Producer/consumer across threads" +msgstr "" + +#: ../../library/asyncio-threading.rst:112 +msgid "" +"When a regular (non-asyncio) thread needs to hand work to an asyncio event " +"loop running in another thread, use a thread-safe primitive such as :class:" +"`queue.Queue` rather than :class:`asyncio.Queue`, which is only safe within " +"a single event loop.::" +msgstr "" + +#: ../../library/asyncio-threading.rst:117 +msgid "" +"import asyncio\n" +"import queue\n" +"import threading\n" +"\n" +"def producer(q: queue.Queue[int]) -> None:\n" +" for i in range(5):\n" +" print(f\"Producing {i}\")\n" +" q.put(i)\n" +" q.shutdown()\n" +"\n" +"async def consumer(q: queue.Queue[int]) -> None:\n" +" while True:\n" +" try:\n" +" item = q.get_nowait()\n" +" except queue.Empty:\n" +" await asyncio.sleep(0.1)\n" +" continue\n" +" except queue.ShutDown:\n" +" break\n" +" print(f\"Consumed {item}\")\n" +" await asyncio.sleep(item)\n" +"\n" +"q: queue.Queue[int] = queue.Queue()\n" +"consumer_thread = threading.Thread(\n" +" target=lambda: asyncio.run(consumer(q))\n" +")\n" +"consumer_thread.start()\n" +"producer(q)\n" +"consumer_thread.join()" +msgstr "" + +#: ../../library/asyncio-threading.rst:147 +msgid "" +"The producer runs on the main thread while the consumer runs inside an event " +"loop on its own thread, yet they communicate safely through ``queue.Queue``. " +"When the queue is empty the consumer sleeps briefly and tries again. When " +"the producer is done it calls :meth:`~queue.Queue.shutdown`, which causes " +"subsequent :meth:`~queue.Queue.get_nowait` calls to raise :exc:`queue." +"ShutDown` so the consumer can exit cleanly." +msgstr "" diff --git a/library/asyncio.po b/library/asyncio.po index 8c267942ad..6d09a7a84d 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-01-22 16:55+0000\n" +"POT-Creation-Date: 2026-06-11 00:43+0000\n" "PO-Revision-Date: 2025-07-06 17:13+0800\n" "Last-Translator: Weilin Du\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -227,6 +227,6 @@ msgstr "" msgid "Reference" msgstr "參閱" -#: ../../library/asyncio.rst:133 +#: ../../library/asyncio.rst:134 msgid "The source code for asyncio can be found in :source:`Lib/asyncio/`." msgstr "asyncio 的原始碼可以在 :source:`Lib/asyncio/` 中找到。" diff --git a/library/bisect.po b/library/bisect.po index ad8b60c227..70665fac29 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-03-01 00:20+0000\n" +"POT-Creation-Date: 2026-06-09 00:37+0000\n" "PO-Revision-Date: 2023-08-01 12:53+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -315,14 +315,14 @@ msgstr "" #: ../../library/bisect.rst:206 msgid "" -">>> def grade(score)\n" +">>> def grade(score):\n" "... i = bisect([60, 70, 80, 90], score)\n" "... return \"FDCBA\"[i]\n" "...\n" ">>> [grade(score) for score in [33, 99, 77, 70, 89, 90, 100]]\n" "['F', 'A', 'C', 'C', 'B', 'A', 'A']" msgstr "" -">>> def grade(score)\n" +">>> def grade(score):\n" "... i = bisect([60, 70, 80, 90], score)\n" "... return \"FDCBA\"[i]\n" "...\n" diff --git a/library/collections.abc.po b/library/collections.abc.po index b999edb5cc..f5d30db6dd 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-08 00:15+0000\n" +"POT-Creation-Date: 2026-06-09 00:37+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -309,8 +309,8 @@ msgid "" "Inherited :class:`Sequence` methods and ``append``, ``clear``, ``reverse``, " "``extend``, ``pop``, ``remove``, and ``__iadd__``" msgstr "" -"繼承 :class:`Sequence` 方法和 ``append``、``clear``、``reverse``、``extend``、" -"``pop``、``remove`` 和 ``__iadd__``" +"繼承 :class:`Sequence` 方法和 ``append``、``clear``、``reverse``、" +"``extend``、``pop``、``remove`` 和 ``__iadd__``" #: ../../library/collections.abc.rst:143 msgid ":class:`ByteString`" @@ -554,15 +554,14 @@ msgid "" "ABC for classes that provide the :meth:`~iterator.__iter__` and :meth:" "`~iterator.__next__` methods. See also the definition of :term:`iterator`." msgstr "" -"有提供 :meth:`~iterator.__iter__` 和 :meth:`~iterator.__next__` 方法之類別的 ABC。" -"另請參閱 :term:`iterator` 的定義。" +"有提供 :meth:`~iterator.__iter__` 和 :meth:`~iterator.__next__` 方法之類別的 " +"ABC。另請參閱 :term:`iterator` 的定義。" #: ../../library/collections.abc.rst:247 msgid "" "ABC for iterable classes that also provide the :meth:`~object.__reversed__` " "method." -msgstr "" -"亦有提供 :meth:`~object.__reversed__` 方法之可疊代類別的 ABC。" +msgstr "亦有提供 :meth:`~object.__reversed__` 方法之可疊代類別的 ABC。" #: ../../library/collections.abc.rst:254 msgid "" @@ -635,10 +634,11 @@ msgid "" "also never understood as subtypes of :class:`!ByteString` (either at runtime " "or by static type checkers)." msgstr "" -":class:`!ByteString` 最初被設計為一個抽象類別,以作為 :class:`bytes` 和 :class:`bytearray` " -"的超型別 (supertype)。然而由於 ABC 從未擁有任何方法,知道一個物件是 :class:`!ByteString` 的" -"實例從未真正告訴你任何關於該物件的有用資訊。其他常見的緩衝區型別如 :class:`memoryview` " -"也從未被理解為 :class:`!ByteString` 的子型別(無論是在 runtime 還是由靜態型別檢查器)。" +":class:`!ByteString` 最初被設計為一個抽象類別,以作為 :class:`bytes` 和 :" +"class:`bytearray` 的超型別 (supertype)。然而由於 ABC 從未擁有任何方法,知道一" +"個物件是 :class:`!ByteString` 的實例從未真正告訴你任何關於該物件的有用資訊。" +"其他常見的緩衝區型別如 :class:`memoryview` 也從未被理解為 :class:`!" +"ByteString` 的子型別(無論是在 runtime 還是由靜態型別檢查器)。" #: ../../library/collections.abc.rst:309 msgid "See :pep:`PEP 688 <688#current-options>` for more details." @@ -819,7 +819,7 @@ msgid "" "The :class:`Set` mixin provides a :meth:`!_hash` method to compute a hash " "value for the set; however, :meth:`~object.__hash__` is not defined because " "not all sets are :term:`hashable` or immutable. To add set hashability " -"using mixins, inherit from both :meth:`Set` and :meth:`Hashable`, then " +"using mixins, inherit from both :class:`Set` and :class:`Hashable`, then " "define ``__hash__ = Set._hash``." msgstr "" diff --git a/library/curses.ascii.po b/library/curses.ascii.po index 904fd61b46..62a5aa98c9 100644 --- a/library/curses.ascii.po +++ b/library/curses.ascii.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-07 00:19+0000\n" +"POT-Creation-Date: 2026-06-19 00:50+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -210,7 +210,7 @@ msgid "Checks for a character value that fits in the 7-bit ASCII set." msgstr "" #: ../../library/curses.ascii.rst:120 -msgid "Checks for an ASCII whitespace character; space or horizontal tab." +msgid "Checks for an ASCII blank character; space or horizontal tab." msgstr "" #: ../../library/curses.ascii.rst:125 @@ -225,7 +225,7 @@ msgid "" msgstr "" #: ../../library/curses.ascii.rst:136 -msgid "Checks for ASCII any printable character except space." +msgid "Checks for any ASCII printable character except space." msgstr "" #: ../../library/curses.ascii.rst:141 @@ -238,7 +238,7 @@ msgstr "" #: ../../library/curses.ascii.rst:151 msgid "" -"Checks for any printable ASCII character which is not a space or an " +"Checks for any ASCII printable character which is not a space or an " "alphanumeric character." msgstr "" @@ -259,56 +259,58 @@ msgid "" msgstr "" #: ../../library/curses.ascii.rst:174 -msgid "Checks for an ASCII control character (ordinal values 0 to 31)." +msgid "" +"Checks for an ASCII control character (ordinal values 0 to 31). Unlike :" +"func:`iscntrl`, this does not include the delete character (0x7f)." msgstr "" -#: ../../library/curses.ascii.rst:179 +#: ../../library/curses.ascii.rst:180 msgid "Checks for a non-ASCII character (ordinal values 0x80 and above)." msgstr "" -#: ../../library/curses.ascii.rst:181 +#: ../../library/curses.ascii.rst:182 msgid "" "These functions accept either integers or single-character strings; when the " "argument is a string, it is first converted using the built-in function :" "func:`ord`." msgstr "" -#: ../../library/curses.ascii.rst:184 +#: ../../library/curses.ascii.rst:185 msgid "" "Note that all these functions check ordinal bit values derived from the " "character of the string you pass in; they do not actually know anything " "about the host machine's character encoding." msgstr "" -#: ../../library/curses.ascii.rst:188 +#: ../../library/curses.ascii.rst:189 msgid "" "The following two functions take either a single-character string or integer " "byte value; they return a value of the same type." msgstr "" -#: ../../library/curses.ascii.rst:194 +#: ../../library/curses.ascii.rst:195 msgid "Return the ASCII value corresponding to the low 7 bits of *c*." msgstr "" -#: ../../library/curses.ascii.rst:199 +#: ../../library/curses.ascii.rst:200 msgid "" "Return the control character corresponding to the given character (the " "character bit value is bitwise-anded with 0x1f)." msgstr "" -#: ../../library/curses.ascii.rst:205 +#: ../../library/curses.ascii.rst:206 msgid "" "Return the 8-bit character corresponding to the given ASCII character (the " "character bit value is bitwise-ored with 0x80)." msgstr "" -#: ../../library/curses.ascii.rst:208 +#: ../../library/curses.ascii.rst:209 msgid "" "The following function takes either a single-character string or integer " "value; it returns a string." msgstr "" -#: ../../library/curses.ascii.rst:218 +#: ../../library/curses.ascii.rst:219 msgid "" "Return a string representation of the ASCII character *c*. If *c* is " "printable, this string is the character itself. If the character is a " @@ -319,21 +321,21 @@ msgid "" "``'!'`` prepended to the result." msgstr "" -#: ../../library/curses.ascii.rst:228 +#: ../../library/curses.ascii.rst:229 msgid "" "A 33-element string array that contains the ASCII mnemonics for the thirty-" "two ASCII control characters from 0 (NUL) to 0x1f (US), in order, plus the " "mnemonic ``SP`` for the space character." msgstr "" -#: ../../library/curses.ascii.rst:212 +#: ../../library/curses.ascii.rst:213 msgid "^ (caret)" msgstr "^ (插入符號)" -#: ../../library/curses.ascii.rst:212 +#: ../../library/curses.ascii.rst:213 msgid "in curses module" msgstr "於 curses 模組中" -#: ../../library/curses.ascii.rst:212 +#: ../../library/curses.ascii.rst:213 msgid "! (exclamation)" msgstr "! (驚嘆號)" diff --git a/library/curses.panel.po b/library/curses.panel.po index abc44d555e..f28a9d6756 100644 --- a/library/curses.panel.po +++ b/library/curses.panel.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-07 00:19+0000\n" +"POT-Creation-Date: 2026-06-19 00:50+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,27 +42,27 @@ msgstr "" #: ../../library/curses.panel.rst:31 msgid "" -"Returns a panel object, associating it with the given window *win*. Be aware " -"that you need to keep the returned panel object referenced explicitly. If " -"you don't, the panel object is garbage collected and removed from the panel " -"stack." +"Returns a panel object, associating it with the given window *win* and " +"placing the new panel on top of the panel stack. Be aware that you need to " +"keep the returned panel object referenced explicitly. If you don't, the " +"panel object is garbage collected and removed from the panel stack." msgstr "" -#: ../../library/curses.panel.rst:38 +#: ../../library/curses.panel.rst:39 msgid "Returns the top panel in the panel stack." msgstr "" -#: ../../library/curses.panel.rst:43 +#: ../../library/curses.panel.rst:44 msgid "" "Updates the virtual screen after changes in the panel stack. This does not " "call :func:`curses.doupdate`, so you'll have to do this yourself." msgstr "" -#: ../../library/curses.panel.rst:50 -msgid "Panel Objects" +#: ../../library/curses.panel.rst:51 +msgid "Panel objects" msgstr "" -#: ../../library/curses.panel.rst:52 +#: ../../library/curses.panel.rst:53 msgid "" "Panel objects, as returned by :func:`new_panel` above, are windows with a " "stacking order. There's always a window associated with a panel which " @@ -70,60 +70,62 @@ msgid "" "window's depth in the panel stack." msgstr "" -#: ../../library/curses.panel.rst:57 +#: ../../library/curses.panel.rst:58 msgid "Panel objects have the following methods:" msgstr "" -#: ../../library/curses.panel.rst:62 +#: ../../library/curses.panel.rst:63 msgid "Returns the panel above the current panel." msgstr "" -#: ../../library/curses.panel.rst:67 +#: ../../library/curses.panel.rst:68 msgid "Returns the panel below the current panel." msgstr "" -#: ../../library/curses.panel.rst:72 +#: ../../library/curses.panel.rst:73 msgid "Push the panel to the bottom of the stack." msgstr "" -#: ../../library/curses.panel.rst:77 +#: ../../library/curses.panel.rst:78 msgid "" "Returns ``True`` if the panel is hidden (not visible), ``False`` otherwise." msgstr "" -#: ../../library/curses.panel.rst:82 +#: ../../library/curses.panel.rst:83 msgid "" "Hide the panel. This does not delete the object, it just makes the window on " "screen invisible." msgstr "" -#: ../../library/curses.panel.rst:88 +#: ../../library/curses.panel.rst:89 msgid "Move the panel to the screen coordinates ``(y, x)``." msgstr "" -#: ../../library/curses.panel.rst:93 +#: ../../library/curses.panel.rst:94 msgid "Change the window associated with the panel to the window *win*." msgstr "" -#: ../../library/curses.panel.rst:98 +#: ../../library/curses.panel.rst:99 msgid "" "Set the panel's user pointer to *obj*. This is used to associate an " "arbitrary piece of data with the panel, and can be any Python object." msgstr "" -#: ../../library/curses.panel.rst:104 -msgid "Display the panel (which might have been hidden)." +#: ../../library/curses.panel.rst:105 +msgid "" +"Display the panel (which might have been hidden), placing it on top of the " +"panel stack." msgstr "" -#: ../../library/curses.panel.rst:109 +#: ../../library/curses.panel.rst:111 msgid "Push panel to the top of the stack." msgstr "" -#: ../../library/curses.panel.rst:114 +#: ../../library/curses.panel.rst:116 msgid "" "Returns the user pointer for the panel. This might be any Python object." msgstr "" -#: ../../library/curses.panel.rst:119 +#: ../../library/curses.panel.rst:121 msgid "Returns the window object associated with the panel." msgstr "" diff --git a/library/curses.po b/library/curses.po index b149013e90..0e16ba7db7 100644 --- a/library/curses.po +++ b/library/curses.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-20 00:18+0000\n" +"POT-Creation-Date: 2026-06-19 00:50+0000\n" "PO-Revision-Date: 2018-05-23 14:42+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -150,7 +150,11 @@ msgstr "" msgid "Change the definition of the color-pair ``0`` to ``(fg, bg)``." msgstr "" -#: ../../library/curses.rst:91 +#: ../../library/curses.rst:86 +msgid "This is an ncurses extension." +msgstr "" + +#: ../../library/curses.rst:93 msgid "" "Return the output speed of the terminal in bits per second. On software " "terminal emulators it will have a fixed high value. Included for historical " @@ -158,17 +162,17 @@ msgid "" "and occasionally to change interfaces depending on the line speed." msgstr "" -#: ../../library/curses.rst:99 +#: ../../library/curses.rst:101 msgid "Emit a short attention sound." msgstr "" -#: ../../library/curses.rst:104 +#: ../../library/curses.rst:106 msgid "" "Return ``True`` or ``False``, depending on whether the programmer can change " "the colors displayed by the terminal." msgstr "" -#: ../../library/curses.rst:110 +#: ../../library/curses.rst:112 msgid "" "Enter cbreak mode. In cbreak mode (sometimes called \"rare\" mode) normal " "tty line buffering is turned off and characters are available to be read one " @@ -178,16 +182,16 @@ msgid "" "terminal in cbreak mode." msgstr "" -#: ../../library/curses.rst:119 +#: ../../library/curses.rst:121 msgid "" "Return the intensity of the red, green, and blue (RGB) components in the " "color *color_number*, which must be between ``0`` and ``COLORS - 1``. " "Return a 3-tuple, containing the R,G,B values for the given color, which " "will be between ``0`` (no component) and ``1000`` (maximum amount of " -"component)." +"component). Raise an exception if the color is not supported." msgstr "" -#: ../../library/curses.rst:127 +#: ../../library/curses.rst:130 msgid "" "Return the attribute value for displaying text in the specified color pair. " "Only the first 256 color pairs are supported. This attribute value can be " @@ -196,7 +200,7 @@ msgid "" "function." msgstr "" -#: ../../library/curses.rst:136 +#: ../../library/curses.rst:139 msgid "" "Set the cursor state. *visibility* can be set to ``0``, ``1``, or ``2``, " "for invisible, normal, or very visible. If the terminal supports the " @@ -205,7 +209,7 @@ msgid "" "and the \"very visible\" mode is a block cursor." msgstr "" -#: ../../library/curses.rst:145 +#: ../../library/curses.rst:148 msgid "" "Save the current terminal mode as the \"program\" mode, the mode when the " "running program is using curses. (Its counterpart is the \"shell\" mode, " @@ -213,7 +217,7 @@ msgid "" "`reset_prog_mode` will restore this mode." msgstr "" -#: ../../library/curses.rst:153 +#: ../../library/curses.rst:156 msgid "" "Save the current terminal mode as the \"shell\" mode, the mode when the " "running program is not using curses. (Its counterpart is the \"program\" " @@ -221,19 +225,19 @@ msgid "" "func:`reset_shell_mode` will restore this mode." msgstr "" -#: ../../library/curses.rst:161 +#: ../../library/curses.rst:164 msgid "Insert an *ms* millisecond pause in output." msgstr "" -#: ../../library/curses.rst:166 +#: ../../library/curses.rst:169 msgid "" "Update the physical screen. The curses library keeps two data structures, " "one representing the current physical screen contents and a virtual screen " -"representing the desired next state. The :func:`doupdate` ground updates " +"representing the desired next state. The :func:`doupdate` function updates " "the physical screen to match the virtual screen." msgstr "" -#: ../../library/curses.rst:171 +#: ../../library/curses.rst:174 msgid "" "The virtual screen may be updated by a :meth:`~window.noutrefresh` call " "after write operations such as :meth:`~window.addstr` have been performed on " @@ -244,48 +248,48 @@ msgid "" "func:`!doupdate`." msgstr "" -#: ../../library/curses.rst:181 +#: ../../library/curses.rst:184 msgid "" "Enter echo mode. In echo mode, each character input is echoed to the screen " "as it is entered." msgstr "" -#: ../../library/curses.rst:187 +#: ../../library/curses.rst:190 msgid "De-initialize the library, and return terminal to normal status." msgstr "" -#: ../../library/curses.rst:192 +#: ../../library/curses.rst:195 msgid "" "Return the user's current erase character as a one-byte bytes object. Under " "Unix operating systems this is a property of the controlling tty of the " "curses program, and is not set by the curses library itself." msgstr "" -#: ../../library/curses.rst:199 +#: ../../library/curses.rst:202 msgid "" "The :func:`.filter` routine, if used, must be called before :func:`initscr` " -"is called. The effect is that, during those calls, :envvar:`LINES` is set " -"to ``1``; the capabilities ``clear``, ``cup``, ``cud``, ``cud1``, ``cuu1``, " -"``cuu``, ``vpa`` are disabled; and the ``home`` string is set to the value " -"of ``cr``. The effect is that the cursor is confined to the current line, " -"and so are screen updates. This may be used for enabling character-at-a-" -"time line editing without touching the rest of the screen." +"is called. The effect is that, during the initialization, :envvar:`LINES` " +"is set to ``1``; the capabilities ``clear``, ``cup``, ``cud``, ``cud1``, " +"``cuu1``, ``cuu``, ``vpa`` are disabled; and the ``home`` string is set to " +"the value of ``cr``. The effect is that the cursor is confined to the " +"current line, and so are screen updates. This may be used for enabling " +"character-at-a-time line editing without touching the rest of the screen." msgstr "" -#: ../../library/curses.rst:209 +#: ../../library/curses.rst:212 msgid "" "Flash the screen. That is, change it to reverse-video and then change it " "back in a short interval. Some people prefer such as 'visible bell' to the " "audible attention signal produced by :func:`beep`." msgstr "" -#: ../../library/curses.rst:216 +#: ../../library/curses.rst:219 msgid "" "Flush all input buffers. This throws away any typeahead that has been " "typed by the user and has not yet been processed by the program." msgstr "" -#: ../../library/curses.rst:222 +#: ../../library/curses.rst:225 msgid "" "After :meth:`~window.getch` returns :const:`KEY_MOUSE` to signal a mouse " "event, this method should be called to retrieve the queued mouse event, " @@ -300,51 +304,52 @@ msgid "" "const:`BUTTON_ALT`." msgstr "" -#: ../../library/curses.rst:233 ../../library/curses.rst:1801 +#: ../../library/curses.rst:236 ../../library/curses.rst:1847 msgid "" "The ``BUTTON5_*`` constants are now exposed if they are provided by the " "underlying curses library." msgstr "" -#: ../../library/curses.rst:240 +#: ../../library/curses.rst:243 msgid "" "Return the current coordinates of the virtual screen cursor as a tuple ``(y, " "x)``. If :meth:`leaveok ` is currently ``True``, then " "return ``(-1, -1)``." msgstr "" -#: ../../library/curses.rst:246 +#: ../../library/curses.rst:249 msgid "" -"Read window related data stored in the file by an earlier :func:`window." +"Read window-related data stored in the file by an earlier :meth:`window." "putwin` call. The routine then creates and initializes a new window using " -"that data, returning the new window object." +"that data, returning the new window object. The *file* argument must be a " +"file object opened for reading in binary mode." msgstr "" -#: ../../library/curses.rst:253 +#: ../../library/curses.rst:257 msgid "" "Return ``True`` if the terminal can display colors; otherwise, return " "``False``." msgstr "" -#: ../../library/curses.rst:257 +#: ../../library/curses.rst:261 msgid "" "Return ``True`` if the module supports extended colors; otherwise, return " "``False``. Extended color support allows more than 256 color pairs for " -"terminals that support more than 16 colors (e.g. xterm-256color)." +"terminals that support more than 16 colors (for example, xterm-256color)." msgstr "" -#: ../../library/curses.rst:261 +#: ../../library/curses.rst:265 msgid "Extended color support requires ncurses version 6.1 or later." msgstr "" -#: ../../library/curses.rst:267 +#: ../../library/curses.rst:271 msgid "" "Return ``True`` if the terminal has insert- and delete-character " "capabilities. This function is included for historical reasons only, as all " "modern software terminal emulators have such capabilities." msgstr "" -#: ../../library/curses.rst:274 +#: ../../library/curses.rst:278 msgid "" "Return ``True`` if the terminal has insert- and delete-line capabilities, or " "can simulate them using scrolling regions. This function is included for " @@ -352,13 +357,13 @@ msgid "" "capabilities." msgstr "" -#: ../../library/curses.rst:282 +#: ../../library/curses.rst:286 msgid "" "Take a key value *ch*, and return ``True`` if the current terminal type " "recognizes a key with that value." msgstr "" -#: ../../library/curses.rst:288 +#: ../../library/curses.rst:292 msgid "" "Used for half-delay mode, which is similar to cbreak mode in that characters " "typed by the user are immediately available to the program. However, after " @@ -367,7 +372,7 @@ msgid "" "``255``. Use :func:`nocbreak` to leave half-delay mode." msgstr "" -#: ../../library/curses.rst:297 +#: ../../library/curses.rst:301 msgid "" "Change the definition of a color, taking the number of the color to be " "changed followed by three RGB values (for the amounts of red, green, and " @@ -379,7 +384,7 @@ msgid "" "``True``." msgstr "" -#: ../../library/curses.rst:308 +#: ../../library/curses.rst:312 msgid "" "Change the definition of a color-pair. It takes three arguments: the number " "of the color-pair to be changed, the foreground color number, and the " @@ -393,31 +398,38 @@ msgid "" "definition." msgstr "" -#: ../../library/curses.rst:323 +#: ../../library/curses.rst:327 msgid "" "Initialize the library. Return a :ref:`window ` " "object which represents the whole screen." msgstr "" -#: ../../library/curses.rst:328 +#: ../../library/curses.rst:332 msgid "" "If there is an error opening the terminal, the underlying curses library may " "cause the interpreter to exit." msgstr "" -#: ../../library/curses.rst:334 +#: ../../library/curses.rst:338 +msgid "" +"If *flag* is ``True``, pressing an interrupt key (interrupt, break, or quit) " +"will flush all output in the terminal driver queue. If *flag* is ``False``, " +"no flushing is done." +msgstr "" + +#: ../../library/curses.rst:345 msgid "" "Return ``True`` if :func:`resize_term` would modify the window structure, " "``False`` otherwise." msgstr "" -#: ../../library/curses.rst:340 +#: ../../library/curses.rst:351 msgid "" "Return ``True`` if :func:`endwin` has been called (that is, the curses " "library has been deinitialized)." msgstr "" -#: ../../library/curses.rst:346 +#: ../../library/curses.rst:357 msgid "" "Return the name of the key numbered *k* as a bytes object. The name of a " "key generating printable ASCII character is the key's character. The name " @@ -428,54 +440,59 @@ msgid "" "character." msgstr "" -#: ../../library/curses.rst:356 +#: ../../library/curses.rst:364 +msgid "Raise a :exc:`ValueError` if *k* is negative." +msgstr "" + +#: ../../library/curses.rst:369 msgid "" "Return the user's current line kill character as a one-byte bytes object. " "Under Unix operating systems this is a property of the controlling tty of " "the curses program, and is not set by the curses library itself." msgstr "" -#: ../../library/curses.rst:363 +#: ../../library/curses.rst:376 msgid "" "Return a bytes object containing the terminfo long name field describing the " "current terminal. The maximum length of a verbose description is 128 " "characters. It is defined only after the call to :func:`initscr`." msgstr "" -#: ../../library/curses.rst:370 +#: ../../library/curses.rst:383 msgid "" "If *flag* is ``True``, allow 8-bit characters to be input. If *flag* is " "``False``, allow only 7-bit chars." msgstr "" -#: ../../library/curses.rst:376 +#: ../../library/curses.rst:389 msgid "" "Set the maximum time in milliseconds that can elapse between press and " "release events in order for them to be recognized as a click, and return the " -"previous interval value. The default value is 200 milliseconds, or one " -"fifth of a second." +"previous interval value. The default value is 166 milliseconds, or one " +"sixth of a second. Use a negative *interval* to obtain the interval value " +"without changing it." msgstr "" -#: ../../library/curses.rst:383 +#: ../../library/curses.rst:397 msgid "" "Set the mouse events to be reported, and return a tuple ``(availmask, " "oldmask)``. *availmask* indicates which of the specified mouse events can " "be reported; on complete failure it returns ``0``. *oldmask* is the " -"previous value of the given window's mouse event mask. If this function is " -"never called, no mouse events are ever reported." +"previous value of the mouse event mask. If this function is never called, " +"no mouse events are ever reported." msgstr "" -#: ../../library/curses.rst:392 +#: ../../library/curses.rst:406 msgid "Sleep for *ms* milliseconds." msgstr "" -#: ../../library/curses.rst:397 +#: ../../library/curses.rst:411 msgid "" "Create and return a pointer to a new pad data structure with the given " "number of lines and columns. Return a pad as a window object." msgstr "" -#: ../../library/curses.rst:400 +#: ../../library/curses.rst:414 msgid "" "A pad is like a window, except that it is not restricted by the screen size, " "and is not necessarily associated with a particular part of the screen. " @@ -486,40 +503,44 @@ msgid "" "arguments to specify the part of the pad to be displayed and the location on " "the screen to be used for the display. The arguments are *pminrow*, " "*pmincol*, *sminrow*, *smincol*, *smaxrow*, *smaxcol*; the *p* arguments " -"refer to the upper left corner of the pad region to be displayed and the *s* " +"refer to the upper-left corner of the pad region to be displayed and the *s* " "arguments define a clipping box on the screen within which the pad region is " "to be displayed." msgstr "" -#: ../../library/curses.rst:416 +#: ../../library/curses.rst:430 msgid "" "Return a new :ref:`window `, whose left-upper corner " "is at ``(begin_y, begin_x)``, and whose height/width is *nlines*/*ncols*." msgstr "" -#: ../../library/curses.rst:419 +#: ../../library/curses.rst:433 msgid "" "By default, the window will extend from the specified position to the lower " "right corner of the screen." msgstr "" -#: ../../library/curses.rst:425 +#: ../../library/curses.rst:439 msgid "" "Enter newline mode. This mode translates the return key into newline on " "input, and translates newline into return and line-feed on output. Newline " "mode is initially on." msgstr "" -#: ../../library/curses.rst:432 +#: ../../library/curses.rst:443 +msgid "If *flag* is ``False``, the effect is the same as calling :func:`nonl`." +msgstr "" + +#: ../../library/curses.rst:448 msgid "" "Leave cbreak mode. Return to normal \"cooked\" mode with line buffering." msgstr "" -#: ../../library/curses.rst:437 +#: ../../library/curses.rst:453 msgid "Leave echo mode. Echoing of input characters is turned off." msgstr "" -#: ../../library/curses.rst:442 +#: ../../library/curses.rst:458 msgid "" "Leave newline mode. Disable translation of return into newline on input, " "and disable low-level translation of newline into newline/return on output " @@ -529,7 +550,7 @@ msgid "" "also, it will be able to detect the return key on input." msgstr "" -#: ../../library/curses.rst:452 +#: ../../library/curses.rst:468 msgid "" "When the :func:`!noqiflush` routine is used, normal flush of input and " "output queues associated with the ``INTR``, ``QUIT`` and ``SUSP`` characters " @@ -538,63 +559,69 @@ msgid "" "occurred, after the handler exits." msgstr "" -#: ../../library/curses.rst:460 +#: ../../library/curses.rst:476 msgid "Leave raw mode. Return to normal \"cooked\" mode with line buffering." msgstr "" -#: ../../library/curses.rst:465 +#: ../../library/curses.rst:481 msgid "" "Return a tuple ``(fg, bg)`` containing the colors for the requested color " "pair. The value of *pair_number* must be between ``0`` and ``COLOR_PAIRS - " "1``." msgstr "" -#: ../../library/curses.rst:471 +#: ../../library/curses.rst:487 msgid "" "Return the number of the color-pair set by the attribute value *attr*. :func:" "`color_pair` is the counterpart to this function." msgstr "" -#: ../../library/curses.rst:477 +#: ../../library/curses.rst:493 msgid "" "Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified " "terminfo capability for the current terminal. Note that the output of :func:" "`putp` always goes to standard output." msgstr "" -#: ../../library/curses.rst:484 +#: ../../library/curses.rst:497 ../../library/curses.rst:633 +#: ../../library/curses.rst:643 ../../library/curses.rst:653 +#: ../../library/curses.rst:663 +msgid ":func:`setupterm` (or :func:`initscr`) must be called first." +msgstr "" + +#: ../../library/curses.rst:502 msgid "" "If *flag* is ``False``, the effect is the same as calling :func:`noqiflush`. " "If *flag* is ``True``, or no argument is provided, the queues will be " "flushed when these control characters are read." msgstr "" -#: ../../library/curses.rst:491 +#: ../../library/curses.rst:509 msgid "" "Enter raw mode. In raw mode, normal line buffering and processing of " "interrupt, quit, suspend, and flow control keys are turned off; characters " "are presented to curses input functions one by one." msgstr "" -#: ../../library/curses.rst:498 +#: ../../library/curses.rst:516 msgid "" "Restore the terminal to \"program\" mode, as previously saved by :func:" "`def_prog_mode`." msgstr "" -#: ../../library/curses.rst:504 +#: ../../library/curses.rst:522 msgid "" "Restore the terminal to \"shell\" mode, as previously saved by :func:" "`def_shell_mode`." msgstr "" -#: ../../library/curses.rst:510 +#: ../../library/curses.rst:528 msgid "" "Restore the state of the terminal modes to what it was at the last call to :" "func:`savetty`." msgstr "" -#: ../../library/curses.rst:516 +#: ../../library/curses.rst:534 msgid "" "Backend function used by :func:`resizeterm`, performing most of the work; " "when resizing the windows, :func:`resize_term` blank-fills the areas that " @@ -604,47 +631,47 @@ msgid "" "to resize these without additional interaction with the application." msgstr "" -#: ../../library/curses.rst:526 +#: ../../library/curses.rst:544 msgid "" "Resize the standard and current windows to the specified dimensions, and " "adjusts other bookkeeping data used by the curses library that record the " "window dimensions (in particular the SIGWINCH handler)." msgstr "" -#: ../../library/curses.rst:533 +#: ../../library/curses.rst:551 msgid "" "Save the current state of the terminal modes in a buffer, usable by :func:" "`resetty`." msgstr "" -#: ../../library/curses.rst:538 +#: ../../library/curses.rst:556 msgid "Retrieves the value set by :func:`set_escdelay`." msgstr "" -#: ../../library/curses.rst:544 +#: ../../library/curses.rst:562 msgid "" "Sets the number of milliseconds to wait after reading an escape character, " "to distinguish between an individual escape character entered on the " "keyboard from escape sequences sent by cursor and function keys." msgstr "" -#: ../../library/curses.rst:552 +#: ../../library/curses.rst:570 msgid "Retrieves the value set by :func:`set_tabsize`." msgstr "" -#: ../../library/curses.rst:558 +#: ../../library/curses.rst:576 msgid "" "Sets the number of columns used by the curses library when converting a tab " "character to spaces as it adds the tab to a window." msgstr "" -#: ../../library/curses.rst:565 +#: ../../library/curses.rst:583 msgid "" "Set the virtual screen cursor to *y*, *x*. If *y* and *x* are both ``-1``, " "then :meth:`leaveok ` is set ``True``." msgstr "" -#: ../../library/curses.rst:571 +#: ../../library/curses.rst:589 msgid "" "Initialize the terminal. *term* is a string giving the terminal name, or " "``None``; if omitted or ``None``, the value of the :envvar:`TERM` " @@ -653,14 +680,21 @@ msgid "" "descriptor for ``sys.stdout`` will be used." msgstr "" -#: ../../library/curses.rst:580 +#: ../../library/curses.rst:595 +msgid "" +"Raise a :exc:`curses.error` if the terminal could not be found or its " +"terminfo database entry could not be read. If the terminal has already been " +"initialized, this function has no effect." +msgstr "" + +#: ../../library/curses.rst:602 msgid "" "Must be called if the programmer wants to use colors, and before any other " "color manipulation routine is called. It is good practice to call this " "routine right after :func:`initscr`." msgstr "" -#: ../../library/curses.rst:584 +#: ../../library/curses.rst:606 msgid "" ":func:`start_color` initializes eight basic colors (black, red, green, " "yellow, blue, magenta, cyan, and white), and two global variables in the :" @@ -670,20 +704,20 @@ msgid "" "terminal was just turned on." msgstr "" -#: ../../library/curses.rst:593 +#: ../../library/curses.rst:615 msgid "" "Return a logical OR of all video attributes supported by the terminal. This " "information is useful when a curses program needs complete control over the " "appearance of the screen." msgstr "" -#: ../../library/curses.rst:600 +#: ../../library/curses.rst:622 msgid "" "Return the value of the environment variable :envvar:`TERM`, as a bytes " "object, truncated to 14 characters." msgstr "" -#: ../../library/curses.rst:606 +#: ../../library/curses.rst:628 msgid "" "Return the value of the Boolean capability corresponding to the terminfo " "capability name *capname* as an integer. Return the value ``-1`` if " @@ -691,7 +725,7 @@ msgid "" "from the terminal description." msgstr "" -#: ../../library/curses.rst:614 +#: ../../library/curses.rst:638 msgid "" "Return the value of the numeric capability corresponding to the terminfo " "capability name *capname* as an integer. Return the value ``-2`` if " @@ -699,7 +733,7 @@ msgid "" "from the terminal description." msgstr "" -#: ../../library/curses.rst:622 +#: ../../library/curses.rst:648 msgid "" "Return the value of the string capability corresponding to the terminfo " "capability name *capname* as a bytes object. Return ``None`` if *capname* " @@ -707,21 +741,22 @@ msgid "" "terminal description." msgstr "" -#: ../../library/curses.rst:630 +#: ../../library/curses.rst:658 msgid "" "Instantiate the bytes object *str* with the supplied parameters, where *str* " -"should be a parameterized string obtained from the terminfo database. E.g. " -"``tparm(tigetstr(\"cup\"), 5, 3)`` could result in ``b'\\033[6;4H'``, the " -"exact result depending on terminal type." +"should be a parameterized string obtained from the terminfo database. For " +"example, ``tparm(tigetstr(\"cup\"), 5, 3)`` could result in " +"``b'\\033[6;4H'``, the exact result depending on terminal type. Up to nine " +"integer parameters may be supplied." msgstr "" -#: ../../library/curses.rst:638 +#: ../../library/curses.rst:668 msgid "" "Specify that the file descriptor *fd* be used for typeahead checking. If " "*fd* is ``-1``, then no typeahead checking is done." msgstr "" -#: ../../library/curses.rst:641 +#: ../../library/curses.rst:671 msgid "" "The curses library does \"line-breakout optimization\" by looking for " "typeahead periodically while updating the screen. If input is found, and it " @@ -731,7 +766,7 @@ msgid "" "typeahead checking." msgstr "" -#: ../../library/curses.rst:650 +#: ../../library/curses.rst:680 msgid "" "Return a bytes object which is a printable representation of the character " "*ch*. Control characters are represented as a caret followed by the " @@ -739,35 +774,35 @@ msgid "" "are." msgstr "" -#: ../../library/curses.rst:657 +#: ../../library/curses.rst:687 msgid "Push *ch* so the next :meth:`~window.getch` will return it." msgstr "" -#: ../../library/curses.rst:661 +#: ../../library/curses.rst:691 msgid "Only one *ch* can be pushed before :meth:`!getch` is called." msgstr "" -#: ../../library/curses.rst:666 +#: ../../library/curses.rst:696 msgid "" "Update the :const:`LINES` and :const:`COLS` module variables. Useful for " "detecting manual screen resize." msgstr "" -#: ../../library/curses.rst:674 +#: ../../library/curses.rst:704 msgid "Push *ch* so the next :meth:`~window.get_wch` will return it." msgstr "" -#: ../../library/curses.rst:678 +#: ../../library/curses.rst:708 msgid "Only one *ch* can be pushed before :meth:`!get_wch` is called." msgstr "" -#: ../../library/curses.rst:685 +#: ../../library/curses.rst:715 msgid "" "Push a :const:`KEY_MOUSE` event onto the input queue, associating the given " "state data with it." msgstr "" -#: ../../library/curses.rst:691 +#: ../../library/curses.rst:721 msgid "" "If used, this function should be called before :func:`initscr` or newterm " "are called. When *flag* is ``False``, the values of lines and columns " @@ -777,11 +812,11 @@ msgid "" "to use the window size if :envvar:`LINES` and :envvar:`COLUMNS` are not set)." msgstr "" -#: ../../library/curses.rst:701 +#: ../../library/curses.rst:731 msgid "Equivalent to ``assume_default_colors(-1, -1)``." msgstr "" -#: ../../library/curses.rst:706 +#: ../../library/curses.rst:736 msgid "" "Initialize curses and call another callable object, *func*, which should be " "the rest of your curses-using application. If the application raises an " @@ -795,97 +830,96 @@ msgid "" "echo, and disables the terminal keypad." msgstr "" -#: ../../library/curses.rst:720 -msgid "Window Objects" +#: ../../library/curses.rst:750 +msgid "Window objects" msgstr "" -#: ../../library/curses.rst:724 +#: ../../library/curses.rst:754 msgid "" "Window objects, as returned by :func:`initscr` and :func:`newwin` above, " "have the following methods and attributes:" msgstr "" -#: ../../library/curses.rst:731 +#: ../../library/curses.rst:761 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, overwriting any " "character previously painted at that location. By default, the character " "position and attributes are the current settings for the window object." msgstr "" -#: ../../library/curses.rst:737 +#: ../../library/curses.rst:767 msgid "" "Writing outside the window, subwindow, or pad raises a :exc:`curses.error`. " -"Attempting to write to the lower right corner of a window, subwindow, or pad " +"Attempting to write to the lower-right corner of a window, subwindow, or pad " "will cause an exception to be raised after the character is printed." msgstr "" -#: ../../library/curses.rst:745 +#: ../../library/curses.rst:775 msgid "" "Paint at most *n* characters of the character string *str* at ``(y, x)`` " "with attributes *attr*, overwriting anything previously on the display." msgstr "" -#: ../../library/curses.rst:753 +#: ../../library/curses.rst:783 msgid "" "Paint the character string *str* at ``(y, x)`` with attributes *attr*, " "overwriting anything previously on the display." msgstr "" -#: ../../library/curses.rst:758 +#: ../../library/curses.rst:788 msgid "" "Writing outside the window, subwindow, or pad raises :exc:`curses.error`. " -"Attempting to write to the lower right corner of a window, subwindow, or pad " +"Attempting to write to the lower-right corner of a window, subwindow, or pad " "will cause an exception to be raised after the string is printed." msgstr "" -#: ../../library/curses.rst:762 +#: ../../library/curses.rst:792 msgid "" -"A `bug in ncurses `_, the backend for " -"this Python module, can cause SegFaults when resizing windows. This is fixed " -"in ncurses-6.1-20190511. If you are stuck with an earlier ncurses, you can " -"avoid triggering this if you do not call :func:`addstr` with a *str* that " -"has embedded newlines. Instead, call :func:`addstr` separately for each " -"line." +"A bug in ncurses, the backend for this Python module, could cause segfaults " +"when resizing windows. This was fixed in ncurses-6.1-20190511. If you are " +"stuck with an earlier ncurses, you can avoid triggering it by not calling :" +"meth:`!addstr` with a *str* that has embedded newlines; instead, call :meth:" +"`!addstr` separately for each line." msgstr "" -#: ../../library/curses.rst:772 +#: ../../library/curses.rst:801 msgid "" "Remove attribute *attr* from the \"background\" set applied to all writes to " "the current window." msgstr "" -#: ../../library/curses.rst:778 +#: ../../library/curses.rst:807 msgid "" "Add attribute *attr* to the \"background\" set applied to all writes to the " "current window." msgstr "" -#: ../../library/curses.rst:784 +#: ../../library/curses.rst:813 msgid "" "Set the \"background\" set of attributes to *attr*. This set is initially " "``0`` (no attributes)." msgstr "" -#: ../../library/curses.rst:790 +#: ../../library/curses.rst:819 msgid "" "Set the background property of the window to the character *ch*, with " "attributes *attr*. The change is then applied to every character position " "in that window:" msgstr "" -#: ../../library/curses.rst:794 +#: ../../library/curses.rst:823 msgid "" "The attribute of every character in the window is changed to the new " "background attribute." msgstr "" -#: ../../library/curses.rst:797 +#: ../../library/curses.rst:826 msgid "" "Wherever the former background character appears, it is changed to the new " "background character." msgstr "" -#: ../../library/curses.rst:803 +#: ../../library/curses.rst:832 msgid "" "Set the window's background. A window's background consists of a character " "and any combination of attributes. The attribute part of the background is " @@ -896,128 +930,128 @@ msgid "" "delete line/character operations." msgstr "" -#: ../../library/curses.rst:813 +#: ../../library/curses.rst:842 msgid "" "Draw a border around the edges of the window. Each parameter specifies the " "character to use for a specific part of the border; see the table below for " "more details." msgstr "" -#: ../../library/curses.rst:819 +#: ../../library/curses.rst:848 msgid "" "A ``0`` value for any parameter will cause the default character to be used " "for that parameter. Keyword parameters can *not* be used. The defaults are " "listed in this table:" msgstr "" -#: ../../library/curses.rst:824 +#: ../../library/curses.rst:853 msgid "Parameter" msgstr "參數" -#: ../../library/curses.rst:824 +#: ../../library/curses.rst:853 msgid "Description" msgstr "描述" -#: ../../library/curses.rst:824 +#: ../../library/curses.rst:853 msgid "Default value" msgstr "預設值" -#: ../../library/curses.rst:826 +#: ../../library/curses.rst:855 msgid "*ls*" msgstr "*ls*" -#: ../../library/curses.rst:826 +#: ../../library/curses.rst:855 msgid "Left side" msgstr "" -#: ../../library/curses.rst:826 ../../library/curses.rst:828 +#: ../../library/curses.rst:855 ../../library/curses.rst:857 msgid ":const:`ACS_VLINE`" msgstr ":const:`ACS_VLINE`" -#: ../../library/curses.rst:828 +#: ../../library/curses.rst:857 msgid "*rs*" msgstr "*rs*" -#: ../../library/curses.rst:828 +#: ../../library/curses.rst:857 msgid "Right side" msgstr "" -#: ../../library/curses.rst:830 +#: ../../library/curses.rst:859 msgid "*ts*" msgstr "*ts*" -#: ../../library/curses.rst:830 +#: ../../library/curses.rst:859 msgid "Top" msgstr "" -#: ../../library/curses.rst:830 ../../library/curses.rst:832 +#: ../../library/curses.rst:859 ../../library/curses.rst:861 msgid ":const:`ACS_HLINE`" msgstr ":const:`ACS_HLINE`" -#: ../../library/curses.rst:832 +#: ../../library/curses.rst:861 msgid "*bs*" msgstr "*bs*" -#: ../../library/curses.rst:832 +#: ../../library/curses.rst:861 msgid "Bottom" msgstr "" -#: ../../library/curses.rst:834 +#: ../../library/curses.rst:863 msgid "*tl*" msgstr "*tl*" -#: ../../library/curses.rst:834 +#: ../../library/curses.rst:863 msgid "Upper-left corner" msgstr "" -#: ../../library/curses.rst:834 +#: ../../library/curses.rst:863 msgid ":const:`ACS_ULCORNER`" msgstr ":const:`ACS_ULCORNER`" -#: ../../library/curses.rst:836 +#: ../../library/curses.rst:865 msgid "*tr*" msgstr "*tr*" -#: ../../library/curses.rst:836 +#: ../../library/curses.rst:865 msgid "Upper-right corner" msgstr "" -#: ../../library/curses.rst:836 +#: ../../library/curses.rst:865 msgid ":const:`ACS_URCORNER`" msgstr ":const:`ACS_URCORNER`" -#: ../../library/curses.rst:838 +#: ../../library/curses.rst:867 msgid "*bl*" msgstr "*bl*" -#: ../../library/curses.rst:838 +#: ../../library/curses.rst:867 msgid "Bottom-left corner" msgstr "" -#: ../../library/curses.rst:838 +#: ../../library/curses.rst:867 msgid ":const:`ACS_LLCORNER`" msgstr ":const:`ACS_LLCORNER`" -#: ../../library/curses.rst:840 +#: ../../library/curses.rst:869 msgid "*br*" msgstr "*br*" -#: ../../library/curses.rst:840 +#: ../../library/curses.rst:869 msgid "Bottom-right corner" msgstr "" -#: ../../library/curses.rst:840 +#: ../../library/curses.rst:869 msgid ":const:`ACS_LRCORNER`" msgstr ":const:`ACS_LRCORNER`" -#: ../../library/curses.rst:846 +#: ../../library/curses.rst:875 msgid "" "Similar to :meth:`border`, but both *ls* and *rs* are *vertch* and both *ts* " "and *bs* are *horch*. The default corner characters are always used by this " "function." msgstr "" -#: ../../library/curses.rst:855 +#: ../../library/curses.rst:884 msgid "" "Set the attributes of *num* characters at the current cursor position, or at " "position ``(y, x)`` if supplied. If *num* is not given or is ``-1``, the " @@ -1027,45 +1061,47 @@ msgid "" "be redisplayed by the next window refresh." msgstr "" -#: ../../library/curses.rst:865 +#: ../../library/curses.rst:894 msgid "" "Like :meth:`erase`, but also cause the whole window to be repainted upon " "next call to :meth:`refresh`." msgstr "" -#: ../../library/curses.rst:871 +#: ../../library/curses.rst:900 msgid "" "If *flag* is ``True``, the next call to :meth:`refresh` will clear the " "window completely." msgstr "" -#: ../../library/curses.rst:877 +#: ../../library/curses.rst:906 msgid "" "Erase from cursor to the end of the window: all lines below the cursor are " "deleted, and then the equivalent of :meth:`clrtoeol` is performed." msgstr "" -#: ../../library/curses.rst:883 +#: ../../library/curses.rst:912 msgid "Erase from cursor to the end of the line." msgstr "" -#: ../../library/curses.rst:888 +#: ../../library/curses.rst:917 msgid "" "Update the current cursor position of all the ancestors of the window to " "reflect the current cursor position of the window." msgstr "" -#: ../../library/curses.rst:894 -msgid "Delete any character at ``(y, x)``." +#: ../../library/curses.rst:923 +msgid "" +"Delete the character under the cursor, or at ``(y, x)`` if specified. All " +"characters to the right on the same line are shifted one position left." msgstr "" -#: ../../library/curses.rst:899 +#: ../../library/curses.rst:929 msgid "" "Delete the line under the cursor. All following lines are moved up by one " "line." msgstr "" -#: ../../library/curses.rst:905 +#: ../../library/curses.rst:935 msgid "" "An abbreviation for \"derive window\", :meth:`derwin` is the same as " "calling :meth:`subwin`, except that *begin_y* and *begin_x* are relative to " @@ -1073,13 +1109,13 @@ msgid "" "a window object for the derived window." msgstr "" -#: ../../library/curses.rst:913 +#: ../../library/curses.rst:943 msgid "" "Add character *ch* with attribute *attr*, and immediately call :meth:" "`refresh` on the window." msgstr "" -#: ../../library/curses.rst:919 +#: ../../library/curses.rst:949 msgid "" "Test whether the given pair of screen-relative character-cell coordinates " "are enclosed by the given window, returning ``True`` or ``False``. It is " @@ -1087,11 +1123,11 @@ msgid "" "location of a mouse event." msgstr "" -#: ../../library/curses.rst:924 +#: ../../library/curses.rst:954 msgid "Previously it returned ``1`` or ``0`` instead of ``True`` or ``False``." msgstr "" -#: ../../library/curses.rst:930 +#: ../../library/curses.rst:960 msgid "" "Encoding used to encode method arguments (Unicode strings and characters). " "The encoding attribute is inherited from the parent window when a subwindow " @@ -1099,19 +1135,19 @@ msgid "" "locale encoding is used (see :func:`locale.getencoding`)." msgstr "" -#: ../../library/curses.rst:940 +#: ../../library/curses.rst:970 msgid "Clear the window." msgstr "清除視窗。" -#: ../../library/curses.rst:945 +#: ../../library/curses.rst:975 msgid "Return a tuple ``(y, x)`` of coordinates of upper-left corner." msgstr "回傳左上角的座標 ``(y, x)``。" -#: ../../library/curses.rst:950 +#: ../../library/curses.rst:980 msgid "Return the given window's current background character/attribute pair." msgstr "回傳給定視窗目前的背景字元/屬性對。" -#: ../../library/curses.rst:955 +#: ../../library/curses.rst:985 msgid "" "Get a character. Note that the integer returned does *not* have to be in " "ASCII range: function keys, keypad keys and so on are represented by numbers " @@ -1119,14 +1155,14 @@ msgid "" "otherwise wait until a key is pressed." msgstr "" -#: ../../library/curses.rst:963 +#: ../../library/curses.rst:993 msgid "" "Get a wide character. Return a character for most keys, or an integer for " "function keys, keypad keys, and other special keys. In no-delay mode, raise " "an exception if there is no input." msgstr "" -#: ../../library/curses.rst:972 +#: ../../library/curses.rst:1002 msgid "" "Get a character, returning a string instead of an integer, as :meth:`getch` " "does. Function keys, keypad keys and other special keys return a multibyte " @@ -1134,40 +1170,41 @@ msgid "" "there is no input." msgstr "" -#: ../../library/curses.rst:980 +#: ../../library/curses.rst:1010 msgid "Return a tuple ``(y, x)`` of the height and width of the window." msgstr "回傳視窗的高度和寬度的元組 ``(y, x)``。" -#: ../../library/curses.rst:985 +#: ../../library/curses.rst:1015 msgid "" "Return the beginning coordinates of this window relative to its parent " "window as a tuple ``(y, x)``. Return ``(-1, -1)`` if this window has no " "parent." msgstr "" -#: ../../library/curses.rst:995 +#: ../../library/curses.rst:1025 msgid "" -"Read a bytes object from the user, with primitive line editing capacity. The " -"maximum value for *n* is 2047." +"Read a bytes object from the user, with primitive line editing capacity. At " +"most *n* characters are read; *n* defaults to and cannot exceed 2047." msgstr "" -#: ../../library/curses.rst:998 ../../library/curses.rst:1093 +#: ../../library/curses.rst:1029 ../../library/curses.rst:1128 msgid "The maximum value for *n* was increased from 1023 to 2047." msgstr "" -#: ../../library/curses.rst:1004 +#: ../../library/curses.rst:1035 msgid "" "Return a tuple ``(y, x)`` of current cursor position relative to the " "window's upper-left corner." msgstr "" -#: ../../library/curses.rst:1011 +#: ../../library/curses.rst:1042 msgid "" "Display a horizontal line starting at ``(y, x)`` with length *n* consisting " -"of the character *ch*." +"of the character *ch* with attributes *attr*. The line stops at the right " +"edge of the window if fewer than *n* cells are available." msgstr "" -#: ../../library/curses.rst:1017 +#: ../../library/curses.rst:1049 msgid "" "If *flag* is ``False``, curses no longer considers using the hardware insert/" "delete character feature of the terminal; if *flag* is ``True``, use of " @@ -1175,13 +1212,13 @@ msgid "" "initialized, use of character insert/delete is enabled by default." msgstr "" -#: ../../library/curses.rst:1025 +#: ../../library/curses.rst:1057 msgid "" -"If *flag* is ``True``, :mod:`!curses` will try and use hardware line editing " -"facilities. Otherwise, line insertion/deletion are disabled." +"If *flag* is ``True``, :mod:`!curses` will try to use hardware line editing " +"facilities. Otherwise, curses will not use them." msgstr "" -#: ../../library/curses.rst:1031 +#: ../../library/curses.rst:1063 msgid "" "If *flag* is ``True``, any change in the window image automatically causes " "the window to be refreshed; you no longer have to call :meth:`refresh` " @@ -1189,19 +1226,21 @@ msgid "" "calls to wrefresh. This option is disabled by default." msgstr "" -#: ../../library/curses.rst:1039 +#: ../../library/curses.rst:1071 msgid "" "Return the character at the given position in the window. The bottom 8 bits " "are the character proper, and upper bits are the attributes." msgstr "" -#: ../../library/curses.rst:1046 +#: ../../library/curses.rst:1078 msgid "" -"Paint character *ch* at ``(y, x)`` with attributes *attr*, moving the line " -"from position *x* right by one character." +"Insert character *ch* with attributes *attr* before the character under the " +"cursor, or at ``(y, x)`` if specified. All characters to the right of the " +"cursor are shifted one position right, with the rightmost character on the " +"line being lost. The cursor position does not change." msgstr "" -#: ../../library/curses.rst:1052 +#: ../../library/curses.rst:1086 msgid "" "Insert *nlines* lines into the specified window above the current line. The " "*nlines* bottom lines are lost. For negative *nlines*, delete *nlines* " @@ -1210,13 +1249,13 @@ msgid "" "remains the same." msgstr "" -#: ../../library/curses.rst:1061 +#: ../../library/curses.rst:1095 msgid "" "Insert a blank line under the cursor. All following lines are moved down by " "one line." msgstr "" -#: ../../library/curses.rst:1068 +#: ../../library/curses.rst:1102 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor, up to *n* characters. If *n* is " @@ -1226,7 +1265,7 @@ msgid "" "if specified)." msgstr "" -#: ../../library/curses.rst:1078 +#: ../../library/curses.rst:1112 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor. All characters to the right of the " @@ -1235,85 +1274,98 @@ msgid "" "specified)." msgstr "" -#: ../../library/curses.rst:1087 +#: ../../library/curses.rst:1121 msgid "" "Return a bytes object of characters, extracted from the window starting at " -"the current cursor position, or at *y*, *x* if specified. Attributes are " -"stripped from the characters. If *n* is specified, :meth:`instr` returns a " -"string at most *n* characters long (exclusive of the trailing NUL). The " -"maximum value for *n* is 2047." +"the current cursor position, or at *y*, *x* if specified, and stopping at " +"the end of the line. Attributes and color information are stripped from the " +"characters. If *n* is specified, :meth:`instr` returns a string at most *n* " +"characters long (exclusive of the trailing NUL). The maximum value for *n* " +"is 2047." msgstr "" -#: ../../library/curses.rst:1099 +#: ../../library/curses.rst:1134 msgid "" "Return ``True`` if the specified line was modified since the last call to :" "meth:`refresh`; otherwise return ``False``. Raise a :exc:`curses.error` " "exception if *line* is not valid for the given window." msgstr "" -#: ../../library/curses.rst:1106 +#: ../../library/curses.rst:1141 msgid "" "Return ``True`` if the specified window was modified since the last call to :" "meth:`refresh`; otherwise return ``False``." msgstr "" -#: ../../library/curses.rst:1112 +#: ../../library/curses.rst:1147 msgid "" "If *flag* is ``True``, escape sequences generated by some keys (keypad, " "function keys) will be interpreted by :mod:`!curses`. If *flag* is " "``False``, escape sequences will be left as is in the input stream." msgstr "" -#: ../../library/curses.rst:1119 +#: ../../library/curses.rst:1154 msgid "" "If *flag* is ``True``, cursor is left where it is on update, instead of " -"being at \"cursor position.\" This reduces cursor movement where possible. " -"If possible the cursor will be made invisible." +"being at \"cursor position.\" This reduces cursor movement where possible." msgstr "" -#: ../../library/curses.rst:1123 +#: ../../library/curses.rst:1157 msgid "" "If *flag* is ``False``, cursor will always be at \"cursor position\" after " "an update." msgstr "" -#: ../../library/curses.rst:1128 +#: ../../library/curses.rst:1162 msgid "Move cursor to ``(new_y, new_x)``." msgstr "移動游標到 ``(new_y, new_x)``。" -#: ../../library/curses.rst:1133 +#: ../../library/curses.rst:1167 msgid "" "Move the window inside its parent window. The screen-relative parameters of " "the window are not changed. This routine is used to display different parts " "of the parent window at the same physical position on the screen." msgstr "" -#: ../../library/curses.rst:1140 +#: ../../library/curses.rst:1174 msgid "Move the window so its upper-left corner is at ``(new_y, new_x)``." msgstr "" -#: ../../library/curses.rst:1145 +#: ../../library/curses.rst:1176 +msgid "" +"Moving the window so that any part of it would be off the screen is an " +"error: the window is not moved and :exc:`curses.error` is raised." +msgstr "" + +#: ../../library/curses.rst:1182 msgid "If *flag* is ``True``, :meth:`getch` will be non-blocking." msgstr "如果 *flag* 為 ``True``,則 :meth:`getch` 將為非阻塞的。" -#: ../../library/curses.rst:1150 +#: ../../library/curses.rst:1187 msgid "If *flag* is ``True``, escape sequences will not be timed out." msgstr "" -#: ../../library/curses.rst:1152 +#: ../../library/curses.rst:1189 msgid "" "If *flag* is ``False``, after a few milliseconds, an escape sequence will " "not be interpreted, and will be left in the input stream as is." msgstr "" -#: ../../library/curses.rst:1158 +#: ../../library/curses.rst:1196 msgid "" "Mark for refresh but wait. This function updates the data structure " "representing the desired state of the window, but does not force an update " "of the physical screen. To accomplish that, call :func:`doupdate`." msgstr "" -#: ../../library/curses.rst:1165 +#: ../../library/curses.rst:1200 +msgid "" +"The 6 arguments can only be specified, and are then required, when the " +"window is a pad created with :func:`newpad`; they have the same meaning as " +"for :meth:`refresh`." +msgstr "" + +#: ../../library/curses.rst:1207 msgid "" "Overlay the window on top of *destwin*. The windows need not be the same " "size, only the overlapping region is copied. This copy is non-destructive, " @@ -1321,7 +1373,7 @@ msgid "" "contents of *destwin*." msgstr "" -#: ../../library/curses.rst:1170 +#: ../../library/curses.rst:1212 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overlay` can be used. *sminrow* and *smincol* are the upper-left " @@ -1329,7 +1381,7 @@ msgid "" "in the destination window." msgstr "" -#: ../../library/curses.rst:1178 +#: ../../library/curses.rst:1220 msgid "" "Overwrite the window on top of *destwin*. The windows need not be the same " "size, in which case only the overlapping region is copied. This copy is " @@ -1337,7 +1389,7 @@ msgid "" "the old contents of *destwin*." msgstr "" -#: ../../library/curses.rst:1183 +#: ../../library/curses.rst:1225 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overwrite` can be used. *sminrow* and *smincol* are the upper-left " @@ -1345,46 +1397,46 @@ msgid "" "the destination window." msgstr "" -#: ../../library/curses.rst:1191 +#: ../../library/curses.rst:1233 msgid "" "Write all data associated with the window into the provided file object. " "This information can be later retrieved using the :func:`getwin` function." msgstr "" -#: ../../library/curses.rst:1197 +#: ../../library/curses.rst:1239 msgid "" "Indicate that the *num* screen lines, starting at line *beg*, are corrupted " "and should be completely redrawn on the next :meth:`refresh` call." msgstr "" -#: ../../library/curses.rst:1203 +#: ../../library/curses.rst:1245 msgid "" "Touch the entire window, causing it to be completely redrawn on the next :" "meth:`refresh` call." msgstr "" -#: ../../library/curses.rst:1209 +#: ../../library/curses.rst:1251 msgid "" "Update the display immediately (sync actual screen with previous drawing/" "deleting methods)." msgstr "" -#: ../../library/curses.rst:1212 +#: ../../library/curses.rst:1254 msgid "" -"The 6 optional arguments can only be specified when the window is a pad " -"created with :func:`newpad`. The additional parameters are needed to " -"indicate what part of the pad and screen are involved. *pminrow* and " -"*pmincol* specify the upper left-hand corner of the rectangle to be " -"displayed in the pad. *sminrow*, *smincol*, *smaxrow*, and *smaxcol* " -"specify the edges of the rectangle to be displayed on the screen. The lower " -"right-hand corner of the rectangle to be displayed in the pad is calculated " -"from the screen coordinates, since the rectangles must be the same size. " -"Both rectangles must be entirely contained within their respective " -"structures. Negative values of *pminrow*, *pmincol*, *sminrow*, or " -"*smincol* are treated as if they were zero." +"The 6 arguments can only be specified, and are then required, when the " +"window is a pad created with :func:`newpad`. The additional parameters are " +"needed to indicate what part of the pad and screen are involved. *pminrow* " +"and *pmincol* specify the upper-left corner of the rectangle to be displayed " +"in the pad. *sminrow*, *smincol*, *smaxrow*, and *smaxcol* specify the " +"edges of the rectangle to be displayed on the screen. The lower-right " +"corner of the rectangle to be displayed in the pad is calculated from the " +"screen coordinates, since the rectangles must be the same size. Both " +"rectangles must be entirely contained within their respective structures. " +"Negative values of *pminrow*, *pmincol*, *sminrow*, or *smincol* are treated " +"as if they were zero." msgstr "" -#: ../../library/curses.rst:1226 +#: ../../library/curses.rst:1268 msgid "" "Reallocate storage for a curses window to adjust its dimensions to the " "specified values. If either dimension is larger than the current values, " @@ -1392,11 +1444,14 @@ msgid "" "rendition (as set by :meth:`bkgdset`) merged into them." msgstr "" -#: ../../library/curses.rst:1234 -msgid "Scroll the screen or scrolling region upward by *lines* lines." +#: ../../library/curses.rst:1276 +msgid "" +"Scroll the screen or scrolling region. Scroll upward by *lines* lines if " +"*lines* is positive, or downward if it is negative. Scrolling has no effect " +"unless it has been enabled for the window with :meth:`scrollok`." msgstr "" -#: ../../library/curses.rst:1239 +#: ../../library/curses.rst:1283 msgid "" "Control what happens when the cursor of a window is moved off the edge of " "the window or scrolling region, either as a result of a newline action on " @@ -1406,54 +1461,63 @@ msgid "" "scrolling effect on the terminal, it is also necessary to call :meth:`idlok`." msgstr "" -#: ../../library/curses.rst:1249 +#: ../../library/curses.rst:1293 msgid "" "Set the scrolling region from line *top* to line *bottom*. All scrolling " "actions will take place in this region." msgstr "" -#: ../../library/curses.rst:1255 +#: ../../library/curses.rst:1299 msgid "" "Turn off the standout attribute. On some terminals this has the side effect " "of turning off all attributes." msgstr "" -#: ../../library/curses.rst:1261 +#: ../../library/curses.rst:1305 msgid "Turn on attribute *A_STANDOUT*." msgstr "" -#: ../../library/curses.rst:1267 ../../library/curses.rst:1274 +#: ../../library/curses.rst:1311 msgid "" -"Return a sub-window, whose upper-left corner is at ``(begin_y, begin_x)``, " -"and whose width/height is *ncols*/*nlines*." +"Return a sub-pad, whose upper-left corner is at ``(begin_y, begin_x)``, and " +"whose width/height is *ncols*/*nlines*. The coordinates are relative to the " +"parent pad (unlike :meth:`subwin`, which uses screen coordinates). This " +"method is only available for pads created with :func:`newpad`." msgstr "" -#: ../../library/curses.rst:1277 +#: ../../library/curses.rst:1320 +msgid "" +"Return a sub-window, whose upper-left corner is at the screen-relative " +"coordinates ``(begin_y, begin_x)``, and whose width/height is *ncols*/" +"*nlines*." +msgstr "" + +#: ../../library/curses.rst:1323 msgid "" "By default, the sub-window will extend from the specified position to the " "lower right corner of the window." msgstr "" -#: ../../library/curses.rst:1283 +#: ../../library/curses.rst:1329 msgid "" "Touch each location in the window that has been touched in any of its " "ancestor windows. This routine is called by :meth:`refresh`, so it should " "almost never be necessary to call it manually." msgstr "" -#: ../../library/curses.rst:1290 +#: ../../library/curses.rst:1336 msgid "" "If *flag* is ``True``, then :meth:`syncup` is called automatically whenever " "there is a change in the window." msgstr "" -#: ../../library/curses.rst:1296 +#: ../../library/curses.rst:1342 msgid "" "Touch all locations in ancestors of the window that have been changed in " "the window." msgstr "" -#: ../../library/curses.rst:1302 +#: ../../library/curses.rst:1348 msgid "" "Set blocking or non-blocking read behavior for the window. If *delay* is " "negative, blocking read is used (which will wait indefinitely for input). " @@ -1463,7 +1527,7 @@ msgid "" "still no input at the end of that time." msgstr "" -#: ../../library/curses.rst:1312 +#: ../../library/curses.rst:1358 msgid "" "Pretend *count* lines have been changed, starting with line *start*. If " "*changed* is supplied, it specifies whether the affected lines are marked as " @@ -1471,49 +1535,49 @@ msgid "" "``=False``)." msgstr "" -#: ../../library/curses.rst:1319 +#: ../../library/curses.rst:1365 msgid "" "Pretend the whole window has been changed, for purposes of drawing " "optimizations." msgstr "" -#: ../../library/curses.rst:1325 +#: ../../library/curses.rst:1371 msgid "" "Mark all lines in the window as unchanged since the last call to :meth:" "`refresh`." msgstr "" -#: ../../library/curses.rst:1332 +#: ../../library/curses.rst:1378 msgid "" "Display a vertical line starting at ``(y, x)`` with length *n* consisting of " "the character *ch* with attributes *attr*." msgstr "" -#: ../../library/curses.rst:1337 +#: ../../library/curses.rst:1383 msgid "Constants" msgstr "" -#: ../../library/curses.rst:1339 +#: ../../library/curses.rst:1385 msgid "The :mod:`!curses` module defines the following data members:" msgstr ":mod:`!curses` 模組定義了以下資料成員:" -#: ../../library/curses.rst:1344 +#: ../../library/curses.rst:1390 msgid "" "Some curses routines that return an integer, such as :meth:`~window." "getch`, return :const:`ERR` upon failure." msgstr "" -#: ../../library/curses.rst:1350 +#: ../../library/curses.rst:1396 msgid "" "Some curses routines that return an integer, such as :func:`napms`, " "return :const:`OK` upon success." msgstr "" -#: ../../library/curses.rst:1356 +#: ../../library/curses.rst:1402 msgid "A bytes object representing the current version of the module." msgstr "" -#: ../../library/curses.rst:1361 +#: ../../library/curses.rst:1407 msgid "" "A named tuple containing the three components of the ncurses library " "version: *major*, *minor*, and *patch*. All values are integers. The " @@ -1521,536 +1585,536 @@ msgid "" "is equivalent to ``curses.ncurses_version.major`` and so on." msgstr "" -#: ../../library/curses.rst:1366 +#: ../../library/curses.rst:1412 msgid "Availability: if the ncurses library is used." msgstr "" -#: ../../library/curses.rst:1372 +#: ../../library/curses.rst:1418 msgid "" "The maximum number of colors the terminal can support. It is defined only " "after the call to :func:`start_color`." msgstr "" -#: ../../library/curses.rst:1377 +#: ../../library/curses.rst:1423 msgid "" "The maximum number of color pairs the terminal can support. It is defined " "only after the call to :func:`start_color`." msgstr "" -#: ../../library/curses.rst:1382 +#: ../../library/curses.rst:1428 msgid "" -"The width of the screen, i.e., the number of columns. It is defined only " +"The width of the screen, that is, the number of columns. It is defined only " "after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" "func:`resizeterm` and :func:`resize_term`." msgstr "" -#: ../../library/curses.rst:1389 +#: ../../library/curses.rst:1435 msgid "" -"The height of the screen, i.e., the number of lines. It is defined only " +"The height of the screen, that is, the number of lines. It is defined only " "after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" "func:`resizeterm` and :func:`resize_term`." msgstr "" -#: ../../library/curses.rst:1395 +#: ../../library/curses.rst:1441 msgid "" "Some constants are available to specify character cell attributes. The exact " "constants available are system dependent." msgstr "" -#: ../../library/curses.rst:1399 +#: ../../library/curses.rst:1445 msgid "Attribute" msgstr "" -#: ../../library/curses.rst:1399 ../../library/curses.rst:1444 -#: ../../library/curses.rst:1690 ../../library/curses.rst:1782 +#: ../../library/curses.rst:1445 ../../library/curses.rst:1490 +#: ../../library/curses.rst:1736 ../../library/curses.rst:1828 msgid "Meaning" msgstr "含義" -#: ../../library/curses.rst:1401 +#: ../../library/curses.rst:1447 msgid "Alternate character set mode" msgstr "" -#: ../../library/curses.rst:1403 +#: ../../library/curses.rst:1449 msgid "Blink mode" msgstr "" -#: ../../library/curses.rst:1405 +#: ../../library/curses.rst:1451 msgid "Bold mode" msgstr "" -#: ../../library/curses.rst:1407 +#: ../../library/curses.rst:1453 msgid "Dim mode" msgstr "" -#: ../../library/curses.rst:1409 +#: ../../library/curses.rst:1455 msgid "Invisible or blank mode" msgstr "" -#: ../../library/curses.rst:1411 +#: ../../library/curses.rst:1457 msgid "Italic mode" msgstr "" -#: ../../library/curses.rst:1413 +#: ../../library/curses.rst:1459 msgid "Normal attribute" msgstr "" -#: ../../library/curses.rst:1415 +#: ../../library/curses.rst:1461 msgid "Protected mode" msgstr "" -#: ../../library/curses.rst:1417 +#: ../../library/curses.rst:1463 msgid "Reverse background and foreground colors" msgstr "" -#: ../../library/curses.rst:1420 +#: ../../library/curses.rst:1466 msgid "Standout mode" msgstr "" -#: ../../library/curses.rst:1422 +#: ../../library/curses.rst:1468 msgid "Underline mode" msgstr "" -#: ../../library/curses.rst:1424 +#: ../../library/curses.rst:1470 msgid "Horizontal highlight" msgstr "" -#: ../../library/curses.rst:1426 +#: ../../library/curses.rst:1472 msgid "Left highlight" msgstr "" -#: ../../library/curses.rst:1428 +#: ../../library/curses.rst:1474 msgid "Low highlight" msgstr "" -#: ../../library/curses.rst:1430 +#: ../../library/curses.rst:1476 msgid "Right highlight" msgstr "" -#: ../../library/curses.rst:1432 +#: ../../library/curses.rst:1478 msgid "Top highlight" msgstr "" -#: ../../library/curses.rst:1434 +#: ../../library/curses.rst:1480 msgid "Vertical highlight" msgstr "" -#: ../../library/curses.rst:1437 +#: ../../library/curses.rst:1483 msgid "``A_ITALIC`` was added." msgstr "新增 ``A_ITALIC``。" -#: ../../library/curses.rst:1440 +#: ../../library/curses.rst:1486 msgid "" "Several constants are available to extract corresponding attributes returned " "by some methods." msgstr "" -#: ../../library/curses.rst:1444 +#: ../../library/curses.rst:1490 msgid "Bit-mask" msgstr "" -#: ../../library/curses.rst:1446 +#: ../../library/curses.rst:1492 msgid "Bit-mask to extract attributes" msgstr "" -#: ../../library/curses.rst:1449 +#: ../../library/curses.rst:1495 msgid "Bit-mask to extract a character" msgstr "" -#: ../../library/curses.rst:1452 +#: ../../library/curses.rst:1498 msgid "Bit-mask to extract color-pair field information" msgstr "" -#: ../../library/curses.rst:1456 +#: ../../library/curses.rst:1502 msgid "" "Keys are referred to by integer constants with names starting with " "``KEY_``. The exact keycaps available are system dependent." msgstr "" -#: ../../library/curses.rst:1462 +#: ../../library/curses.rst:1508 msgid "Key constant" msgstr "" -#: ../../library/curses.rst:1462 +#: ../../library/curses.rst:1508 msgid "Key" msgstr "" -#: ../../library/curses.rst:1464 +#: ../../library/curses.rst:1510 msgid "Minimum key value" msgstr "" -#: ../../library/curses.rst:1466 +#: ../../library/curses.rst:1512 msgid "Break key (unreliable)" msgstr "" -#: ../../library/curses.rst:1468 +#: ../../library/curses.rst:1514 msgid "Down-arrow" msgstr "" -#: ../../library/curses.rst:1470 +#: ../../library/curses.rst:1516 msgid "Up-arrow" msgstr "" -#: ../../library/curses.rst:1472 +#: ../../library/curses.rst:1518 msgid "Left-arrow" msgstr "" -#: ../../library/curses.rst:1474 +#: ../../library/curses.rst:1520 msgid "Right-arrow" msgstr "" -#: ../../library/curses.rst:1476 +#: ../../library/curses.rst:1522 msgid "Home key (upward+left arrow)" msgstr "" -#: ../../library/curses.rst:1478 +#: ../../library/curses.rst:1524 msgid "Backspace (unreliable)" msgstr "" -#: ../../library/curses.rst:1480 +#: ../../library/curses.rst:1526 msgid "Function keys. Up to 64 function keys are supported." msgstr "" -#: ../../library/curses.rst:1483 +#: ../../library/curses.rst:1529 msgid "Value of function key *n*" msgstr "" -#: ../../library/curses.rst:1485 +#: ../../library/curses.rst:1531 msgid "Delete line" msgstr "" -#: ../../library/curses.rst:1487 +#: ../../library/curses.rst:1533 msgid "Insert line" msgstr "" -#: ../../library/curses.rst:1489 +#: ../../library/curses.rst:1535 msgid "Delete character" msgstr "" -#: ../../library/curses.rst:1491 +#: ../../library/curses.rst:1537 msgid "Insert char or enter insert mode" msgstr "" -#: ../../library/curses.rst:1493 +#: ../../library/curses.rst:1539 msgid "Exit insert char mode" msgstr "" -#: ../../library/curses.rst:1495 +#: ../../library/curses.rst:1541 msgid "Clear screen" msgstr "" -#: ../../library/curses.rst:1497 +#: ../../library/curses.rst:1543 msgid "Clear to end of screen" msgstr "" -#: ../../library/curses.rst:1499 +#: ../../library/curses.rst:1545 msgid "Clear to end of line" msgstr "" -#: ../../library/curses.rst:1501 +#: ../../library/curses.rst:1547 msgid "Scroll 1 line forward" msgstr "" -#: ../../library/curses.rst:1503 +#: ../../library/curses.rst:1549 msgid "Scroll 1 line backward (reverse)" msgstr "" -#: ../../library/curses.rst:1505 +#: ../../library/curses.rst:1551 msgid "Next page" msgstr "" -#: ../../library/curses.rst:1507 +#: ../../library/curses.rst:1553 msgid "Previous page" msgstr "" -#: ../../library/curses.rst:1509 +#: ../../library/curses.rst:1555 msgid "Set tab" msgstr "" -#: ../../library/curses.rst:1511 +#: ../../library/curses.rst:1557 msgid "Clear tab" msgstr "" -#: ../../library/curses.rst:1513 +#: ../../library/curses.rst:1559 msgid "Clear all tabs" msgstr "" -#: ../../library/curses.rst:1515 +#: ../../library/curses.rst:1561 msgid "Enter or send (unreliable)" msgstr "" -#: ../../library/curses.rst:1517 +#: ../../library/curses.rst:1563 msgid "Soft (partial) reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1519 +#: ../../library/curses.rst:1565 msgid "Reset or hard reset (unreliable)" msgstr "" -#: ../../library/curses.rst:1521 +#: ../../library/curses.rst:1567 msgid "Print" msgstr "" -#: ../../library/curses.rst:1523 +#: ../../library/curses.rst:1569 msgid "Home down or bottom (lower left)" msgstr "" -#: ../../library/curses.rst:1525 +#: ../../library/curses.rst:1571 msgid "Upper left of keypad" msgstr "" -#: ../../library/curses.rst:1527 +#: ../../library/curses.rst:1573 msgid "Upper right of keypad" msgstr "" -#: ../../library/curses.rst:1529 +#: ../../library/curses.rst:1575 msgid "Center of keypad" msgstr "" -#: ../../library/curses.rst:1531 +#: ../../library/curses.rst:1577 msgid "Lower left of keypad" msgstr "" -#: ../../library/curses.rst:1533 +#: ../../library/curses.rst:1579 msgid "Lower right of keypad" msgstr "" -#: ../../library/curses.rst:1535 +#: ../../library/curses.rst:1581 msgid "Back tab" msgstr "" -#: ../../library/curses.rst:1537 +#: ../../library/curses.rst:1583 msgid "Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1539 +#: ../../library/curses.rst:1585 msgid "Cancel" msgstr "" -#: ../../library/curses.rst:1541 +#: ../../library/curses.rst:1587 msgid "Close" msgstr "" -#: ../../library/curses.rst:1543 +#: ../../library/curses.rst:1589 msgid "Cmd (command)" msgstr "" -#: ../../library/curses.rst:1545 +#: ../../library/curses.rst:1591 msgid "Copy" msgstr "" -#: ../../library/curses.rst:1547 +#: ../../library/curses.rst:1593 msgid "Create" msgstr "" -#: ../../library/curses.rst:1549 +#: ../../library/curses.rst:1595 msgid "End" msgstr "" -#: ../../library/curses.rst:1551 +#: ../../library/curses.rst:1597 msgid "Exit" msgstr "" -#: ../../library/curses.rst:1553 +#: ../../library/curses.rst:1599 msgid "Find" msgstr "" -#: ../../library/curses.rst:1555 +#: ../../library/curses.rst:1601 msgid "Help" msgstr "" -#: ../../library/curses.rst:1557 +#: ../../library/curses.rst:1603 msgid "Mark" msgstr "" -#: ../../library/curses.rst:1559 +#: ../../library/curses.rst:1605 msgid "Message" msgstr "" -#: ../../library/curses.rst:1561 +#: ../../library/curses.rst:1607 msgid "Move" msgstr "" -#: ../../library/curses.rst:1563 +#: ../../library/curses.rst:1609 msgid "Next" msgstr "" -#: ../../library/curses.rst:1565 +#: ../../library/curses.rst:1611 msgid "Open" msgstr "" -#: ../../library/curses.rst:1567 +#: ../../library/curses.rst:1613 msgid "Options" msgstr "" -#: ../../library/curses.rst:1569 +#: ../../library/curses.rst:1615 msgid "Prev (previous)" msgstr "" -#: ../../library/curses.rst:1571 +#: ../../library/curses.rst:1617 msgid "Redo" msgstr "" -#: ../../library/curses.rst:1573 +#: ../../library/curses.rst:1619 msgid "Ref (reference)" msgstr "" -#: ../../library/curses.rst:1575 +#: ../../library/curses.rst:1621 msgid "Refresh" msgstr "" -#: ../../library/curses.rst:1577 +#: ../../library/curses.rst:1623 msgid "Replace" msgstr "" -#: ../../library/curses.rst:1579 +#: ../../library/curses.rst:1625 msgid "Restart" msgstr "" -#: ../../library/curses.rst:1581 +#: ../../library/curses.rst:1627 msgid "Resume" msgstr "" -#: ../../library/curses.rst:1583 +#: ../../library/curses.rst:1629 msgid "Save" msgstr "" -#: ../../library/curses.rst:1585 +#: ../../library/curses.rst:1631 msgid "Shifted Beg (beginning)" msgstr "" -#: ../../library/curses.rst:1587 +#: ../../library/curses.rst:1633 msgid "Shifted Cancel" msgstr "" -#: ../../library/curses.rst:1589 +#: ../../library/curses.rst:1635 msgid "Shifted Command" msgstr "" -#: ../../library/curses.rst:1591 +#: ../../library/curses.rst:1637 msgid "Shifted Copy" msgstr "" -#: ../../library/curses.rst:1593 +#: ../../library/curses.rst:1639 msgid "Shifted Create" msgstr "" -#: ../../library/curses.rst:1595 +#: ../../library/curses.rst:1641 msgid "Shifted Delete char" msgstr "" -#: ../../library/curses.rst:1597 +#: ../../library/curses.rst:1643 msgid "Shifted Delete line" msgstr "" -#: ../../library/curses.rst:1599 +#: ../../library/curses.rst:1645 msgid "Select" msgstr "" -#: ../../library/curses.rst:1601 +#: ../../library/curses.rst:1647 msgid "Shifted End" msgstr "" -#: ../../library/curses.rst:1603 +#: ../../library/curses.rst:1649 msgid "Shifted Clear line" msgstr "" -#: ../../library/curses.rst:1605 +#: ../../library/curses.rst:1651 msgid "Shifted Exit" msgstr "" -#: ../../library/curses.rst:1607 +#: ../../library/curses.rst:1653 msgid "Shifted Find" msgstr "" -#: ../../library/curses.rst:1609 +#: ../../library/curses.rst:1655 msgid "Shifted Help" msgstr "" -#: ../../library/curses.rst:1611 +#: ../../library/curses.rst:1657 msgid "Shifted Home" msgstr "" -#: ../../library/curses.rst:1613 +#: ../../library/curses.rst:1659 msgid "Shifted Input" msgstr "" -#: ../../library/curses.rst:1615 +#: ../../library/curses.rst:1661 msgid "Shifted Left arrow" msgstr "" -#: ../../library/curses.rst:1617 +#: ../../library/curses.rst:1663 msgid "Shifted Message" msgstr "" -#: ../../library/curses.rst:1619 +#: ../../library/curses.rst:1665 msgid "Shifted Move" msgstr "" -#: ../../library/curses.rst:1621 +#: ../../library/curses.rst:1667 msgid "Shifted Next" msgstr "" -#: ../../library/curses.rst:1623 +#: ../../library/curses.rst:1669 msgid "Shifted Options" msgstr "" -#: ../../library/curses.rst:1625 +#: ../../library/curses.rst:1671 msgid "Shifted Prev" msgstr "" -#: ../../library/curses.rst:1627 +#: ../../library/curses.rst:1673 msgid "Shifted Print" msgstr "" -#: ../../library/curses.rst:1629 +#: ../../library/curses.rst:1675 msgid "Shifted Redo" msgstr "" -#: ../../library/curses.rst:1631 +#: ../../library/curses.rst:1677 msgid "Shifted Replace" msgstr "" -#: ../../library/curses.rst:1633 +#: ../../library/curses.rst:1679 msgid "Shifted Right arrow" msgstr "" -#: ../../library/curses.rst:1635 +#: ../../library/curses.rst:1681 msgid "Shifted Resume" msgstr "" -#: ../../library/curses.rst:1637 +#: ../../library/curses.rst:1683 msgid "Shifted Save" msgstr "" -#: ../../library/curses.rst:1639 +#: ../../library/curses.rst:1685 msgid "Shifted Suspend" msgstr "" -#: ../../library/curses.rst:1641 +#: ../../library/curses.rst:1687 msgid "Shifted Undo" msgstr "" -#: ../../library/curses.rst:1643 +#: ../../library/curses.rst:1689 msgid "Suspend" msgstr "" -#: ../../library/curses.rst:1645 +#: ../../library/curses.rst:1691 msgid "Undo" msgstr "" -#: ../../library/curses.rst:1647 +#: ../../library/curses.rst:1693 msgid "Mouse event has occurred" msgstr "" -#: ../../library/curses.rst:1649 +#: ../../library/curses.rst:1695 msgid "Terminal resize event" msgstr "" -#: ../../library/curses.rst:1651 +#: ../../library/curses.rst:1697 msgid "Maximum key value" msgstr "" -#: ../../library/curses.rst:1654 +#: ../../library/curses.rst:1700 msgid "" "On VT100s and their software emulations, such as X terminal emulators, there " "are normally at least four function keys (:const:`KEY_F1 `, :const:" @@ -2062,64 +2126,64 @@ msgid "" "keypad mappings are standard:" msgstr "" -#: ../../library/curses.rst:1663 +#: ../../library/curses.rst:1709 msgid "Keycap" msgstr "" -#: ../../library/curses.rst:1663 ../../library/curses.rst:1808 -#: ../../library/curses.rst:1932 +#: ../../library/curses.rst:1709 ../../library/curses.rst:1854 +#: ../../library/curses.rst:1983 msgid "Constant" msgstr "" -#: ../../library/curses.rst:1665 +#: ../../library/curses.rst:1711 msgid ":kbd:`Insert`" msgstr ":kbd:`Insert`" -#: ../../library/curses.rst:1665 +#: ../../library/curses.rst:1711 msgid "KEY_IC" msgstr "KEY_IC" -#: ../../library/curses.rst:1667 +#: ../../library/curses.rst:1713 msgid ":kbd:`Delete`" msgstr ":kbd:`Delete`" -#: ../../library/curses.rst:1667 +#: ../../library/curses.rst:1713 msgid "KEY_DC" msgstr "KEY_DC" -#: ../../library/curses.rst:1669 +#: ../../library/curses.rst:1715 msgid ":kbd:`Home`" msgstr ":kbd:`Home`" -#: ../../library/curses.rst:1669 +#: ../../library/curses.rst:1715 msgid "KEY_HOME" msgstr "KEY_HOME" -#: ../../library/curses.rst:1671 +#: ../../library/curses.rst:1717 msgid ":kbd:`End`" msgstr ":kbd:`End`" -#: ../../library/curses.rst:1671 +#: ../../library/curses.rst:1717 msgid "KEY_END" msgstr "KEY_END" -#: ../../library/curses.rst:1673 +#: ../../library/curses.rst:1719 msgid ":kbd:`Page Up`" msgstr ":kbd:`Page Up`" -#: ../../library/curses.rst:1673 +#: ../../library/curses.rst:1719 msgid "KEY_PPAGE" msgstr "KEY_PPAGE" -#: ../../library/curses.rst:1675 +#: ../../library/curses.rst:1721 msgid ":kbd:`Page Down`" msgstr ":kbd:`Page Down`" -#: ../../library/curses.rst:1675 +#: ../../library/curses.rst:1721 msgid "KEY_NPAGE" msgstr "KEY_NPAGE" -#: ../../library/curses.rst:1680 +#: ../../library/curses.rst:1726 msgid "" "The following table lists characters from the alternate character set. These " "are inherited from the VT100 terminal, and will generally be available on " @@ -2127,268 +2191,273 @@ msgid "" "available, curses falls back on a crude printable ASCII approximation." msgstr "" -#: ../../library/curses.rst:1687 +#: ../../library/curses.rst:1733 msgid "These are available only after :func:`initscr` has been called." msgstr "" -#: ../../library/curses.rst:1690 +#: ../../library/curses.rst:1736 msgid "ACS code" msgstr "" -#: ../../library/curses.rst:1692 -msgid "alternate name for upper right corner" +#: ../../library/curses.rst:1738 +msgid "alternate name for upper-right corner" msgstr "" -#: ../../library/curses.rst:1694 +#: ../../library/curses.rst:1740 msgid "solid square block" msgstr "" -#: ../../library/curses.rst:1696 +#: ../../library/curses.rst:1742 msgid "board of squares" msgstr "" -#: ../../library/curses.rst:1698 +#: ../../library/curses.rst:1744 msgid "alternate name for horizontal line" msgstr "" -#: ../../library/curses.rst:1700 -msgid "alternate name for upper left corner" -msgstr "" +#: ../../library/curses.rst:1746 +#, fuzzy +msgid "alternate name for upper-left corner" +msgstr "回傳左上角的座標 ``(y, x)``。" -#: ../../library/curses.rst:1702 +#: ../../library/curses.rst:1748 msgid "alternate name for top tee" msgstr "" -#: ../../library/curses.rst:1704 +#: ../../library/curses.rst:1750 msgid "bottom tee" msgstr "" -#: ../../library/curses.rst:1706 +#: ../../library/curses.rst:1752 msgid "bullet" msgstr "" -#: ../../library/curses.rst:1708 +#: ../../library/curses.rst:1754 msgid "checker board (stipple)" msgstr "" -#: ../../library/curses.rst:1710 +#: ../../library/curses.rst:1756 msgid "arrow pointing down" msgstr "" -#: ../../library/curses.rst:1712 +#: ../../library/curses.rst:1758 msgid "degree symbol" msgstr "" -#: ../../library/curses.rst:1714 +#: ../../library/curses.rst:1760 msgid "diamond" msgstr "" -#: ../../library/curses.rst:1716 +#: ../../library/curses.rst:1762 msgid "greater-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1718 +#: ../../library/curses.rst:1764 msgid "horizontal line" msgstr "" -#: ../../library/curses.rst:1720 +#: ../../library/curses.rst:1766 msgid "lantern symbol" msgstr "" -#: ../../library/curses.rst:1722 +#: ../../library/curses.rst:1768 msgid "left arrow" msgstr "" -#: ../../library/curses.rst:1724 +#: ../../library/curses.rst:1770 msgid "less-than-or-equal-to" msgstr "" -#: ../../library/curses.rst:1726 -msgid "lower left-hand corner" +#: ../../library/curses.rst:1772 +msgid "lower-left corner" msgstr "" -#: ../../library/curses.rst:1728 -msgid "lower right-hand corner" +#: ../../library/curses.rst:1774 +msgid "lower-right corner" msgstr "" -#: ../../library/curses.rst:1730 +#: ../../library/curses.rst:1776 msgid "left tee" msgstr "" -#: ../../library/curses.rst:1732 +#: ../../library/curses.rst:1778 msgid "not-equal sign" msgstr "" -#: ../../library/curses.rst:1734 +#: ../../library/curses.rst:1780 msgid "letter pi" msgstr "" -#: ../../library/curses.rst:1736 +#: ../../library/curses.rst:1782 msgid "plus-or-minus sign" msgstr "" -#: ../../library/curses.rst:1738 +#: ../../library/curses.rst:1784 msgid "big plus sign" msgstr "" -#: ../../library/curses.rst:1740 +#: ../../library/curses.rst:1786 msgid "right arrow" msgstr "" -#: ../../library/curses.rst:1742 +#: ../../library/curses.rst:1788 msgid "right tee" msgstr "" -#: ../../library/curses.rst:1744 +#: ../../library/curses.rst:1790 msgid "scan line 1" msgstr "" -#: ../../library/curses.rst:1746 +#: ../../library/curses.rst:1792 msgid "scan line 3" msgstr "" -#: ../../library/curses.rst:1748 +#: ../../library/curses.rst:1794 msgid "scan line 7" msgstr "" -#: ../../library/curses.rst:1750 +#: ../../library/curses.rst:1796 msgid "scan line 9" msgstr "" -#: ../../library/curses.rst:1752 -msgid "alternate name for lower right corner" +#: ../../library/curses.rst:1798 +msgid "alternate name for lower-right corner" msgstr "" -#: ../../library/curses.rst:1754 +#: ../../library/curses.rst:1800 msgid "alternate name for vertical line" msgstr "" -#: ../../library/curses.rst:1756 +#: ../../library/curses.rst:1802 msgid "alternate name for right tee" msgstr "" -#: ../../library/curses.rst:1758 -msgid "alternate name for lower left corner" +#: ../../library/curses.rst:1804 +msgid "alternate name for lower-left corner" msgstr "" -#: ../../library/curses.rst:1760 +#: ../../library/curses.rst:1806 msgid "alternate name for bottom tee" msgstr "" -#: ../../library/curses.rst:1762 +#: ../../library/curses.rst:1808 msgid "alternate name for left tee" msgstr "" -#: ../../library/curses.rst:1764 +#: ../../library/curses.rst:1810 msgid "alternate name for crossover or big plus" msgstr "" -#: ../../library/curses.rst:1766 +#: ../../library/curses.rst:1812 msgid "pound sterling" msgstr "" -#: ../../library/curses.rst:1768 +#: ../../library/curses.rst:1814 msgid "top tee" msgstr "" -#: ../../library/curses.rst:1770 +#: ../../library/curses.rst:1816 msgid "up arrow" msgstr "" -#: ../../library/curses.rst:1772 -msgid "upper left corner" +#: ../../library/curses.rst:1818 +msgid "upper-left corner" msgstr "" -#: ../../library/curses.rst:1774 -msgid "upper right corner" +#: ../../library/curses.rst:1820 +msgid "upper-right corner" msgstr "" -#: ../../library/curses.rst:1776 +#: ../../library/curses.rst:1822 msgid "vertical line" msgstr "" -#: ../../library/curses.rst:1779 +#: ../../library/curses.rst:1825 msgid "" "The following table lists mouse button constants used by :meth:`getmouse`:" msgstr "" -#: ../../library/curses.rst:1782 +#: ../../library/curses.rst:1828 msgid "Mouse button constant" msgstr "" -#: ../../library/curses.rst:1784 +#: ../../library/curses.rst:1830 msgid "Mouse button *n* pressed" msgstr "" -#: ../../library/curses.rst:1786 +#: ../../library/curses.rst:1832 msgid "Mouse button *n* released" msgstr "" -#: ../../library/curses.rst:1788 +#: ../../library/curses.rst:1834 msgid "Mouse button *n* clicked" msgstr "" -#: ../../library/curses.rst:1790 +#: ../../library/curses.rst:1836 msgid "Mouse button *n* double clicked" msgstr "" -#: ../../library/curses.rst:1792 +#: ../../library/curses.rst:1838 msgid "Mouse button *n* triple clicked" msgstr "" -#: ../../library/curses.rst:1794 +#: ../../library/curses.rst:1840 msgid "Shift was down during button state change" msgstr "" -#: ../../library/curses.rst:1796 ../../library/curses.rst:1798 +#: ../../library/curses.rst:1842 msgid "Control was down during button state change" msgstr "" -#: ../../library/curses.rst:1805 +#: ../../library/curses.rst:1844 +msgid "Alt was down during button state change" +msgstr "" + +#: ../../library/curses.rst:1851 msgid "The following table lists the predefined colors:" msgstr "" -#: ../../library/curses.rst:1808 +#: ../../library/curses.rst:1854 msgid "Color" msgstr "顏色" -#: ../../library/curses.rst:1810 +#: ../../library/curses.rst:1856 msgid "Black" msgstr "黑" -#: ../../library/curses.rst:1812 +#: ../../library/curses.rst:1858 msgid "Blue" msgstr "藍" -#: ../../library/curses.rst:1814 +#: ../../library/curses.rst:1860 msgid "Cyan (light greenish blue)" msgstr "" -#: ../../library/curses.rst:1816 +#: ../../library/curses.rst:1862 msgid "Green" msgstr "綠" -#: ../../library/curses.rst:1818 +#: ../../library/curses.rst:1864 msgid "Magenta (purplish red)" msgstr "" -#: ../../library/curses.rst:1820 +#: ../../library/curses.rst:1866 msgid "Red" msgstr "紅" -#: ../../library/curses.rst:1822 +#: ../../library/curses.rst:1868 msgid "White" msgstr "白" -#: ../../library/curses.rst:1824 +#: ../../library/curses.rst:1870 msgid "Yellow" msgstr "" -#: ../../library/curses.rst:1829 +#: ../../library/curses.rst:1875 msgid ":mod:`!curses.textpad` --- Text input widget for curses programs" msgstr "" -#: ../../library/curses.rst:1837 +#: ../../library/curses.rst:1883 msgid "" "The :mod:`!curses.textpad` module provides a :class:`Textbox` class that " "handles elementary text editing in a curses window, supporting a set of " @@ -2398,215 +2467,220 @@ msgid "" "purposes." msgstr "" -#: ../../library/curses.rst:1843 +#: ../../library/curses.rst:1889 msgid "The module :mod:`!curses.textpad` defines the following function:" msgstr ":mod:`!curses.textpad` 模組定義了以下函式:" -#: ../../library/curses.rst:1848 +#: ../../library/curses.rst:1894 msgid "" "Draw a rectangle. The first argument must be a window object; the remaining " "arguments are coordinates relative to that window. The second and third " -"arguments are the y and x coordinates of the upper left hand corner of the " +"arguments are the y and x coordinates of the upper-left corner of the " "rectangle to be drawn; the fourth and fifth arguments are the y and x " -"coordinates of the lower right hand corner. The rectangle will be drawn " -"using VT100/IBM PC forms characters on terminals that make this possible " +"coordinates of the lower-right corner. The rectangle will be drawn using " +"VT100/IBM PC forms characters on terminals that make this possible " "(including xterm and most other software terminal emulators). Otherwise it " "will be drawn with ASCII dashes, vertical bars, and plus signs." msgstr "" -#: ../../library/curses.rst:1861 +#: ../../library/curses.rst:1907 msgid "Textbox objects" msgstr "" -#: ../../library/curses.rst:1863 +#: ../../library/curses.rst:1909 msgid "You can instantiate a :class:`Textbox` object as follows:" msgstr "" -#: ../../library/curses.rst:1868 +#: ../../library/curses.rst:1914 msgid "" "Return a textbox widget object. The *win* argument should be a curses :ref:" "`window ` object in which the textbox is to be " -"contained. The edit cursor of the textbox is initially located at the upper " -"left hand corner of the containing window, with coordinates ``(0, 0)``. The " -"instance's :attr:`stripspaces` flag is initially on." +"contained. If *insert_mode* is true, the textbox inserts typed characters, " +"shifting existing text to the right, rather than overwriting it. The edit " +"cursor of the textbox is initially located at the upper-left corner of the " +"containing window, with coordinates ``(0, 0)``. The instance's :attr:" +"`stripspaces` flag is initially on." msgstr "" -#: ../../library/curses.rst:1874 +#: ../../library/curses.rst:1922 msgid ":class:`Textbox` objects have the following methods:" msgstr "" -#: ../../library/curses.rst:1879 +#: ../../library/curses.rst:1927 msgid "" "This is the entry point you will normally use. It accepts editing " "keystrokes until one of the termination keystrokes is entered. If " -"*validator* is supplied, it must be a function. It will be called for each " +"*validate* is supplied, it must be a function. It will be called for each " "keystroke entered with the keystroke as a parameter; command dispatch is " -"done on the result. This method returns the window contents as a string; " -"whether blanks in the window are included is affected by the :attr:" -"`stripspaces` attribute." +"done on the result. If it returns a false value, the keystroke is ignored. " +"This method returns the window contents as a string; whether blanks in the " +"window are included is affected by the :attr:`stripspaces` attribute." msgstr "" -#: ../../library/curses.rst:1890 +#: ../../library/curses.rst:1939 msgid "" -"Process a single command keystroke. Here are the supported special " -"keystrokes:" +"Process a single command keystroke. Returns ``1`` to continue editing, or " +"``0`` if a termination keystroke was processed. Here are the supported " +"special keystrokes:" msgstr "" -#: ../../library/curses.rst:1894 ../../library/curses.rst:1932 +#: ../../library/curses.rst:1944 ../../library/curses.rst:1983 msgid "Keystroke" msgstr "" -#: ../../library/curses.rst:1894 +#: ../../library/curses.rst:1944 msgid "Action" msgstr "" -#: ../../library/curses.rst:1896 +#: ../../library/curses.rst:1946 msgid ":kbd:`Control-A`" msgstr ":kbd:`Control-A`" -#: ../../library/curses.rst:1896 +#: ../../library/curses.rst:1946 msgid "Go to left edge of window." msgstr "" -#: ../../library/curses.rst:1898 ../../library/curses.rst:1934 +#: ../../library/curses.rst:1948 ../../library/curses.rst:1985 msgid ":kbd:`Control-B`" msgstr ":kbd:`Control-B`" -#: ../../library/curses.rst:1898 +#: ../../library/curses.rst:1948 msgid "Cursor left, wrapping to previous line if appropriate." msgstr "" -#: ../../library/curses.rst:1901 +#: ../../library/curses.rst:1951 msgid ":kbd:`Control-D`" msgstr ":kbd:`Control-D`" -#: ../../library/curses.rst:1901 +#: ../../library/curses.rst:1951 msgid "Delete character under cursor." msgstr "" -#: ../../library/curses.rst:1903 +#: ../../library/curses.rst:1953 msgid ":kbd:`Control-E`" msgstr ":kbd:`Control-E`" -#: ../../library/curses.rst:1903 +#: ../../library/curses.rst:1953 msgid "Go to right edge (stripspaces off) or end of line (stripspaces on)." msgstr "" -#: ../../library/curses.rst:1906 ../../library/curses.rst:1936 +#: ../../library/curses.rst:1956 ../../library/curses.rst:1987 msgid ":kbd:`Control-F`" msgstr ":kbd:`Control-F`" -#: ../../library/curses.rst:1906 +#: ../../library/curses.rst:1956 msgid "Cursor right, wrapping to next line when appropriate." msgstr "" -#: ../../library/curses.rst:1909 +#: ../../library/curses.rst:1959 msgid ":kbd:`Control-G`" msgstr ":kbd:`Control-G`" -#: ../../library/curses.rst:1909 +#: ../../library/curses.rst:1959 msgid "Terminate, returning the window contents." msgstr "" -#: ../../library/curses.rst:1911 +#: ../../library/curses.rst:1961 msgid ":kbd:`Control-H`" msgstr ":kbd:`Control-H`" -#: ../../library/curses.rst:1911 +#: ../../library/curses.rst:1961 msgid "Delete character backward." msgstr "" -#: ../../library/curses.rst:1913 +#: ../../library/curses.rst:1963 msgid ":kbd:`Control-J`" msgstr ":kbd:`Control-J`" -#: ../../library/curses.rst:1913 -msgid "Terminate if the window is 1 line, otherwise insert newline." +#: ../../library/curses.rst:1963 +msgid "" +"Terminate if the window is 1 line, otherwise move to the start of the next " +"line." msgstr "" -#: ../../library/curses.rst:1916 +#: ../../library/curses.rst:1967 msgid ":kbd:`Control-K`" msgstr ":kbd:`Control-K`" -#: ../../library/curses.rst:1916 +#: ../../library/curses.rst:1967 msgid "If line is blank, delete it, otherwise clear to end of line." msgstr "" -#: ../../library/curses.rst:1919 +#: ../../library/curses.rst:1970 msgid ":kbd:`Control-L`" msgstr ":kbd:`Control-L`" -#: ../../library/curses.rst:1919 +#: ../../library/curses.rst:1970 msgid "Refresh screen." msgstr "" -#: ../../library/curses.rst:1921 ../../library/curses.rst:1940 +#: ../../library/curses.rst:1972 ../../library/curses.rst:1991 msgid ":kbd:`Control-N`" msgstr ":kbd:`Control-N`" -#: ../../library/curses.rst:1921 +#: ../../library/curses.rst:1972 msgid "Cursor down; move down one line." msgstr "" -#: ../../library/curses.rst:1923 +#: ../../library/curses.rst:1974 msgid ":kbd:`Control-O`" msgstr ":kbd:`Control-O`" -#: ../../library/curses.rst:1923 +#: ../../library/curses.rst:1974 msgid "Insert a blank line at cursor location." msgstr "" -#: ../../library/curses.rst:1925 ../../library/curses.rst:1938 +#: ../../library/curses.rst:1976 ../../library/curses.rst:1989 msgid ":kbd:`Control-P`" msgstr ":kbd:`Control-P`" -#: ../../library/curses.rst:1925 +#: ../../library/curses.rst:1976 msgid "Cursor up; move up one line." msgstr "" -#: ../../library/curses.rst:1928 +#: ../../library/curses.rst:1979 msgid "" "Move operations do nothing if the cursor is at an edge where the movement is " "not possible. The following synonyms are supported where possible:" msgstr "" -#: ../../library/curses.rst:1934 +#: ../../library/curses.rst:1985 msgid ":const:`~curses.KEY_LEFT`" msgstr ":const:`~curses.KEY_LEFT`" -#: ../../library/curses.rst:1936 +#: ../../library/curses.rst:1987 msgid ":const:`~curses.KEY_RIGHT`" msgstr ":const:`~curses.KEY_RIGHT`" -#: ../../library/curses.rst:1938 +#: ../../library/curses.rst:1989 msgid ":const:`~curses.KEY_UP`" msgstr ":const:`~curses.KEY_UP`" -#: ../../library/curses.rst:1940 +#: ../../library/curses.rst:1991 msgid ":const:`~curses.KEY_DOWN`" msgstr ":const:`~curses.KEY_DOWN`" -#: ../../library/curses.rst:1942 +#: ../../library/curses.rst:1993 msgid ":const:`~curses.KEY_BACKSPACE`" msgstr ":const:`~curses.KEY_BACKSPACE`" -#: ../../library/curses.rst:1942 +#: ../../library/curses.rst:1993 msgid ":kbd:`Control-h`" msgstr ":kbd:`Control-h`" -#: ../../library/curses.rst:1945 +#: ../../library/curses.rst:1996 msgid "" "All other keystrokes are treated as a command to insert the given character " "and move right (with line wrapping)." msgstr "" -#: ../../library/curses.rst:1951 +#: ../../library/curses.rst:2002 msgid "" "Return the window contents as a string; whether blanks in the window are " "included is affected by the :attr:`stripspaces` member." msgstr "" -#: ../../library/curses.rst:1957 +#: ../../library/curses.rst:2008 msgid "" "This attribute is a flag which controls the interpretation of blanks in the " "window. When it is on, trailing blanks on each line are ignored; any cursor " diff --git a/library/dataclasses.po b/library/dataclasses.po index 25a63d685c..dcfc903aa6 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-05-14 00:37+0000\n" +"POT-Creation-Date: 2026-06-12 00:46+0000\n" "PO-Revision-Date: 2023-02-11 15:02+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -207,22 +207,44 @@ msgid "" msgstr "如果該類別已經定義了 :meth:`!__repr__`,則此參數會被忽略。" #: ../../library/dataclasses.rst:105 -#, fuzzy msgid "" "*eq*: If true (the default), an :meth:`~object.__eq__` method will be " -"generated. This method compares the class as if it were a tuple of its " -"fields, in order. Both instances in the comparison must be of the identical " -"type." -msgstr "" -"*eq*:如果為真(預設值),將生成一個 :meth:`~object.__eq__` 方法。此方法按順" -"序比較類別,就好像它是其欄位的元組一樣。比較中的兩個實例必須屬於同一型別。" +"generated." +msgstr "*eq*:如果為真(預設值),將生成一個 :meth:`~object.__eq__` 方法。" + +#: ../../library/dataclasses.rst:108 +msgid "" +"This method compares the class by comparing each field in order. Both " +"instances in the comparison must be of the identical type." +msgstr "此方法按順序比較每個欄位來比較類別。比較中的兩個實例必須屬於同一型別。" -#: ../../library/dataclasses.rst:110 +#: ../../library/dataclasses.rst:111 msgid "" "If the class already defines :meth:`!__eq__`, this parameter is ignored." msgstr "如果該類別已經定義了 :meth:`!__eq__`,則此參數會被忽略。" #: ../../library/dataclasses.rst:113 +msgid "" +"The generated ``__eq__`` method now compares each field individually (for " +"example, ``self.a == other.a and self.b == other.b``), rather than comparing " +"tuples of fields as in previous versions." +msgstr "" + +#: ../../library/dataclasses.rst:118 +msgid "" +"This change makes the comparison faster but it may alter results in cases " +"where attributes compare equal by identity but not by value (such as " +"``float('nan')``)." +msgstr "" + +#: ../../library/dataclasses.rst:122 +msgid "" +"In Python 3.12 and earlier, the comparison was performed by creating tuples " +"of the fields and comparing them (for example, ``(self.a, self.b) == (other." +"a, other.b)``)." +msgstr "" + +#: ../../library/dataclasses.rst:126 #, fuzzy msgid "" "*order*: If true (the default is ``False``), :meth:`~object.__lt__`, :meth:" @@ -236,7 +258,7 @@ msgstr "" "生。它們按順序比較類別,就好像它是其欄位的元組一樣。比較中的兩個實例必須屬於" "同一型別。如果 *order* 為真且 *eq* 為假,則會引發 :exc:`ValueError`。" -#: ../../library/dataclasses.rst:120 +#: ../../library/dataclasses.rst:133 msgid "" "If the class already defines any of :meth:`!__lt__`, :meth:`!__le__`, :meth:" "`!__gt__`, or :meth:`!__ge__`, then :exc:`TypeError` is raised." @@ -244,7 +266,7 @@ msgstr "" "如果該類別已經定義了 :meth:`!__lt__`、:meth:`!__le__`、:meth:`!__gt__` 或 :" "meth:`!__ge__` 中的任何一個,則引發 :exc:`TypeError`。" -#: ../../library/dataclasses.rst:124 +#: ../../library/dataclasses.rst:137 #, fuzzy msgid "" "*unsafe_hash*: If true, force ``dataclasses`` to create a :meth:`~object." @@ -255,7 +277,7 @@ msgstr "" "*unsafe_hash*:如果 ``False``\\ (預設值),將根據 *eq* 和 *frozen* 的設定生" "成一個 :meth:`~object.__hash__` 方法。" -#: ../../library/dataclasses.rst:130 +#: ../../library/dataclasses.rst:143 #, fuzzy msgid "" ":meth:`!__hash__` is used by built-in :meth:`hash`, and when objects are " @@ -270,7 +292,7 @@ msgstr "" "複雜的屬性,它取決於程序設計師的意圖 :meth:`!__eq__` 的存在和行為,以及 " "dataclass 裝飾器中的 *eq* 和 *frozen* 旗標的值." -#: ../../library/dataclasses.rst:137 +#: ../../library/dataclasses.rst:150 #, fuzzy msgid "" "By default, ``@dataclass`` will not implicitly add a :meth:`~object." @@ -284,7 +306,7 @@ msgstr "" "類別屬性 ``__hash__ = None`` 對 Python 具有特定含義,如 :meth:`!__hash__` 文" "件中所述。" -#: ../../library/dataclasses.rst:143 +#: ../../library/dataclasses.rst:156 #, fuzzy msgid "" "If :meth:`!__hash__` is not explicitly defined, or if it is set to ``None``, " @@ -300,7 +322,7 @@ msgstr "" "方法。如果你的類別在邏輯上是不可變的但仍然可以改變,則可能是這種情況。這是一" "個特殊的用例,應該仔細考慮。" -#: ../../library/dataclasses.rst:150 +#: ../../library/dataclasses.rst:163 #, fuzzy msgid "" "Here are the rules governing implicit creation of a :meth:`!__hash__` " @@ -312,7 +334,7 @@ msgstr "" "有顯式的 :meth:`!__hash__` 方法又設定 ``unsafe_hash=True``;這將導致 :exc:" "`TypeError`。" -#: ../../library/dataclasses.rst:155 +#: ../../library/dataclasses.rst:168 msgid "" "If *eq* and *frozen* are both true, by default ``@dataclass`` will generate " "a :meth:`!__hash__` method for you. If *eq* is true and *frozen* is false, :" @@ -328,7 +350,7 @@ msgstr "" "__hash__` 將保持不變,這意味著將使用超類別的 :meth:`!__hash__` 方法(如果超類" "別是 :class:`object`,這意味著它將回退到基於 id 的雜湊)。" -#: ../../library/dataclasses.rst:163 +#: ../../library/dataclasses.rst:176 #, fuzzy msgid "" "*frozen*: If true (the default is ``False``), assigning to fields will " @@ -339,7 +361,7 @@ msgstr "" "凍結實例。如果 :meth:`~object.__setattr__` 或 :meth:`~object.__delattr__` 在" "類別中定義,則 :exc:`TypeError` 被引發。請參閱下面的討論。" -#: ../../library/dataclasses.rst:167 +#: ../../library/dataclasses.rst:180 msgid "" "If :meth:`~object.__setattr__` or :meth:`~object.__delattr__` is defined in " "the class and *frozen* is true, then :exc:`TypeError` is raised." @@ -347,7 +369,7 @@ msgstr "" "如果類別中定義了 :meth:`~object.__setattr__` 或 :meth:`~object.__delattr__` " "且 *frozen* 為真,則會引發 :exc:`TypeError`。" -#: ../../library/dataclasses.rst:170 +#: ../../library/dataclasses.rst:183 #, fuzzy msgid "" "*match_args*: If true (the default is ``True``), the :attr:`~object." @@ -362,7 +384,7 @@ msgstr "" "成,見上文)。如果為 false,或者類別中已經定義了 :attr:`!__match_args__`,則" "不會生成 :attr:`!__match_args__`。" -#: ../../library/dataclasses.rst:179 +#: ../../library/dataclasses.rst:192 #, fuzzy msgid "" "*kw_only*: If true (the default value is ``False``), then all fields will be " @@ -378,11 +400,11 @@ msgstr "" "類別的任何其他方面都沒有影響。有關詳細資訊,請參閱 :term:`parameter` 詞彙表條" "目。另請參閱 :const:`KW_ONLY` 部分。" -#: ../../library/dataclasses.rst:187 +#: ../../library/dataclasses.rst:200 msgid "Keyword-only fields are not included in :attr:`!__match_args__`." msgstr "" -#: ../../library/dataclasses.rst:191 +#: ../../library/dataclasses.rst:204 #, fuzzy msgid "" "*slots*: If true (the default is ``False``), :attr:`~object.__slots__` " @@ -394,7 +416,7 @@ msgstr "" "屬性並回傳新類別而不是原始類別。如果 :attr:`!__slots__` 已經在類別中定義," "則 :exc:`TypeError` 被引發。" -#: ../../library/dataclasses.rst:197 +#: ../../library/dataclasses.rst:210 msgid "" "Passing parameters to a base class :meth:`~object.__init_subclass__` when " "using ``slots=True`` will result in a :exc:`TypeError`. Either use " @@ -402,7 +424,7 @@ msgid "" "workaround. See :gh:`91126` for full details." msgstr "" -#: ../../library/dataclasses.rst:205 +#: ../../library/dataclasses.rst:218 #, fuzzy msgid "" "If a field name is already included in the :attr:`!__slots__` of a base " @@ -418,7 +440,7 @@ msgstr "" "夠確定繼承的插槽,基底類別 :attr:`!__slots__` 可以是任何可疊代的,但*不是*疊" "代器。" -#: ../../library/dataclasses.rst:215 +#: ../../library/dataclasses.rst:228 #, fuzzy msgid "" "*weakref_slot*: If true (the default is ``False``), add a slot named " @@ -430,14 +452,14 @@ msgstr "" "插槽,這是使實例可弱引用所必需的。在沒有指定 ``slots=True`` 的情況下指定 " "``weakref_slot=True`` 是錯誤的。" -#: ../../library/dataclasses.rst:223 +#: ../../library/dataclasses.rst:236 #, fuzzy msgid "" "``field``\\s may optionally specify a default value, using normal Python " "syntax::" msgstr "``field``\\s 可以選擇指定一個預設值,使用普通的 Python 語法: ::" -#: ../../library/dataclasses.rst:226 +#: ../../library/dataclasses.rst:239 msgid "" "@dataclass\n" "class C:\n" @@ -445,7 +467,7 @@ msgid "" " b: int = 0 # assign a default value for 'b'" msgstr "" -#: ../../library/dataclasses.rst:231 +#: ../../library/dataclasses.rst:244 #, fuzzy msgid "" "In this example, both :attr:`!a` and :attr:`!b` will be included in the " @@ -454,11 +476,11 @@ msgstr "" "在此示例中,:attr:`!a` 和 :attr:`!b` 都將包含在新增的 :meth:`~object." "__init__` 方法中,該方法將定義為: ::" -#: ../../library/dataclasses.rst:234 +#: ../../library/dataclasses.rst:247 msgid "def __init__(self, a: int, b: int = 0):" msgstr "def __init__(self, a: int, b: int = 0):" -#: ../../library/dataclasses.rst:236 +#: ../../library/dataclasses.rst:249 #, fuzzy msgid "" ":exc:`TypeError` will be raised if a field without a default value follows a " @@ -468,7 +490,7 @@ msgstr "" ":exc:`TypeError` 如果沒有預設值的欄位跟在具有預設值的欄位之後,將引發。無論這" "發生在單個類別中還是作為類別繼承的結果,都是如此。" -#: ../../library/dataclasses.rst:242 +#: ../../library/dataclasses.rst:255 #, fuzzy msgid "" "For common and simple use cases, no other functionality is required. There " @@ -481,7 +503,7 @@ msgstr "" "位資訊。為了滿足這種對附加資訊的需求,你可以透過呼叫提供的 :func:`!field` 函" "式來替換預設欄位值。例如: ::" -#: ../../library/dataclasses.rst:248 +#: ../../library/dataclasses.rst:261 msgid "" "@dataclass\n" "class C:\n" @@ -497,7 +519,7 @@ msgstr "" "c = C()\n" "c.mylist += [1, 2, 3]" -#: ../../library/dataclasses.rst:255 +#: ../../library/dataclasses.rst:268 #, fuzzy msgid "" "As shown above, the :const:`MISSING` value is a sentinel object used to " @@ -509,11 +531,11 @@ msgstr "" "供。使用此標記是因為 ``None`` 對於某些具有不同含義的參數是有效值。任何程式碼" "都不應直接使用 :const:`MISSING` 值。" -#: ../../library/dataclasses.rst:260 +#: ../../library/dataclasses.rst:273 msgid "The parameters to :func:`!field` are:" msgstr ":func:`!field` 的參數是:" -#: ../../library/dataclasses.rst:262 +#: ../../library/dataclasses.rst:275 msgid "" "*default*: If provided, this will be the default value for this field. This " "is needed because the :func:`!field` call itself replaces the normal " @@ -522,7 +544,7 @@ msgstr "" "*default*:如果有提供,這將是該欄位的預設值。這是必需的,因為 :meth:`!field` " "呼叫本身會替換預設值的正常位置。" -#: ../../library/dataclasses.rst:266 +#: ../../library/dataclasses.rst:279 #, fuzzy msgid "" "*default_factory*: If provided, it must be a zero-argument callable that " @@ -535,7 +557,7 @@ msgstr "" "時將被呼叫。除其他用途外,這可用於指定具有可變預設值的欄位,如下所述。同時指" "定 *default* 和 *default_factory* 是錯誤的。" -#: ../../library/dataclasses.rst:272 +#: ../../library/dataclasses.rst:285 #, fuzzy msgid "" "*init*: If true (the default), this field is included as a parameter to the " @@ -544,7 +566,7 @@ msgstr "" "*init*:如果為 true(預設值),則此欄位將作為生成的 :meth:`~object.__init__` " "方法的參數包含在內。" -#: ../../library/dataclasses.rst:275 +#: ../../library/dataclasses.rst:288 #, fuzzy msgid "" "*repr*: If true (the default), this field is included in the string returned " @@ -553,7 +575,7 @@ msgstr "" "*repr*:如果為真(預設值),則此欄位包含在生成的 :meth:`~object.__repr__` 方" "法回傳的字串中。" -#: ../../library/dataclasses.rst:278 +#: ../../library/dataclasses.rst:291 #, fuzzy msgid "" "*hash*: This can be a bool or ``None``. If true, this field is included in " @@ -569,7 +591,7 @@ msgstr "" "是預期的行為。如果一個欄位用於比較,則應在雜湊中考慮該欄位。不鼓勵將此值設定" "為 ``None`` 以外的任何值。" -#: ../../library/dataclasses.rst:286 +#: ../../library/dataclasses.rst:299 #, fuzzy msgid "" "One possible reason to set ``hash=False`` but ``compare=True`` would be if a " @@ -582,7 +604,7 @@ msgstr "" "湊值的成本很高,則需要該欄位進行相等性測試,並且還有其他欄位有助於型別的雜湊" "值。即使一個欄位被排除在雜湊之外,它仍然會被用於比較。" -#: ../../library/dataclasses.rst:292 +#: ../../library/dataclasses.rst:305 #, fuzzy msgid "" "*compare*: If true (the default), this field is included in the generated " @@ -592,7 +614,7 @@ msgstr "" "*compare*:如果為真(預設值),則此欄位包含在生成的相等和比較方法中(:meth:" "`~object.__eq__`、:meth:`~object.__gt__` 等)。" -#: ../../library/dataclasses.rst:296 +#: ../../library/dataclasses.rst:309 #, fuzzy msgid "" "*metadata*: This can be a mapping or ``None``. ``None`` is treated as an " @@ -607,7 +629,7 @@ msgstr "" "不被資料類別使用,而是作為第三方擴充機制提供的。多個第三方可以各自擁有自己的" "密鑰,用作元資料中的命名空間。" -#: ../../library/dataclasses.rst:304 +#: ../../library/dataclasses.rst:317 #, fuzzy msgid "" "*kw_only*: If true, this field will be marked as keyword-only. This is used " @@ -616,15 +638,15 @@ msgstr "" "*kw_only*:如果為真,該欄位將被標記為僅限關鍵字。這在計算生成的 :meth:" "`~object.__init__` 方法的參數時使用。" -#: ../../library/dataclasses.rst:308 +#: ../../library/dataclasses.rst:321 msgid "Keyword-only fields are also not included in :attr:`!__match_args__`." msgstr "" -#: ../../library/dataclasses.rst:312 +#: ../../library/dataclasses.rst:325 msgid "*doc*: optional docstring for this field." msgstr "" -#: ../../library/dataclasses.rst:316 +#: ../../library/dataclasses.rst:329 #, fuzzy msgid "" "If the default value of a field is specified by a call to :func:`!field`, " @@ -640,7 +662,7 @@ msgstr "" "在 :func:`@dataclass ` 裝飾器運行後,類別屬性將全部包含欄位的預設" "值,就像預設值本身已指定一樣。例如,在: ::" -#: ../../library/dataclasses.rst:325 +#: ../../library/dataclasses.rst:338 msgid "" "@dataclass\n" "class C:\n" @@ -656,7 +678,7 @@ msgstr "" " z: int = field(repr=False, default=10)\n" " t: int = 20" -#: ../../library/dataclasses.rst:332 +#: ../../library/dataclasses.rst:345 #, fuzzy msgid "" "The class attribute :attr:`!C.z` will be ``10``, the class attribute :attr:`!" @@ -666,7 +688,7 @@ msgstr "" "類別屬性 :attr:`!C.z` 將為 ``10``,類別屬性 :attr:`!C.t` 將為 ``20``,類別屬" "性 :attr:`!C.x` 和 :attr:`!C.y` 將不會放。" -#: ../../library/dataclasses.rst:338 +#: ../../library/dataclasses.rst:351 #, fuzzy msgid "" ":class:`!Field` objects describe each defined field. These objects are " @@ -678,15 +700,15 @@ msgstr "" "`fields` 模組級方法回傳(見下文)。使用者不應該直接實例化 :class:`!Field` 物" "件。它記錄的屬性是:" -#: ../../library/dataclasses.rst:343 +#: ../../library/dataclasses.rst:356 msgid ":attr:`!name`: The name of the field." msgstr ":attr:`!name`:欄位的名稱。" -#: ../../library/dataclasses.rst:344 +#: ../../library/dataclasses.rst:357 msgid ":attr:`!type`: The type of the field." msgstr ":attr:`!type`:欄位的型別。" -#: ../../library/dataclasses.rst:345 +#: ../../library/dataclasses.rst:358 #, fuzzy msgid "" ":attr:`!default`, :attr:`!default_factory`, :attr:`!init`, :attr:`!repr`, :" @@ -697,14 +719,14 @@ msgstr "" "attr:`!hash`、:attr:`!compare`, :attr:`!metadata` 和 :attr:`!kw_only` 有與它" "們在 :func:`field` 函式中的含義和值相同。" -#: ../../library/dataclasses.rst:349 +#: ../../library/dataclasses.rst:362 #, fuzzy msgid "" "Other attributes may exist, but they are private and must not be inspected " "or relied on." msgstr "可能存在其他屬性,但它們是私有的,不得檢查或依賴。" -#: ../../library/dataclasses.rst:354 +#: ../../library/dataclasses.rst:367 msgid "" "``InitVar[T]`` type annotations describe variables that are :ref:`init-only " "`. Fields annotated with :class:`!InitVar` " @@ -713,7 +735,7 @@ msgid "" "meth:`~object.__init__` and an optional :meth:`__post_init__`." msgstr "" -#: ../../library/dataclasses.rst:363 +#: ../../library/dataclasses.rst:376 #, fuzzy msgid "" "Returns a tuple of :class:`Field` objects that define the fields for this " @@ -725,7 +747,7 @@ msgstr "" "實例。如果未傳遞資料類別或其中一個實例,則引發 :exc:`TypeError`。不回傳 " "``ClassVar`` 或 ``InitVar`` 的偽欄位。" -#: ../../library/dataclasses.rst:370 +#: ../../library/dataclasses.rst:383 #, fuzzy msgid "" "Converts the dataclass *obj* to a dict (by using the factory function " @@ -737,12 +759,12 @@ msgstr "" "都被轉換為其欄位的字典,作為 ``name: value`` 對。資料類別、字典、列表和元組被" "遞迴到。其他物件使用 :func:`copy.deepcopy` 複製。" -#: ../../library/dataclasses.rst:376 +#: ../../library/dataclasses.rst:389 #, fuzzy msgid "Example of using :func:`!asdict` on nested dataclasses::" msgstr "在嵌套資料類別上使用 :func:`!asdict` 的範例: ::" -#: ../../library/dataclasses.rst:378 +#: ../../library/dataclasses.rst:391 msgid "" "@dataclass\n" "class Point:\n" @@ -774,22 +796,22 @@ msgstr "" "c = C([Point(0, 0), Point(10, 4)])\n" "assert asdict(c) == {'mylist': [{'x': 0, 'y': 0}, {'x': 10, 'y': 4}]}" -#: ../../library/dataclasses.rst:393 ../../library/dataclasses.rst:413 +#: ../../library/dataclasses.rst:406 ../../library/dataclasses.rst:426 #, fuzzy msgid "To create a shallow copy, the following workaround may be used::" msgstr "要建立淺複製,可以使用以下解決方法:" -#: ../../library/dataclasses.rst:395 +#: ../../library/dataclasses.rst:408 msgid "{field.name: getattr(obj, field.name) for field in fields(obj)}" msgstr "{field.name: getattr(obj, field.name) for field in fields(obj)}" -#: ../../library/dataclasses.rst:397 +#: ../../library/dataclasses.rst:410 #, fuzzy msgid "" ":func:`!asdict` raises :exc:`TypeError` if *obj* is not a dataclass instance." msgstr ":func:`!asdict` 如果 *obj* 不是資料類別實例,則引發 :exc:`TypeError`。" -#: ../../library/dataclasses.rst:402 +#: ../../library/dataclasses.rst:415 #, fuzzy msgid "" "Converts the dataclass *obj* to a tuple (by using the factory function " @@ -801,11 +823,11 @@ msgstr "" "都被轉換為其欄位值的元組。資料類別、字典、列表和元組被遞迴到。其他物件使用 :" "func:`copy.deepcopy` 複製。" -#: ../../library/dataclasses.rst:408 +#: ../../library/dataclasses.rst:421 msgid "Continuing from the previous example::" msgstr "從前面的例子繼續: ::" -#: ../../library/dataclasses.rst:410 +#: ../../library/dataclasses.rst:423 msgid "" "assert astuple(p) == (10, 20)\n" "assert astuple(c) == ([(0, 0), (10, 4)],)" @@ -813,11 +835,11 @@ msgstr "" "assert astuple(p) == (10, 20)\n" "assert astuple(c) == ([(0, 0), (10, 4)],)" -#: ../../library/dataclasses.rst:415 +#: ../../library/dataclasses.rst:428 msgid "tuple(getattr(obj, field.name) for field in dataclasses.fields(obj))" msgstr "tuple(getattr(obj, field.name) for field in dataclasses.fields(obj))" -#: ../../library/dataclasses.rst:417 +#: ../../library/dataclasses.rst:430 #, fuzzy msgid "" ":func:`!astuple` raises :exc:`TypeError` if *obj* is not a dataclass " @@ -825,7 +847,7 @@ msgid "" msgstr "" ":func:`!astuple` 如果 *obj* 不是資料類別實例,則引發 :exc:`TypeError`。" -#: ../../library/dataclasses.rst:422 +#: ../../library/dataclasses.rst:435 #, fuzzy msgid "" "Creates a new dataclass with name *cls_name*, fields as defined in *fields*, " @@ -845,13 +867,13 @@ msgstr "" "``kw_only`` 的值, ``slots`` 和 ``weakref_slot`` 與它們在 :func:`dataclass` 中" "的含義相同。" -#: ../../library/dataclasses.rst:432 +#: ../../library/dataclasses.rst:445 msgid "" "If *module* is defined, the :attr:`!__module__` attribute of the dataclass " "is set to that value. By default, it is set to the module name of the caller." msgstr "" -#: ../../library/dataclasses.rst:436 +#: ../../library/dataclasses.rst:449 msgid "" "The *decorator* parameter is a callable that will be used to create the " "dataclass. It should take the class object as a first argument and the same " @@ -859,7 +881,7 @@ msgid "" "function is used." msgstr "" -#: ../../library/dataclasses.rst:441 +#: ../../library/dataclasses.rst:454 #, fuzzy msgid "" "This function is not strictly required, because any Python mechanism for " @@ -871,7 +893,7 @@ msgstr "" "別的 Python 機制都可以應用 :func:`dataclass` 函式將該類別轉換為資料類別。提供" "此功能是為了方便。例如: ::" -#: ../../library/dataclasses.rst:447 +#: ../../library/dataclasses.rst:460 msgid "" "C = make_dataclass('C',\n" " [('x', int),\n" @@ -885,11 +907,11 @@ msgstr "" " ('z', int, field(default=5))],\n" " namespace={'add_one': lambda self: self.x + 1})" -#: ../../library/dataclasses.rst:453 +#: ../../library/dataclasses.rst:466 msgid "Is equivalent to::" msgstr "相當於: ::" -#: ../../library/dataclasses.rst:455 +#: ../../library/dataclasses.rst:468 msgid "" "@dataclass\n" "class C:\n" @@ -909,11 +931,11 @@ msgstr "" " def add_one(self):\n" " return self.x + 1" -#: ../../library/dataclasses.rst:464 +#: ../../library/dataclasses.rst:477 msgid "Added the *decorator* parameter." msgstr "新增了 *decorator* 參數。" -#: ../../library/dataclasses.rst:469 +#: ../../library/dataclasses.rst:482 msgid "" "Creates a new object of the same type as *obj*, replacing fields with values " "from *changes*. If *obj* is not a Data Class, raises :exc:`TypeError`. If " @@ -924,7 +946,7 @@ msgstr "" "``obj`` 不是資料類別則引發 :exc:`TypeError`。如果 ``changes`` 中的鍵不是給定 " "dataclass 的欄位則引發 :exc:`TypeError`。" -#: ../../library/dataclasses.rst:474 +#: ../../library/dataclasses.rst:487 #, fuzzy msgid "" "The newly returned object is created by calling the :meth:`~object.__init__` " @@ -934,7 +956,7 @@ msgstr "" "新回傳的物件是透過呼叫資料類別的 :meth:`~object.__init__` 方法建立的。這確" "保 :meth:`__post_init__`\\ (如果存在)也被呼叫。" -#: ../../library/dataclasses.rst:478 +#: ../../library/dataclasses.rst:491 #, fuzzy msgid "" "Init-only variables without default values, if any exist, must be specified " @@ -944,7 +966,7 @@ msgstr "" "沒有預設值的僅初始化變數(如果存在)必須在呼叫 :func:`replace` 時指定,以便它" "們可以傳遞給 :meth:`__init__` 和 :meth:`__post_init__`。" -#: ../../library/dataclasses.rst:482 +#: ../../library/dataclasses.rst:495 #, fuzzy msgid "" "It is an error for *changes* to contain any fields that are defined as " @@ -953,7 +975,7 @@ msgstr "" "*changes* 包含任何定義為具有 ``init=False`` 的欄位是錯誤的。在這種情況下將引" "發 :exc:`ValueError`。" -#: ../../library/dataclasses.rst:486 +#: ../../library/dataclasses.rst:499 #, fuzzy msgid "" "Be forewarned about how ``init=False`` fields work during a call to :func:`!" @@ -970,13 +992,13 @@ msgstr "" "建構函式可能是明智的,或者可能是處理實例複製的自訂 :func:`!replace` (或類似" "命名的)方法。" -#: ../../library/dataclasses.rst:495 +#: ../../library/dataclasses.rst:508 msgid "" "Dataclass instances are also supported by generic function :func:`copy." "replace`." msgstr "" -#: ../../library/dataclasses.rst:499 +#: ../../library/dataclasses.rst:512 msgid "" "Return ``True`` if its parameter is a dataclass (including subclasses of a " "dataclass, but not including :ref:`generic aliases `) or " @@ -985,7 +1007,7 @@ msgstr "" "如果它的參數是一個資料類別(包含一個資料類別的子類別,但不包含\\ :ref:`通用別" "名 `)或一個實例則回傳 ``True``,否則回傳 ``False``。" -#: ../../library/dataclasses.rst:503 +#: ../../library/dataclasses.rst:516 #, fuzzy msgid "" "If you need to know if a class is an instance of a dataclass (and not a " @@ -995,7 +1017,7 @@ msgstr "" "如果你需要知道一個類別是否是資料類別的實例(而不是資料類別本身),那麼新增一" "個進一步的檢查 ``not isinstance(obj, type)``: ::" -#: ../../library/dataclasses.rst:507 +#: ../../library/dataclasses.rst:520 msgid "" "def is_dataclass_instance(obj):\n" " return is_dataclass(obj) and not isinstance(obj, type)" @@ -1003,12 +1025,12 @@ msgstr "" "def is_dataclass_instance(obj):\n" " return is_dataclass(obj) and not isinstance(obj, type)" -#: ../../library/dataclasses.rst:512 +#: ../../library/dataclasses.rst:525 #, fuzzy msgid "A sentinel value signifying a missing default or default_factory." msgstr "表示缺少 default 或 default_factory 的標記值。" -#: ../../library/dataclasses.rst:516 +#: ../../library/dataclasses.rst:529 #, fuzzy msgid "" "A sentinel value used as a type annotation. Any fields after a pseudo-field " @@ -1024,14 +1046,14 @@ msgstr "" "類欄位的名稱。按照慣例,名稱 ``_`` 用於 :const:`!KW_ONLY` 欄位。僅關鍵字欄位" "表示 :meth:`~object.__init__` 參數,在實例化類別時必須將其指定為關鍵字。" -#: ../../library/dataclasses.rst:525 +#: ../../library/dataclasses.rst:538 #, fuzzy msgid "" "In this example, the fields ``y`` and ``z`` will be marked as keyword-only " "fields::" msgstr "在此示例中,欄位 ``y`` 和 ``z`` 將被標記為僅關鍵字欄位: ::" -#: ../../library/dataclasses.rst:527 +#: ../../library/dataclasses.rst:540 msgid "" "@dataclass\n" "class Point:\n" @@ -1051,14 +1073,14 @@ msgstr "" "\n" "p = Point(0, y=1.5, z=2.0)" -#: ../../library/dataclasses.rst:536 +#: ../../library/dataclasses.rst:549 #, fuzzy msgid "" "In a single dataclass, it is an error to specify more than one field whose " "type is :const:`!KW_ONLY`." msgstr "在單個資料類別中,指定多個型別為 :const:`!KW_ONLY` 的欄位是錯誤的。" -#: ../../library/dataclasses.rst:543 +#: ../../library/dataclasses.rst:556 #, fuzzy msgid "" "Raised when an implicitly defined :meth:`~object.__setattr__` or :meth:" @@ -1068,12 +1090,12 @@ msgstr "" "當在使用 frozen=True 定義的資料類別上呼叫隱式定義的 :meth:`__setattr__` 或 :" "meth:`__delattr__` 時引發。它是 :exc:`AttributeError` 的子類別。" -#: ../../library/dataclasses.rst:550 +#: ../../library/dataclasses.rst:563 #, fuzzy msgid "Post-init processing" msgstr "後初始化處理" -#: ../../library/dataclasses.rst:554 +#: ../../library/dataclasses.rst:567 #, fuzzy msgid "" "When defined on the class, it will be called by the generated :meth:`~object." @@ -1089,14 +1111,14 @@ msgstr "" "將按照它們在類別中定義的順序傳遞給 :meth:`!__post_init__` 。如果沒有生成 :" "meth:`!__init__` 方法,那麼 :meth:`!__post_init__` 將不會被自動呼叫。" -#: ../../library/dataclasses.rst:561 +#: ../../library/dataclasses.rst:574 #, fuzzy msgid "" "Among other uses, this allows for initializing field values that depend on " "one or more other fields. For example::" msgstr "在其他用途中,這允許初始化依賴於一個或多個其他欄位的欄位值。例如: ::" -#: ../../library/dataclasses.rst:564 +#: ../../library/dataclasses.rst:577 msgid "" "@dataclass\n" "class C:\n" @@ -1116,7 +1138,7 @@ msgstr "" " def __post_init__(self):\n" " self.c = self.a + self.b" -#: ../../library/dataclasses.rst:573 +#: ../../library/dataclasses.rst:586 #, fuzzy msgid "" "The :meth:`~object.__init__` method generated by :deco:`dataclass` does not " @@ -1128,7 +1150,7 @@ msgstr "" "類別 :meth:`!__init__` 方法。如果基底類別有一個必須呼叫的 :meth:`!__init__` " "方法,通常在 :meth:`__post_init__` 方法中呼叫此方法: ::" -#: ../../library/dataclasses.rst:578 +#: ../../library/dataclasses.rst:591 msgid "" "class Rectangle:\n" " def __init__(self, height, width):\n" @@ -1154,7 +1176,7 @@ msgstr "" " def __post_init__(self):\n" " super().__init__(self.side, self.side)" -#: ../../library/dataclasses.rst:590 +#: ../../library/dataclasses.rst:603 #, fuzzy msgid "" "Note, however, that in general the dataclass-generated :meth:`!__init__` " @@ -1164,7 +1186,7 @@ msgstr "" "但是請注意,通常不需要呼叫資料類別生成的 :meth:`!__init__` 方法,因為衍生資料" "類別將負責初始化作為資料類別本身的任何基底類別的所有欄位。" -#: ../../library/dataclasses.rst:594 +#: ../../library/dataclasses.rst:607 #, fuzzy msgid "" "See the section below on init-only variables for ways to pass parameters to :" @@ -1174,11 +1196,11 @@ msgstr "" "請參閱下面有關僅初始化變數的部分,了解將參數傳遞給 :meth:`!__post_init__` 的" "方法。另請參閱有關 :func:`replace` 如何處理 ``init=False`` 欄位的警告。" -#: ../../library/dataclasses.rst:601 +#: ../../library/dataclasses.rst:614 msgid "Class variables" msgstr "類別變數" -#: ../../library/dataclasses.rst:603 +#: ../../library/dataclasses.rst:616 #, fuzzy msgid "" "One of the few places where :deco:`dataclass` actually inspects the type of " @@ -1194,12 +1216,12 @@ msgstr "" "外,並被資料類別機制忽略。模組級 :func:`fields` 函式不會回傳此類別 " "``ClassVar`` 偽欄位。" -#: ../../library/dataclasses.rst:614 +#: ../../library/dataclasses.rst:627 #, fuzzy msgid "Init-only variables" msgstr "僅初始化變數" -#: ../../library/dataclasses.rst:616 +#: ../../library/dataclasses.rst:629 #, fuzzy msgid "" "Another place where :deco:`dataclass` inspects a type annotation is to " @@ -1218,14 +1240,14 @@ msgstr "" "的 :meth:`~object.__init__` 方法,並傳遞給可選的 :meth:`__post_init__` 方法。" "它們不被資料類別使用。" -#: ../../library/dataclasses.rst:626 +#: ../../library/dataclasses.rst:639 #, fuzzy msgid "" "For example, suppose a field will be initialized from a database, if a value " "is not provided when creating the class::" msgstr "例如,假設一個欄位將從資料庫中初始化,如果在建立類別時沒有提供值: ::" -#: ../../library/dataclasses.rst:629 +#: ../../library/dataclasses.rst:642 msgid "" "@dataclass\n" "class C:\n" @@ -1251,7 +1273,7 @@ msgstr "" "\n" "c = C(10, database=my_database)" -#: ../../library/dataclasses.rst:641 +#: ../../library/dataclasses.rst:654 #, fuzzy msgid "" "In this case, :func:`fields` will return :class:`Field` objects for :attr:`!" @@ -1260,11 +1282,11 @@ msgstr "" "在這種情況下,:func:`fields` 將為 :attr:`!i` 和 :attr:`!j` 回傳 :class:" "`Field` 物件,但不會為 :attr:`!database` 回傳。" -#: ../../library/dataclasses.rst:647 +#: ../../library/dataclasses.rst:660 msgid "Frozen instances" msgstr "凍結實例" -#: ../../library/dataclasses.rst:649 +#: ../../library/dataclasses.rst:662 #, fuzzy msgid "" "It is not possible to create truly immutable Python objects. However, by " @@ -1278,7 +1300,7 @@ msgstr "" "別將向類別新增 :meth:`~object.__setattr__` 和 :meth:`~object.__delattr__` 方" "法。這些方法在叫用時會引發 :exc:`FrozenInstanceError`。" -#: ../../library/dataclasses.rst:655 +#: ../../library/dataclasses.rst:668 #, fuzzy msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" @@ -1288,11 +1310,11 @@ msgstr "" "使用 ``frozen=True`` 時有一個微小的性能損失::meth:`~object.__init__` 不能使" "用簡單賦值來初始化欄位,必須使用 :meth:`!object.__setattr__`。" -#: ../../library/dataclasses.rst:664 +#: ../../library/dataclasses.rst:677 msgid "Inheritance" msgstr "繼承" -#: ../../library/dataclasses.rst:666 +#: ../../library/dataclasses.rst:679 #, fuzzy msgid "" "When the dataclass is being created by the :deco:`dataclass` decorator, it " @@ -1310,7 +1332,7 @@ msgstr "" "將自己的欄位新增到有序對映中。所有生成的方法都將使用這種組合的、計算的有序欄" "位對映。因為欄位是按插入順序排列的,所以衍生類別會覆蓋基底類別。一個例子: ::" -#: ../../library/dataclasses.rst:676 +#: ../../library/dataclasses.rst:689 msgid "" "@dataclass\n" "class Base:\n" @@ -1332,7 +1354,7 @@ msgstr "" " z: int = 10\n" " x: int = 15" -#: ../../library/dataclasses.rst:686 +#: ../../library/dataclasses.rst:699 #, fuzzy msgid "" "The final list of fields is, in order, :attr:`!x`, :attr:`!y`, :attr:`!z`. " @@ -1342,23 +1364,23 @@ msgstr "" "最終的欄位列表按順序為 :attr:`!x`、:attr:`!y`、:attr:`!z`。:attr:`!x` 的最終" "型別是 :class:`int`,如類別 :class:`!C` 中指定的那樣。" -#: ../../library/dataclasses.rst:689 +#: ../../library/dataclasses.rst:702 #, fuzzy msgid "" "The generated :meth:`~object.__init__` method for :class:`!C` will look " "like::" msgstr "為 :class:`!C` 生成的 :meth:`~object.__init__` 方法將如下所示: ::" -#: ../../library/dataclasses.rst:691 +#: ../../library/dataclasses.rst:704 msgid "def __init__(self, x: int = 15, y: int = 0, z: int = 10):" msgstr "def __init__(self, x: int = 15, y: int = 0, z: int = 10):" -#: ../../library/dataclasses.rst:694 +#: ../../library/dataclasses.rst:707 #, fuzzy msgid "Re-ordering of keyword-only parameters in :meth:`!__init__`" msgstr ":meth:`!__init__` 中僅關鍵字參數的重新排序" -#: ../../library/dataclasses.rst:696 +#: ../../library/dataclasses.rst:709 #, fuzzy msgid "" "After the parameters needed for :meth:`~object.__init__` are computed, any " @@ -1370,7 +1392,7 @@ msgstr "" "僅關鍵字)參數之後。這是如何在 Python 中實作僅關鍵字參數的要求:它們必須位於" "非僅關鍵字參數之後。" -#: ../../library/dataclasses.rst:702 +#: ../../library/dataclasses.rst:715 #, fuzzy msgid "" "In this example, :attr:`!Base.y`, :attr:`!Base.w`, and :attr:`!D.t` are " @@ -1380,7 +1402,7 @@ msgstr "" "在此示例中,:attr:`!Base.y`、:attr:`!Base.w` 和 :attr:`!D.t` 是僅限關鍵字的欄" "位,:attr:`!Base.x` 和 :attr:`!D.z` 是常規欄位: ::" -#: ../../library/dataclasses.rst:705 +#: ../../library/dataclasses.rst:718 msgid "" "@dataclass\n" "class Base:\n" @@ -1406,12 +1428,12 @@ msgstr "" " z: int = 10\n" " t: int = field(kw_only=True, default=0)" -#: ../../library/dataclasses.rst:717 +#: ../../library/dataclasses.rst:730 #, fuzzy msgid "The generated :meth:`!__init__` method for :class:`!D` will look like::" msgstr "為 :class:`!D` 生成的 :meth:`!__init__` 方法將如下所示: ::" -#: ../../library/dataclasses.rst:719 +#: ../../library/dataclasses.rst:732 msgid "" "def __init__(self, x: Any = 15.0, z: int = 10, *, y: int = 0, w: int = 1, t: " "int = 0):" @@ -1419,7 +1441,7 @@ msgstr "" "def __init__(self, x: Any = 15.0, z: int = 10, *, y: int = 0, w: int = 1, t: " "int = 0):" -#: ../../library/dataclasses.rst:721 +#: ../../library/dataclasses.rst:734 #, fuzzy msgid "" "Note that the parameters have been re-ordered from how they appear in the " @@ -1429,18 +1451,18 @@ msgstr "" "請注意,參數已根據它們在欄位列表中的顯示方式重新排序:從常規欄位衍生的參數後" "跟從僅關鍵字欄位衍生的參數。" -#: ../../library/dataclasses.rst:725 +#: ../../library/dataclasses.rst:738 #, fuzzy msgid "" "The relative ordering of keyword-only parameters is maintained in the re-" "ordered :meth:`!__init__` parameter list." msgstr "僅關鍵字參數的相對順序在重新排序的 :meth:`!__init__` 參數列表中維護。" -#: ../../library/dataclasses.rst:730 +#: ../../library/dataclasses.rst:743 msgid "Default factory functions" msgstr "預設工廠函式" -#: ../../library/dataclasses.rst:732 +#: ../../library/dataclasses.rst:745 #, fuzzy msgid "" "If a :func:`field` specifies a *default_factory*, it is called with zero " @@ -1450,11 +1472,11 @@ msgstr "" "如果 :func:`field` 指定了 *default_factory*,當需要該欄位的預設值時,它會以零" "引數呼叫。例如,要建立列表的新實例,請使用: ::" -#: ../../library/dataclasses.rst:736 +#: ../../library/dataclasses.rst:749 msgid "mylist: list = field(default_factory=list)" msgstr "mylist: list = field(default_factory=list)" -#: ../../library/dataclasses.rst:738 +#: ../../library/dataclasses.rst:751 #, fuzzy msgid "" "If a field is excluded from :meth:`~object.__init__` (using ``init=False``) " @@ -1467,11 +1489,11 @@ msgstr "" "位還指定了 ``default_factory``,那麼預設工廠函式將始終從生成的 :meth:" "`__init__ 中呼叫`功能。發生這種情況是因為沒有其他方法可以為該欄位賦予初始值。" -#: ../../library/dataclasses.rst:745 +#: ../../library/dataclasses.rst:758 msgid "Mutable default values" msgstr "可變預設值" -#: ../../library/dataclasses.rst:747 +#: ../../library/dataclasses.rst:760 #, fuzzy msgid "" "Python stores default member variable values in class attributes. Consider " @@ -1479,7 +1501,7 @@ msgid "" msgstr "" "Python 將預設成員變數值儲存在類別屬性中。考慮這個例子,不使用資料類別: ::" -#: ../../library/dataclasses.rst:750 +#: ../../library/dataclasses.rst:763 msgid "" "class C:\n" " x = []\n" @@ -1505,7 +1527,7 @@ msgstr "" "assert o1.x == [1, 2]\n" "assert o1.x is o2.x" -#: ../../library/dataclasses.rst:762 +#: ../../library/dataclasses.rst:775 #, fuzzy msgid "" "Note that the two instances of class :class:`!C` share the same class " @@ -1514,12 +1536,12 @@ msgstr "" "請注意,類別 :class:`!C` 的兩個實例共享同一個類別變數 :attr:`!x`,正如預期的" "那樣。" -#: ../../library/dataclasses.rst:765 +#: ../../library/dataclasses.rst:778 #, fuzzy msgid "Using dataclasses, *if* this code was valid::" msgstr "使用資料類別,*如果*\\ 此程式碼有效: ::" -#: ../../library/dataclasses.rst:767 +#: ../../library/dataclasses.rst:780 msgid "" "@dataclass\n" "class D:\n" @@ -1533,11 +1555,11 @@ msgstr "" " def add(self, element):\n" " self.x.append(element)" -#: ../../library/dataclasses.rst:773 +#: ../../library/dataclasses.rst:786 msgid "it would generate code similar to::" msgstr "它會生成類似的程式碼: ::" -#: ../../library/dataclasses.rst:775 +#: ../../library/dataclasses.rst:788 msgid "" "class D:\n" " x = []\n" @@ -1557,7 +1579,7 @@ msgstr "" "\n" "assert D().x is D().x" -#: ../../library/dataclasses.rst:784 +#: ../../library/dataclasses.rst:797 #, fuzzy msgid "" "This has the same issue as the original example using class :class:`!C`. " @@ -1577,14 +1599,14 @@ msgstr "" "檢測到不可雜湊的預設參數,它將引發 :exc:`TypeError`。假設是如果一個值是不可散" "列的,那麼它就是可變的。這是一個部分解決方案,但它確實可以防止許多常見錯誤。" -#: ../../library/dataclasses.rst:795 +#: ../../library/dataclasses.rst:808 #, fuzzy msgid "" "Using default factory functions is a way to create new instances of mutable " "types as default values for fields::" msgstr "使用預設工廠函式是一種建立可變型別的新實例作為欄位預設值的方法: ::" -#: ../../library/dataclasses.rst:798 +#: ../../library/dataclasses.rst:811 msgid "" "@dataclass\n" "class D:\n" @@ -1598,7 +1620,7 @@ msgstr "" "\n" "assert D().x is not D().x" -#: ../../library/dataclasses.rst:804 +#: ../../library/dataclasses.rst:817 #, fuzzy msgid "" "Instead of looking for and disallowing objects of type :class:`list`, :class:" @@ -1608,12 +1630,12 @@ msgstr "" "不再查找和禁止型別為 :class:`list`、:class:`dict` 或 :class:`set` 的物件,現" "在不允許使用不可雜湊的物件作為預設值。不可雜湊性用於近似可變性。" -#: ../../library/dataclasses.rst:811 +#: ../../library/dataclasses.rst:824 #, fuzzy msgid "Descriptor-typed fields" msgstr "描述器型別的欄位" -#: ../../library/dataclasses.rst:813 +#: ../../library/dataclasses.rst:826 #, fuzzy msgid "" "Fields that are assigned :ref:`descriptor objects ` as their " @@ -1621,7 +1643,7 @@ msgid "" msgstr "" "指定為\\ :ref:`描述器物件 `\\ 作為預設值的欄位具有以下特殊行為:" -#: ../../library/dataclasses.rst:816 +#: ../../library/dataclasses.rst:829 #, fuzzy msgid "" "The value for the field passed to the dataclass's :meth:`~object.__init__` " @@ -1631,7 +1653,7 @@ msgstr "" "傳遞給資料類別的 :meth:`~object.__init__` 方法的欄位值被傳遞給描述器的 :meth:" "`~object.__set__` 方法,而不是覆蓋描述器物件。" -#: ../../library/dataclasses.rst:820 +#: ../../library/dataclasses.rst:833 #, fuzzy msgid "" "Similarly, when getting or setting the field, the descriptor's :meth:" @@ -1641,7 +1663,7 @@ msgstr "" "同樣,在取得或設定欄位時,將呼叫描述器的 :meth:`~object.__get__` 或 :meth:`!" "__set__` 方法,而不是回傳或覆蓋描述器物件。" -#: ../../library/dataclasses.rst:824 +#: ../../library/dataclasses.rst:837 #, fuzzy msgid "" "To determine whether a field contains a default value, :deco:`dataclass` " @@ -1657,7 +1679,7 @@ msgstr "" "面,如果描述器在這種情況下引發 :exc:`AttributeError`,則不會為該欄位提供預設" "值。" -#: ../../library/dataclasses.rst:834 +#: ../../library/dataclasses.rst:847 msgid "" "class IntConversionDescriptor:\n" " def __init__(self, *, default):\n" @@ -1711,7 +1733,7 @@ msgstr "" "i.quantity_on_hand = 2.5 # 以 2.5 呼叫 __set__\n" "print(i.quantity_on_hand) # 2" -#: ../../library/dataclasses.rst:859 +#: ../../library/dataclasses.rst:872 #, fuzzy msgid "" "Note that if a field is annotated with a descriptor type, but is not " diff --git a/library/dialog.po b/library/dialog.po index b73e6c32f4..f8086d0d1a 100644 --- a/library/dialog.po +++ b/library/dialog.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-20 00:18+0000\n" +"POT-Creation-Date: 2026-06-19 00:50+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-" @@ -18,7 +18,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: ../../library/dialog.rst:2 -msgid "Tkinter Dialogs" +#, fuzzy +msgid "Tkinter dialogs" msgstr "Tkinter 對話框" #: ../../library/dialog.rst:5 @@ -57,25 +58,62 @@ msgid "" "layouts." msgstr "" -#: ../../library/dialog.rst:42 +#: ../../library/dialog.rst:41 +msgid "" +"Validate the data entered by the user. Return true if it is valid, in which " +"case the dialog proceeds to :meth:`apply`; return false to keep the dialog " +"open. The default implementation always returns true; override it to check " +"the input." +msgstr "" + +#: ../../library/dialog.rst:49 +msgid "" +"Process the data entered by the user. Called after :meth:`validate` succeeds " +"and just before the dialog is destroyed. The default implementation does " +"nothing; override it to act on or store the result." +msgstr "" + +#: ../../library/dialog.rst:57 +msgid "" +"Destroy the dialog window, clearing the reference to the widget that had the " +"initial focus." +msgstr "" + +#: ../../library/dialog.rst:63 +msgid "" +"A simple modal dialog that displays the message *text* above a row of push " +"buttons whose labels are given by *buttons*, and returns the index of the " +"button the user presses. *default* is the index of the button activated by " +"the Return key, *cancel* the index returned when the window is closed " +"through the window manager, *title* the window title, and *class_* the Tk " +"class name of the window." +msgstr "" + +#: ../../library/dialog.rst:72 +msgid "" +"Display the dialog, wait until the user presses a button or closes the " +"window, and return the index of the chosen button." +msgstr "" + +#: ../../library/dialog.rst:78 msgid ":mod:`!tkinter.filedialog` --- File selection dialogs" msgstr ":mod:`!tkinter.filedialog` --- 檔案選擇對話框" -#: ../../library/dialog.rst:47 +#: ../../library/dialog.rst:83 msgid "**Source code:** :source:`Lib/tkinter/filedialog.py`" msgstr "**原始碼:**\\ :source:`Lib/tkinter/filedialog.py`" -#: ../../library/dialog.rst:51 +#: ../../library/dialog.rst:87 msgid "" "The :mod:`!tkinter.filedialog` module provides classes and factory functions " "for creating file/directory selection windows." msgstr "" -#: ../../library/dialog.rst:55 -msgid "Native Load/Save Dialogs" +#: ../../library/dialog.rst:91 +msgid "Native load/save dialogs" msgstr "" -#: ../../library/dialog.rst:57 +#: ../../library/dialog.rst:93 msgid "" "The following classes and functions provide file dialog windows that combine " "a native look-and-feel with configuration options to customize behaviour. " @@ -112,175 +150,223 @@ msgstr "" msgid "*multiple* - when true, selection of multiple items is allowed" msgstr "" -#: ../../library/dialog.rst:77 +#: ../../library/dialog.rst:113 msgid "**Static factory functions**" msgstr "" -#: ../../library/dialog.rst:79 +#: ../../library/dialog.rst:115 msgid "" "The below functions when called create a modal, native look-and-feel dialog, " -"wait for the user's selection, then return the selected value(s) or ``None`` " -"to the caller." +"wait for the user's selection, and return it. The exact return value depends " +"on the function (see below); when the dialog is cancelled it is an empty " +"string, an empty tuple, an empty list or ``None``." msgstr "" -#: ../../library/dialog.rst:86 +#: ../../library/dialog.rst:123 msgid "" -"The above two functions create an :class:`Open` dialog and return the opened " -"file object(s) in read-only mode." +"Create an :class:`Open` dialog. :func:`askopenfile` returns the opened file " +"object, or ``None`` if the dialog is cancelled. :func:`askopenfiles` returns " +"a list of the opened file objects, or an empty list if cancelled. The files " +"are opened in mode *mode* (read-only ``'r'`` by default)." msgstr "" -#: ../../library/dialog.rst:91 +#: ../../library/dialog.rst:132 msgid "" -"Create a :class:`SaveAs` dialog and return a file object opened in write-" -"only mode." +"Create a :class:`SaveAs` dialog and return the opened file object, or " +"``None`` if the dialog is cancelled. The file is opened in mode *mode* " +"(``'w'`` by default)." msgstr "" -#: ../../library/dialog.rst:96 +#: ../../library/dialog.rst:139 msgid "" -"The above two functions create an :class:`Open` dialog and return the " -"selected filename(s) that correspond to existing file(s)." +"Create an :class:`Open` dialog. :func:`askopenfilename` returns the selected " +"filename as a string, or an empty string if the dialog is cancelled. :func:" +"`askopenfilenames` returns a tuple of the selected filenames, or an empty " +"tuple if cancelled." msgstr "" -#: ../../library/dialog.rst:101 -msgid "Create a :class:`SaveAs` dialog and return the selected filename." -msgstr "" - -#: ../../library/dialog.rst:105 -msgid "Prompt user to select a directory." -msgstr "" - -#: ../../library/dialog.rst:106 -msgid "Additional keyword option:" +#: ../../library/dialog.rst:147 +msgid "" +"Create a :class:`SaveAs` dialog and return the selected filename as a " +"string, or an empty string if the dialog is cancelled." msgstr "" -#: ../../library/dialog.rst:107 -msgid "*mustexist* - determines if selection must be an existing directory." +#: ../../library/dialog.rst:152 +msgid "" +"Prompt the user to select a directory, and return its path as a string, or " +"an empty string if the dialog is cancelled. Additional keyword option: " +"*mustexist* - if true, the user may only select an existing directory (false " +"by default)." msgstr "" -#: ../../library/dialog.rst:112 +#: ../../library/dialog.rst:160 msgid "" "The above two classes provide native dialog windows for saving and loading " "files." msgstr "" -#: ../../library/dialog.rst:115 +#: ../../library/dialog.rst:163 msgid "**Convenience classes**" msgstr "" -#: ../../library/dialog.rst:117 +#: ../../library/dialog.rst:165 msgid "" "The below classes are used for creating file/directory windows from scratch. " "These do not emulate the native look-and-feel of the platform." msgstr "" -#: ../../library/dialog.rst:122 +#: ../../library/dialog.rst:170 msgid "Create a dialog prompting the user to select a directory." msgstr "" -#: ../../library/dialog.rst:124 +#: ../../library/dialog.rst:172 msgid "" "The *FileDialog* class should be subclassed for custom event handling and " "behaviour." msgstr "" -#: ../../library/dialog.rst:129 +#: ../../library/dialog.rst:177 msgid "Create a basic file selection dialog." msgstr "" -#: ../../library/dialog.rst:133 +#: ../../library/dialog.rst:181 msgid "Trigger the termination of the dialog window." msgstr "" -#: ../../library/dialog.rst:137 +#: ../../library/dialog.rst:185 msgid "Event handler for double-click event on directory." msgstr "" -#: ../../library/dialog.rst:141 +#: ../../library/dialog.rst:189 msgid "Event handler for click event on directory." msgstr "" -#: ../../library/dialog.rst:145 +#: ../../library/dialog.rst:193 msgid "Event handler for double-click event on file." msgstr "" -#: ../../library/dialog.rst:149 +#: ../../library/dialog.rst:197 msgid "Event handler for single-click event on file." msgstr "" -#: ../../library/dialog.rst:153 +#: ../../library/dialog.rst:201 msgid "Filter the files by directory." msgstr "" -#: ../../library/dialog.rst:157 +#: ../../library/dialog.rst:205 msgid "Retrieve the file filter currently in use." msgstr "" -#: ../../library/dialog.rst:161 +#: ../../library/dialog.rst:209 msgid "Retrieve the currently selected item." msgstr "" -#: ../../library/dialog.rst:165 +#: ../../library/dialog.rst:213 msgid "Render dialog and start event loop." msgstr "" -#: ../../library/dialog.rst:169 +#: ../../library/dialog.rst:217 msgid "Exit dialog returning current selection." msgstr "" -#: ../../library/dialog.rst:173 +#: ../../library/dialog.rst:221 +msgid "" +"Called when the user confirms the current selection. The base implementation " +"accepts the selection and closes the dialog; :class:`LoadFileDialog` and :" +"class:`SaveFileDialog` override it to check the selection first." +msgstr "" + +#: ../../library/dialog.rst:228 msgid "Exit dialog returning filename, if any." msgstr "" -#: ../../library/dialog.rst:177 +#: ../../library/dialog.rst:232 msgid "Set the file filter." msgstr "" -#: ../../library/dialog.rst:181 +#: ../../library/dialog.rst:236 msgid "Update the current file selection to *file*." msgstr "" -#: ../../library/dialog.rst:186 +#: ../../library/dialog.rst:241 msgid "" "A subclass of FileDialog that creates a dialog window for selecting an " "existing file." msgstr "" -#: ../../library/dialog.rst:191 +#: ../../library/dialog.rst:246 msgid "" "Test that a file is provided and that the selection indicates an already " "existing file." msgstr "" -#: ../../library/dialog.rst:196 +#: ../../library/dialog.rst:251 msgid "" "A subclass of FileDialog that creates a dialog window for selecting a " "destination file." msgstr "" -#: ../../library/dialog.rst:201 +#: ../../library/dialog.rst:256 msgid "" "Test whether or not the selection points to a valid file that is not a " "directory. Confirmation is required if an already existing file is selected." msgstr "" -#: ../../library/dialog.rst:206 +#: ../../library/dialog.rst:261 msgid ":mod:`!tkinter.commondialog` --- Dialog window templates" msgstr ":mod:`!tkinter.commondialog` --- 對話框視窗範本" -#: ../../library/dialog.rst:211 +#: ../../library/dialog.rst:266 msgid "**Source code:** :source:`Lib/tkinter/commondialog.py`" msgstr "**原始碼:**\\ :source:`Lib/tkinter/commondialog.py`" -#: ../../library/dialog.rst:215 +#: ../../library/dialog.rst:270 msgid "" "The :mod:`!tkinter.commondialog` module provides the :class:`Dialog` class " "that is the base class for dialogs defined in other supporting modules." msgstr "" -#: ../../library/dialog.rst:222 +#: ../../library/dialog.rst:277 msgid "Render the Dialog window." msgstr "" -#: ../../library/dialog.rst:227 +#: ../../library/dialog.rst:281 +#, fuzzy +msgid ":mod:`!tkinter.dialog` --- Classic Tk dialog boxes" +msgstr ":mod:`!tkinter.filedialog` --- 檔案選擇對話框" + +#: ../../library/dialog.rst:286 +#, fuzzy +msgid "**Source code:** :source:`Lib/tkinter/dialog.py`" +msgstr "**原始碼:**\\ :source:`Lib/tkinter/filedialog.py`" + +#: ../../library/dialog.rst:290 +msgid "" +"The :mod:`!tkinter.dialog` module provides a simple modal dialog box built " +"on the classic (non-themed) Tk widgets." +msgstr "" + +#: ../../library/dialog.rst:295 +msgid "" +"The name of the default bitmap (``'questhead'``) displayed by a :class:" +"`Dialog`." +msgstr "" + +#: ../../library/dialog.rst:300 +msgid "" +"Display a modal dialog box built from the classic (non-themed) Tk widgets " +"and wait for the user to press one of its buttons. The options, given " +"through *cnf* or as keyword arguments, include *title* (the window title), " +"*text* (the message), *bitmap* (an icon, :data:`DIALOG_ICON` by default), " +"*default* (the index of the default button) and *strings* (the sequence of " +"button labels). After construction, the :attr:`!num` attribute holds the " +"index of the button the user pressed." +msgstr "" + +#: ../../library/dialog.rst:311 +msgid "Destroy the dialog window." +msgstr "" + +#: ../../library/dialog.rst:316 msgid "Modules :mod:`tkinter.messagebox`, :ref:`tut-files`" msgstr ":mod:`tkinter.messagebox` 模組、:ref:`tut-files`" diff --git a/library/functions.po b/library/functions.po index 1d0d163bad..56cb786c07 100644 --- a/library/functions.po +++ b/library/functions.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-04-16 00:29+0000\n" +"POT-Creation-Date: 2026-06-12 18:22+0000\n" "PO-Revision-Date: 2025-07-28 21:38+0800\n" "Last-Translator: Weilin Du <1372449351@qq.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1081,9 +1081,10 @@ msgstr "" "(identifier)(請見 :func:`setattr`)。" #: ../../library/functions.rst:476 +#, fuzzy msgid "" "Create a new dictionary. The :class:`dict` object is the dictionary class. " -"See :class:`dict` and :ref:`typesmapping` for documentation about this class." +"See also :ref:`typesmapping` for documentation about this class." msgstr "" "建立一個新的 dictionary(字典)。:class:`dict` 物件是一個 dictionary class。" "參見 :class:`dict` 和 :ref:`typesmapping` 來瞭解這個 class。" @@ -1614,10 +1615,11 @@ msgstr "" "exc:`TypeError`。" #: ../../library/functions.rst:854 +#, fuzzy msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " -"*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" -"ref:`types-set` for documentation about this class." +"*iterable*. :class:`frozenset` is a built-in class. See also :ref:`types-" +"set` for documentation about this class." msgstr "" "回傳一個新的 :class:`frozenset` 物件,它包含選擇性引數 *iterable* 中的元素。" "``frozenset`` 是一個內建的 class。有關此 class 的文件,請參閱 :class:" @@ -3212,10 +3214,11 @@ msgstr "" "確地表示為浮點數。更多資訊請參閱 :ref:`tut-fp-issues`。" #: ../../library/functions.rst:1810 +#, fuzzy msgid "" "Return a new :class:`set` object, optionally with elements taken from " -"*iterable*. ``set`` is a built-in class. See :class:`set` and :ref:`types-" -"set` for documentation about this class." +"*iterable*. :class:`set` is a built-in class. See also :ref:`types-set` " +"for documentation about this class." msgstr "" "回傳一個新的 :class:`set` 物件,可選擇性地包含從 *iterable* 取得的元素。" "``set`` 是一個內建類別。關於此類別的說明文件請參閱 :class:`set` 和 :ref:" diff --git a/library/importlib.resources.po b/library/importlib.resources.po index 010415fbe7..aea4ecf7d7 100644 --- a/library/importlib.resources.po +++ b/library/importlib.resources.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-05-01 00:34+0000\n" +"POT-Creation-Date: 2026-06-06 15:51+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,8 +202,8 @@ msgstr "" #: ../../library/importlib.resources.rst:140 #: ../../library/importlib.resources.rst:183 #: ../../library/importlib.resources.rst:231 -#: ../../library/importlib.resources.rst:248 -#: ../../library/importlib.resources.rst:266 +#: ../../library/importlib.resources.rst:247 +#: ../../library/importlib.resources.rst:265 msgid "" "See :ref:`the introduction ` for details on " "*anchor* and *path_names*." @@ -220,8 +220,8 @@ msgstr "" #: ../../library/importlib.resources.rst:186 #: ../../library/importlib.resources.rst:207 #: ../../library/importlib.resources.rst:234 -#: ../../library/importlib.resources.rst:251 -#: ../../library/importlib.resources.rst:269 +#: ../../library/importlib.resources.rst:250 +#: ../../library/importlib.resources.rst:268 msgid "This function is roughly equivalent to::" msgstr "這個函式大致等同於: ::" @@ -231,7 +231,8 @@ msgstr "files(anchor).joinpath(*path_names).open('rb')" #: ../../library/importlib.resources.rst:150 #: ../../library/importlib.resources.rst:190 -#: ../../library/importlib.resources.rst:255 +#: ../../library/importlib.resources.rst:238 +#: ../../library/importlib.resources.rst:254 msgid "Multiple *path_names* are accepted." msgstr "多個 *path_names* 是被接受的。" @@ -269,7 +270,6 @@ msgstr "files(anchor).joinpath(*path_names).open('r', encoding=encoding)" #: ../../library/importlib.resources.rst:174 #: ../../library/importlib.resources.rst:211 -#: ../../library/importlib.resources.rst:238 msgid "" "Multiple *path_names* are accepted. *encoding* and *errors* must be given as " "keyword arguments." @@ -324,17 +324,17 @@ msgstr "" msgid "as_file(files(anchor).joinpath(*path_names))" msgstr "as_file(files(anchor).joinpath(*path_names))" -#: ../../library/importlib.resources.rst:245 +#: ../../library/importlib.resources.rst:244 msgid "" "Return ``True`` if the named resource exists, otherwise ``False``. This " "function does not consider directories to be resources." msgstr "" -#: ../../library/importlib.resources.rst:253 +#: ../../library/importlib.resources.rst:252 msgid "files(anchor).joinpath(*path_names).is_file()" msgstr "files(anchor).joinpath(*path_names).is_file()" -#: ../../library/importlib.resources.rst:261 +#: ../../library/importlib.resources.rst:260 msgid "" "Return an iterable over the named items within the package or path. The " "iterable returns names of resources (e.g. files) and non-resources (e.g. " @@ -342,7 +342,7 @@ msgid "" "subdirectories." msgstr "" -#: ../../library/importlib.resources.rst:271 +#: ../../library/importlib.resources.rst:270 msgid "" "for resource in files(anchor).joinpath(*path_names).iterdir():\n" " yield resource.name" @@ -350,7 +350,7 @@ msgstr "" "for resource in files(anchor).joinpath(*path_names).iterdir():\n" " yield resource.name" -#: ../../library/importlib.resources.rst:274 +#: ../../library/importlib.resources.rst:273 msgid "" "Prefer ``iterdir()`` as above, which offers more control over the results " "and richer functionality." diff --git a/library/locale.po b/library/locale.po index 6e37f8ac31..80a48941b7 100644 --- a/library/locale.po +++ b/library/locale.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-07 00:19+0000\n" +"POT-Creation-Date: 2026-06-12 00:46+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -540,7 +540,7 @@ msgid "" "``'LC_CTYPE'``, ``'LANG'`` and ``'LANGUAGE'``, in that order." msgstr "" -#: ../../library/locale.rst:364 ../../library/locale.rst:379 +#: ../../library/locale.rst:364 ../../library/locale.rst:377 msgid "" "The language code has the same format as a :ref:`locale name `, " "but without encoding and ``@``-modifier. The language code and encoding may " @@ -548,7 +548,7 @@ msgid "" "represented as ``(None, None)``." msgstr "" -#: ../../library/locale.rst:375 +#: ../../library/locale.rst:373 msgid "" "Returns the current setting for the given locale category as a tuple " "containing the language code and encoding. *category* may be one of the :" @@ -556,7 +556,7 @@ msgid "" "`LC_CTYPE`." msgstr "" -#: ../../library/locale.rst:388 +#: ../../library/locale.rst:386 msgid "" "Return the :term:`locale encoding` used for text data, according to user " "preferences. User preferences are expressed differently on different " @@ -564,72 +564,72 @@ msgid "" "this function only returns a guess." msgstr "" -#: ../../library/locale.rst:393 +#: ../../library/locale.rst:391 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:397 +#: ../../library/locale.rst:395 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:401 ../../library/locale.rst:419 +#: ../../library/locale.rst:399 ../../library/locale.rst:417 msgid "" "The :ref:`Python preinitialization ` configures the LC_CTYPE " "locale. See also the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../library/locale.rst:404 +#: ../../library/locale.rst:402 msgid "" "The function now always returns ``\"utf-8\"`` on Android or if the :ref:" "`Python UTF-8 Mode ` is enabled." msgstr "" -#: ../../library/locale.rst:411 +#: ../../library/locale.rst:409 msgid "Get the current :term:`locale encoding`:" msgstr "" -#: ../../library/locale.rst:413 +#: ../../library/locale.rst:411 msgid "On Android and VxWorks, return ``\"utf-8\"``." msgstr "" -#: ../../library/locale.rst:414 +#: ../../library/locale.rst:412 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:417 +#: ../../library/locale.rst:415 msgid "On Windows, return the ANSI code page." msgstr "" -#: ../../library/locale.rst:422 +#: ../../library/locale.rst:420 msgid "" "This function is similar to :func:`getpreferredencoding(False) " "` except this function ignores the :ref:`Python UTF-8 " "Mode `." msgstr "" -#: ../../library/locale.rst:431 +#: ../../library/locale.rst:429 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:435 +#: ../../library/locale.rst:433 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:441 +#: ../../library/locale.rst:439 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 " @@ -637,7 +637,7 @@ msgid "" "is equal to it." msgstr "" -#: ../../library/locale.rst:449 +#: ../../library/locale.rst:447 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, " @@ -645,7 +645,7 @@ msgid "" "repeatedly, e.g. when collating a sequence of strings." msgstr "" -#: ../../library/locale.rst:458 +#: ../../library/locale.rst:456 msgid "" "Formats a number *val* according to the current :const:`LC_NUMERIC` setting. " "The format follows the conventions of the ``%`` operator. For floating-" @@ -653,29 +653,29 @@ msgid "" "is ``True``, also takes the grouping into account." msgstr "" -#: ../../library/locale.rst:463 +#: ../../library/locale.rst:461 msgid "" "If *monetary* is true, the conversion uses monetary thousands separator and " "grouping strings." msgstr "" -#: ../../library/locale.rst:466 +#: ../../library/locale.rst:464 msgid "" "Processes formatting specifiers as in ``format % val``, but takes the " "current locale settings into account." msgstr "" -#: ../../library/locale.rst:469 +#: ../../library/locale.rst:467 msgid "The *monetary* keyword parameter was added." msgstr "新增了 *monetary* 關鍵字參數。" -#: ../../library/locale.rst:475 +#: ../../library/locale.rst:473 msgid "" "Formats a number *val* according to the current :const:`LC_MONETARY` " "settings." msgstr "" -#: ../../library/locale.rst:477 +#: ../../library/locale.rst:475 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), " @@ -683,43 +683,43 @@ msgid "" "not the default), the international currency symbol is used." msgstr "" -#: ../../library/locale.rst:484 +#: ../../library/locale.rst:482 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:490 +#: ../../library/locale.rst:488 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:496 +#: ../../library/locale.rst:494 msgid "" "Converts a string into a normalized number string, following the :const:" "`LC_NUMERIC` settings." msgstr "" -#: ../../library/locale.rst:504 +#: ../../library/locale.rst:502 msgid "" "Converts a normalized number string into a formatted string following the :" "const:`LC_NUMERIC` settings." msgstr "" -#: ../../library/locale.rst:512 +#: ../../library/locale.rst:510 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:518 +#: ../../library/locale.rst:516 msgid "" "Converts a string to an integer, following the :const:`LC_NUMERIC` " "conventions." msgstr "" -#: ../../library/locale.rst:523 +#: ../../library/locale.rst:521 msgid "" "Locale category for the character type functions. Most importantly, this " "category defines the text encoding, i.e. how bytes are interpreted as " @@ -729,32 +729,32 @@ msgid "" "SSH connections." msgstr "" -#: ../../library/locale.rst:530 +#: ../../library/locale.rst:528 msgid "" "Python doesn't internally use locale-dependent character transformation " "functions from ``ctype.h``. Instead, ``pyctype.h`` provides locale-" "independent equivalents like :c:macro:`Py_TOLOWER`." msgstr "" -#: ../../library/locale.rst:537 +#: ../../library/locale.rst:535 msgid "" "Locale category for sorting strings. The functions :func:`strcoll` and :" "func:`strxfrm` of the :mod:`!locale` module are affected." msgstr "" -#: ../../library/locale.rst:543 +#: ../../library/locale.rst:541 msgid "" "Locale category for the formatting of time. The function :func:`time." "strftime` follows these conventions." msgstr "" -#: ../../library/locale.rst:549 +#: ../../library/locale.rst:547 msgid "" "Locale category for formatting of monetary values. The available options " "are available from the :func:`localeconv` function." msgstr "" -#: ../../library/locale.rst:555 +#: ../../library/locale.rst:553 msgid "" "Locale category for message display. Python currently does not support " "application specific locale-aware messages. Messages displayed by the " @@ -762,13 +762,13 @@ msgid "" "affected by this category." msgstr "" -#: ../../library/locale.rst:560 +#: ../../library/locale.rst:558 msgid "" "This value may not be available on operating systems not conforming to the " "POSIX standard, most notably Windows." msgstr "" -#: ../../library/locale.rst:566 +#: ../../library/locale.rst:564 msgid "" "Locale category for formatting numbers. The functions :func:" "`format_string`, :func:`atoi`, :func:`atof` and :func:`.str` of the :mod:`!" @@ -776,7 +776,7 @@ msgid "" "operations are not affected." msgstr "" -#: ../../library/locale.rst:574 +#: ../../library/locale.rst:572 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 " @@ -786,17 +786,17 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:583 +#: ../../library/locale.rst:581 msgid "" "This is a symbolic constant used for different values returned by :func:" "`localeconv`." msgstr "" -#: ../../library/locale.rst:588 +#: ../../library/locale.rst:586 msgid "Background, details, hints, tips and caveats" msgstr "" -#: ../../library/locale.rst:590 +#: ../../library/locale.rst:588 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 " @@ -804,7 +804,7 @@ msgid "" "This makes the locale somewhat painful to use correctly." msgstr "" -#: ../../library/locale.rst:595 +#: ../../library/locale.rst:593 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 :" @@ -814,7 +814,7 @@ msgid "" "categories by calling ``setlocale(LC_ALL, '')``." msgstr "" -#: ../../library/locale.rst:602 +#: ../../library/locale.rst:600 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 " @@ -822,7 +822,7 @@ msgid "" "that happen to run before the settings have been restored." msgstr "" -#: ../../library/locale.rst:607 +#: ../../library/locale.rst:605 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 " @@ -833,14 +833,14 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:614 +#: ../../library/locale.rst:612 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:618 +#: ../../library/locale.rst:616 msgid "" "There is no way to perform case conversions and character classifications " "according to the locale. For (Unicode) text strings these are done " @@ -851,21 +851,21 @@ msgid "" "whitespace." msgstr "" -#: ../../library/locale.rst:629 +#: ../../library/locale.rst:627 msgid "Locale names" msgstr "" -#: ../../library/locale.rst:631 +#: ../../library/locale.rst:629 msgid "" "The format of the locale name is platform dependent, and the set of " "supported locales can depend on the system configuration." msgstr "" -#: ../../library/locale.rst:634 +#: ../../library/locale.rst:632 msgid "On Posix platforms, it usually has the format [1]_:" msgstr "" -#: ../../library/locale.rst:639 +#: ../../library/locale.rst:637 msgid "" "where *language* is a two- or three-letter language code from `ISO 639`_, " "*territory* is a two-letter country or region code from `ISO 3166`_, " @@ -874,13 +874,13 @@ msgid "" "\"latin\", \"valencia\", \"stroke\" and \"euro\")." msgstr "" -#: ../../library/locale.rst:645 +#: ../../library/locale.rst:643 msgid "" "On Windows, several formats are supported. [2]_ [3]_ A subset of `IETF BCP " "47`_ tags:" msgstr "" -#: ../../library/locale.rst:652 +#: ../../library/locale.rst:650 msgid "" "where *language* and *territory* have the same meaning as in Posix, *script* " "is a four-letter script code from `ISO 15924`_, and *modifier* is a language " @@ -890,11 +890,11 @@ msgid "" "allowed for BCP 47 tags." msgstr "" -#: ../../library/locale.rst:659 +#: ../../library/locale.rst:657 msgid "Windows also supports locale names in the format:" msgstr "" -#: ../../library/locale.rst:664 +#: ../../library/locale.rst:662 msgid "" "where *language* and *territory* are full names, such as \"English\" and " "\"United States\", and *charset* is either a code page number (for example, " @@ -902,34 +902,34 @@ msgid "" "format." msgstr "" -#: ../../library/locale.rst:669 +#: ../../library/locale.rst:667 msgid "The \"C\" locale is supported on all platforms." msgstr "" -#: ../../library/locale.rst:676 +#: ../../library/locale.rst:674 msgid "" "`IEEE Std 1003.1-2024; 8.2 Internationalization Variables `_" msgstr "" -#: ../../library/locale.rst:677 +#: ../../library/locale.rst:675 msgid "" "`UCRT Locale names, Languages, and Country/Region strings `_" msgstr "" -#: ../../library/locale.rst:678 +#: ../../library/locale.rst:676 msgid "" "`Locale Names `_" msgstr "" -#: ../../library/locale.rst:684 +#: ../../library/locale.rst:682 msgid "For extension writers and programs that embed Python" msgstr "" -#: ../../library/locale.rst:686 +#: ../../library/locale.rst:684 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 " @@ -937,7 +937,7 @@ msgid "" "whether or not the locale is ``C``)." msgstr "" -#: ../../library/locale.rst:691 +#: ../../library/locale.rst:689 msgid "" "When Python code uses the :mod:`!locale` module to change the locale, this " "also affects the embedding application. If the embedding application " @@ -947,11 +947,11 @@ msgid "" "accessible as a shared library." msgstr "" -#: ../../library/locale.rst:702 +#: ../../library/locale.rst:700 msgid "Access to message catalogs" msgstr "" -#: ../../library/locale.rst:711 +#: ../../library/locale.rst:709 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:" @@ -962,7 +962,7 @@ msgid "" "locating message catalogs." msgstr "" -#: ../../library/locale.rst:718 +#: ../../library/locale.rst:716 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/operator.po b/library/operator.po index fb3db11060..0778a9f6ef 100644 --- a/library/operator.po +++ b/library/operator.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-07 00:19+0000\n" +"POT-Creation-Date: 2026-06-09 00:37+0000\n" "PO-Revision-Date: 2023-02-18 14:49+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -127,8 +127,8 @@ msgid "Return ``a + b``, for *a* and *b* numbers." msgstr "對於數字 *a* 和 *b*,回傳 ``a + b``。" #: ../../library/operator.rst:115 -msgid "Return the bitwise and of *a* and *b*." -msgstr "回傳 *x* 和 *y* 位元運算與 (and) 的結果。" +msgid "Return ``a & b``." +msgstr "回傳 ``a & b``。" #: ../../library/operator.rst:121 msgid "Return ``a // b``." @@ -146,22 +146,20 @@ msgstr "" "結果總是 :class:`int` 型別。在過去的版本中,結果可能為 ``int`` 子類別的實例。" #: ../../library/operator.rst:139 -msgid "" -"Return the bitwise inverse of the number *obj*. This is equivalent to " -"``~obj``." -msgstr "回傳數字 *obj* 按位元取反 (inverse) 的結果。這等價於 ``~obj``。" +msgid "Return ``~obj``." +msgstr "回傳 ``~obj``。" #: ../../library/operator.rst:145 -msgid "Return *a* shifted left by *b*." -msgstr "回傳 *a* 左移 *b* 位的結果。" +msgid "Return ``a << b``." +msgstr "回傳 ``a << b``。" #: ../../library/operator.rst:151 msgid "Return ``a % b``." msgstr "回傳 ``a % b``。" #: ../../library/operator.rst:157 -msgid "Return ``a * b``, for *a* and *b* numbers." -msgstr "對於數字 *a* 和 *b*,回傳 ``a * b``。" +msgid "Return ``a * b``." +msgstr "回傳 ``a * b``。" #: ../../library/operator.rst:163 msgid "Return ``a @ b``." @@ -172,20 +170,20 @@ msgid "Return *obj* negated (``-obj``)." msgstr "回傳 *obj* 取負值的結果 (\\ ``-obj``\\ )。" #: ../../library/operator.rst:177 -msgid "Return the bitwise or of *a* and *b*." -msgstr "回傳 *a* 和 *b* 按位元或 (or) 的結果。" +msgid "Return ``a | b``." +msgstr "回傳 ``a | b``。" #: ../../library/operator.rst:183 -msgid "Return *obj* positive (``+obj``)." -msgstr "回傳 *obj* 取正的結果 (\\ ``+obj``\\ )。" +msgid "Return ``+obj``." +msgstr "回傳 ``+obj``。" #: ../../library/operator.rst:189 -msgid "Return ``a ** b``, for *a* and *b* numbers." -msgstr "對於數字 *a* 和 *b*,回傳 ``a ** b``。" +msgid "Return ``a ** b``." +msgstr "回傳 ``a ** b``。" #: ../../library/operator.rst:195 -msgid "Return *a* shifted right by *b*." -msgstr "回傳 *a* 右移 *b* 位的結果。" +msgid "Return ``a >> b``." +msgstr "回傳 ``a >> b``。" #: ../../library/operator.rst:201 msgid "Return ``a - b``." @@ -198,8 +196,8 @@ msgid "" msgstr "回傳 ``a / b``,例如 2/3 將等於 .66 而不是 0。這也被稱為「真」除法。" #: ../../library/operator.rst:214 -msgid "Return the bitwise exclusive or of *a* and *b*." -msgstr "回傳 *a* 和 *b* 按位元異或 (exclusive or) 的結果。" +msgid "Return ``a ^ b``." +msgstr "回傳 ``a ^ b``。" #: ../../library/operator.rst:217 msgid "" @@ -259,8 +257,8 @@ msgid "" "arguments for :func:`map`, :func:`sorted`, :meth:`itertools.groupby`, or " "other functions that expect a function argument." msgstr "" -":mod:`!operator` module 還定義了一些用於常規屬性和條目查詢的工具。這些工具適合" -"用來編寫快速欄位提取器以作為 :func:`map`、:func:`sorted`、:meth:`itertools." +":mod:`!operator` module 還定義了一些用於常規屬性和條目查詢的工具。這些工具適" +"合用來編寫快速欄位提取器以作為 :func:`map`、:func:`sorted`、:meth:`itertools." "groupby` 或其他需要函式引數的函式之引數。" #: ../../library/operator.rst:287 @@ -508,8 +506,8 @@ msgid "``floordiv(a, b)``" msgstr "``floordiv(a, b)``" #: ../../library/operator.rst:408 -msgid "Bitwise And" -msgstr "按位元與 (And)" +msgid "Bitwise And, or Intersection" +msgstr "按位元與 (And),或稱交集 (Intersection)" #: ../../library/operator.rst:408 msgid "``a & b``" @@ -519,361 +517,361 @@ msgstr "``a & b``" msgid "``and_(a, b)``" msgstr "``and_(a, b)``" -#: ../../library/operator.rst:410 -msgid "Bitwise Exclusive Or" -msgstr "按位元互斥或 (Exclusive Or)" +#: ../../library/operator.rst:411 +msgid "Bitwise Exclusive Or, or Symmetric Difference" +msgstr "按位元互斥或 (Exclusive Or),或稱對稱差集 (Symmetric Difference)" -#: ../../library/operator.rst:410 +#: ../../library/operator.rst:411 msgid "``a ^ b``" msgstr "``a ^ b``" -#: ../../library/operator.rst:410 +#: ../../library/operator.rst:411 msgid "``xor(a, b)``" msgstr "``xor(a, b)``" -#: ../../library/operator.rst:412 -msgid "Bitwise Inversion" -msgstr "按位元取反 (Inversion)" +#: ../../library/operator.rst:415 +msgid "Bitwise Inversion, or Complement" +msgstr "按位元取反 (Inversion),或稱補集 (Complement)" -#: ../../library/operator.rst:412 +#: ../../library/operator.rst:415 msgid "``~ a``" msgstr "``~ a``" -#: ../../library/operator.rst:412 +#: ../../library/operator.rst:415 msgid "``invert(a)``" msgstr "``invert(a)``" -#: ../../library/operator.rst:414 -msgid "Bitwise Or" -msgstr "按位元或 (Or)" +#: ../../library/operator.rst:418 +msgid "Bitwise Or, or Union" +msgstr "按位元或 (Or),或稱聯集 (Union)" -#: ../../library/operator.rst:414 +#: ../../library/operator.rst:418 msgid "``a | b``" msgstr "``a | b``" -#: ../../library/operator.rst:414 +#: ../../library/operator.rst:418 msgid "``or_(a, b)``" msgstr "``or_(a, b)``" -#: ../../library/operator.rst:416 +#: ../../library/operator.rst:421 msgid "Exponentiation" msgstr "取冪" -#: ../../library/operator.rst:416 +#: ../../library/operator.rst:421 msgid "``a ** b``" msgstr "``a ** b``" -#: ../../library/operator.rst:416 +#: ../../library/operator.rst:421 msgid "``pow(a, b)``" msgstr "``pow(a, b)``" -#: ../../library/operator.rst:418 ../../library/operator.rst:420 -#: ../../library/operator.rst:422 ../../library/operator.rst:424 +#: ../../library/operator.rst:423 ../../library/operator.rst:425 +#: ../../library/operator.rst:427 ../../library/operator.rst:429 msgid "Identity" msgstr "識別性" -#: ../../library/operator.rst:418 +#: ../../library/operator.rst:423 msgid "``a is b``" msgstr "``a is b``" -#: ../../library/operator.rst:418 +#: ../../library/operator.rst:423 msgid "``is_(a, b)``" msgstr "``is_(a, b)``" -#: ../../library/operator.rst:420 +#: ../../library/operator.rst:425 msgid "``a is not b``" msgstr "``a is not b``" -#: ../../library/operator.rst:420 +#: ../../library/operator.rst:425 msgid "``is_not(a, b)``" msgstr "``is_not(a, b)``" -#: ../../library/operator.rst:422 +#: ../../library/operator.rst:427 msgid "``a is None``" msgstr "``a is None``" -#: ../../library/operator.rst:422 +#: ../../library/operator.rst:427 msgid "``is_none(a)``" msgstr "``is_none(a)``" -#: ../../library/operator.rst:424 +#: ../../library/operator.rst:429 msgid "``a is not None``" msgstr "``a is not None``" -#: ../../library/operator.rst:424 +#: ../../library/operator.rst:429 msgid "``is_not_none(a)``" msgstr "``is_not_none(a)``" -#: ../../library/operator.rst:426 +#: ../../library/operator.rst:431 msgid "Indexed Assignment" msgstr "索引賦值" -#: ../../library/operator.rst:426 +#: ../../library/operator.rst:431 msgid "``obj[k] = v``" msgstr "``obj[k] = v``" -#: ../../library/operator.rst:426 +#: ../../library/operator.rst:431 msgid "``setitem(obj, k, v)``" msgstr "``setitem(obj, k, v)``" -#: ../../library/operator.rst:428 +#: ../../library/operator.rst:433 msgid "Indexed Deletion" msgstr "索引刪除" -#: ../../library/operator.rst:428 +#: ../../library/operator.rst:433 msgid "``del obj[k]``" msgstr "``del obj[k]``" -#: ../../library/operator.rst:428 +#: ../../library/operator.rst:433 msgid "``delitem(obj, k)``" msgstr "``delitem(obj, k)``" -#: ../../library/operator.rst:430 +#: ../../library/operator.rst:435 msgid "Indexing" msgstr "索引取值" -#: ../../library/operator.rst:430 +#: ../../library/operator.rst:435 msgid "``obj[k]``" msgstr "``obj[k]``" -#: ../../library/operator.rst:430 +#: ../../library/operator.rst:435 msgid "``getitem(obj, k)``" msgstr "``getitem(obj, k)``" -#: ../../library/operator.rst:432 +#: ../../library/operator.rst:437 msgid "Left Shift" msgstr "左移" -#: ../../library/operator.rst:432 +#: ../../library/operator.rst:437 msgid "``a << b``" msgstr "``a << b``" -#: ../../library/operator.rst:432 +#: ../../library/operator.rst:437 msgid "``lshift(a, b)``" msgstr "``lshift(a, b)``" -#: ../../library/operator.rst:434 +#: ../../library/operator.rst:439 msgid "Modulo" msgstr "模除 (Modulo)" -#: ../../library/operator.rst:434 +#: ../../library/operator.rst:439 msgid "``a % b``" msgstr "``a % b``" -#: ../../library/operator.rst:434 +#: ../../library/operator.rst:439 msgid "``mod(a, b)``" msgstr "``mod(a, b)``" -#: ../../library/operator.rst:436 +#: ../../library/operator.rst:441 msgid "Multiplication" msgstr "乘法" -#: ../../library/operator.rst:436 +#: ../../library/operator.rst:441 msgid "``a * b``" msgstr "``a * b``" -#: ../../library/operator.rst:436 +#: ../../library/operator.rst:441 msgid "``mul(a, b)``" msgstr "``mul(a, b)``" -#: ../../library/operator.rst:438 +#: ../../library/operator.rst:443 msgid "Matrix Multiplication" msgstr "矩陣乘法" -#: ../../library/operator.rst:438 +#: ../../library/operator.rst:443 msgid "``a @ b``" msgstr "``a @ b``" -#: ../../library/operator.rst:438 +#: ../../library/operator.rst:443 msgid "``matmul(a, b)``" msgstr "``matmul(a, b)``" -#: ../../library/operator.rst:440 +#: ../../library/operator.rst:445 msgid "Negation (Arithmetic)" msgstr "反相(算術)" -#: ../../library/operator.rst:440 +#: ../../library/operator.rst:445 msgid "``- a``" msgstr "``- a``" -#: ../../library/operator.rst:440 +#: ../../library/operator.rst:445 msgid "``neg(a)``" msgstr "``neg(a)``" -#: ../../library/operator.rst:442 +#: ../../library/operator.rst:447 msgid "Negation (Logical)" msgstr "反相(邏輯)" -#: ../../library/operator.rst:442 +#: ../../library/operator.rst:447 msgid "``not a``" msgstr "``not a``" -#: ../../library/operator.rst:442 +#: ../../library/operator.rst:447 msgid "``not_(a)``" msgstr "``not_(a)``" -#: ../../library/operator.rst:444 +#: ../../library/operator.rst:449 msgid "Positive" msgstr "正數" -#: ../../library/operator.rst:444 +#: ../../library/operator.rst:449 msgid "``+ a``" msgstr "``+ a``" -#: ../../library/operator.rst:444 +#: ../../library/operator.rst:449 msgid "``pos(a)``" msgstr "``pos(a)``" -#: ../../library/operator.rst:446 +#: ../../library/operator.rst:451 msgid "Right Shift" msgstr "右移" -#: ../../library/operator.rst:446 +#: ../../library/operator.rst:451 msgid "``a >> b``" msgstr "``a >> b``" -#: ../../library/operator.rst:446 +#: ../../library/operator.rst:451 msgid "``rshift(a, b)``" msgstr "``rshift(a, b)``" -#: ../../library/operator.rst:448 +#: ../../library/operator.rst:453 msgid "Slice Assignment" msgstr "切片賦值" -#: ../../library/operator.rst:448 +#: ../../library/operator.rst:453 msgid "``seq[i:j] = values``" msgstr "``seq[i:j] = values``" -#: ../../library/operator.rst:448 +#: ../../library/operator.rst:453 msgid "``setitem(seq, slice(i, j), values)``" msgstr "``setitem(seq, slice(i, j), values)``" -#: ../../library/operator.rst:450 +#: ../../library/operator.rst:455 msgid "Slice Deletion" msgstr "切片刪除" -#: ../../library/operator.rst:450 +#: ../../library/operator.rst:455 msgid "``del seq[i:j]``" msgstr "``del seq[i:j]``" -#: ../../library/operator.rst:450 +#: ../../library/operator.rst:455 msgid "``delitem(seq, slice(i, j))``" msgstr "``delitem(seq, slice(i, j))``" -#: ../../library/operator.rst:452 +#: ../../library/operator.rst:457 msgid "Slicing" msgstr "切片取值" -#: ../../library/operator.rst:452 +#: ../../library/operator.rst:457 msgid "``seq[i:j]``" msgstr "``seq[i:j]``" -#: ../../library/operator.rst:452 +#: ../../library/operator.rst:457 msgid "``getitem(seq, slice(i, j))``" msgstr "``getitem(seq, slice(i, j))``" -#: ../../library/operator.rst:454 +#: ../../library/operator.rst:459 msgid "String Formatting" msgstr "字串格式化" -#: ../../library/operator.rst:454 +#: ../../library/operator.rst:459 msgid "``s % obj``" msgstr "``s % obj``" -#: ../../library/operator.rst:454 +#: ../../library/operator.rst:459 msgid "``mod(s, obj)``" msgstr "``mod(s, obj)``" -#: ../../library/operator.rst:456 +#: ../../library/operator.rst:461 msgid "Subtraction" msgstr "減法" -#: ../../library/operator.rst:456 +#: ../../library/operator.rst:461 msgid "``a - b``" msgstr "``a - b``" -#: ../../library/operator.rst:456 +#: ../../library/operator.rst:461 msgid "``sub(a, b)``" msgstr "``sub(a, b)``" -#: ../../library/operator.rst:458 +#: ../../library/operator.rst:463 msgid "Truth Test" msgstr "真值檢測" -#: ../../library/operator.rst:458 +#: ../../library/operator.rst:463 msgid "``obj``" msgstr "``obj``" -#: ../../library/operator.rst:458 +#: ../../library/operator.rst:463 msgid "``truth(obj)``" msgstr "``truth(obj)``" -#: ../../library/operator.rst:460 ../../library/operator.rst:462 -#: ../../library/operator.rst:468 ../../library/operator.rst:470 +#: ../../library/operator.rst:465 ../../library/operator.rst:467 +#: ../../library/operator.rst:473 ../../library/operator.rst:475 msgid "Ordering" msgstr "比較大小" -#: ../../library/operator.rst:460 +#: ../../library/operator.rst:465 msgid "``a < b``" msgstr "``a < b``" -#: ../../library/operator.rst:460 +#: ../../library/operator.rst:465 msgid "``lt(a, b)``" msgstr "``lt(a, b)``" -#: ../../library/operator.rst:462 +#: ../../library/operator.rst:467 msgid "``a <= b``" msgstr "``a <= b``" -#: ../../library/operator.rst:462 +#: ../../library/operator.rst:467 msgid "``le(a, b)``" msgstr "``le(a, b)``" -#: ../../library/operator.rst:464 +#: ../../library/operator.rst:469 msgid "Equality" msgstr "相等性" -#: ../../library/operator.rst:464 +#: ../../library/operator.rst:469 msgid "``a == b``" msgstr "``a == b``" -#: ../../library/operator.rst:464 +#: ../../library/operator.rst:469 msgid "``eq(a, b)``" msgstr "``eq(a, b)``" -#: ../../library/operator.rst:466 +#: ../../library/operator.rst:471 msgid "Difference" msgstr "不等性" -#: ../../library/operator.rst:466 +#: ../../library/operator.rst:471 msgid "``a != b``" msgstr "``a != b``" -#: ../../library/operator.rst:466 +#: ../../library/operator.rst:471 msgid "``ne(a, b)``" msgstr "``ne(a, b)``" -#: ../../library/operator.rst:468 +#: ../../library/operator.rst:473 msgid "``a >= b``" msgstr "``a >= b``" -#: ../../library/operator.rst:468 +#: ../../library/operator.rst:473 msgid "``ge(a, b)``" msgstr "``ge(a, b)``" -#: ../../library/operator.rst:470 +#: ../../library/operator.rst:475 msgid "``a > b``" msgstr "``a > b``" -#: ../../library/operator.rst:470 +#: ../../library/operator.rst:475 msgid "``gt(a, b)``" msgstr "``gt(a, b)``" -#: ../../library/operator.rst:474 +#: ../../library/operator.rst:479 msgid "In-place Operators" msgstr "原地 (in-place) 運算子" -#: ../../library/operator.rst:476 +#: ../../library/operator.rst:481 msgid "" "Many operations have an \"in-place\" version. Listed below are functions " "providing a more primitive access to in-place operators than the usual " @@ -887,7 +885,7 @@ msgstr "" "iadd(x, y)``。換一種方式來講就是 ``z = operator.iadd(x, y)`` 等價於複合陳述" "式 ``z = x; z += y``。" -#: ../../library/operator.rst:483 +#: ../../library/operator.rst:488 msgid "" "In those examples, note that when an in-place method is called, the " "computation and assignment are performed in two separate steps. The in-" @@ -897,7 +895,7 @@ msgstr "" "在這些例子中,請注意當呼叫一個原地方法時,運算和賦值是分成兩個步驟來執行的。" "下面列出的原地函式只執行第一步,即呼叫原地方法,第二步賦值則不加處理。" -#: ../../library/operator.rst:488 +#: ../../library/operator.rst:493 msgid "" "For immutable targets such as strings, numbers, and tuples, the updated " "value is computed, but not assigned back to the input variable:" @@ -905,7 +903,7 @@ msgstr "" "對於不可變 (immutable) 的目標例如字串、數字和 tupple,更新的值會被計算,但不" "會被再被賦值給輸入變數:" -#: ../../library/operator.rst:497 +#: ../../library/operator.rst:502 msgid "" "For mutable targets such as lists and dictionaries, the in-place method will " "perform the update, so no subsequent assignment is necessary:" @@ -913,59 +911,91 @@ msgstr "" "對於可變 (mutable) 的目標例如 list 和 dictionary,原地方法將執行更新,因此不" "需要後續賦值操作:" -#: ../../library/operator.rst:509 +#: ../../library/operator.rst:514 msgid "``a = iadd(a, b)`` is equivalent to ``a += b``." msgstr "``a = iadd(a, b)`` 等價於 ``a += b``。" -#: ../../library/operator.rst:515 +#: ../../library/operator.rst:520 msgid "``a = iand(a, b)`` is equivalent to ``a &= b``." msgstr "``a = iand(a, b)`` 等價於 ``a &= b``。" -#: ../../library/operator.rst:521 +#: ../../library/operator.rst:526 msgid "" "``a = iconcat(a, b)`` is equivalent to ``a += b`` for *a* and *b* sequences." msgstr "``a = iconcat(a, b)`` 等價於 ``a += b``,其中 *a* 和 *b* 為序列。" -#: ../../library/operator.rst:527 +#: ../../library/operator.rst:532 msgid "``a = ifloordiv(a, b)`` is equivalent to ``a //= b``." msgstr "``a = ifloordiv(a, b)`` 等價於 ``a //= b``。" -#: ../../library/operator.rst:533 +#: ../../library/operator.rst:538 msgid "``a = ilshift(a, b)`` is equivalent to ``a <<= b``." msgstr "``a = ilshift(a, b)`` 等價於 ``a <<= b``。" -#: ../../library/operator.rst:539 +#: ../../library/operator.rst:544 msgid "``a = imod(a, b)`` is equivalent to ``a %= b``." msgstr "``a = imod(a, b)`` 等價於 ``a %= b``。" -#: ../../library/operator.rst:545 +#: ../../library/operator.rst:550 msgid "``a = imul(a, b)`` is equivalent to ``a *= b``." msgstr "``a = imul(a, b)`` 等價於 ``a *= b``。" -#: ../../library/operator.rst:551 +#: ../../library/operator.rst:556 msgid "``a = imatmul(a, b)`` is equivalent to ``a @= b``." msgstr "``a = imatmul(a, b)`` 等價於 ``a @= b``。" -#: ../../library/operator.rst:559 +#: ../../library/operator.rst:564 msgid "``a = ior(a, b)`` is equivalent to ``a |= b``." msgstr "``a = ior(a, b)`` 等價於 ``a |= b``。" -#: ../../library/operator.rst:565 +#: ../../library/operator.rst:570 msgid "``a = ipow(a, b)`` is equivalent to ``a **= b``." msgstr "``a = ipow(a, b)`` 等價於 ``a **= b``。" -#: ../../library/operator.rst:571 +#: ../../library/operator.rst:576 msgid "``a = irshift(a, b)`` is equivalent to ``a >>= b``." msgstr "``a = irshift(a, b)`` 等價於 ``a >>= b``。" -#: ../../library/operator.rst:577 +#: ../../library/operator.rst:582 msgid "``a = isub(a, b)`` is equivalent to ``a -= b``." msgstr "``a = isub(a, b)`` 等價於 ``a -= b``。" -#: ../../library/operator.rst:583 +#: ../../library/operator.rst:588 msgid "``a = itruediv(a, b)`` is equivalent to ``a /= b``." msgstr "``a = itruediv(a, b)`` 等價於 ``a /= b``。" -#: ../../library/operator.rst:589 +#: ../../library/operator.rst:594 msgid "``a = ixor(a, b)`` is equivalent to ``a ^= b``." msgstr "``a = ixor(a, b)`` 等價於 ``a ^= b``。" + +#~ msgid "Return the bitwise and of *a* and *b*." +#~ msgstr "回傳 *x* 和 *y* 位元運算與 (and) 的結果。" + +#~ msgid "" +#~ "Return the bitwise inverse of the number *obj*. This is equivalent to " +#~ "``~obj``." +#~ msgstr "回傳數字 *obj* 按位元取反 (inverse) 的結果。這等價於 ``~obj``。" + +#~ msgid "Return *a* shifted left by *b*." +#~ msgstr "回傳 *a* 左移 *b* 位的結果。" + +#~ msgid "Return ``a * b``, for *a* and *b* numbers." +#~ msgstr "對於數字 *a* 和 *b*,回傳 ``a * b``。" + +#~ msgid "Return the bitwise or of *a* and *b*." +#~ msgstr "回傳 *a* 和 *b* 按位元或 (or) 的結果。" + +#~ msgid "Return *obj* positive (``+obj``)." +#~ msgstr "回傳 *obj* 取正的結果 (\\ ``+obj``\\ )。" + +#~ msgid "Return ``a ** b``, for *a* and *b* numbers." +#~ msgstr "對於數字 *a* 和 *b*,回傳 ``a ** b``。" + +#~ msgid "Return *a* shifted right by *b*." +#~ msgstr "回傳 *a* 右移 *b* 位的結果。" + +#~ msgid "Return the bitwise exclusive or of *a* and *b*." +#~ msgstr "回傳 *a* 和 *b* 按位元異或 (exclusive or) 的結果。" + +#~ msgid "Bitwise And" +#~ msgstr "按位元與 (And)" diff --git a/library/pyexpat.po b/library/pyexpat.po index 04d1f67f7e..c93cd0e02c 100644 --- a/library/pyexpat.po +++ b/library/pyexpat.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-18 00:20+0000\n" +"POT-Creation-Date: 2026-06-10 00:43+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-" @@ -284,57 +284,71 @@ msgstr "" #: ../../library/pyexpat.rst:241 msgid "" -":class:`!xmlparser` objects have the following methods to mitigate some " -"common XML vulnerabilities." -msgstr ":class:`!xmlparser` 物件擁有以下方法來減輕一些常見的 XML 漏洞。" +":class:`!xmlparser` objects have the following methods to tune protections " +"against some common XML vulnerabilities." +msgstr ":class:`!xmlparser` 物件擁有以下方法來調整對一些常見 XML 漏洞的防護。" #: ../../library/pyexpat.rst:246 msgid "" -"Sets the number of allocated bytes of dynamic memory needed to activate " -"protection against disproportionate use of RAM." +"Sets the number of output bytes needed to activate protection against " +"`billion laughs`_ attacks." msgstr "" #: ../../library/pyexpat.rst:249 msgid "" -"By default, parser objects have an allocation activation threshold of 64 " -"MiB, or equivalently 67,108,864 bytes." +"The number of output bytes includes amplification from entity expansion and " +"reading DTD files." msgstr "" #: ../../library/pyexpat.rst:252 msgid "" +"Parser objects usually have a protection activation threshold of 8 MiB, but " +"the actual default value depends on the underlying Expat library." +msgstr "" + +#: ../../library/pyexpat.rst:255 ../../library/pyexpat.rst:307 +msgid "" "An :exc:`ExpatError` is raised if this method is called on a |xml-non-root-" "parser| parser. The corresponding :attr:`~ExpatError.lineno` and :attr:" "`~ExpatError.offset` should not be used as they may have no special meaning." msgstr "" -#: ../../library/pyexpat.rst:261 +#: ../../library/pyexpat.rst:262 msgid "" -"Sets the maximum amplification factor between direct input and bytes of " -"dynamic memory allocated." +"Activation thresholds below 4 MiB are known to break support for DITA 1.3 " +"payload and are hence not recommended." msgstr "" -#: ../../library/pyexpat.rst:264 +#: ../../library/pyexpat.rst:269 msgid "" -"The amplification factor is calculated as ``allocated / direct`` while " -"parsing, where ``direct`` is the number of bytes read from the primary " -"document in parsing and ``allocated`` is the number of bytes of dynamic " -"memory allocated in the parser hierarchy." +"Sets the maximum tolerated amplification factor for protection against " +"`billion laughs`_ attacks." msgstr "" -#: ../../library/pyexpat.rst:269 +#: ../../library/pyexpat.rst:272 +msgid "" +"The amplification factor is calculated as ``(direct + indirect) / direct`` " +"while parsing, where ``direct`` is the number of bytes read from the primary " +"document in parsing and ``indirect`` is the number of bytes added by " +"expanding entities and reading of external DTD files." +msgstr "" + +#: ../../library/pyexpat.rst:277 msgid "" "The *max_factor* value must be a non-NaN :class:`float` value greater than " -"or equal to 1.0. Amplification factors greater than 100.0 can be observed " -"near the start of parsing even with benign files in practice. In particular, " -"the activation threshold should be carefully chosen to avoid false positives." +"or equal to 1.0. Peak amplifications of factor 15,000 for the entire payload " +"and of factor 30,000 in the middle of parsing have been observed with small " +"benign files in practice. In particular, the activation threshold should be " +"carefully chosen to avoid false positives." msgstr "" -#: ../../library/pyexpat.rst:274 +#: ../../library/pyexpat.rst:283 ../../library/pyexpat.rst:329 msgid "" -"By default, parser objects have a maximum amplification factor of 100.0." +"Parser objects usually have a maximum amplification factor of 100, but the " +"actual default value depends on the underlying Expat library." msgstr "" -#: ../../library/pyexpat.rst:276 +#: ../../library/pyexpat.rst:286 ../../library/pyexpat.rst:332 msgid "" "An :exc:`ExpatError` is raised if this method is called on a |xml-non-root-" "parser| parser or if *max_factor* is outside the valid range. The " @@ -342,24 +356,65 @@ msgid "" "should not be used as they may have no special meaning." msgstr "" -#: ../../library/pyexpat.rst:283 +#: ../../library/pyexpat.rst:293 +msgid "" +"The maximum amplification factor is only considered if the threshold that " +"can be adjusted by :meth:`." +"SetBillionLaughsAttackProtectionActivationThreshold` is exceeded." +msgstr "" + +#: ../../library/pyexpat.rst:301 +msgid "" +"Sets the number of allocated bytes of dynamic memory needed to activate " +"protection against disproportionate use of RAM." +msgstr "" + +#: ../../library/pyexpat.rst:304 +msgid "" +"Parser objects usually have an allocation activation threshold of 64 MiB, " +"but the actual default value depends on the underlying Expat library." +msgstr "" + +#: ../../library/pyexpat.rst:316 +msgid "" +"Sets the maximum amplification factor between direct input and bytes of " +"dynamic memory allocated." +msgstr "" + +#: ../../library/pyexpat.rst:319 +msgid "" +"The amplification factor is calculated as ``allocated / direct`` while " +"parsing, where ``direct`` is the number of bytes read from the primary " +"document in parsing and ``allocated`` is the number of bytes of dynamic " +"memory allocated in the parser hierarchy." +msgstr "" + +#: ../../library/pyexpat.rst:324 +msgid "" +"The *max_factor* value must be a non-NaN :class:`float` value greater than " +"or equal to 1.0. Amplification factors greater than 100.0 can be observed " +"near the start of parsing even with benign files in practice. In particular, " +"the activation threshold should be carefully chosen to avoid false positives." +msgstr "" + +#: ../../library/pyexpat.rst:339 msgid "" "The maximum amplification factor is only considered if the threshold that " "can be adjusted by :meth:`.SetAllocTrackerActivationThreshold` is exceeded." msgstr "" -#: ../../library/pyexpat.rst:290 +#: ../../library/pyexpat.rst:346 msgid ":class:`xmlparser` objects have the following attributes:" msgstr ":class:`xmlparser` 物件擁有以下屬性:" -#: ../../library/pyexpat.rst:295 +#: ../../library/pyexpat.rst:351 msgid "" "The size of the buffer used when :attr:`buffer_text` is true. A new buffer " "size can be set by assigning a new integer value to this attribute. When the " "size is changed, the buffer will be flushed." msgstr "" -#: ../../library/pyexpat.rst:303 +#: ../../library/pyexpat.rst:359 msgid "" "Setting this to true causes the :class:`xmlparser` object to buffer textual " "content returned by Expat to avoid multiple calls to the :meth:" @@ -370,14 +425,14 @@ msgid "" "newlines may be chunked too." msgstr "" -#: ../../library/pyexpat.rst:314 +#: ../../library/pyexpat.rst:370 msgid "" "If :attr:`buffer_text` is enabled, the number of bytes stored in the buffer. " "These bytes represent UTF-8 encoded text. This attribute has no meaningful " "interpretation when :attr:`buffer_text` is false." msgstr "" -#: ../../library/pyexpat.rst:321 +#: ../../library/pyexpat.rst:377 msgid "" "Setting this attribute to a non-zero integer causes the attributes to be " "reported as a list rather than a dictionary. The attributes are presented " @@ -387,7 +442,7 @@ msgid "" "is false; it may be changed at any time." msgstr "" -#: ../../library/pyexpat.rst:331 +#: ../../library/pyexpat.rst:387 msgid "" "If set to a non-zero integer, the parser will report only those attributes " "which were specified in the document instance and not those which were " @@ -398,7 +453,7 @@ msgid "" "time." msgstr "" -#: ../../library/pyexpat.rst:339 +#: ../../library/pyexpat.rst:395 msgid "" "The following attributes contain values relating to the most recent error " "encountered by an :class:`xmlparser` object, and will only have correct " @@ -406,26 +461,26 @@ msgid "" "`xml.parsers.expat.ExpatError` exception." msgstr "" -#: ../../library/pyexpat.rst:347 +#: ../../library/pyexpat.rst:403 msgid "Byte index at which an error occurred." msgstr "" -#: ../../library/pyexpat.rst:352 +#: ../../library/pyexpat.rst:408 msgid "" "Numeric code specifying the problem. This value can be passed to the :func:" "`ErrorString` function, or compared to one of the constants defined in the " "``errors`` object." msgstr "" -#: ../../library/pyexpat.rst:359 +#: ../../library/pyexpat.rst:415 msgid "Column number at which an error occurred." msgstr "" -#: ../../library/pyexpat.rst:364 +#: ../../library/pyexpat.rst:420 msgid "Line number at which an error occurred." msgstr "" -#: ../../library/pyexpat.rst:366 +#: ../../library/pyexpat.rst:422 msgid "" "The following attributes contain values relating to the current parse " "location in an :class:`xmlparser` object. During a callback reporting a " @@ -435,19 +490,19 @@ msgid "" "whether there was an associated callback)." msgstr "" -#: ../../library/pyexpat.rst:376 +#: ../../library/pyexpat.rst:432 msgid "Current byte index in the parser input." msgstr "" -#: ../../library/pyexpat.rst:381 +#: ../../library/pyexpat.rst:437 msgid "Current column number in the parser input." msgstr "" -#: ../../library/pyexpat.rst:386 +#: ../../library/pyexpat.rst:442 msgid "Current line number in the parser input." msgstr "" -#: ../../library/pyexpat.rst:388 +#: ../../library/pyexpat.rst:444 msgid "" "Here is the list of handlers that can be set. To set a handler on an :class:" "`xmlparser` object *o*, use ``o.handlername = func``. *handlername* must be " @@ -456,7 +511,7 @@ msgid "" "unless otherwise stated." msgstr "" -#: ../../library/pyexpat.rst:397 +#: ../../library/pyexpat.rst:453 msgid "" "Called when the XML declaration is parsed. The XML declaration is the " "(optional) declaration of the applicable version of the XML recommendation, " @@ -467,7 +522,7 @@ msgid "" "only available with Expat version 1.95.0 or newer." msgstr "" -#: ../../library/pyexpat.rst:408 +#: ../../library/pyexpat.rst:464 msgid "" "Called when Expat begins parsing the document type declaration (``'``." msgstr "" -#: ../../library/pyexpat.rst:525 +#: ../../library/pyexpat.rst:581 msgid "" "Called at the start of a CDATA section. This and :attr:" "`EndCdataSectionHandler` are needed to be able to identify the syntactical " "start and end for CDATA sections." msgstr "" -#: ../../library/pyexpat.rst:532 +#: ../../library/pyexpat.rst:588 msgid "Called at the end of a CDATA section." msgstr "在 CDATA 區塊結束時呼叫。" -#: ../../library/pyexpat.rst:537 +#: ../../library/pyexpat.rst:593 msgid "" "Called for any characters in the XML document for which no applicable " "handler has been specified. This means characters that are part of a " @@ -601,14 +656,14 @@ msgid "" "supplied." msgstr "" -#: ../../library/pyexpat.rst:544 +#: ../../library/pyexpat.rst:600 msgid "" "This is the same as the :func:`DefaultHandler`, but doesn't inhibit " "expansion of internal entities. The entity reference will not be passed to " "the default handler." msgstr "" -#: ../../library/pyexpat.rst:551 +#: ../../library/pyexpat.rst:607 msgid "" "Called if the XML document hasn't been declared as being a standalone " "document. This happens when there is an external subset or a reference to a " @@ -618,7 +673,7 @@ msgid "" "set, no exception is raised by the parser for this condition." msgstr "" -#: ../../library/pyexpat.rst:563 +#: ../../library/pyexpat.rst:619 msgid "" "Implementing a handler that accesses local files and/or the network may " "create a vulnerability to `external entity attacks `_ before implementing this handler." msgstr "" -#: ../../library/pyexpat.rst:570 +#: ../../library/pyexpat.rst:626 msgid "" "Called for references to external entities. *base* is the current base, as " "set by a previous call to :meth:`SetBase`. The public and system " @@ -636,7 +691,7 @@ msgid "" "is opaque and should only be used as described below." msgstr "" -#: ../../library/pyexpat.rst:576 +#: ../../library/pyexpat.rst:632 msgid "" "For external entities to be parsed, this handler must be implemented. It is " "responsible for creating the sub-parser using " @@ -646,28 +701,28 @@ msgid "" "`XML_ERROR_EXTERNAL_ENTITY_HANDLING` error, otherwise parsing will continue." msgstr "" -#: ../../library/pyexpat.rst:584 +#: ../../library/pyexpat.rst:640 msgid "" "If this handler is not provided, external entities are reported by the :attr:" "`DefaultHandler` callback, if provided." msgstr "" -#: ../../library/pyexpat.rst:591 +#: ../../library/pyexpat.rst:647 msgid "ExpatError Exceptions" msgstr "ExpatError 例外" -#: ../../library/pyexpat.rst:596 +#: ../../library/pyexpat.rst:652 msgid ":exc:`ExpatError` exceptions have a number of interesting attributes:" msgstr "" -#: ../../library/pyexpat.rst:601 +#: ../../library/pyexpat.rst:657 msgid "" "Expat's internal error number for the specific error. The :data:`errors." "messages ` dictionary maps these error " "numbers to Expat's error messages. For example::" msgstr "" -#: ../../library/pyexpat.rst:605 +#: ../../library/pyexpat.rst:661 msgid "" "from xml.parsers.expat import ParserCreate, ExpatError, errors\n" "\n" @@ -685,36 +740,36 @@ msgstr "" "except ExpatError as err:\n" " print(\"Error:\", errors.messages[err.code])" -#: ../../library/pyexpat.rst:613 +#: ../../library/pyexpat.rst:669 msgid "" "The :mod:`~xml.parsers.expat.errors` module also provides error message " "constants and a dictionary :data:`~xml.parsers.expat.errors.codes` mapping " "these messages back to the error codes, see below." msgstr "" -#: ../../library/pyexpat.rst:620 +#: ../../library/pyexpat.rst:676 msgid "" "Line number on which the error was detected. The first line is numbered " "``1``." msgstr "" -#: ../../library/pyexpat.rst:625 +#: ../../library/pyexpat.rst:681 msgid "" "Character offset into the line where the error occurred. The first column " "is numbered ``0``." msgstr "" -#: ../../library/pyexpat.rst:632 +#: ../../library/pyexpat.rst:688 msgid "Example" msgstr "範例" -#: ../../library/pyexpat.rst:634 +#: ../../library/pyexpat.rst:690 msgid "" "The following program defines three handlers that just print out their " "arguments. ::" msgstr "" -#: ../../library/pyexpat.rst:637 +#: ../../library/pyexpat.rst:693 msgid "" "import xml.parsers.expat\n" "\n" @@ -758,11 +813,11 @@ msgstr "" "More text\n" "\"\"\", 1)" -#: ../../library/pyexpat.rst:658 +#: ../../library/pyexpat.rst:714 msgid "The output from this program is::" msgstr "這個程式的輸出是: ::" -#: ../../library/pyexpat.rst:660 +#: ../../library/pyexpat.rst:716 msgid "" "Start element: parent {'id': 'top'}\n" "Start element: child1 {'name': 'paul'}\n" @@ -786,76 +841,76 @@ msgstr "" "Character data: '\\n'\n" "End element: parent" -#: ../../library/pyexpat.rst:675 +#: ../../library/pyexpat.rst:731 msgid "Content Model Descriptions" msgstr "" -#: ../../library/pyexpat.rst:681 +#: ../../library/pyexpat.rst:737 msgid "" "Content models are described using nested tuples. Each tuple contains four " "values: the type, the quantifier, the name, and a tuple of children. " "Children are simply additional content model descriptions." msgstr "" -#: ../../library/pyexpat.rst:685 +#: ../../library/pyexpat.rst:741 msgid "" "The values of the first two fields are constants defined in the :mod:`!xml." "parsers.expat.model` module. These constants can be collected in two " "groups: the model type group and the quantifier group." msgstr "" -#: ../../library/pyexpat.rst:689 +#: ../../library/pyexpat.rst:745 msgid "The constants in the model type group are:" msgstr "" -#: ../../library/pyexpat.rst:695 +#: ../../library/pyexpat.rst:751 msgid "" "The element named by the model name was declared to have a content model of " "``ANY``." msgstr "" -#: ../../library/pyexpat.rst:702 +#: ../../library/pyexpat.rst:758 msgid "" "The named element allows a choice from a number of options; this is used for " "content models such as ``(A | B | C)``." msgstr "" -#: ../../library/pyexpat.rst:709 +#: ../../library/pyexpat.rst:765 msgid "Elements which are declared to be ``EMPTY`` have this model type." msgstr "" -#: ../../library/pyexpat.rst:723 +#: ../../library/pyexpat.rst:779 msgid "" "Models which represent a series of models which follow one after the other " "are indicated with this model type. This is used for models such as ``(A, " "B, C)``." msgstr "" -#: ../../library/pyexpat.rst:726 +#: ../../library/pyexpat.rst:782 msgid "The constants in the quantifier group are:" msgstr "" -#: ../../library/pyexpat.rst:732 +#: ../../library/pyexpat.rst:788 msgid "No modifier is given, so it can appear exactly once, as for ``A``." msgstr "" -#: ../../library/pyexpat.rst:738 +#: ../../library/pyexpat.rst:794 msgid "The model is optional: it can appear once or not at all, as for ``A?``." msgstr "" -#: ../../library/pyexpat.rst:744 +#: ../../library/pyexpat.rst:800 msgid "The model must occur one or more times (like ``A+``)." msgstr "" -#: ../../library/pyexpat.rst:750 +#: ../../library/pyexpat.rst:806 msgid "The model must occur zero or more times, as for ``A*``." msgstr "" -#: ../../library/pyexpat.rst:756 +#: ../../library/pyexpat.rst:812 msgid "Expat error constants" msgstr "Expat 錯誤常數" -#: ../../library/pyexpat.rst:760 +#: ../../library/pyexpat.rst:816 msgid "" "The following constants are provided in the :mod:`!xml.parsers.expat.errors` " "module. These constants are useful in interpreting some of the attributes " @@ -866,210 +921,210 @@ msgid "" "XML_ERROR_{CONSTANT_NAME}]`." msgstr "" -#: ../../library/pyexpat.rst:768 +#: ../../library/pyexpat.rst:824 msgid "The ``errors`` module has the following attributes:" msgstr "``errors`` 模組有以下屬性:" -#: ../../library/pyexpat.rst:772 +#: ../../library/pyexpat.rst:828 msgid "A dictionary mapping string descriptions to their error codes." msgstr "" -#: ../../library/pyexpat.rst:779 +#: ../../library/pyexpat.rst:835 msgid "A dictionary mapping numeric error codes to their string descriptions." msgstr "" -#: ../../library/pyexpat.rst:789 +#: ../../library/pyexpat.rst:845 msgid "" "An entity reference in an attribute value referred to an external entity " "instead of an internal entity." msgstr "" -#: ../../library/pyexpat.rst:795 +#: ../../library/pyexpat.rst:851 msgid "" "A character reference referred to a character which is illegal in XML (for " "example, character ``0``, or '``�``')." msgstr "" -#: ../../library/pyexpat.rst:801 +#: ../../library/pyexpat.rst:857 msgid "" "An entity reference referred to an entity which was declared with a " "notation, so cannot be parsed." msgstr "" -#: ../../library/pyexpat.rst:807 +#: ../../library/pyexpat.rst:863 msgid "An attribute was used more than once in a start tag." msgstr "" -#: ../../library/pyexpat.rst:815 +#: ../../library/pyexpat.rst:871 msgid "" "Raised when an input byte could not properly be assigned to a character; for " "example, a NUL byte (value ``0``) in a UTF-8 input stream." msgstr "" -#: ../../library/pyexpat.rst:821 +#: ../../library/pyexpat.rst:877 msgid "Something other than whitespace occurred after the document element." msgstr "" -#: ../../library/pyexpat.rst:826 +#: ../../library/pyexpat.rst:882 msgid "" "An XML declaration was found somewhere other than the start of the input " "data." msgstr "" -#: ../../library/pyexpat.rst:831 +#: ../../library/pyexpat.rst:887 msgid "" "The document contains no elements (XML requires all documents to contain " "exactly one top-level element).." msgstr "" -#: ../../library/pyexpat.rst:837 +#: ../../library/pyexpat.rst:893 msgid "Expat was not able to allocate memory internally." msgstr "" -#: ../../library/pyexpat.rst:842 +#: ../../library/pyexpat.rst:898 msgid "A parameter entity reference was found where it was not allowed." msgstr "" -#: ../../library/pyexpat.rst:847 +#: ../../library/pyexpat.rst:903 msgid "An incomplete character was found in the input." msgstr "" -#: ../../library/pyexpat.rst:852 +#: ../../library/pyexpat.rst:908 msgid "" "An entity reference contained another reference to the same entity; possibly " "via a different name, and possibly indirectly." msgstr "" -#: ../../library/pyexpat.rst:858 +#: ../../library/pyexpat.rst:914 msgid "Some unspecified syntax error was encountered." msgstr "" -#: ../../library/pyexpat.rst:863 +#: ../../library/pyexpat.rst:919 msgid "An end tag did not match the innermost open start tag." msgstr "" -#: ../../library/pyexpat.rst:868 +#: ../../library/pyexpat.rst:924 msgid "" "Some token (such as a start tag) was not closed before the end of the stream " "or the next token was encountered." msgstr "" -#: ../../library/pyexpat.rst:874 +#: ../../library/pyexpat.rst:930 msgid "A reference was made to an entity which was not defined." msgstr "" -#: ../../library/pyexpat.rst:879 +#: ../../library/pyexpat.rst:935 msgid "The document encoding is not supported by Expat." msgstr "" -#: ../../library/pyexpat.rst:884 +#: ../../library/pyexpat.rst:940 msgid "A CDATA marked section was not closed." msgstr "以 CDATA 標記的區塊未被關閉。" -#: ../../library/pyexpat.rst:892 +#: ../../library/pyexpat.rst:948 msgid "" "The parser determined that the document was not \"standalone\" though it " "declared itself to be in the XML declaration, and the :attr:" "`NotStandaloneHandler` was set and returned ``0``." msgstr "" -#: ../../library/pyexpat.rst:905 +#: ../../library/pyexpat.rst:961 msgid "" "An operation was requested that requires DTD support to be compiled in, but " "Expat was configured without DTD support. This should never be reported by " "a standard build of the :mod:`!xml.parsers.expat` module." msgstr "" -#: ../../library/pyexpat.rst:912 +#: ../../library/pyexpat.rst:968 msgid "" "A behavioral change was requested after parsing started that can only be " "changed before parsing has started. This is (currently) only raised by :" "meth:`UseForeignDTD`." msgstr "" -#: ../../library/pyexpat.rst:919 +#: ../../library/pyexpat.rst:975 msgid "An undeclared prefix was found when namespace processing was enabled." msgstr "" -#: ../../library/pyexpat.rst:924 +#: ../../library/pyexpat.rst:980 msgid "" "The document attempted to remove the namespace declaration associated with a " "prefix." msgstr "" -#: ../../library/pyexpat.rst:930 +#: ../../library/pyexpat.rst:986 msgid "A parameter entity contained incomplete markup." msgstr "" -#: ../../library/pyexpat.rst:935 +#: ../../library/pyexpat.rst:991 msgid "The document contained no document element at all." msgstr "" -#: ../../library/pyexpat.rst:940 +#: ../../library/pyexpat.rst:996 msgid "There was an error parsing a text declaration in an external entity." msgstr "" -#: ../../library/pyexpat.rst:945 +#: ../../library/pyexpat.rst:1001 msgid "Characters were found in the public id that are not allowed." msgstr "" -#: ../../library/pyexpat.rst:950 +#: ../../library/pyexpat.rst:1006 msgid "" "The requested operation was made on a suspended parser, but isn't allowed. " "This includes attempts to provide additional input or to stop the parser." msgstr "" -#: ../../library/pyexpat.rst:956 +#: ../../library/pyexpat.rst:1012 msgid "" "An attempt to resume the parser was made when the parser had not been " "suspended." msgstr "" -#: ../../library/pyexpat.rst:961 ../../library/pyexpat.rst:994 -#: ../../library/pyexpat.rst:999 +#: ../../library/pyexpat.rst:1017 ../../library/pyexpat.rst:1050 +#: ../../library/pyexpat.rst:1055 msgid "This should not be reported to Python applications." msgstr "" -#: ../../library/pyexpat.rst:966 +#: ../../library/pyexpat.rst:1022 msgid "" "The requested operation was made on a parser which was finished parsing " "input, but isn't allowed. This includes attempts to provide additional " "input or to stop the parser." msgstr "" -#: ../../library/pyexpat.rst:976 +#: ../../library/pyexpat.rst:1032 msgid "" "An attempt was made to undeclare reserved namespace prefix ``xml`` or to " "bind it to another namespace URI." msgstr "" -#: ../../library/pyexpat.rst:983 +#: ../../library/pyexpat.rst:1039 msgid "" "An attempt was made to declare or undeclare reserved namespace prefix " "``xmlns``." msgstr "" -#: ../../library/pyexpat.rst:988 +#: ../../library/pyexpat.rst:1044 msgid "" "An attempt was made to bind the URI of one the reserved namespace prefixes " "``xml`` and ``xmlns`` to another namespace prefix." msgstr "" -#: ../../library/pyexpat.rst:1004 +#: ../../library/pyexpat.rst:1060 msgid "" "The limit on input amplification factor (from DTD and entities) has been " "breached." msgstr "" -#: ../../library/pyexpat.rst:1010 +#: ../../library/pyexpat.rst:1066 msgid "The parser was tried to be stopped or suspended before it started." msgstr "" -#: ../../library/pyexpat.rst:1016 +#: ../../library/pyexpat.rst:1072 msgid "Footnotes" msgstr "註腳" -#: ../../library/pyexpat.rst:1017 +#: ../../library/pyexpat.rst:1073 msgid "" "The encoding string included in XML output should conform to the appropriate " "standards. For example, \"UTF-8\" is valid, but \"UTF8\" is not. See https://" diff --git a/library/shutil.po b/library/shutil.po index 1d2321d537..7d987d1731 100644 --- a/library/shutil.po +++ b/library/shutil.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-03 00:49+0000\n" +"POT-Creation-Date: 2026-06-10 00:43+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-" @@ -126,7 +126,7 @@ msgstr "" #: ../../library/shutil.rst:88 ../../library/shutil.rst:199 #: ../../library/shutil.rst:231 ../../library/shutil.rst:301 -#: ../../library/shutil.rst:414 +#: ../../library/shutil.rst:418 msgid "" "Platform-specific fast-copy syscalls may be used internally in order to copy " "the file more efficiently. See :ref:`shutil-platform-dependent-efficient-" @@ -507,13 +507,21 @@ msgstr "" #: ../../library/shutil.rst:391 msgid "" -"If the destination is on the current filesystem, then :func:`os.rename` is " -"used. Otherwise, *src* is copied to the destination using *copy_function* " -"and then removed. In case of symlinks, a new symlink pointing to the target " -"of *src* will be created as the destination and *src* will be removed." +":func:`os.rename` is preferably used internally when *src* and the " +"destination are on the same filesystem. In case :func:`os.rename` fails due " +"to :exc:`OSError` (e.g. the user has write permission to the destination " +"file but not to its parent directory), this method falls back to using " +"*copy_function*, in which case *src* is copied to the destination using " +"*copy_function* and then removed." msgstr "" -#: ../../library/shutil.rst:396 +#: ../../library/shutil.rst:397 +msgid "" +"In case of symlinks, a new symlink pointing to the target of *src* will be " +"created in or as the destination, and *src* will be removed." +msgstr "" + +#: ../../library/shutil.rst:400 msgid "" "If *copy_function* is given, it must be a callable that takes two arguments, " "*src* and the destination, and will be used to copy *src* to the destination " @@ -524,7 +532,7 @@ msgid "" "copy the metadata, at the expense of not copying any of the metadata." msgstr "" -#: ../../library/shutil.rst:404 +#: ../../library/shutil.rst:408 msgid "" "Raises an :ref:`auditing event ` ``shutil.move`` with arguments " "``src``, ``dst``." @@ -532,57 +540,57 @@ msgstr "" "引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` ``shutil." "move``。" -#: ../../library/shutil.rst:406 +#: ../../library/shutil.rst:410 msgid "" "Added explicit symlink handling for foreign filesystems, thus adapting it to " "the behavior of GNU's :program:`mv`. Now returns *dst*." msgstr "" -#: ../../library/shutil.rst:411 +#: ../../library/shutil.rst:415 msgid "Added the *copy_function* keyword argument." msgstr "新增 *copy_function* 關鍵字引數。" -#: ../../library/shutil.rst:419 +#: ../../library/shutil.rst:423 msgid "Accepts a :term:`path-like object` for both *src* and *dst*." msgstr "" -#: ../../library/shutil.rst:424 +#: ../../library/shutil.rst:428 msgid "" "Return disk usage statistics about the given path as a :term:`named tuple` " "with the attributes *total*, *used* and *free*, which are the amount of " "total, used and free space, in bytes. *path* may be a file or a directory." msgstr "" -#: ../../library/shutil.rst:431 +#: ../../library/shutil.rst:435 msgid "" "On Unix filesystems, *path* must point to a path within a **mounted** " "filesystem partition. On those platforms, CPython doesn't attempt to " "retrieve disk usage information from non-mounted filesystems." msgstr "" -#: ../../library/shutil.rst:437 +#: ../../library/shutil.rst:441 msgid "On Windows, *path* can now be a file or directory." msgstr "" -#: ../../library/shutil.rst:440 ../../library/shutil.rst:454 +#: ../../library/shutil.rst:444 ../../library/shutil.rst:458 msgid "Availability" msgstr "可用性" -#: ../../library/shutil.rst:445 +#: ../../library/shutil.rst:449 msgid "Change owner *user* and/or *group* of the given *path*." msgstr "" -#: ../../library/shutil.rst:447 +#: ../../library/shutil.rst:451 msgid "" "*user* can be a system user name or a uid; the same applies to *group*. At " "least one argument is required." msgstr "" -#: ../../library/shutil.rst:450 +#: ../../library/shutil.rst:454 msgid "See also :func:`os.chown`, the underlying function." msgstr "另請參閱 :func:`os.chown`,它是底層函式。" -#: ../../library/shutil.rst:452 +#: ../../library/shutil.rst:456 msgid "" "Raises an :ref:`auditing event ` ``shutil.chown`` with arguments " "``path``, ``user``, ``group``." @@ -590,23 +598,23 @@ msgstr "" "引發一個附帶引數 ``path``、``user``、``group`` 的\\ :ref:`稽核事件 " "` ``shutil.chown``。" -#: ../../library/shutil.rst:458 +#: ../../library/shutil.rst:462 msgid "Added *dir_fd* and *follow_symlinks* parameters." msgstr "新增 *dir_fd* 和 *follow_symlinks* 參數。" -#: ../../library/shutil.rst:464 +#: ../../library/shutil.rst:468 msgid "" "Return the path to an executable which would be run if the given *cmd* was " "called. If no *cmd* would be called, return ``None``." msgstr "" -#: ../../library/shutil.rst:467 +#: ../../library/shutil.rst:471 msgid "" "*mode* is a permission mask passed to :func:`os.access`, by default " "determining if the file exists and is executable." msgstr "" -#: ../../library/shutil.rst:470 +#: ../../library/shutil.rst:474 msgid "" "*path* is a \"``PATH`` string\" specifying the directories to look in, " "delimited by :data:`os.pathsep`. When no *path* is specified, the :envvar:" @@ -614,14 +622,14 @@ msgid "" "to :data:`os.defpath` if it is not set." msgstr "" -#: ../../library/shutil.rst:475 +#: ../../library/shutil.rst:479 msgid "" "If *cmd* contains a directory component, :func:`!which` only checks the " "specified path directly and does not search the directories listed in *path* " "or in the system's :envvar:`PATH` environment variable." msgstr "" -#: ../../library/shutil.rst:479 +#: ../../library/shutil.rst:483 msgid "" "On Windows, the current directory is prepended to the *path* if *mode* does " "not include ``os.X_OK``. When the *mode* does include ``os.X_OK``, the " @@ -631,7 +639,7 @@ msgid "" "environment variable ``NoDefaultCurrentDirectoryInExePath``." msgstr "" -#: ../../library/shutil.rst:486 +#: ../../library/shutil.rst:490 msgid "" "Also on Windows, the :envvar:`PATHEXT` environment variable is used to " "resolve commands that may not already include an extension. For example, if " @@ -640,7 +648,7 @@ msgid "" "directories. For example, on Windows::" msgstr "" -#: ../../library/shutil.rst:492 +#: ../../library/shutil.rst:496 msgid "" ">>> shutil.which(\"python\")\n" "'C:\\\\Python33\\\\python.EXE'" @@ -648,13 +656,13 @@ msgstr "" ">>> shutil.which(\"python\")\n" "'C:\\\\Python33\\\\python.EXE'" -#: ../../library/shutil.rst:495 +#: ../../library/shutil.rst:499 msgid "" "This is also applied when *cmd* is a path that contains a directory " "component::" msgstr "" -#: ../../library/shutil.rst:498 +#: ../../library/shutil.rst:502 msgid "" ">>> shutil.which(\"C:\\\\Python33\\\\python\")\n" "'C:\\\\Python33\\\\python.EXE'" @@ -662,13 +670,13 @@ msgstr "" ">>> shutil.which(\"C:\\\\Python33\\\\python\")\n" "'C:\\\\Python33\\\\python.EXE'" -#: ../../library/shutil.rst:503 +#: ../../library/shutil.rst:507 msgid "" "The :class:`bytes` type is now accepted. If *cmd* type is :class:`bytes`, " "the result type is also :class:`bytes`." msgstr "" -#: ../../library/shutil.rst:507 +#: ../../library/shutil.rst:511 msgid "" "On Windows, the current directory is no longer prepended to the search path " "if *mode* includes ``os.X_OK`` and WinAPI " @@ -679,18 +687,18 @@ msgid "" "now be found." msgstr "" -#: ../../library/shutil.rst:518 +#: ../../library/shutil.rst:522 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:525 +#: ../../library/shutil.rst:529 msgid "Platform-dependent efficient copy operations" msgstr "" -#: ../../library/shutil.rst:527 +#: ../../library/shutil.rst:531 msgid "" "Starting from Python 3.8, all functions involving a file copy (:func:" "`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, and :func:" @@ -700,51 +708,51 @@ msgid "" "buffers in Python as in \"``outfd.write(infd.read())``\"." msgstr "" -#: ../../library/shutil.rst:535 +#: ../../library/shutil.rst:539 msgid "On macOS `fcopyfile`_ is used to copy the file content (not metadata)." msgstr "" -#: ../../library/shutil.rst:537 +#: ../../library/shutil.rst:541 msgid "On Linux :func:`os.copy_file_range` or :func:`os.sendfile` is used." msgstr "Linux 上會使用 :func:`os.copy_file_range` 或 :func:`os.sendfile`。" -#: ../../library/shutil.rst:539 +#: ../../library/shutil.rst:543 msgid "On Solaris :func:`os.sendfile` is used." msgstr "Solaris 上會使用 :func:`os.sendfile`。" -#: ../../library/shutil.rst:541 +#: ../../library/shutil.rst:545 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:545 +#: ../../library/shutil.rst:549 msgid "" "If the fast-copy operation fails and no data was written in the destination " "file then shutil will silently fall back to less efficient :func:" "`copyfileobj` function internally." msgstr "" -#: ../../library/shutil.rst:551 +#: ../../library/shutil.rst:555 msgid "Solaris now uses :func:`os.sendfile`." msgstr "" -#: ../../library/shutil.rst:554 +#: ../../library/shutil.rst:558 msgid "" "Copy-on-write or server-side copy may be used internally via :func:`os." "copy_file_range` on supported Linux filesystems." msgstr "" -#: ../../library/shutil.rst:561 +#: ../../library/shutil.rst:565 msgid "copytree example" msgstr "copytree 範例" -#: ../../library/shutil.rst:563 +#: ../../library/shutil.rst:567 msgid "An example that uses the :func:`ignore_patterns` helper::" msgstr "" -#: ../../library/shutil.rst:565 +#: ../../library/shutil.rst:569 msgid "" "from shutil import copytree, ignore_patterns\n" "\n" @@ -754,17 +762,17 @@ msgstr "" "\n" "copytree(source, destination, ignore=ignore_patterns('*.pyc', 'tmp*'))" -#: ../../library/shutil.rst:569 +#: ../../library/shutil.rst:573 msgid "" "This will copy everything except ``.pyc`` files and files or directories " "whose name starts with ``tmp``." msgstr "" -#: ../../library/shutil.rst:572 +#: ../../library/shutil.rst:576 msgid "Another example that uses the *ignore* argument to add a logging call::" msgstr "" -#: ../../library/shutil.rst:574 +#: ../../library/shutil.rst:578 msgid "" "from shutil import copytree\n" "import logging\n" @@ -784,11 +792,11 @@ msgstr "" "\n" "copytree(source, destination, ignore=_logpath)" -#: ../../library/shutil.rst:587 +#: ../../library/shutil.rst:591 msgid "rmtree example" msgstr "rmtree 範例" -#: ../../library/shutil.rst:589 +#: ../../library/shutil.rst:593 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 " @@ -796,7 +804,7 @@ msgid "" "propagate. ::" msgstr "" -#: ../../library/shutil.rst:594 +#: ../../library/shutil.rst:598 msgid "" "import os, stat\n" "import shutil\n" @@ -809,31 +817,31 @@ msgid "" "shutil.rmtree(directory, onexc=remove_readonly)" msgstr "" -#: ../../library/shutil.rst:607 +#: ../../library/shutil.rst:611 msgid "Archiving operations" msgstr "" -#: ../../library/shutil.rst:611 +#: ../../library/shutil.rst:615 msgid "Added support for the *xztar* format." msgstr "新增 *xztar* 格式的支援。" -#: ../../library/shutil.rst:615 +#: ../../library/shutil.rst:619 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:620 +#: ../../library/shutil.rst:624 msgid "Create an archive file (such as zip or tar) and return its name." msgstr "" -#: ../../library/shutil.rst:622 +#: ../../library/shutil.rst:626 msgid "" "*base_name* is the name of the file to create, including the path, minus any " "format-specific extension." msgstr "" -#: ../../library/shutil.rst:625 +#: ../../library/shutil.rst:629 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), " @@ -842,14 +850,14 @@ msgid "" "module is available)." msgstr "" -#: ../../library/shutil.rst:631 +#: ../../library/shutil.rst:635 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:635 +#: ../../library/shutil.rst:639 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. " @@ -857,23 +865,23 @@ msgid "" "example-with-basedir` for how to use *base_dir* and *root_dir* together." msgstr "" -#: ../../library/shutil.rst:641 +#: ../../library/shutil.rst:645 msgid "*root_dir* and *base_dir* both default to the current directory." msgstr "" -#: ../../library/shutil.rst:643 +#: ../../library/shutil.rst:647 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:646 +#: ../../library/shutil.rst:650 msgid "" "*owner* and *group* are used when creating a tar archive. By default, uses " "the current owner and group." msgstr "" -#: ../../library/shutil.rst:649 +#: ../../library/shutil.rst:653 msgid "" "*logger* must be an object compatible with :pep:`282`, usually an instance " "of :class:`logging.Logger`." @@ -881,11 +889,11 @@ msgstr "" "*logger* 必須是與 :pep:`282` 相容的物件,通常是 :class:`logging.Logger` 的實" "例。" -#: ../../library/shutil.rst:652 +#: ../../library/shutil.rst:656 msgid "The *verbose* argument is unused and deprecated." msgstr "*verbose* 引數未被使用且已棄用。" -#: ../../library/shutil.rst:654 +#: ../../library/shutil.rst:658 msgid "" "Raises an :ref:`auditing event ` ``shutil.make_archive`` with " "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." @@ -893,7 +901,7 @@ msgstr "" "引發一個附帶引數 ``base_name``、``format``、``root_dir``、``base_dir`` 的\\ :" "ref:`稽核事件 ` ``shutil.make_archive``。" -#: ../../library/shutil.rst:658 +#: ../../library/shutil.rst:662 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 " @@ -901,66 +909,66 @@ msgid "" "*root_dir* to perform archiving." msgstr "" -#: ../../library/shutil.rst:664 +#: ../../library/shutil.rst:668 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:668 +#: ../../library/shutil.rst:672 msgid "" "This function is now made thread-safe during creation of standard ``.zip`` " "and tar archives." msgstr "" -#: ../../library/shutil.rst:674 +#: ../../library/shutil.rst:678 msgid "" "Return a list of supported formats for archiving. Each element of the " "returned sequence is a tuple ``(name, description)``." msgstr "" -#: ../../library/shutil.rst:677 ../../library/shutil.rst:794 +#: ../../library/shutil.rst:681 ../../library/shutil.rst:798 msgid "By default :mod:`!shutil` provides these formats:" msgstr "預設情況下 :mod:`!shutil` 提供這些格式:" -#: ../../library/shutil.rst:679 +#: ../../library/shutil.rst:683 msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:680 +#: ../../library/shutil.rst:684 msgid "" "*tar*: Uncompressed tar file. Uses POSIX.1-2001 pax format for new archives." msgstr "" -#: ../../library/shutil.rst:681 ../../library/shutil.rst:799 +#: ../../library/shutil.rst:685 ../../library/shutil.rst:803 msgid "*gztar*: gzip'ed tar-file (if the :mod:`zlib` module is available)." msgstr "" -#: ../../library/shutil.rst:682 ../../library/shutil.rst:800 +#: ../../library/shutil.rst:686 ../../library/shutil.rst:804 msgid "*bztar*: bzip2'ed tar-file (if the :mod:`bz2` module is available)." msgstr "" -#: ../../library/shutil.rst:683 ../../library/shutil.rst:801 +#: ../../library/shutil.rst:687 ../../library/shutil.rst:805 msgid "*xztar*: xz'ed tar-file (if the :mod:`lzma` module is available)." msgstr "" -#: ../../library/shutil.rst:684 ../../library/shutil.rst:802 +#: ../../library/shutil.rst:688 ../../library/shutil.rst:806 msgid "" "*zstdtar*: Zstandard compressed tar-file (if the :mod:`compression.zstd` " "module is available)." msgstr "" -#: ../../library/shutil.rst:687 +#: ../../library/shutil.rst:691 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:693 +#: ../../library/shutil.rst:697 msgid "Register an archiver for the format *name*." msgstr "" -#: ../../library/shutil.rst:695 +#: ../../library/shutil.rst:699 msgid "" "*function* is the callable that will be used to create archives. The " "callable will receive the *base_name* of the file to create, followed by the " @@ -969,7 +977,7 @@ msgid "" "*dry_run* and *logger* (as passed in :func:`make_archive`)." msgstr "" -#: ../../library/shutil.rst:701 +#: ../../library/shutil.rst:705 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 " @@ -978,37 +986,37 @@ msgid "" "not thread-safe." msgstr "" -#: ../../library/shutil.rst:707 +#: ../../library/shutil.rst:711 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:710 +#: ../../library/shutil.rst:714 msgid "" "*description* is used by :func:`get_archive_formats` which returns the list " "of archivers. Defaults to an empty string." msgstr "" -#: ../../library/shutil.rst:713 +#: ../../library/shutil.rst:717 msgid "Added support for functions supporting the *root_dir* argument." msgstr "" -#: ../../library/shutil.rst:719 +#: ../../library/shutil.rst:723 msgid "Remove the archive format *name* from the list of supported formats." msgstr "" -#: ../../library/shutil.rst:724 +#: ../../library/shutil.rst:728 msgid "Unpack an archive. *filename* is the full path of the archive." msgstr "" -#: ../../library/shutil.rst:726 +#: ../../library/shutil.rst:730 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:729 +#: ../../library/shutil.rst:733 msgid "" "*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", " "\"bztar\", \"xztar\", or \"zstdtar\". Or any other format registered with :" @@ -1017,7 +1025,7 @@ msgid "" "for that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/shutil.rst:736 +#: ../../library/shutil.rst:740 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 " @@ -1026,7 +1034,7 @@ msgid "" "extraction-filter` for details.)" msgstr "" -#: ../../library/shutil.rst:742 +#: ../../library/shutil.rst:746 msgid "" "Raises an :ref:`auditing event ` ``shutil.unpack_archive`` with " "arguments ``filename``, ``extract_dir``, ``format``." @@ -1034,7 +1042,7 @@ msgstr "" "引發一個附帶引數 ``filename``、``extract_dir``、``format`` 的\\ :ref:`稽核事" "件 ` ``shutil.unpack_archive``。" -#: ../../library/shutil.rst:746 +#: ../../library/shutil.rst:750 msgid "" "Never extract archives from untrusted sources without prior inspection. It " "is possible that files are created outside of the path specified in the " @@ -1042,7 +1050,7 @@ msgid "" "filenames with \"..\" components." msgstr "" -#: ../../library/shutil.rst:751 +#: ../../library/shutil.rst:755 msgid "" "Since Python 3.14, the defaults for both built-in formats (zip and tar " "files) will prevent the most dangerous of such security issues, but will not " @@ -1050,91 +1058,91 @@ msgid "" "verification` section for tar-specific details." msgstr "" -#: ../../library/shutil.rst:757 +#: ../../library/shutil.rst:761 msgid "Accepts a :term:`path-like object` for *filename* and *extract_dir*." msgstr "" -#: ../../library/shutil.rst:760 +#: ../../library/shutil.rst:764 msgid "Added the *filter* argument." msgstr "新增 *filter* 引數。" -#: ../../library/shutil.rst:765 +#: ../../library/shutil.rst:769 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:769 +#: ../../library/shutil.rst:773 msgid "" "*function* is the callable that will be used to unpack archives. The " "callable will receive:" msgstr "" -#: ../../library/shutil.rst:772 +#: ../../library/shutil.rst:776 msgid "the path of the archive, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:773 +#: ../../library/shutil.rst:777 msgid "" "the directory the archive must be extracted to, as a positional argument;" msgstr "" -#: ../../library/shutil.rst:774 +#: ../../library/shutil.rst:778 msgid "" "possibly a *filter* keyword argument, if it was given to :func:" "`unpack_archive`;" msgstr "" -#: ../../library/shutil.rst:776 +#: ../../library/shutil.rst:780 msgid "" "additional keyword arguments, specified by *extra_args* as a sequence of " "``(name, value)`` tuples." msgstr "" -#: ../../library/shutil.rst:779 +#: ../../library/shutil.rst:783 msgid "" "*description* can be provided to describe the format, and will be returned " "by the :func:`get_unpack_formats` function." msgstr "" -#: ../../library/shutil.rst:785 +#: ../../library/shutil.rst:789 msgid "Unregister an unpack format. *name* is the name of the format." msgstr "" -#: ../../library/shutil.rst:790 +#: ../../library/shutil.rst:794 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:796 +#: ../../library/shutil.rst:800 msgid "" "*zip*: ZIP file (unpacking compressed files works only if the corresponding " "module is available)." msgstr "" -#: ../../library/shutil.rst:798 +#: ../../library/shutil.rst:802 msgid "*tar*: uncompressed tar file." msgstr "" -#: ../../library/shutil.rst:805 +#: ../../library/shutil.rst:809 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:812 +#: ../../library/shutil.rst:816 msgid "Archiving example" msgstr "" -#: ../../library/shutil.rst:814 +#: ../../library/shutil.rst:818 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:817 +#: ../../library/shutil.rst:821 msgid "" ">>> from shutil import make_archive\n" ">>> import os\n" @@ -1150,11 +1158,11 @@ msgstr "" ">>> make_archive(archive_name, 'gztar', root_dir)\n" "'/Users/tarek/myarchive.tar.gz'" -#: ../../library/shutil.rst:824 +#: ../../library/shutil.rst:828 msgid "The resulting archive contains:" msgstr "" -#: ../../library/shutil.rst:826 +#: ../../library/shutil.rst:830 msgid "" "$ tar -tzvf /Users/tarek/myarchive.tar.gz\n" "drwx------ tarek/staff 0 2010-02-01 16:23:40 ./\n" @@ -1176,18 +1184,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:842 +#: ../../library/shutil.rst:846 msgid "Archiving example with *base_dir*" msgstr "" -#: ../../library/shutil.rst:844 +#: ../../library/shutil.rst:848 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:848 +#: ../../library/shutil.rst:852 msgid "" "$ tree tmp\n" "tmp\n" @@ -1205,13 +1213,13 @@ msgstr "" " └── please_add.txt\n" " └── do_not_add.txt" -#: ../../library/shutil.rst:858 +#: ../../library/shutil.rst:862 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:861 +#: ../../library/shutil.rst:865 msgid "" ">>> from shutil import make_archive\n" ">>> import os\n" @@ -1235,11 +1243,11 @@ msgstr "" "... )\n" "'/Users/tarek/myarchive.tar'" -#: ../../library/shutil.rst:872 +#: ../../library/shutil.rst:876 msgid "Listing the files in the resulting archive gives us:" msgstr "" -#: ../../library/shutil.rst:874 +#: ../../library/shutil.rst:878 msgid "" "$ python -m tarfile -l /Users/tarek/myarchive.tar\n" "structure/content/\n" @@ -1249,29 +1257,29 @@ msgstr "" "structure/content/\n" "structure/content/please_add.txt" -#: ../../library/shutil.rst:882 +#: ../../library/shutil.rst:886 msgid "Querying the size of the output terminal" msgstr "" -#: ../../library/shutil.rst:886 +#: ../../library/shutil.rst:890 msgid "Get the size of the terminal window." msgstr "" -#: ../../library/shutil.rst:888 +#: ../../library/shutil.rst:892 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:892 +#: ../../library/shutil.rst:896 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:896 +#: ../../library/shutil.rst:900 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 " @@ -1280,17 +1288,17 @@ msgid "" "emulators." msgstr "" -#: ../../library/shutil.rst:902 +#: ../../library/shutil.rst:906 msgid "The value returned is a named tuple of type :class:`os.terminal_size`." msgstr "" -#: ../../library/shutil.rst:904 +#: ../../library/shutil.rst:908 msgid "" "See also: The Single UNIX Specification, Version 2, `Other Environment " "Variables`_." msgstr "" -#: ../../library/shutil.rst:909 +#: ../../library/shutil.rst:913 msgid "" "The ``fallback`` values are also used if :func:`os.get_terminal_size` " "returns zeroes." diff --git a/library/socket.po b/library/socket.po index ab137a97a4..aa4ba04189 100644 --- a/library/socket.po +++ b/library/socket.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-03-29 00:23+0000\n" +"POT-Creation-Date: 2026-06-11 00:43+0000\n" "PO-Revision-Date: 2024-12-30 23:45+0800\n" "Last-Translator: Jay \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -55,23 +55,23 @@ msgstr "由於是呼叫作業系統的 socket API,某些行為可能會因平 #: ../../library/socket.rst:756 ../../library/socket.rst:771 #: ../../library/socket.rst:780 ../../library/socket.rst:788 #: ../../library/socket.rst:805 ../../library/socket.rst:820 -#: ../../library/socket.rst:830 ../../library/socket.rst:1019 -#: ../../library/socket.rst:1144 ../../library/socket.rst:1160 -#: ../../library/socket.rst:1173 ../../library/socket.rst:1188 -#: ../../library/socket.rst:1205 ../../library/socket.rst:1216 -#: ../../library/socket.rst:1227 ../../library/socket.rst:1238 -#: ../../library/socket.rst:1327 ../../library/socket.rst:1347 -#: ../../library/socket.rst:1373 ../../library/socket.rst:1396 -#: ../../library/socket.rst:1425 ../../library/socket.rst:1436 -#: ../../library/socket.rst:1463 ../../library/socket.rst:1480 -#: ../../library/socket.rst:1497 ../../library/socket.rst:1511 -#: ../../library/socket.rst:1562 ../../library/socket.rst:1609 -#: ../../library/socket.rst:1623 ../../library/socket.rst:1643 -#: ../../library/socket.rst:1690 ../../library/socket.rst:1723 -#: ../../library/socket.rst:1736 ../../library/socket.rst:1862 -#: ../../library/socket.rst:1906 ../../library/socket.rst:2014 -#: ../../library/socket.rst:2032 ../../library/socket.rst:2113 -#: ../../library/socket.rst:2123 ../../library/socket.rst:2135 +#: ../../library/socket.rst:830 ../../library/socket.rst:962 +#: ../../library/socket.rst:1081 ../../library/socket.rst:1097 +#: ../../library/socket.rst:1110 ../../library/socket.rst:1125 +#: ../../library/socket.rst:1142 ../../library/socket.rst:1153 +#: ../../library/socket.rst:1164 ../../library/socket.rst:1175 +#: ../../library/socket.rst:1264 ../../library/socket.rst:1284 +#: ../../library/socket.rst:1310 ../../library/socket.rst:1333 +#: ../../library/socket.rst:1362 ../../library/socket.rst:1373 +#: ../../library/socket.rst:1400 ../../library/socket.rst:1417 +#: ../../library/socket.rst:1434 ../../library/socket.rst:1448 +#: ../../library/socket.rst:1559 ../../library/socket.rst:1606 +#: ../../library/socket.rst:1620 ../../library/socket.rst:1640 +#: ../../library/socket.rst:1687 ../../library/socket.rst:1720 +#: ../../library/socket.rst:1733 ../../library/socket.rst:1859 +#: ../../library/socket.rst:1903 ../../library/socket.rst:2011 +#: ../../library/socket.rst:2029 ../../library/socket.rst:2110 +#: ../../library/socket.rst:2120 ../../library/socket.rst:2132 #: ../../includes/wasm-notavail.rst:3 msgid "Availability" msgstr "可用性" @@ -150,8 +150,8 @@ msgid "" "Previously, :const:`AF_UNIX` socket paths were assumed to use UTF-8 encoding." msgstr "" -#: ../../library/socket.rst:68 ../../library/socket.rst:1310 -#: ../../library/socket.rst:1352 ../../library/socket.rst:2107 +#: ../../library/socket.rst:68 ../../library/socket.rst:1247 +#: ../../library/socket.rst:1289 ../../library/socket.rst:2104 msgid "Writable :term:`bytes-like object` is now accepted." msgstr "" @@ -805,7 +805,7 @@ msgid "" "the :meth:`~socket.socket.ioctl` method of socket objects." msgstr "" -#: ../../library/socket.rst:617 ../../library/socket.rst:1725 +#: ../../library/socket.rst:617 ../../library/socket.rst:1722 msgid "``SIO_LOOPBACK_FAST_PATH`` was added." msgstr "加入 ``SIO_LOOPBACK_FAST_PATH``。" @@ -950,91 +950,13 @@ msgid "" "The following functions all create :ref:`socket objects `." msgstr "" -#: ../../library/socket.rst:843 +#: ../../library/socket.rst:841 msgid "" -"Create a new socket using the given address family, socket type and protocol " -"number. The address family should be :const:`AF_INET` (the default), :const:" -"`AF_INET6`, :const:`AF_UNIX`, :const:`AF_CAN`, :const:`AF_PACKET`, or :const:" -"`AF_RDS`. The socket type should be :const:`SOCK_STREAM` (the default), :" -"const:`SOCK_DGRAM`, :const:`SOCK_RAW` or perhaps one of the other ``SOCK_`` " -"constants. The protocol number is usually zero and may be omitted or in the " -"case where the address family is :const:`AF_CAN` the protocol should be one " -"of :const:`CAN_RAW`, :const:`CAN_BCM`, :const:`CAN_ISOTP` or :const:" -"`CAN_J1939`." -msgstr "" - -#: ../../library/socket.rst:853 -msgid "" -"If *fileno* is specified, the values for *family*, *type*, and *proto* are " -"auto-detected from the specified file descriptor. Auto-detection can be " -"overruled by calling the function with explicit *family*, *type*, or *proto* " -"arguments. This only affects how Python represents e.g. the return value " -"of :meth:`socket.getpeername` but not the actual OS resource. Unlike :func:" -"`socket.fromfd`, *fileno* will return the same socket and not a duplicate. " -"This may help close a detached socket using :meth:`socket.close`." +"The :class:`socket ` class constructor creates a new socket " +"directly; see :ref:`socket-objects` for its parameters and full description." msgstr "" -#: ../../library/socket.rst:862 ../../library/socket.rst:1008 -#: ../../library/socket.rst:1544 ../../library/socket.rst:1638 -msgid "The newly created socket is :ref:`non-inheritable `." -msgstr "" - -#: ../../library/socket.rst:864 -msgid "" -"Raises an :ref:`auditing event ` ``socket.__new__`` with arguments " -"``self``, ``family``, ``type``, ``protocol``." -msgstr "" -"引發一個附帶引數 ``self``、``family``、``type``、``protocol`` 的\\ :ref:`稽核" -"事件 ` ``socket.__new__``。" - -#: ../../library/socket.rst:866 -msgid "The AF_CAN family was added. The AF_RDS family was added." -msgstr "" - -#: ../../library/socket.rst:870 -msgid "The CAN_BCM protocol was added." -msgstr "新增 CAN_BCM 協定。" - -#: ../../library/socket.rst:873 ../../library/socket.rst:1010 -msgid "The returned socket is now non-inheritable." -msgstr "" - -#: ../../library/socket.rst:876 -msgid "The CAN_ISOTP protocol was added." -msgstr "新增 CAN_ISOTP 協定。" - -#: ../../library/socket.rst:879 -msgid "" -"When :const:`SOCK_NONBLOCK` or :const:`SOCK_CLOEXEC` bit flags are applied " -"to *type* they are cleared, and :attr:`socket.type` will not reflect them. " -"They are still passed to the underlying system ``socket()`` call. Therefore," -msgstr "" - -#: ../../library/socket.rst:887 -msgid "" -"sock = socket.socket(\n" -" socket.AF_INET,\n" -" socket.SOCK_STREAM | socket.SOCK_NONBLOCK)" -msgstr "" -"sock = socket.socket(\n" -" socket.AF_INET,\n" -" socket.SOCK_STREAM | socket.SOCK_NONBLOCK)" - -#: ../../library/socket.rst:891 -msgid "" -"will still create a non-blocking socket on OSes that support " -"``SOCK_NONBLOCK``, but ``sock.type`` will be set to ``socket.SOCK_STREAM``." -msgstr "" - -#: ../../library/socket.rst:895 -msgid "The CAN_J1939 protocol was added." -msgstr "新增 CAN_J1939 協定。" - -#: ../../library/socket.rst:898 -msgid "The IPPROTO_MPTCP protocol was added." -msgstr "新增 IPPROTO_MPTCP 協定。" - -#: ../../library/socket.rst:903 +#: ../../library/socket.rst:846 msgid "" "Build a pair of connected socket objects using the given address family, " "socket type, and protocol number. Address family, socket type, and protocol " @@ -1043,25 +965,25 @@ msgid "" "const:`AF_INET`." msgstr "" -#: ../../library/socket.rst:908 +#: ../../library/socket.rst:851 msgid "The newly created sockets are :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:910 +#: ../../library/socket.rst:853 msgid "" "The returned socket objects now support the whole socket API, rather than a " "subset." msgstr "" -#: ../../library/socket.rst:914 +#: ../../library/socket.rst:857 msgid "The returned sockets are now non-inheritable." msgstr "" -#: ../../library/socket.rst:917 +#: ../../library/socket.rst:860 msgid "Windows support added." msgstr "新增對 Windows 的支援。" -#: ../../library/socket.rst:923 +#: ../../library/socket.rst:866 msgid "" "Connect to a TCP service listening on the internet *address* (a 2-tuple " "``(host, port)``), and return the socket object. This is a higher-level " @@ -1072,21 +994,21 @@ msgid "" "IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:931 +#: ../../library/socket.rst:874 msgid "" "Passing the optional *timeout* parameter will set the timeout on the socket " "instance before attempting to connect. If no *timeout* is supplied, the " "global default timeout setting returned by :func:`getdefaulttimeout` is used." msgstr "" -#: ../../library/socket.rst:936 +#: ../../library/socket.rst:879 msgid "" "If supplied, *source_address* must be a 2-tuple ``(host, port)`` for the " "socket to bind to as its source address before connecting. If host or port " "are '' or 0 respectively the OS default behavior will be used." msgstr "" -#: ../../library/socket.rst:940 +#: ../../library/socket.rst:883 msgid "" "When a connection cannot be created, an exception is raised. By default, it " "is the exception from the last address in the list. If *all_errors* is " @@ -1094,21 +1016,21 @@ msgid "" "attempts." msgstr "" -#: ../../library/socket.rst:945 +#: ../../library/socket.rst:888 msgid "*source_address* was added." msgstr "新增 *source_address*。" -#: ../../library/socket.rst:948 +#: ../../library/socket.rst:891 msgid "*all_errors* was added." msgstr "新增 *all_errors*。" -#: ../../library/socket.rst:954 +#: ../../library/socket.rst:897 msgid "" "Convenience function which creates a TCP socket bound to *address* (a 2-" "tuple ``(host, port)``) and returns the socket object." msgstr "" -#: ../../library/socket.rst:957 +#: ../../library/socket.rst:900 msgid "" "*family* should be either :data:`AF_INET` or :data:`AF_INET6`. *backlog* is " "the queue size passed to :meth:`socket.listen`; if not specified , a default " @@ -1116,7 +1038,7 @@ msgid "" "`SO_REUSEPORT` socket option." msgstr "" -#: ../../library/socket.rst:962 +#: ../../library/socket.rst:905 msgid "" "If *dualstack_ipv6* is true, *family* is :data:`AF_INET6` and the platform " "supports it the socket will be able to accept both IPv4 and IPv6 " @@ -1129,7 +1051,7 @@ msgid "" "parameter can be used in conjunction with :func:`has_dualstack_ipv6`:" msgstr "" -#: ../../library/socket.rst:975 +#: ../../library/socket.rst:918 msgid "" "import socket\n" "\n" @@ -1149,20 +1071,20 @@ msgstr "" "else:\n" " s = socket.create_server(addr)" -#: ../../library/socket.rst:984 +#: ../../library/socket.rst:927 msgid "" "On POSIX platforms the :data:`SO_REUSEADDR` socket option is set in order to " "immediately reuse previous sockets which were bound on the same *address* " "and remained in TIME_WAIT state." msgstr "" -#: ../../library/socket.rst:992 +#: ../../library/socket.rst:935 msgid "" "Return ``True`` if the platform supports creating a TCP socket which can " "handle both IPv4 and IPv6 connections." msgstr "" -#: ../../library/socket.rst:999 +#: ../../library/socket.rst:942 msgid "" "Duplicate the file descriptor *fd* (an integer as returned by a file " "object's :meth:`~io.IOBase.fileno` method) and build a socket object from " @@ -1175,39 +1097,42 @@ msgid "" "daemon). The socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:1016 -msgid "" -"Instantiate a socket from data obtained from the :meth:`socket.share` " -"method. The socket is assumed to be in blocking mode." +#: ../../library/socket.rst:951 ../../library/socket.rst:1486 +#: ../../library/socket.rst:1541 ../../library/socket.rst:1635 +msgid "The newly created socket is :ref:`non-inheritable `." msgstr "" -#: ../../library/socket.rst:1026 +#: ../../library/socket.rst:953 ../../library/socket.rst:1497 +msgid "The returned socket is now non-inheritable." +msgstr "" + +#: ../../library/socket.rst:959 msgid "" -"This is a Python type object that represents the socket object type. It is " -"the same as ``type(socket(...))``." +"Instantiate a socket from data obtained from the :meth:`socket.share` " +"method. The socket is assumed to be in blocking mode." msgstr "" -#: ../../library/socket.rst:1031 +#: ../../library/socket.rst:968 msgid "Other functions" msgstr "其他函式" -#: ../../library/socket.rst:1033 +#: ../../library/socket.rst:970 msgid "The :mod:`!socket` module also offers various network-related services:" msgstr "" -#: ../../library/socket.rst:1038 +#: ../../library/socket.rst:975 msgid "" "Close a socket file descriptor. This is like :func:`os.close`, but for " "sockets. On some platforms (most notably Windows) :func:`os.close` does not " "work for socket file descriptors." msgstr "" -#: ../../library/socket.rst:1046 +#: ../../library/socket.rst:983 msgid "" "This function wraps the C function ``getaddrinfo`` of the underlying system." msgstr "" -#: ../../library/socket.rst:1048 +#: ../../library/socket.rst:985 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 " @@ -1217,7 +1142,7 @@ msgid "" "and *port*, you can pass ``NULL`` to the underlying C API." msgstr "" -#: ../../library/socket.rst:1055 +#: ../../library/socket.rst:992 msgid "" "The *family*, *type* and *proto* arguments can be optionally specified in " "order to provide options and limit the list of addresses returned. Pass " @@ -1225,7 +1150,7 @@ msgid "" "limit the results. See the note below for details." msgstr "" -#: ../../library/socket.rst:1060 +#: ../../library/socket.rst:997 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:" @@ -1233,15 +1158,15 @@ msgid "" "if *host* is a domain name." msgstr "" -#: ../../library/socket.rst:1065 +#: ../../library/socket.rst:1002 msgid "The function returns a list of 5-tuples with the following structure:" msgstr "" -#: ../../library/socket.rst:1067 +#: ../../library/socket.rst:1004 msgid "``(family, type, proto, canonname, sockaddr)``" msgstr "``(family, type, proto, canonname, sockaddr)``" -#: ../../library/socket.rst:1069 +#: ../../library/socket.rst:1006 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 " @@ -1253,7 +1178,7 @@ msgid "" "`AF_INET6`), and is meant to be passed to the :meth:`socket.connect` method." msgstr "" -#: ../../library/socket.rst:1081 +#: ../../library/socket.rst:1018 msgid "" "If you intend to use results from :func:`!getaddrinfo` to create a socket " "(rather than, for example, retrieve *canonname*), consider limiting the " @@ -1262,13 +1187,13 @@ msgid "" "application can handle." msgstr "" -#: ../../library/socket.rst:1087 +#: ../../library/socket.rst:1024 msgid "" "The behavior with default values of *family*, *type*, *proto* and *flags* is " "system-specific." msgstr "" -#: ../../library/socket.rst:1090 +#: ../../library/socket.rst:1027 msgid "" "Many systems (for example, most Linux configurations) will return a sorted " "list of all matching addresses. These addresses should generally be tried in " @@ -1278,14 +1203,14 @@ msgid "" "attempts." msgstr "" -#: ../../library/socket.rst:1097 +#: ../../library/socket.rst:1034 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:1102 +#: ../../library/socket.rst:1039 msgid "" "Raises an :ref:`auditing event ` ``socket.getaddrinfo`` with " "arguments ``host``, ``port``, ``family``, ``type``, ``protocol``." @@ -1293,14 +1218,14 @@ msgstr "" "引發一個附帶引數 ``host``、``port``、``family``、``type``、``protocol`` 的" "\\ :ref:`稽核事件 ` ``socket.getaddrinfo``。" -#: ../../library/socket.rst:1104 +#: ../../library/socket.rst:1041 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:1108 +#: ../../library/socket.rst:1045 msgid "" ">>> socket.getaddrinfo(\"example.org\", 80, proto=socket.IPPROTO_TCP)\n" "[(socket.AF_INET6, socket.SOCK_STREAM,\n" @@ -1314,17 +1239,17 @@ msgstr "" " (socket.AF_INET, socket.SOCK_STREAM,\n" " 6, '', ('93.184.216.34', 80))]" -#: ../../library/socket.rst:1114 +#: ../../library/socket.rst:1051 msgid "parameters can now be passed using keyword arguments." msgstr "" -#: ../../library/socket.rst:1117 +#: ../../library/socket.rst:1054 msgid "" "for IPv6 multicast addresses, string representing an address will not " "contain ``%scope_id`` part." msgstr "" -#: ../../library/socket.rst:1125 +#: ../../library/socket.rst:1062 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 " @@ -1335,7 +1260,7 @@ msgid "" "``'0.0.0.0'``, the hostname from :func:`gethostname` is returned." msgstr "" -#: ../../library/socket.rst:1136 +#: ../../library/socket.rst:1073 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 " @@ -1345,7 +1270,7 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:1142 ../../library/socket.rst:1158 +#: ../../library/socket.rst:1079 ../../library/socket.rst:1095 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyname`` with " "argument ``hostname``." @@ -1353,7 +1278,7 @@ msgstr "" "引發一個附帶引數 ``hostname`` 的\\ :ref:`稽核事件 ` ``socket." "gethostbyname``。" -#: ../../library/socket.rst:1149 +#: ../../library/socket.rst:1086 msgid "" "Translate a host name to IPv4 address format, extended interface. Return a 3-" "tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is the host's " @@ -1365,26 +1290,26 @@ msgid "" "stack support." msgstr "" -#: ../../library/socket.rst:1165 +#: ../../library/socket.rst:1102 msgid "" "Return a string containing the hostname of the machine where the Python " "interpreter is currently executing." msgstr "" -#: ../../library/socket.rst:1168 +#: ../../library/socket.rst:1105 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostname`` with no " "arguments." msgstr "" "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``socket.gethostname``。" -#: ../../library/socket.rst:1170 +#: ../../library/socket.rst:1107 msgid "" "Note: :func:`gethostname` doesn't always return the fully qualified domain " "name; use :func:`getfqdn` for that." msgstr "" -#: ../../library/socket.rst:1178 +#: ../../library/socket.rst:1115 msgid "" "Return a 3-tuple ``(hostname, aliaslist, ipaddrlist)`` where *hostname* is " "the primary host name responding to the given *ip_address*, *aliaslist* is a " @@ -1395,7 +1320,7 @@ msgid "" "`gethostbyaddr` supports both IPv4 and IPv6." msgstr "" -#: ../../library/socket.rst:1186 +#: ../../library/socket.rst:1123 msgid "" "Raises an :ref:`auditing event ` ``socket.gethostbyaddr`` with " "argument ``ip_address``." @@ -1403,7 +1328,7 @@ msgstr "" "引發一個附帶引數 ``ip_address`` 的\\ :ref:`稽核事件 ` ``socket." "gethostbyaddr``。" -#: ../../library/socket.rst:1193 +#: ../../library/socket.rst:1130 msgid "" "Translate a socket address *sockaddr* into a 2-tuple ``(host, port)``. " "Depending on the settings of *flags*, the result can contain a fully " @@ -1411,18 +1336,18 @@ msgid "" "Similarly, *port* can contain a string port name or a numeric port number." msgstr "" -#: ../../library/socket.rst:1198 +#: ../../library/socket.rst:1135 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:1201 +#: ../../library/socket.rst:1138 msgid "" "For more information about *flags* you can consult :manpage:`getnameinfo(3)`." msgstr "" -#: ../../library/socket.rst:1203 +#: ../../library/socket.rst:1140 msgid "" "Raises an :ref:`auditing event ` ``socket.getnameinfo`` with " "argument ``sockaddr``." @@ -1430,7 +1355,7 @@ msgstr "" "引發一個附帶引數 ``sockaddr`` 的\\ :ref:`稽核事件 ` ``socket." "getnameinfo``。" -#: ../../library/socket.rst:1210 +#: ../../library/socket.rst:1147 msgid "" "Translate an internet protocol name (for example, ``'icmp'``) to a constant " "suitable for passing as the (optional) third argument to the :func:`~socket." @@ -1439,14 +1364,14 @@ msgid "" "is chosen automatically if the protocol is omitted or zero." msgstr "" -#: ../../library/socket.rst:1221 +#: ../../library/socket.rst:1158 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:1225 +#: ../../library/socket.rst:1162 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyname`` with " "arguments ``servicename``, ``protocolname``." @@ -1454,14 +1379,14 @@ msgstr "" "引發一個附帶引數 ``sockaddr``、``protocolname`` 的\\ :ref:`稽核事件 " "` ``socket.getservbyname``。" -#: ../../library/socket.rst:1232 +#: ../../library/socket.rst:1169 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:1236 +#: ../../library/socket.rst:1173 msgid "" "Raises an :ref:`auditing event ` ``socket.getservbyport`` with " "arguments ``port``, ``protocolname``." @@ -1469,40 +1394,40 @@ msgstr "" "引發一個附帶引數 ``port``、``protocolname`` 的\\ :ref:`稽核事件 ` " "``socket.getservbyport``。" -#: ../../library/socket.rst:1243 +#: ../../library/socket.rst:1180 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:1250 +#: ../../library/socket.rst:1187 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:1254 ../../library/socket.rst:1272 +#: ../../library/socket.rst:1191 ../../library/socket.rst:1209 msgid "" "Raises :exc:`OverflowError` if *x* does not fit in a 16-bit unsigned integer." msgstr "" -#: ../../library/socket.rst:1261 +#: ../../library/socket.rst:1198 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:1268 +#: ../../library/socket.rst:1205 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:1279 +#: ../../library/socket.rst:1216 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 " @@ -1511,26 +1436,26 @@ msgid "" "which is the C type for the 32-bit packed binary this function returns." msgstr "" -#: ../../library/socket.rst:1285 +#: ../../library/socket.rst:1222 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:1288 +#: ../../library/socket.rst:1225 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:1292 +#: ../../library/socket.rst:1229 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:1298 +#: ../../library/socket.rst:1235 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, " @@ -1540,7 +1465,7 @@ msgid "" "argument." msgstr "" -#: ../../library/socket.rst:1305 +#: ../../library/socket.rst:1242 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 " @@ -1548,7 +1473,7 @@ msgid "" "support." msgstr "" -#: ../../library/socket.rst:1316 +#: ../../library/socket.rst:1253 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 " @@ -1556,7 +1481,7 @@ msgid "" "`inet_aton`) or :c:struct:`in6_addr`." msgstr "" -#: ../../library/socket.rst:1321 +#: ../../library/socket.rst:1258 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:" @@ -1565,11 +1490,11 @@ msgid "" "`inet_pton`." msgstr "" -#: ../../library/socket.rst:1329 ../../library/socket.rst:1349 +#: ../../library/socket.rst:1266 ../../library/socket.rst:1286 msgid "Windows support added" msgstr "" -#: ../../library/socket.rst:1335 +#: ../../library/socket.rst:1272 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, " @@ -1578,7 +1503,7 @@ msgid "" "(similar to :func:`inet_ntoa`) or :c:struct:`in6_addr`." msgstr "" -#: ../../library/socket.rst:1342 +#: ../../library/socket.rst:1279 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 " @@ -1586,7 +1511,7 @@ msgid "" "`OSError` is raised for errors from the call to :func:`inet_ntop`." msgstr "" -#: ../../library/socket.rst:1364 +#: ../../library/socket.rst:1301 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 " @@ -1597,12 +1522,12 @@ msgid "" "the permissible range of values." msgstr "" -#: ../../library/socket.rst:1375 ../../library/socket.rst:1864 -#: ../../library/socket.rst:1908 ../../library/socket.rst:2016 +#: ../../library/socket.rst:1312 ../../library/socket.rst:1861 +#: ../../library/socket.rst:1905 ../../library/socket.rst:2013 msgid "Most Unix platforms." msgstr "" -#: ../../library/socket.rst:1382 +#: ../../library/socket.rst:1319 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 " @@ -1612,7 +1537,7 @@ msgid "" "values." msgstr "" -#: ../../library/socket.rst:1390 +#: ../../library/socket.rst:1327 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 " @@ -1620,31 +1545,31 @@ msgid "" "received, since additional data may be able to fit into the padding area." msgstr "" -#: ../../library/socket.rst:1398 +#: ../../library/socket.rst:1335 msgid "most Unix platforms." msgstr "" -#: ../../library/socket.rst:1405 +#: ../../library/socket.rst:1342 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:1412 +#: ../../library/socket.rst:1349 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:1420 +#: ../../library/socket.rst:1357 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:1423 +#: ../../library/socket.rst:1360 msgid "" "Raises an :ref:`auditing event ` ``socket.sethostname`` with " "argument ``name``." @@ -1652,108 +1577,183 @@ msgstr "" "引發一個附帶引數 ``name`` 的\\ :ref:`稽核事件 ` ``socket." "sethostname``。" -#: ../../library/socket.rst:1432 +#: ../../library/socket.rst:1369 msgid "" "Return a list of network interface information (index int, name string) " "tuples. :exc:`OSError` if the system call fails." msgstr "" -#: ../../library/socket.rst:1440 ../../library/socket.rst:1467 -#: ../../library/socket.rst:1484 +#: ../../library/socket.rst:1377 ../../library/socket.rst:1404 +#: ../../library/socket.rst:1421 msgid "Windows support was added." msgstr "增加對 Windows 的支援。" -#: ../../library/socket.rst:1445 +#: ../../library/socket.rst:1382 msgid "" "On Windows network interfaces have different names in different contexts " "(all names are examples):" msgstr "" -#: ../../library/socket.rst:1448 +#: ../../library/socket.rst:1385 msgid "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" msgstr "UUID: ``{FB605B73-AAC2-49A6-9A2F-25416AEA0573}``" -#: ../../library/socket.rst:1449 +#: ../../library/socket.rst:1386 msgid "name: ``ethernet_32770``" msgstr "" -#: ../../library/socket.rst:1450 +#: ../../library/socket.rst:1387 msgid "friendly name: ``vEthernet (nat)``" msgstr "" -#: ../../library/socket.rst:1451 +#: ../../library/socket.rst:1388 msgid "description: ``Hyper-V Virtual Ethernet Adapter``" msgstr "" -#: ../../library/socket.rst:1453 +#: ../../library/socket.rst:1390 msgid "" "This function returns names of the second form from the list, " "``ethernet_32770`` in this example case." msgstr "" -#: ../../library/socket.rst:1459 +#: ../../library/socket.rst:1396 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:1471 ../../library/socket.rst:1488 +#: ../../library/socket.rst:1408 ../../library/socket.rst:1425 msgid "\"Interface name\" is a name as documented in :func:`if_nameindex`." msgstr "" -#: ../../library/socket.rst:1476 +#: ../../library/socket.rst:1413 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:1493 +#: ../../library/socket.rst:1430 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:1499 +#: ../../library/socket.rst:1436 msgid "" "Unix platforms supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` " "mechanism." msgstr "" -#: ../../library/socket.rst:1507 +#: ../../library/socket.rst:1444 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:1513 +#: ../../library/socket.rst:1450 msgid "" "Unix platforms supporting :meth:`~socket.recvmsg` and :const:`SCM_RIGHTS` " "mechanism." msgstr "" -#: ../../library/socket.rst:1520 +#: ../../library/socket.rst:1457 msgid "Any truncated integers at the end of the list of file descriptors." msgstr "" -#: ../../library/socket.rst:1526 +#: ../../library/socket.rst:1463 msgid "Socket Objects" msgstr "Socket 物件" -#: ../../library/socket.rst:1528 +#: ../../library/socket.rst:1467 +msgid "" +"Create a new socket using the given address family, socket type and protocol " +"number. The address family should be :const:`AF_INET` (the default), :const:" +"`AF_INET6`, :const:`AF_UNIX`, :const:`AF_CAN`, :const:`AF_PACKET`, or :const:" +"`AF_RDS`. The socket type should be :const:`SOCK_STREAM` (the default), :" +"const:`SOCK_DGRAM`, :const:`SOCK_RAW` or perhaps one of the other ``SOCK_`` " +"constants. The protocol number is usually zero and may be omitted or in the " +"case where the address family is :const:`AF_CAN` the protocol should be one " +"of :const:`CAN_RAW`, :const:`CAN_BCM`, :const:`CAN_ISOTP` or :const:" +"`CAN_J1939`." +msgstr "" + +#: ../../library/socket.rst:1477 +msgid "" +"If *fileno* is specified, the values for *family*, *type*, and *proto* are " +"auto-detected from the specified file descriptor. Auto-detection can be " +"overruled by calling the function with explicit *family*, *type*, or *proto* " +"arguments. This only affects how Python represents e.g. the return value " +"of :meth:`socket.getpeername` but not the actual OS resource. Unlike :func:" +"`socket.fromfd`, *fileno* will return the same socket and not a duplicate. " +"This may help close a detached socket using :meth:`socket.close`." +msgstr "" + +#: ../../library/socket.rst:1488 +msgid "" +"Raises an :ref:`auditing event ` ``socket.__new__`` with arguments " +"``self``, ``family``, ``type``, ``protocol``." +msgstr "" +"引發一個附帶引數 ``self``、``family``、``type``、``protocol`` 的\\ :ref:`稽核" +"事件 ` ``socket.__new__``。" + +#: ../../library/socket.rst:1490 +msgid "The AF_CAN family was added. The AF_RDS family was added." +msgstr "" + +#: ../../library/socket.rst:1494 +msgid "The CAN_BCM protocol was added." +msgstr "新增 CAN_BCM 協定。" + +#: ../../library/socket.rst:1500 +msgid "The CAN_ISOTP protocol was added." +msgstr "新增 CAN_ISOTP 協定。" + +#: ../../library/socket.rst:1503 +msgid "" +"When :const:`SOCK_NONBLOCK` or :const:`SOCK_CLOEXEC` bit flags are applied " +"to *type* they are cleared, and :attr:`socket.type` will not reflect them. " +"They are still passed to the underlying system ``socket()`` call. Therefore," +msgstr "" + +#: ../../library/socket.rst:1511 +msgid "" +"sock = socket.socket(\n" +" socket.AF_INET,\n" +" socket.SOCK_STREAM | socket.SOCK_NONBLOCK)" +msgstr "" +"sock = socket.socket(\n" +" socket.AF_INET,\n" +" socket.SOCK_STREAM | socket.SOCK_NONBLOCK)" + +#: ../../library/socket.rst:1515 +msgid "" +"will still create a non-blocking socket on OSes that support " +"``SOCK_NONBLOCK``, but ``sock.type`` will be set to ``socket.SOCK_STREAM``." +msgstr "" + +#: ../../library/socket.rst:1519 +msgid "The CAN_J1939 protocol was added." +msgstr "新增 CAN_J1939 協定。" + +#: ../../library/socket.rst:1522 +msgid "The IPPROTO_MPTCP protocol was added." +msgstr "新增 IPPROTO_MPTCP 協定。" + +#: ../../library/socket.rst:1525 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:1532 +#: ../../library/socket.rst:1529 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:1539 +#: ../../library/socket.rst:1536 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* " @@ -1762,28 +1762,28 @@ msgid "" "connection." msgstr "" -#: ../../library/socket.rst:1546 ../../library/socket.rst:1640 +#: ../../library/socket.rst:1543 ../../library/socket.rst:1637 msgid "The socket is now non-inheritable." msgstr "" -#: ../../library/socket.rst:1549 ../../library/socket.rst:1776 -#: ../../library/socket.rst:1791 ../../library/socket.rst:1868 -#: ../../library/socket.rst:1941 ../../library/socket.rst:1960 -#: ../../library/socket.rst:1977 ../../library/socket.rst:2022 +#: ../../library/socket.rst:1546 ../../library/socket.rst:1773 +#: ../../library/socket.rst:1788 ../../library/socket.rst:1865 +#: ../../library/socket.rst:1938 ../../library/socket.rst:1957 +#: ../../library/socket.rst:1974 ../../library/socket.rst:2019 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:1557 +#: ../../library/socket.rst:1554 msgid "" "Bind the socket to *address*. The socket must not already be bound. The " "format of *address* depends on the address family --- see :ref:`socket-" "addresses`." msgstr "" -#: ../../library/socket.rst:1560 +#: ../../library/socket.rst:1557 msgid "" "Raises an :ref:`auditing event ` ``socket.bind`` with arguments " "``self``, ``address``." @@ -1791,7 +1791,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.bind``。" -#: ../../library/socket.rst:1567 +#: ../../library/socket.rst:1564 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 " @@ -1800,33 +1800,33 @@ msgid "" "flushed)." msgstr "" -#: ../../library/socket.rst:1573 +#: ../../library/socket.rst:1570 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:1577 +#: ../../library/socket.rst:1574 msgid "" ":exc:`OSError` is now raised if an error occurs when the underlying :c:func:" -"`close` call is made." +"`!close` call is made." msgstr "" -#: ../../library/socket.rst:1583 +#: ../../library/socket.rst:1580 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:1591 +#: ../../library/socket.rst:1588 msgid "" "Connect to a remote socket at *address*. The format of *address* depends on " "the address family --- see :ref:`socket-addresses`." msgstr "" -#: ../../library/socket.rst:1594 +#: ../../library/socket.rst:1591 msgid "" "If the connection is interrupted by a signal, the method waits until the " "connection completes, or raises a :exc:`TimeoutError` on timeout, if the " @@ -1836,7 +1836,7 @@ msgid "" "(or the exception raised by the signal handler)." msgstr "" -#: ../../library/socket.rst:1601 ../../library/socket.rst:1621 +#: ../../library/socket.rst:1598 ../../library/socket.rst:1618 msgid "" "Raises an :ref:`auditing event ` ``socket.connect`` with arguments " "``self``, ``address``." @@ -1844,7 +1844,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.connect``。" -#: ../../library/socket.rst:1603 +#: ../../library/socket.rst:1600 msgid "" "The method now waits until the connection completes instead of raising an :" "exc:`InterruptedError` exception if the connection is interrupted by a " @@ -1852,48 +1852,48 @@ msgid "" "blocking or has a timeout (see the :pep:`475` for the rationale)." msgstr "" -#: ../../library/socket.rst:1614 +#: ../../library/socket.rst:1611 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 " +"an exception for errors returned by the C-level :c:func:`!connect` call " "(other problems, such as \"host not found,\" can still raise exceptions). " "The error indicator is ``0`` if the operation succeeded, otherwise the value " "of the :c:data:`errno` variable. This is useful to support, for example, " "asynchronous connects." msgstr "" -#: ../../library/socket.rst:1627 +#: ../../library/socket.rst:1624 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:1636 +#: ../../library/socket.rst:1633 msgid "Duplicate the socket." msgstr "" -#: ../../library/socket.rst:1648 +#: ../../library/socket.rst:1645 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:1651 +#: ../../library/socket.rst:1648 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:1657 +#: ../../library/socket.rst:1654 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:1666 +#: ../../library/socket.rst:1663 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 " @@ -1901,14 +1901,14 @@ msgid "" "`socket-addresses`. On some systems this function is not supported." msgstr "" -#: ../../library/socket.rst:1674 +#: ../../library/socket.rst:1671 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 :ref:`socket-addresses`." msgstr "" -#: ../../library/socket.rst:1681 +#: ../../library/socket.rst:1678 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:1717 +#: ../../library/socket.rst:1714 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:1720 +#: ../../library/socket.rst:1717 msgid "" "Currently only the following control codes are supported: ``SIO_RCVALL``, " "``SIO_KEEPALIVE_VALS``, and ``SIO_LOOPBACK_FAST_PATH``." msgstr "" -#: ../../library/socket.rst:1731 +#: ../../library/socket.rst:1728 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 " @@ -1964,11 +1964,11 @@ msgid "" "connections. If not specified, a default reasonable value is chosen." msgstr "" -#: ../../library/socket.rst:1738 +#: ../../library/socket.rst:1735 msgid "The *backlog* parameter is now optional." msgstr "" -#: ../../library/socket.rst:1747 +#: ../../library/socket.rst:1744 msgid "" "Return a :term:`file object` associated with the socket. The exact returned " "type depends on the arguments given to :meth:`makefile`. These arguments " @@ -1977,28 +1977,28 @@ msgid "" "``'b'``, or a combination of those." msgstr "" -#: ../../library/socket.rst:1753 +#: ../../library/socket.rst:1750 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:1757 +#: ../../library/socket.rst:1754 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:1763 +#: ../../library/socket.rst:1760 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:1770 +#: ../../library/socket.rst:1767 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 " @@ -2008,7 +2008,7 @@ msgid "" "zero." msgstr "" -#: ../../library/socket.rst:1784 +#: ../../library/socket.rst:1781 msgid "" "Receive data from the socket. The return value is a pair ``(bytes, " "address)`` where *bytes* is a bytes object representing the data received " @@ -2018,14 +2018,14 @@ msgid "" "family --- see :ref:`socket-addresses`." msgstr "" -#: ../../library/socket.rst:1796 +#: ../../library/socket.rst:1793 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:1803 +#: ../../library/socket.rst:1800 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 " @@ -2036,7 +2036,7 @@ msgid "" "*flags* argument defaults to 0 and has the same meaning as for :meth:`recv`." msgstr "" -#: ../../library/socket.rst:1813 +#: ../../library/socket.rst:1810 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 " @@ -2051,7 +2051,7 @@ msgid "" "socket, if available; otherwise, its value is unspecified." msgstr "" -#: ../../library/socket.rst:1827 +#: ../../library/socket.rst:1824 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 " @@ -2064,7 +2064,7 @@ msgid "" "descriptors received via this mechanism." msgstr "" -#: ../../library/socket.rst:1838 +#: ../../library/socket.rst:1835 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 " @@ -2073,16 +2073,16 @@ msgid "" "provided it has not been truncated before the start of its associated data." msgstr "" -#: ../../library/socket.rst:1845 +#: ../../library/socket.rst:1842 msgid "" -"On systems which support the :const:`SCM_RIGHTS` mechanism, the following " +"On systems which support the :const:`!SCM_RIGHTS` mechanism, the following " "function will receive up to *maxfds* file descriptors, returning the message " "data and a list containing the descriptors (while ignoring unexpected " "conditions such as unrelated control messages being received). See also :" "meth:`sendmsg`. ::" msgstr "" -#: ../../library/socket.rst:1851 +#: ../../library/socket.rst:1848 msgid "" "import socket, array\n" "\n" @@ -2099,7 +2099,7 @@ msgid "" " return msg, list(fds)" msgstr "" -#: ../../library/socket.rst:1876 +#: ../../library/socket.rst:1873 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 " @@ -2112,7 +2112,7 @@ msgid "" "arguments have the same meaning as for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1887 +#: ../../library/socket.rst:1884 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 " @@ -2120,11 +2120,11 @@ msgid "" "for :meth:`recvmsg`." msgstr "" -#: ../../library/socket.rst:1892 +#: ../../library/socket.rst:1889 msgid "Example::" msgstr "範例: ::" -#: ../../library/socket.rst:1894 +#: ../../library/socket.rst:1891 msgid "" ">>> import socket\n" ">>> s1, s2 = socket.socketpair()\n" @@ -2150,7 +2150,7 @@ msgstr "" ">>> [b1, b2, b3]\n" "[bytearray(b'Mary'), bytearray(b'01 had a 9'), bytearray(b'little lamb---')]" -#: ../../library/socket.rst:1915 +#: ../../library/socket.rst:1912 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 " @@ -2161,7 +2161,7 @@ msgid "" "addresses`." msgstr "" -#: ../../library/socket.rst:1925 +#: ../../library/socket.rst:1922 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), " @@ -2170,7 +2170,7 @@ msgid "" "of the optional argument *flags*; it defaults to zero." msgstr "" -#: ../../library/socket.rst:1934 +#: ../../library/socket.rst:1931 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`. " @@ -2180,7 +2180,7 @@ msgid "" "information on this topic, consult the :ref:`socket-howto`." msgstr "" -#: ../../library/socket.rst:1949 +#: ../../library/socket.rst:1946 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`. " @@ -2190,13 +2190,13 @@ msgid "" "how much data, if any, was successfully sent." msgstr "" -#: ../../library/socket.rst:1956 +#: ../../library/socket.rst:1953 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:1969 +#: ../../library/socket.rst:1966 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 " @@ -2205,7 +2205,7 @@ msgid "" "family --- see :ref:`socket-addresses`." msgstr "" -#: ../../library/socket.rst:1975 +#: ../../library/socket.rst:1972 msgid "" "Raises an :ref:`auditing event ` ``socket.sendto`` with arguments " "``self``, ``address``." @@ -2213,7 +2213,7 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendto``。" -#: ../../library/socket.rst:1985 +#: ../../library/socket.rst:1982 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. " @@ -2233,14 +2233,14 @@ msgid "" "bytes of non-ancillary data sent." msgstr "" -#: ../../library/socket.rst:2005 +#: ../../library/socket.rst:2002 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` " +"const:`AF_UNIX` socket, on systems which support the :const:`!SCM_RIGHTS` " "mechanism. See also :meth:`recvmsg`. ::" msgstr "" -#: ../../library/socket.rst:2009 +#: ../../library/socket.rst:2006 msgid "" "import socket, array\n" "\n" @@ -2254,7 +2254,7 @@ msgstr "" " return sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, array." "array(\"i\", fds))])" -#: ../../library/socket.rst:2018 +#: ../../library/socket.rst:2015 msgid "" "Raises an :ref:`auditing event ` ``socket.sendmsg`` with arguments " "``self``, ``address``." @@ -2262,14 +2262,14 @@ msgstr "" "引發一個附帶引數 ``self``、``address`` 的\\ :ref:`稽核事件 ` " "``socket.sendmsg``。" -#: ../../library/socket.rst:2029 +#: ../../library/socket.rst:2026 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:2038 +#: ../../library/socket.rst:2035 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 " @@ -2283,60 +2283,60 @@ msgid "" "be of :const:`SOCK_STREAM` type. Non-blocking sockets are not supported." msgstr "" -#: ../../library/socket.rst:2054 +#: ../../library/socket.rst:2051 msgid "" "Set the :ref:`inheritable flag ` of the socket's file " "descriptor or socket's handle." msgstr "" -#: ../../library/socket.rst:2062 +#: ../../library/socket.rst:2059 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:2065 +#: ../../library/socket.rst:2062 msgid "" "This method is a shorthand for certain :meth:`~socket.settimeout` calls:" msgstr "" -#: ../../library/socket.rst:2067 +#: ../../library/socket.rst:2064 msgid "``sock.setblocking(True)`` is equivalent to ``sock.settimeout(None)``" msgstr "``sock.setblocking(True)`` 等價於 ``sock.settimeout(None)``" -#: ../../library/socket.rst:2069 +#: ../../library/socket.rst:2066 msgid "``sock.setblocking(False)`` is equivalent to ``sock.settimeout(0.0)``" msgstr "``sock.setblocking(False)`` 等價於 ``sock.settimeout(0.0)``" -#: ../../library/socket.rst:2071 +#: ../../library/socket.rst:2068 msgid "" "The method no longer applies :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:2078 +#: ../../library/socket.rst:2075 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-" -"zero value is given, subsequent socket operations will raise a :exc:" -"`timeout` exception if the timeout period *value* has elapsed before the " -"operation has completed. If zero is given, the socket is put in non-" -"blocking mode. If ``None`` is given, the socket is put in blocking mode." +"nonnegative real number expressing seconds, or ``None``. If a non-zero value " +"is given, subsequent socket operations will raise a :exc:`timeout` exception " +"if the timeout period *value* has elapsed before the operation has " +"completed. If zero is given, the socket is put in non-blocking mode. If " +"``None`` is given, the socket is put in blocking mode." msgstr "" -#: ../../library/socket.rst:2085 +#: ../../library/socket.rst:2082 msgid "" "For further information, please consult the :ref:`notes on socket timeouts " "`." msgstr "" -#: ../../library/socket.rst:2087 +#: ../../library/socket.rst:2084 msgid "" "The method no longer toggles :const:`SOCK_NONBLOCK` flag on :attr:`socket." "type`." msgstr "" -#: ../../library/socket.rst:2097 +#: ../../library/socket.rst:2094 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 " @@ -2345,15 +2345,15 @@ msgid "" "case it is up to the caller to ensure that the bytestring contains the " "proper bits (see the optional built-in module :mod:`struct` for a way to " "encode C structures as bytestrings). When *value* is set to ``None``, " -"*optlen* argument is required. It's equivalent to calling :c:func:" -"`setsockopt` C function with ``optval=NULL`` and ``optlen=optlen``." +"*optlen* argument is required. It's equivalent to calling :c:func:`!" +"setsockopt` C function with ``optval=NULL`` and ``optlen=optlen``." msgstr "" -#: ../../library/socket.rst:2110 +#: ../../library/socket.rst:2107 msgid "setsockopt(level, optname, None, optlen: int) form added." msgstr "" -#: ../../library/socket.rst:2118 +#: ../../library/socket.rst:2115 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`, " @@ -2361,7 +2361,7 @@ msgid "" "and receives are disallowed." msgstr "" -#: ../../library/socket.rst:2128 +#: ../../library/socket.rst:2125 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 " @@ -2372,48 +2372,56 @@ msgid "" "process." msgstr "" -#: ../../library/socket.rst:2140 +#: ../../library/socket.rst:2137 msgid "" -"Note that there are no methods :meth:`read` or :meth:`write`; use :meth:" +"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:2143 +#: ../../library/socket.rst:2140 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:2149 +#: ../../library/socket.rst:2146 msgid "The socket family." msgstr "" -#: ../../library/socket.rst:2154 +#: ../../library/socket.rst:2151 msgid "The socket type." msgstr "" -#: ../../library/socket.rst:2159 +#: ../../library/socket.rst:2156 msgid "The socket protocol." msgstr "" -#: ../../library/socket.rst:2166 +#: ../../library/socket.rst:2161 +msgid "" +"The base class of the :class:`~socket.socket` type, re-exported from :mod:`!" +"_socket`. An instance check such as ``isinstance(socket(...), SocketType)`` " +"is true, but ``SocketType`` is not the same as ``type(socket(...))``, which " +"is :class:`~socket.socket` itself." +msgstr "" + +#: ../../library/socket.rst:2170 msgid "Notes on socket timeouts" msgstr "" -#: ../../library/socket.rst:2168 +#: ../../library/socket.rst:2172 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:2172 +#: ../../library/socket.rst:2176 msgid "" "In *blocking mode*, operations block until complete or the system returns an " "error (such as connection timed out)." msgstr "" -#: ../../library/socket.rst:2175 +#: ../../library/socket.rst:2179 msgid "" "In *non-blocking mode*, operations fail (with an error that is unfortunately " "system-dependent) if they cannot be completed immediately: functions from " @@ -2421,14 +2429,14 @@ msgid "" "available for reading or writing." msgstr "" -#: ../../library/socket.rst:2180 +#: ../../library/socket.rst:2184 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:2185 +#: ../../library/socket.rst:2189 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 " @@ -2437,11 +2445,11 @@ msgid "" "you decide to use the :meth:`~socket.fileno` of a socket." msgstr "" -#: ../../library/socket.rst:2192 +#: ../../library/socket.rst:2196 msgid "Timeouts and the ``connect`` method" msgstr "" -#: ../../library/socket.rst:2194 +#: ../../library/socket.rst:2198 msgid "" "The :meth:`~socket.connect` operation is also subject to the timeout " "setting, and in general it is recommended to call :meth:`~socket.settimeout` " @@ -2451,24 +2459,24 @@ msgid "" "setting." msgstr "" -#: ../../library/socket.rst:2202 +#: ../../library/socket.rst:2206 msgid "Timeouts and the ``accept`` method" msgstr "" -#: ../../library/socket.rst:2204 +#: ../../library/socket.rst:2208 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:2208 +#: ../../library/socket.rst:2212 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:2211 +#: ../../library/socket.rst:2215 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 " @@ -2476,11 +2484,11 @@ msgid "" "it is recommended you manually override this setting." msgstr "" -#: ../../library/socket.rst:2220 +#: ../../library/socket.rst:2224 msgid "Example" msgstr "範例" -#: ../../library/socket.rst:2222 +#: ../../library/socket.rst:2226 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 " @@ -2493,11 +2501,11 @@ msgid "" "on the new socket returned by :meth:`~socket.accept`." msgstr "" -#: ../../library/socket.rst:2232 +#: ../../library/socket.rst:2236 msgid "The first two examples support IPv4 only. ::" msgstr "前兩個範例只支援 IPv4: ::" -#: ../../library/socket.rst:2234 +#: ../../library/socket.rst:2238 msgid "" "# Echo server program\n" "import socket\n" @@ -2516,7 +2524,7 @@ msgid "" " conn.sendall(data)" msgstr "" -#: ../../library/socket.rst:2252 +#: ../../library/socket.rst:2256 msgid "" "# Echo client program\n" "import socket\n" @@ -2530,7 +2538,7 @@ msgid "" "print('Received', repr(data))" msgstr "" -#: ../../library/socket.rst:2263 +#: ../../library/socket.rst:2267 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 " @@ -2540,7 +2548,7 @@ msgid "" "resolution, and sends traffic to the first one connected successfully. ::" msgstr "" -#: ../../library/socket.rst:2270 +#: ../../library/socket.rst:2274 msgid "" "# Echo server program\n" "import socket\n" @@ -2577,7 +2585,7 @@ msgid "" " conn.send(data)" msgstr "" -#: ../../library/socket.rst:2306 +#: ../../library/socket.rst:2310 msgid "" "# Echo client program\n" "import socket\n" @@ -2610,14 +2618,14 @@ msgid "" "print('Received', repr(data))" msgstr "" -#: ../../library/socket.rst:2335 +#: ../../library/socket.rst:2339 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:2339 +#: ../../library/socket.rst:2343 msgid "" "import socket\n" "\n" @@ -2641,29 +2649,29 @@ msgid "" "s.ioctl(socket.SIO_RCVALL, socket.RCVALL_OFF)" msgstr "" -#: ../../library/socket.rst:2360 +#: ../../library/socket.rst:2364 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:2364 +#: ../../library/socket.rst:2368 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:2366 +#: ../../library/socket.rst:2370 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:2370 +#: ../../library/socket.rst:2374 msgid "This last example might require special privileges::" msgstr "" -#: ../../library/socket.rst:2372 +#: ../../library/socket.rst:2376 msgid "" "import socket\n" "import struct\n" @@ -2705,29 +2713,29 @@ msgid "" " print('Error sending CAN frame')" msgstr "" -#: ../../library/socket.rst:2410 +#: ../../library/socket.rst:2414 msgid "" "Running an example several times with too small delay between executions, " "could lead to this error::" msgstr "" -#: ../../library/socket.rst:2413 +#: ../../library/socket.rst:2417 msgid "OSError: [Errno 98] Address already in use" msgstr "OSError: [Errno 98] Address already in use" -#: ../../library/socket.rst:2415 +#: ../../library/socket.rst:2419 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:2418 +#: ../../library/socket.rst:2422 msgid "" "There is a :mod:`!socket` flag to set, in order to prevent this, :const:" "`socket.SO_REUSEADDR`::" msgstr "" -#: ../../library/socket.rst:2421 +#: ../../library/socket.rst:2425 msgid "" "s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" "s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n" @@ -2737,30 +2745,30 @@ msgstr "" "s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\n" "s.bind((HOST, PORT))" -#: ../../library/socket.rst:2425 +#: ../../library/socket.rst:2429 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:2431 +#: ../../library/socket.rst:2435 msgid "" "For an introduction to socket programming (in C), see the following papers:" msgstr "" -#: ../../library/socket.rst:2433 +#: ../../library/socket.rst:2437 msgid "" "*An Introductory 4.3BSD Interprocess Communication Tutorial*, by Stuart " "Sechrest" msgstr "" -#: ../../library/socket.rst:2435 +#: ../../library/socket.rst:2439 msgid "" "*An Advanced 4.3BSD Interprocess Communication Tutorial*, by Samuel J. " "Leffler et al," msgstr "" -#: ../../library/socket.rst:2438 +#: ../../library/socket.rst:2442 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 " @@ -2779,19 +2787,19 @@ msgstr "object(物件)" msgid "socket" msgstr "socket" -#: ../../library/socket.rst:1745 +#: ../../library/socket.rst:1742 msgid "I/O control" msgstr "I/O control(I/O 控制)" -#: ../../library/socket.rst:1745 +#: ../../library/socket.rst:1742 msgid "buffering" msgstr "buffering(緩衝)" -#: ../../library/socket.rst:2095 +#: ../../library/socket.rst:2092 msgid "module" msgstr "module(模組)" -#: ../../library/socket.rst:2095 +#: ../../library/socket.rst:2092 msgid "struct" msgstr "struct" diff --git a/library/stdtypes.po b/library/stdtypes.po index d3e442205e..fd8667e25b 100644 --- a/library/stdtypes.po +++ b/library/stdtypes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-06-05 00:42+0000\n" +"POT-Creation-Date: 2026-06-12 00:46+0000\n" "PO-Revision-Date: 2022-06-12 15:22+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -139,8 +139,8 @@ msgstr "結果" #: ../../library/stdtypes.rst:88 ../../library/stdtypes.rst:292 #: ../../library/stdtypes.rst:432 ../../library/stdtypes.rst:1015 -#: ../../library/stdtypes.rst:1237 ../../library/stdtypes.rst:3175 -#: ../../library/stdtypes.rst:4444 +#: ../../library/stdtypes.rst:1237 ../../library/stdtypes.rst:3190 +#: ../../library/stdtypes.rst:4459 msgid "Notes" msgstr "註解" @@ -154,7 +154,7 @@ msgstr "假如 *x* 為真,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:90 ../../library/stdtypes.rst:1017 #: ../../library/stdtypes.rst:1020 ../../library/stdtypes.rst:1252 -#: ../../library/stdtypes.rst:3181 ../../library/stdtypes.rst:4450 +#: ../../library/stdtypes.rst:3196 ../../library/stdtypes.rst:4465 msgid "\\(1)" msgstr "\\(1)" @@ -168,8 +168,8 @@ msgstr "假如 *x* 為假,則 *x*,否則 *y*" #: ../../library/stdtypes.rst:93 ../../library/stdtypes.rst:305 #: ../../library/stdtypes.rst:325 ../../library/stdtypes.rst:1263 -#: ../../library/stdtypes.rst:3185 ../../library/stdtypes.rst:3187 -#: ../../library/stdtypes.rst:4454 ../../library/stdtypes.rst:4456 +#: ../../library/stdtypes.rst:3200 ../../library/stdtypes.rst:3202 +#: ../../library/stdtypes.rst:4469 ../../library/stdtypes.rst:4471 msgid "\\(2)" msgstr "\\(2)" @@ -181,18 +181,18 @@ msgstr "``not x``" msgid "if *x* is false, then ``True``, else ``False``" msgstr "假如 *x* 為假,則 ``True``,否則 ``False``" -#: ../../library/stdtypes.rst:96 ../../library/stdtypes.rst:3189 -#: ../../library/stdtypes.rst:3191 ../../library/stdtypes.rst:3193 -#: ../../library/stdtypes.rst:3195 ../../library/stdtypes.rst:4458 -#: ../../library/stdtypes.rst:4460 ../../library/stdtypes.rst:4462 -#: ../../library/stdtypes.rst:4464 +#: ../../library/stdtypes.rst:96 ../../library/stdtypes.rst:3204 +#: ../../library/stdtypes.rst:3206 ../../library/stdtypes.rst:3208 +#: ../../library/stdtypes.rst:3210 ../../library/stdtypes.rst:4473 +#: ../../library/stdtypes.rst:4475 ../../library/stdtypes.rst:4477 +#: ../../library/stdtypes.rst:4479 msgid "\\(3)" msgstr "\\(3)" #: ../../library/stdtypes.rst:105 ../../library/stdtypes.rst:336 #: ../../library/stdtypes.rst:450 ../../library/stdtypes.rst:1059 -#: ../../library/stdtypes.rst:1267 ../../library/stdtypes.rst:3225 -#: ../../library/stdtypes.rst:4494 +#: ../../library/stdtypes.rst:1267 ../../library/stdtypes.rst:3240 +#: ../../library/stdtypes.rst:4509 msgid "Notes:" msgstr "註解:" @@ -239,9 +239,9 @@ msgstr "" msgid "This table summarizes the comparison operations:" msgstr "這個表格統整所有比較運算:" -#: ../../library/stdtypes.rst:146 ../../library/stdtypes.rst:3152 -#: ../../library/stdtypes.rst:3175 ../../library/stdtypes.rst:4421 -#: ../../library/stdtypes.rst:4444 +#: ../../library/stdtypes.rst:146 ../../library/stdtypes.rst:3167 +#: ../../library/stdtypes.rst:3190 ../../library/stdtypes.rst:4436 +#: ../../library/stdtypes.rst:4459 msgid "Meaning" msgstr "含義" @@ -591,8 +591,8 @@ msgid "" "zero." msgstr "一個複數,其實部為 *re*,虛部為 *im*。*im* 預設為零。" -#: ../../library/stdtypes.rst:318 ../../library/stdtypes.rst:3183 -#: ../../library/stdtypes.rst:4481 +#: ../../library/stdtypes.rst:318 ../../library/stdtypes.rst:3198 +#: ../../library/stdtypes.rst:4496 msgid "\\(6)" msgstr "\\(6)" @@ -629,9 +629,9 @@ msgid "*x* to the power *y*" msgstr "*x* 的 *y* 次方" #: ../../library/stdtypes.rst:327 ../../library/stdtypes.rst:329 -#: ../../library/stdtypes.rst:3208 ../../library/stdtypes.rst:3211 -#: ../../library/stdtypes.rst:3214 ../../library/stdtypes.rst:4477 -#: ../../library/stdtypes.rst:4484 +#: ../../library/stdtypes.rst:3223 ../../library/stdtypes.rst:3226 +#: ../../library/stdtypes.rst:3229 ../../library/stdtypes.rst:4492 +#: ../../library/stdtypes.rst:4499 msgid "\\(5)" msgstr "\\(5)" @@ -789,9 +789,9 @@ msgid "bitwise :dfn:`or` of *x* and *y*" msgstr "*x* 及 *y* 的位元 :dfn:`或`" #: ../../library/stdtypes.rst:434 ../../library/stdtypes.rst:437 -#: ../../library/stdtypes.rst:440 ../../library/stdtypes.rst:3197 -#: ../../library/stdtypes.rst:3201 ../../library/stdtypes.rst:4466 -#: ../../library/stdtypes.rst:4470 +#: ../../library/stdtypes.rst:440 ../../library/stdtypes.rst:3212 +#: ../../library/stdtypes.rst:3216 ../../library/stdtypes.rst:4481 +#: ../../library/stdtypes.rst:4485 msgid "\\(4)" msgstr "\\(4)" @@ -1142,8 +1142,7 @@ msgstr "" #: ../../library/stdtypes.rst:646 msgid "" "Class method to return a floating-point number constructed from a number *x*." -msgstr "" -"Class method 會基於數字 *x* 建構並回傳一個浮點數。" +msgstr "Class method 會基於數字 *x* 建構並回傳一個浮點數。" #: ../../library/stdtypes.rst:648 msgid "" @@ -1152,8 +1151,8 @@ msgid "" "returned. If the argument is outside the range of a Python float, an :exc:" "`OverflowError` will be raised." msgstr "" -"如果參數是整數或浮點數,將回傳具有相同值的浮點數(在 Python 浮點數精度範圍內)。" -"如果參數超出 Python 浮點數的範圍,將引發 :exc:`OverflowError`。" +"如果參數是整數或浮點數,將回傳具有相同值的浮點數(在 Python 浮點數精度範圍" +"內)。如果參數超出 Python 浮點數的範圍,將引發 :exc:`OverflowError`。" #: ../../library/stdtypes.rst:653 msgid "" @@ -1161,8 +1160,9 @@ msgid "" "__float__()``. If :meth:`~object.__float__` is not defined then it falls " "back to :meth:`~object.__index__`." msgstr "" -"對於任意 Python 物件 ``x``,``float.from_number(x)`` 會委派給 ``x.__float__()``。" -"若 :meth:`~object.__float__` 未定義,則會退回 :meth:`~object.__index__`。" +"對於任意 Python 物件 ``x``,``float.from_number(x)`` 會委派給 ``x." +"__float__()``。若 :meth:`~object.__float__` 未定義,則會退回 :meth:`~object." +"__index__`。" #: ../../library/stdtypes.rst:663 msgid "" @@ -1318,9 +1318,10 @@ msgid "" "falls back to :meth:`~object.__float__`. If :meth:`!__float__` is not " "defined then it falls back to :meth:`~object.__index__`." msgstr "" -"對於任意 Python 物件 ``x``,``complex.from_number(x)`` 會委派給 ``x.__complex__()``。" -"若 :meth:`~object.__complex__` 未定義,則會退回 :meth:`~object.__float__`。" -"若 :meth:`!__float__` 未定義,則會退回 :meth:`~object.__index__`。" +"對於任意 Python 物件 ``x``,``complex.from_number(x)`` 會委派給 ``x." +"__complex__()``。若 :meth:`~object.__complex__` 未定義,則會退回 :meth:" +"`~object.__float__`。若 :meth:`!__float__` 未定義,則會退回 :meth:`~object." +"__index__`。" #: ../../library/stdtypes.rst:761 msgid "Hashing of numeric types" @@ -3212,7 +3213,7 @@ msgstr "" msgid "Return the string encoded to :class:`bytes`." msgstr "" -#: ../../library/stdtypes.rst:1923 ../../library/stdtypes.rst:3620 +#: ../../library/stdtypes.rst:1923 ../../library/stdtypes.rst:3635 msgid "" "*encoding* defaults to ``'utf-8'``; see :ref:`standard-encodings` for " "possible values." @@ -3248,11 +3249,11 @@ msgstr "" ">>> encoded_str_to_bytes\n" "b'Python'" -#: ../../library/stdtypes.rst:1946 ../../library/stdtypes.rst:3639 +#: ../../library/stdtypes.rst:1946 ../../library/stdtypes.rst:3654 msgid "Added support for keyword arguments." msgstr "新增關鍵字引數的支援。" -#: ../../library/stdtypes.rst:1949 ../../library/stdtypes.rst:3642 +#: ../../library/stdtypes.rst:1949 ../../library/stdtypes.rst:3657 msgid "" "The value of the *errors* argument is now checked in :ref:`devmode` and in :" "ref:`debug mode `." @@ -3555,27 +3556,63 @@ msgid "" "least one character, ``False`` otherwise. Digits include decimal characters " "and digits that need special handling, such as the compatibility superscript " "digits. This covers digits which cannot be used to form numbers in base 10, " -"like the Kharosthi numbers. Formally, a digit is a character that has the " +"like the `Kharosthi numbers `__. Formally, a digit is a character that has the " "property value Numeric_Type=Digit or Numeric_Type=Decimal." msgstr "" +#: ../../library/stdtypes.rst:2181 ../../library/stdtypes.rst:2262 +#: ../../library/stdtypes.rst:2279 ../../library/stdtypes.rst:2306 +#: ../../library/stdtypes.rst:2361 ../../library/stdtypes.rst:2434 +#: ../../library/stdtypes.rst:2545 ../../library/stdtypes.rst:2566 +#: ../../library/stdtypes.rst:2630 ../../library/stdtypes.rst:2650 +#: ../../library/stdtypes.rst:2664 ../../library/stdtypes.rst:2751 +#: ../../library/stdtypes.rst:2775 ../../library/stdtypes.rst:2789 +#: ../../library/stdtypes.rst:2896 +msgid "For example:" +msgstr "舉例來說:" + #: ../../library/stdtypes.rst:2183 msgid "" +">>> '0123456789'.isdigit()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isdigit() # Arabic-Indic digits zero to nine\n" +"True\n" +">>> '⅕'.isdigit() # Vulgar fraction one fifth\n" +"False\n" +">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" +"(False, True, True)" +msgstr "" +">>> '0123456789'.isdigit()\n" +"True\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isdigit() # 阿拉伯-印度數字零到九\n" +"True\n" +">>> '⅕'.isdigit() # 普通分數五分之一\n" +"False\n" +">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" +"(False, True, True)" + +#: ../../library/stdtypes.rst:2194 +msgid "See also :meth:`isdecimal` and :meth:`isnumeric`." +msgstr "另請參閱 :meth:`isdecimal` 和 :meth:`isnumeric`。" + +#: ../../library/stdtypes.rst:2199 +msgid "" "Return ``True`` if the string is a valid identifier according to the " "language definition, section :ref:`identifiers`." msgstr "" -#: ../../library/stdtypes.rst:2186 +#: ../../library/stdtypes.rst:2202 msgid "" ":func:`keyword.iskeyword` can be used to test whether string ``s`` is a " "reserved identifier, such as :keyword:`def` and :keyword:`class`." msgstr "" -#: ../../library/stdtypes.rst:2189 +#: ../../library/stdtypes.rst:2205 msgid "Example: ::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:2192 +#: ../../library/stdtypes.rst:2208 msgid "" ">>> from keyword import iskeyword\n" "\n" @@ -3591,13 +3628,13 @@ msgstr "" ">>> 'def'.isidentifier(), iskeyword('def')\n" "(True, True)" -#: ../../library/stdtypes.rst:2202 +#: ../../library/stdtypes.rst:2218 msgid "" "Return ``True`` if all cased characters [4]_ in the string are lowercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:2208 +#: ../../library/stdtypes.rst:2224 msgid "" "Return ``True`` if all characters in the string are numeric characters, and " "there is at least one character, ``False`` otherwise. Numeric characters " @@ -3607,11 +3644,11 @@ msgid "" "Numeric_Type=Decimal or Numeric_Type=Numeric. For example:" msgstr "" -#: ../../library/stdtypes.rst:2216 +#: ../../library/stdtypes.rst:2232 msgid "" ">>> '0123456789'.isnumeric()\n" "True\n" -">>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # Arabic-indic digit zero to nine\n" +">>> '٠١٢٣٤٥٦٧٨٩'.isnumeric() # Arabic-Indic digits zero to nine\n" "True\n" ">>> '⅕'.isnumeric() # Vulgar fraction one fifth\n" "True\n" @@ -3627,20 +3664,17 @@ msgstr "" ">>> '²'.isdecimal(), '²'.isdigit(), '²'.isnumeric()\n" "(False, True, True)" -#: ../../library/stdtypes.rst:2227 -msgid "" -"See also :meth:`isdecimal` and :meth:`isdigit`. Numeric characters are a " -"superset of decimal numbers." -msgstr "" -"也請參閱 :meth:`isdecimal` 和 :meth:`isdigit`。數字字元是十進位數字的超集。" +#: ../../library/stdtypes.rst:2243 +msgid "See also :meth:`isdecimal` and :meth:`isdigit`." +msgstr "另請參閱 :meth:`isdecimal` 和 :meth:`isdigit`。" -#: ../../library/stdtypes.rst:2233 +#: ../../library/stdtypes.rst:2248 msgid "" "Return ``True`` if all characters in the string are printable, ``False`` if " "it contains at least one non-printable character." msgstr "" -#: ../../library/stdtypes.rst:2236 +#: ../../library/stdtypes.rst:2251 msgid "" "Here \"printable\" means the character is suitable for :func:`repr` to use " "in its output; \"non-printable\" means that :func:`repr` on built-in types " @@ -3648,7 +3682,7 @@ msgid "" "written to :data:`sys.stdout` or :data:`sys.stderr`." msgstr "" -#: ../../library/stdtypes.rst:2241 +#: ../../library/stdtypes.rst:2256 msgid "" "The printable characters are those which in the Unicode character database " "(see :mod:`unicodedata`) have a general category in group Letter, Mark, " @@ -3657,17 +3691,7 @@ msgid "" "C), except the ASCII space." msgstr "" -#: ../../library/stdtypes.rst:2247 ../../library/stdtypes.rst:2264 -#: ../../library/stdtypes.rst:2291 ../../library/stdtypes.rst:2346 -#: ../../library/stdtypes.rst:2419 ../../library/stdtypes.rst:2530 -#: ../../library/stdtypes.rst:2551 ../../library/stdtypes.rst:2615 -#: ../../library/stdtypes.rst:2635 ../../library/stdtypes.rst:2649 -#: ../../library/stdtypes.rst:2736 ../../library/stdtypes.rst:2760 -#: ../../library/stdtypes.rst:2774 ../../library/stdtypes.rst:2881 -msgid "For example:" -msgstr "舉例來說:" - -#: ../../library/stdtypes.rst:2249 +#: ../../library/stdtypes.rst:2264 msgid "" ">>> ''.isprintable(), ' '.isprintable()\n" "(True, True)\n" @@ -3679,17 +3703,17 @@ msgstr "" ">>> '\\t'.isprintable(), '\\n'.isprintable()\n" "(False, False)" -#: ../../library/stdtypes.rst:2256 +#: ../../library/stdtypes.rst:2271 msgid "See also :meth:`isspace`." msgstr "另請參閱 :meth:`isspace`。" -#: ../../library/stdtypes.rst:2261 +#: ../../library/stdtypes.rst:2276 msgid "" "Return ``True`` if there are only whitespace characters in the string and " "there is at least one character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:2266 +#: ../../library/stdtypes.rst:2281 msgid "" ">>> ''.isspace()\n" "False\n" @@ -3701,18 +3725,18 @@ msgid "" "True" msgstr "" -#: ../../library/stdtypes.rst:2277 +#: ../../library/stdtypes.rst:2292 msgid "" "A character is *whitespace* if in the Unicode character database (see :mod:" "`unicodedata`), either its general category is ``Zs`` (\"Separator, " "space\"), or its bidirectional class is one of ``WS``, ``B``, or ``S``." msgstr "" -#: ../../library/stdtypes.rst:2282 +#: ../../library/stdtypes.rst:2297 msgid "See also :meth:`isprintable`." msgstr "另請參閱 :meth:`isprintable`。" -#: ../../library/stdtypes.rst:2287 +#: ../../library/stdtypes.rst:2302 msgid "" "Return ``True`` if the string is a titlecased string and there is at least " "one character, for example uppercase characters may only follow uncased " @@ -3720,7 +3744,7 @@ msgid "" "otherwise." msgstr "" -#: ../../library/stdtypes.rst:2293 +#: ../../library/stdtypes.rst:2308 msgid "" ">>> 'Spam, Spam, Spam'.istitle()\n" "True\n" @@ -3736,17 +3760,17 @@ msgstr "" ">>> 'SPAM, SPAM, SPAM'.istitle()\n" "False" -#: ../../library/stdtypes.rst:2302 +#: ../../library/stdtypes.rst:2317 msgid "See also :meth:`title`." msgstr "另請參閱 :meth:`title`。" -#: ../../library/stdtypes.rst:2307 +#: ../../library/stdtypes.rst:2322 msgid "" "Return ``True`` if all cased characters [4]_ in the string are uppercase and " "there is at least one cased character, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:2325 +#: ../../library/stdtypes.rst:2340 msgid "" "Return a string which is the concatenation of the strings in *iterable*. A :" "exc:`TypeError` will be raised if there are any non-string values in " @@ -3754,7 +3778,7 @@ msgid "" "elements is the string providing this method. For example:" msgstr "" -#: ../../library/stdtypes.rst:2330 +#: ../../library/stdtypes.rst:2345 msgid "" ">>> ', '.join(['spam', 'spam', 'spam'])\n" "'spam, spam, spam'\n" @@ -3766,18 +3790,18 @@ msgstr "" ">>> '-'.join('Python')\n" "'P-y-t-h-o-n'" -#: ../../library/stdtypes.rst:2337 +#: ../../library/stdtypes.rst:2352 msgid "See also :meth:`split`." msgstr "另請參閱 :meth:`split`。" -#: ../../library/stdtypes.rst:2342 +#: ../../library/stdtypes.rst:2357 msgid "" "Return the string left justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2348 +#: ../../library/stdtypes.rst:2363 msgid "" ">>> 'Python'.ljust(10)\n" "'Python '\n" @@ -3793,17 +3817,17 @@ msgstr "" ">>> 'Monty Python'.ljust(10, '.')\n" "'Monty Python'" -#: ../../library/stdtypes.rst:2357 ../../library/stdtypes.rst:2890 +#: ../../library/stdtypes.rst:2372 ../../library/stdtypes.rst:2905 msgid "See also :meth:`rjust`." msgstr "另請參閱 :meth:`rjust`。" -#: ../../library/stdtypes.rst:2362 +#: ../../library/stdtypes.rst:2377 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "lowercase. For example:" msgstr "" -#: ../../library/stdtypes.rst:2365 +#: ../../library/stdtypes.rst:2380 msgid "" ">>> 'Lower Method Example'.lower()\n" "'lower method example'" @@ -3811,14 +3835,14 @@ msgstr "" ">>> 'Lower Method Example'.lower()\n" "'lower method example'" -#: ../../library/stdtypes.rst:2370 +#: ../../library/stdtypes.rst:2385 msgid "" "The lowercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:2377 +#: ../../library/stdtypes.rst:2392 msgid "" "Return a copy of the string with leading characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -3827,7 +3851,7 @@ msgid "" "are stripped::" msgstr "" -#: ../../library/stdtypes.rst:2382 +#: ../../library/stdtypes.rst:2397 msgid "" ">>> ' spacious '.lstrip()\n" "'spacious '\n" @@ -3839,13 +3863,13 @@ msgstr "" ">>> 'www.example.com'.lstrip('cmowz.')\n" "'example.com'" -#: ../../library/stdtypes.rst:2387 +#: ../../library/stdtypes.rst:2402 msgid "" "See :meth:`str.removeprefix` for a method that will remove a single prefix " "string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:2390 +#: ../../library/stdtypes.rst:2405 msgid "" ">>> 'Arthur: three!'.lstrip('Arthur: ')\n" "'ee!'\n" @@ -3857,13 +3881,13 @@ msgstr "" ">>> 'Arthur: three!'.removeprefix('Arthur: ')\n" "'three!'" -#: ../../library/stdtypes.rst:2399 +#: ../../library/stdtypes.rst:2414 msgid "" "This static method returns a translation table usable for :meth:`str." "translate`." msgstr "" -#: ../../library/stdtypes.rst:2401 +#: ../../library/stdtypes.rst:2416 msgid "" "If there is only one argument, it must be a dictionary mapping Unicode " "ordinals (integers) or characters (strings of length 1) to Unicode ordinals, " @@ -3871,7 +3895,7 @@ msgid "" "converted to ordinals." msgstr "" -#: ../../library/stdtypes.rst:2406 +#: ../../library/stdtypes.rst:2421 msgid "" "If there are two arguments, they must be strings of equal length, and in the " "resulting dictionary, each character in *from* will be mapped to the " @@ -3879,7 +3903,7 @@ msgid "" "must be a string, whose characters will be mapped to ``None`` in the result." msgstr "" -#: ../../library/stdtypes.rst:2414 +#: ../../library/stdtypes.rst:2429 msgid "" "Split the string at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -3887,7 +3911,7 @@ msgid "" "containing the string itself, followed by two empty strings." msgstr "" -#: ../../library/stdtypes.rst:2421 +#: ../../library/stdtypes.rst:2436 msgid "" ">>> 'Monty Python'.partition(' ')\n" "('Monty', ' ', 'Python')\n" @@ -3903,17 +3927,17 @@ msgstr "" ">>> 'Monty Python'.partition('-')\n" "('Monty Python', '', '')" -#: ../../library/stdtypes.rst:2430 +#: ../../library/stdtypes.rst:2445 msgid "See also :meth:`rpartition`." msgstr "另請參閱 :meth:`rpartition`。" -#: ../../library/stdtypes.rst:2435 +#: ../../library/stdtypes.rst:2450 msgid "" "If the string starts with the *prefix* string, return " "``string[len(prefix):]``. Otherwise, return a copy of the original string:" msgstr "" -#: ../../library/stdtypes.rst:2439 +#: ../../library/stdtypes.rst:2454 msgid "" ">>> 'TestHook'.removeprefix('Test')\n" "'Hook'\n" @@ -3925,18 +3949,18 @@ msgstr "" ">>> 'BaseTestCase'.removeprefix('Test')\n" "'BaseTestCase'" -#: ../../library/stdtypes.rst:2448 +#: ../../library/stdtypes.rst:2463 msgid "See also :meth:`removesuffix` and :meth:`startswith`." msgstr "另請參閱 :meth:`removesuffix` 和 :meth:`startswith`。" -#: ../../library/stdtypes.rst:2453 +#: ../../library/stdtypes.rst:2468 msgid "" "If the string ends with the *suffix* string and that *suffix* is not empty, " "return ``string[:-len(suffix)]``. Otherwise, return a copy of the original " "string:" msgstr "" -#: ../../library/stdtypes.rst:2457 +#: ../../library/stdtypes.rst:2472 msgid "" ">>> 'MiscTests'.removesuffix('Tests')\n" "'Misc'\n" @@ -3948,11 +3972,11 @@ msgstr "" ">>> 'TmpDirMixin'.removesuffix('Tests')\n" "'TmpDirMixin'" -#: ../../library/stdtypes.rst:2466 +#: ../../library/stdtypes.rst:2481 msgid "See also :meth:`removeprefix` and :meth:`endswith`." msgstr "另請參閱 :meth:`removeprefix` 和 :meth:`endswith`。" -#: ../../library/stdtypes.rst:2471 +#: ../../library/stdtypes.rst:2486 msgid "" "Return a copy of the string with all occurrences of substring *old* replaced " "by *new*. If *count* is given, only the first *count* occurrences are " @@ -3960,7 +3984,7 @@ msgid "" "replaced. For example:" msgstr "" -#: ../../library/stdtypes.rst:2476 +#: ../../library/stdtypes.rst:2491 msgid "" ">>> 'spam, spam, spam'.replace('spam', 'eggs')\n" "'eggs, eggs, eggs'\n" @@ -3972,11 +3996,11 @@ msgstr "" ">>> 'spam, spam, spam'.replace('spam', 'eggs', 1)\n" "'eggs, spam, spam'" -#: ../../library/stdtypes.rst:2483 +#: ../../library/stdtypes.rst:2498 msgid "*count* is now supported as a keyword argument." msgstr "*count* 現在作為關鍵字引數被支援。" -#: ../../library/stdtypes.rst:2489 +#: ../../library/stdtypes.rst:2504 msgid "" "Return the highest index in the string where substring *sub* is found, such " "that *sub* is contained within ``s[start:end]``. Optional arguments *start* " @@ -3984,7 +4008,7 @@ msgid "" "For example:" msgstr "" -#: ../../library/stdtypes.rst:2494 +#: ../../library/stdtypes.rst:2509 msgid "" ">>> 'spam, spam, spam'.rfind('sp')\n" "12\n" @@ -3996,17 +4020,17 @@ msgstr "" ">>> 'spam, spam, spam'.rfind('sp', 0, 10)\n" "6" -#: ../../library/stdtypes.rst:2501 +#: ../../library/stdtypes.rst:2516 msgid "See also :meth:`find` and :meth:`rindex`." msgstr "另請參閱 :meth:`find` 和 :meth:`rindex`。" -#: ../../library/stdtypes.rst:2506 +#: ../../library/stdtypes.rst:2521 msgid "" "Like :meth:`rfind` but raises :exc:`ValueError` when the substring *sub* is " "not found. For example:" msgstr "" -#: ../../library/stdtypes.rst:2510 +#: ../../library/stdtypes.rst:2525 msgid "" ">>> 'spam, spam, spam'.rindex('spam')\n" "12\n" @@ -4026,18 +4050,18 @@ msgstr "" " ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^\n" "ValueError: substring not found" -#: ../../library/stdtypes.rst:2521 +#: ../../library/stdtypes.rst:2536 msgid "See also :meth:`index` and :meth:`find`." msgstr "另請參閱 :meth:`index` 和 :meth:`find`。" -#: ../../library/stdtypes.rst:2526 +#: ../../library/stdtypes.rst:2541 msgid "" "Return the string right justified in a string of length *width*. Padding is " "done using the specified *fillchar* (default is an ASCII space). The " "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2532 +#: ../../library/stdtypes.rst:2547 msgid "" ">>> 'Python'.rjust(10)\n" "' Python'\n" @@ -4053,11 +4077,11 @@ msgstr "" ">>> 'Monty Python'.rjust(10, '.')\n" "'Monty Python'" -#: ../../library/stdtypes.rst:2541 +#: ../../library/stdtypes.rst:2556 msgid "See also :meth:`ljust` and :meth:`zfill`." msgstr "另請參閱 :meth:`ljust` 和 :meth:`zfill`。" -#: ../../library/stdtypes.rst:2546 +#: ../../library/stdtypes.rst:2561 msgid "" "Split the string at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself, and the part " @@ -4065,7 +4089,7 @@ msgid "" "containing two empty strings, followed by the string itself." msgstr "" -#: ../../library/stdtypes.rst:2553 +#: ../../library/stdtypes.rst:2568 msgid "" ">>> 'Monty Python'.rpartition(' ')\n" "('Monty', ' ', 'Python')\n" @@ -4081,11 +4105,11 @@ msgstr "" ">>> 'Monty Python'.rpartition('-')\n" "('', '', 'Monty Python')" -#: ../../library/stdtypes.rst:2562 +#: ../../library/stdtypes.rst:2577 msgid "See also :meth:`partition`." msgstr "另請參閱 :meth:`partition`。" -#: ../../library/stdtypes.rst:2567 +#: ../../library/stdtypes.rst:2582 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done, the " @@ -4094,7 +4118,7 @@ msgid "" "behaves like :meth:`split` which is described in detail below." msgstr "" -#: ../../library/stdtypes.rst:2576 +#: ../../library/stdtypes.rst:2591 msgid "" "Return a copy of the string with trailing characters removed. The *chars* " "argument is a string specifying the set of characters to be removed. If " @@ -4103,7 +4127,7 @@ msgid "" "are stripped. For example:" msgstr "" -#: ../../library/stdtypes.rst:2582 +#: ../../library/stdtypes.rst:2597 msgid "" ">>> ' spacious '.rstrip()\n" "' spacious'\n" @@ -4115,13 +4139,13 @@ msgstr "" ">>> 'mississippi'.rstrip('ipz')\n" "'mississ'" -#: ../../library/stdtypes.rst:2589 +#: ../../library/stdtypes.rst:2604 msgid "" "See :meth:`removesuffix` for a method that will remove a single suffix " "string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:2592 +#: ../../library/stdtypes.rst:2607 msgid "" ">>> 'Monty Python'.rstrip(' Python')\n" "'M'\n" @@ -4133,11 +4157,11 @@ msgstr "" ">>> 'Monty Python'.removesuffix(' Python')\n" "'Monty'" -#: ../../library/stdtypes.rst:2597 +#: ../../library/stdtypes.rst:2612 msgid "See also :meth:`strip`." msgstr "另請參閱 :meth:`strip`。" -#: ../../library/stdtypes.rst:2602 +#: ../../library/stdtypes.rst:2617 msgid "" "Return a list of the words in the string, using *sep* as the delimiter " "string. If *maxsplit* is given, at most *maxsplit* splits are done (thus, " @@ -4146,7 +4170,7 @@ msgid "" "possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:2608 +#: ../../library/stdtypes.rst:2623 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty strings (for example, ``'1,,2'.split(',')`` returns " @@ -4156,7 +4180,7 @@ msgid "" "``['']``." msgstr "" -#: ../../library/stdtypes.rst:2617 +#: ../../library/stdtypes.rst:2632 msgid "" ">>> '1,2,3'.split(',')\n" "['1', '2', '3']\n" @@ -4176,7 +4200,7 @@ msgstr "" ">>> '1<>2<>3<4'.split('<>')\n" "['1', '2', '3<4']" -#: ../../library/stdtypes.rst:2628 +#: ../../library/stdtypes.rst:2643 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive whitespace are regarded as a single separator, " @@ -4186,7 +4210,7 @@ msgid "" "returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:2637 +#: ../../library/stdtypes.rst:2652 msgid "" ">>> '1 2 3'.split()\n" "['1', '2', '3']\n" @@ -4202,13 +4226,13 @@ msgstr "" ">>> ' 1 2 3 '.split()\n" "['1', '2', '3']" -#: ../../library/stdtypes.rst:2646 +#: ../../library/stdtypes.rst:2661 msgid "" "If *sep* is not specified or is ``None`` and *maxsplit* is ``0``, only " "leading runs of consecutive whitespace are considered." msgstr "" -#: ../../library/stdtypes.rst:2651 +#: ../../library/stdtypes.rst:2666 msgid "" ">>> \"\".split(None, 0)\n" "[]\n" @@ -4224,136 +4248,136 @@ msgstr "" ">>> \" foo \".split(maxsplit=0)\n" "['foo ']" -#: ../../library/stdtypes.rst:2660 +#: ../../library/stdtypes.rst:2675 msgid "See also :meth:`join` and :meth:`rsplit`." msgstr "另請參閱 :meth:`join` 和 :meth:`rsplit`。" -#: ../../library/stdtypes.rst:2668 +#: ../../library/stdtypes.rst:2683 msgid "" "Return a list of the lines in the string, breaking at line boundaries. Line " "breaks are not included in the resulting list unless *keepends* is given and " "true." msgstr "" -#: ../../library/stdtypes.rst:2672 +#: ../../library/stdtypes.rst:2687 msgid "" "This method splits on the following line boundaries. In particular, the " "boundaries are a superset of :term:`universal newlines`." msgstr "" -#: ../../library/stdtypes.rst:2676 +#: ../../library/stdtypes.rst:2691 msgid "Representation" msgstr "" -#: ../../library/stdtypes.rst:2676 +#: ../../library/stdtypes.rst:2691 msgid "Description" msgstr "描述" -#: ../../library/stdtypes.rst:2678 +#: ../../library/stdtypes.rst:2693 msgid "``\\n``" msgstr "``\\n``" -#: ../../library/stdtypes.rst:2678 +#: ../../library/stdtypes.rst:2693 msgid "Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2680 +#: ../../library/stdtypes.rst:2695 msgid "``\\r``" msgstr "``\\r``" -#: ../../library/stdtypes.rst:2680 +#: ../../library/stdtypes.rst:2695 msgid "Carriage Return" msgstr "" -#: ../../library/stdtypes.rst:2682 +#: ../../library/stdtypes.rst:2697 msgid "``\\r\\n``" msgstr "``\\r\\n``" -#: ../../library/stdtypes.rst:2682 +#: ../../library/stdtypes.rst:2697 msgid "Carriage Return + Line Feed" msgstr "" -#: ../../library/stdtypes.rst:2684 +#: ../../library/stdtypes.rst:2699 msgid "``\\v`` or ``\\x0b``" msgstr "``\\v`` 或 ``\\x0b``" -#: ../../library/stdtypes.rst:2684 +#: ../../library/stdtypes.rst:2699 msgid "Line Tabulation" msgstr "" -#: ../../library/stdtypes.rst:2686 +#: ../../library/stdtypes.rst:2701 msgid "``\\f`` or ``\\x0c``" msgstr "``\\f`` 或 ``\\x0c``" -#: ../../library/stdtypes.rst:2686 +#: ../../library/stdtypes.rst:2701 msgid "Form Feed" msgstr "" -#: ../../library/stdtypes.rst:2688 +#: ../../library/stdtypes.rst:2703 msgid "``\\x1c``" msgstr "``\\x1c``" -#: ../../library/stdtypes.rst:2688 +#: ../../library/stdtypes.rst:2703 msgid "File Separator" msgstr "" -#: ../../library/stdtypes.rst:2690 +#: ../../library/stdtypes.rst:2705 msgid "``\\x1d``" msgstr "``\\x1d``" -#: ../../library/stdtypes.rst:2690 +#: ../../library/stdtypes.rst:2705 msgid "Group Separator" msgstr "" -#: ../../library/stdtypes.rst:2692 +#: ../../library/stdtypes.rst:2707 msgid "``\\x1e``" msgstr "``\\x1e``" -#: ../../library/stdtypes.rst:2692 +#: ../../library/stdtypes.rst:2707 msgid "Record Separator" msgstr "" -#: ../../library/stdtypes.rst:2694 +#: ../../library/stdtypes.rst:2709 msgid "``\\x85``" msgstr "``\\x85``" -#: ../../library/stdtypes.rst:2694 +#: ../../library/stdtypes.rst:2709 msgid "Next Line (C1 Control Code)" msgstr "" -#: ../../library/stdtypes.rst:2696 +#: ../../library/stdtypes.rst:2711 msgid "``\\u2028``" msgstr "``\\u2028``" -#: ../../library/stdtypes.rst:2696 +#: ../../library/stdtypes.rst:2711 msgid "Line Separator" msgstr "" -#: ../../library/stdtypes.rst:2698 +#: ../../library/stdtypes.rst:2713 msgid "``\\u2029``" msgstr "``\\u2029``" -#: ../../library/stdtypes.rst:2698 +#: ../../library/stdtypes.rst:2713 msgid "Paragraph Separator" msgstr "" -#: ../../library/stdtypes.rst:2703 +#: ../../library/stdtypes.rst:2718 msgid "``\\v`` and ``\\f`` added to list of line boundaries." msgstr "" -#: ../../library/stdtypes.rst:2705 ../../library/stdtypes.rst:2811 -#: ../../library/stdtypes.rst:2980 ../../library/stdtypes.rst:3955 -#: ../../library/stdtypes.rst:3973 ../../library/stdtypes.rst:4063 -#: ../../library/stdtypes.rst:4079 ../../library/stdtypes.rst:4104 -#: ../../library/stdtypes.rst:4118 ../../library/stdtypes.rst:4146 -#: ../../library/stdtypes.rst:4160 ../../library/stdtypes.rst:4178 -#: ../../library/stdtypes.rst:4205 ../../library/stdtypes.rst:4228 -#: ../../library/stdtypes.rst:4255 ../../library/stdtypes.rst:4297 -#: ../../library/stdtypes.rst:4321 +#: ../../library/stdtypes.rst:2720 ../../library/stdtypes.rst:2826 +#: ../../library/stdtypes.rst:2995 ../../library/stdtypes.rst:3970 +#: ../../library/stdtypes.rst:3988 ../../library/stdtypes.rst:4078 +#: ../../library/stdtypes.rst:4094 ../../library/stdtypes.rst:4119 +#: ../../library/stdtypes.rst:4133 ../../library/stdtypes.rst:4161 +#: ../../library/stdtypes.rst:4175 ../../library/stdtypes.rst:4193 +#: ../../library/stdtypes.rst:4220 ../../library/stdtypes.rst:4243 +#: ../../library/stdtypes.rst:4270 ../../library/stdtypes.rst:4312 +#: ../../library/stdtypes.rst:4336 msgid "For example::" msgstr "舉例來說: ::" -#: ../../library/stdtypes.rst:2707 +#: ../../library/stdtypes.rst:2722 msgid "" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "['ab c', '', 'de fg', 'kl']\n" @@ -4365,14 +4389,14 @@ msgstr "" ">>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']" -#: ../../library/stdtypes.rst:2712 +#: ../../library/stdtypes.rst:2727 msgid "" "Unlike :meth:`~str.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -#: ../../library/stdtypes.rst:2716 +#: ../../library/stdtypes.rst:2731 msgid "" ">>> \"\".splitlines()\n" "[]\n" @@ -4384,11 +4408,11 @@ msgstr "" ">>> \"One line\\n\".splitlines()\n" "['One line']" -#: ../../library/stdtypes.rst:2721 +#: ../../library/stdtypes.rst:2736 msgid "For comparison, ``split('\\n')`` gives::" msgstr "" -#: ../../library/stdtypes.rst:2723 +#: ../../library/stdtypes.rst:2738 msgid "" ">>> ''.split('\\n')\n" "['']\n" @@ -4400,7 +4424,7 @@ msgstr "" ">>> 'Two lines\\n'.split('\\n')\n" "['Two lines', '']" -#: ../../library/stdtypes.rst:2731 +#: ../../library/stdtypes.rst:2746 msgid "" "Return ``True`` if string starts with the *prefix*, otherwise return " "``False``. *prefix* can also be a tuple of prefixes to look for. With " @@ -4408,7 +4432,7 @@ msgid "" "*end*, stop comparing string at that position." msgstr "" -#: ../../library/stdtypes.rst:2738 +#: ../../library/stdtypes.rst:2753 msgid "" ">>> 'Python'.startswith('Py')\n" "True\n" @@ -4424,11 +4448,11 @@ msgstr "" ">>> 'Python is amazing'.startswith('is', 7)\n" "True" -#: ../../library/stdtypes.rst:2747 +#: ../../library/stdtypes.rst:2762 msgid "See also :meth:`endswith` and :meth:`removeprefix`." msgstr "另請參閱 :meth:`endswith` 和 :meth:`removeprefix`。" -#: ../../library/stdtypes.rst:2752 +#: ../../library/stdtypes.rst:2767 msgid "" "Return a copy of the string with the leading and trailing characters " "removed. The *chars* argument is a string specifying the set of characters " @@ -4437,11 +4461,11 @@ msgid "" "all combinations of its values are stripped." msgstr "" -#: ../../library/stdtypes.rst:2758 +#: ../../library/stdtypes.rst:2773 msgid "Whitespace characters are defined by :meth:`str.isspace`." msgstr "" -#: ../../library/stdtypes.rst:2762 +#: ../../library/stdtypes.rst:2777 msgid "" ">>> ' spacious '.strip()\n" "'spacious'\n" @@ -4453,7 +4477,7 @@ msgstr "" ">>> 'www.example.com'.strip('cmowz.')\n" "'example'" -#: ../../library/stdtypes.rst:2769 +#: ../../library/stdtypes.rst:2784 msgid "" "The outermost leading and trailing *chars* argument values are stripped from " "the string. Characters are removed from the leading end until reaching a " @@ -4461,7 +4485,7 @@ msgid "" "A similar action takes place on the trailing end." msgstr "" -#: ../../library/stdtypes.rst:2776 +#: ../../library/stdtypes.rst:2791 msgid "" ">>> comment_string = '#....... Section 3.2.1 Issue #32 .......'\n" ">>> comment_string.strip('.#! ')\n" @@ -4471,17 +4495,17 @@ msgstr "" ">>> comment_string.strip('.#! ')\n" "'Section 3.2.1 Issue #32'" -#: ../../library/stdtypes.rst:2782 +#: ../../library/stdtypes.rst:2797 msgid "See also :meth:`rstrip`." msgstr "另請參閱 :meth:`rstrip`。" -#: ../../library/stdtypes.rst:2787 +#: ../../library/stdtypes.rst:2802 msgid "" "Return a copy of the string with uppercase characters converted to lowercase " "and vice versa. For example:" msgstr "" -#: ../../library/stdtypes.rst:2790 +#: ../../library/stdtypes.rst:2805 msgid "" ">>> 'Hello World'.swapcase()\n" "'hELLO wORLD'" @@ -4489,13 +4513,13 @@ msgstr "" ">>> 'Hello World'.swapcase()\n" "'hELLO wORLD'" -#: ../../library/stdtypes.rst:2795 +#: ../../library/stdtypes.rst:2810 msgid "" "Note that it is not necessarily true that ``s.swapcase().swapcase() == s``. " "For example:" msgstr "" -#: ../../library/stdtypes.rst:2798 +#: ../../library/stdtypes.rst:2813 msgid "" ">>> 'straße'.swapcase().swapcase()\n" "'strasse'" @@ -4503,17 +4527,17 @@ msgstr "" ">>> 'straße'.swapcase().swapcase()\n" "'strasse'" -#: ../../library/stdtypes.rst:2803 +#: ../../library/stdtypes.rst:2818 msgid "See also :meth:`str.lower` and :meth:`str.upper`." msgstr "另請參閱 :meth:`str.lower` 和 :meth:`str.upper`。" -#: ../../library/stdtypes.rst:2808 +#: ../../library/stdtypes.rst:2823 msgid "" "Return a titlecased version of the string where words start with an " "uppercase character and the remaining characters are lowercase." msgstr "" -#: ../../library/stdtypes.rst:2813 +#: ../../library/stdtypes.rst:2828 msgid "" ">>> 'Hello world'.title()\n" "'Hello World'" @@ -4521,7 +4545,7 @@ msgstr "" ">>> 'Hello world'.title()\n" "'Hello World'" -#: ../../library/stdtypes.rst:2816 ../../library/stdtypes.rst:4265 +#: ../../library/stdtypes.rst:2831 ../../library/stdtypes.rst:4280 msgid "" "The algorithm uses a simple language-independent definition of a word as " "groups of consecutive letters. The definition works in many contexts but it " @@ -4529,7 +4553,7 @@ msgid "" "which may not be the desired result::" msgstr "" -#: ../../library/stdtypes.rst:2821 +#: ../../library/stdtypes.rst:2836 msgid "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" @@ -4537,19 +4561,19 @@ msgstr "" ">>> \"they're bill's friends from the UK\".title()\n" "\"They'Re Bill'S Friends From The Uk\"" -#: ../../library/stdtypes.rst:2824 +#: ../../library/stdtypes.rst:2839 msgid "" "The :func:`string.capwords` function does not have this problem, as it " "splits words on spaces only." msgstr "" -#: ../../library/stdtypes.rst:2827 +#: ../../library/stdtypes.rst:2842 msgid "" "Alternatively, a workaround for apostrophes can be constructed using regular " "expressions::" msgstr "" -#: ../../library/stdtypes.rst:2830 +#: ../../library/stdtypes.rst:2845 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -4569,11 +4593,11 @@ msgstr "" ">>> titlecase(\"they're bill's friends.\")\n" "\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:2839 +#: ../../library/stdtypes.rst:2854 msgid "See also :meth:`istitle`." msgstr "另請參閱 :meth:`istitle`。" -#: ../../library/stdtypes.rst:2844 +#: ../../library/stdtypes.rst:2859 msgid "" "Return a copy of the string in which each character has been mapped through " "the given translation table. The table must be an object that implements " @@ -4585,19 +4609,19 @@ msgid "" "exception, to map the character to itself." msgstr "" -#: ../../library/stdtypes.rst:2853 +#: ../../library/stdtypes.rst:2868 msgid "" "You can use :meth:`str.maketrans` to create a translation map from character-" "to-character mappings in different formats." msgstr "" -#: ../../library/stdtypes.rst:2856 +#: ../../library/stdtypes.rst:2871 msgid "" "See also the :mod:`codecs` module for a more flexible approach to custom " "character mappings." msgstr "" -#: ../../library/stdtypes.rst:2862 +#: ../../library/stdtypes.rst:2877 msgid "" "Return a copy of the string with all the cased characters [4]_ converted to " "uppercase. Note that ``s.upper().isupper()`` might be ``False`` if ``s`` " @@ -4606,14 +4630,14 @@ msgid "" "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:2868 +#: ../../library/stdtypes.rst:2883 msgid "" "The uppercasing algorithm used is `described in section 3.13 'Default Case " "Folding' of the Unicode Standard `__." msgstr "" -#: ../../library/stdtypes.rst:2875 +#: ../../library/stdtypes.rst:2890 msgid "" "Return a copy of the string left filled with ASCII ``'0'`` digits to make a " "string of length *width*. A leading sign prefix (``'+'``/``'-'``) is handled " @@ -4621,7 +4645,7 @@ msgid "" "original string is returned if *width* is less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:2883 +#: ../../library/stdtypes.rst:2898 msgid "" ">>> \"42\".zfill(5)\n" "'00042'\n" @@ -4633,27 +4657,27 @@ msgstr "" ">>> \"-42\".zfill(5)\n" "'-0042'" -#: ../../library/stdtypes.rst:2910 +#: ../../library/stdtypes.rst:2925 msgid "Formatted String Literals (f-strings)" msgstr "" -#: ../../library/stdtypes.rst:2913 +#: ../../library/stdtypes.rst:2928 msgid "" "The :keyword:`await` and :keyword:`async for` can be used in expressions " "within f-strings." msgstr "" -#: ../../library/stdtypes.rst:2916 +#: ../../library/stdtypes.rst:2931 msgid "Added the debug specifier (``=``)" msgstr "" -#: ../../library/stdtypes.rst:2918 +#: ../../library/stdtypes.rst:2933 msgid "" "Many restrictions on expressions within f-strings have been removed. " "Notably, nested strings, comments, and backslashes are now permitted." msgstr "" -#: ../../library/stdtypes.rst:2922 +#: ../../library/stdtypes.rst:2937 msgid "" "An :dfn:`f-string` (formally a :dfn:`formatted string literal`) is a string " "literal that is prefixed with ``f`` or ``F``. This type of string literal " @@ -4662,29 +4686,29 @@ msgid "" "replacement field must contain an expression, optionally followed by:" msgstr "" -#: ../../library/stdtypes.rst:2929 +#: ../../library/stdtypes.rst:2944 msgid "a *debug specifier* -- an equal sign (``=``);" msgstr "" -#: ../../library/stdtypes.rst:2930 +#: ../../library/stdtypes.rst:2945 msgid "a *conversion specifier* -- ``!s``, ``!r`` or ``!a``; and/or" msgstr "" -#: ../../library/stdtypes.rst:2931 +#: ../../library/stdtypes.rst:2946 msgid "a *format specifier* prefixed with a colon (``:``)." msgstr "" -#: ../../library/stdtypes.rst:2933 +#: ../../library/stdtypes.rst:2948 msgid "" "See the :ref:`Lexical Analysis section on f-strings ` for details " "on the syntax of these fields." msgstr "" -#: ../../library/stdtypes.rst:2937 +#: ../../library/stdtypes.rst:2952 msgid "Debug specifier" msgstr "" -#: ../../library/stdtypes.rst:2941 +#: ../../library/stdtypes.rst:2956 msgid "" "If a debug specifier -- an equal sign (``=``) -- appears after the " "replacement field expression, the resulting f-string will contain the " @@ -4692,7 +4716,7 @@ msgid "" "is often useful for debugging::" msgstr "" -#: ../../library/stdtypes.rst:2946 +#: ../../library/stdtypes.rst:2961 msgid "" ">>> number = 14.3\n" ">>> f'{number=}'\n" @@ -4702,13 +4726,13 @@ msgstr "" ">>> f'{number=}'\n" "'number=14.3'" -#: ../../library/stdtypes.rst:2950 +#: ../../library/stdtypes.rst:2965 msgid "" "Whitespace before, inside and after the expression, as well as whitespace " "after the equal sign, is significant --- it is retained in the result::" msgstr "" -#: ../../library/stdtypes.rst:2953 +#: ../../library/stdtypes.rst:2968 msgid "" ">>> f'{ number - 4 = }'\n" "' number - 4 = 10.3'" @@ -4716,17 +4740,17 @@ msgstr "" ">>> f'{ number - 4 = }'\n" "' number - 4 = 10.3'" -#: ../../library/stdtypes.rst:2958 +#: ../../library/stdtypes.rst:2973 msgid "Conversion specifier" msgstr "" -#: ../../library/stdtypes.rst:2960 +#: ../../library/stdtypes.rst:2975 msgid "" "By default, the value of a replacement field expression is converted to a " "string using :func:`str`::" msgstr "" -#: ../../library/stdtypes.rst:2963 +#: ../../library/stdtypes.rst:2978 msgid "" ">>> from fractions import Fraction\n" ">>> one_third = Fraction(1, 3)\n" @@ -4738,13 +4762,13 @@ msgstr "" ">>> f'{one_third}'\n" "'1/3'" -#: ../../library/stdtypes.rst:2968 +#: ../../library/stdtypes.rst:2983 msgid "" "When a debug specifier but no format specifier is used, the default " "conversion instead uses :func:`repr`::" msgstr "" -#: ../../library/stdtypes.rst:2971 +#: ../../library/stdtypes.rst:2986 msgid "" ">>> f'{one_third = }'\n" "'one_third = Fraction(1, 3)'" @@ -4752,24 +4776,24 @@ msgstr "" ">>> f'{one_third = }'\n" "'one_third = Fraction(1, 3)'" -#: ../../library/stdtypes.rst:2974 +#: ../../library/stdtypes.rst:2989 msgid "" "The conversion can be specified explicitly using one of these specifiers:" msgstr "" -#: ../../library/stdtypes.rst:2976 +#: ../../library/stdtypes.rst:2991 msgid "``!s`` for :func:`str`" msgstr "``!s`` 用於 :func:`str`" -#: ../../library/stdtypes.rst:2977 +#: ../../library/stdtypes.rst:2992 msgid "``!r`` for :func:`repr`" msgstr "``!r`` 用於 :func:`repr`" -#: ../../library/stdtypes.rst:2978 +#: ../../library/stdtypes.rst:2993 msgid "``!a`` for :func:`ascii`" msgstr "``!a`` 用於 :func:`ascii`" -#: ../../library/stdtypes.rst:2982 +#: ../../library/stdtypes.rst:2997 msgid "" ">>> str(one_third)\n" "'1/3'\n" @@ -4801,11 +4825,11 @@ msgstr "" ">>> f'{string = !a}'\n" "\"string = '\\\\xa1ko\\\\u010dka \\\\U0001f638!'\"" -#: ../../library/stdtypes.rst:2999 +#: ../../library/stdtypes.rst:3014 msgid "Format specifier" msgstr "" -#: ../../library/stdtypes.rst:3001 +#: ../../library/stdtypes.rst:3016 msgid "" "After the expression has been evaluated, and possibly converted using an " "explicit conversion specifier, it is formatted using the :func:`format` " @@ -4815,7 +4839,7 @@ msgid "" "the replacement field. For example::" msgstr "" -#: ../../library/stdtypes.rst:3008 +#: ../../library/stdtypes.rst:3023 msgid "" ">>> from fractions import Fraction\n" ">>> one_third = Fraction(1, 3)\n" @@ -4839,29 +4863,29 @@ msgstr "" ">>> f'{one_third = :~>10}~'\n" "'one_third = ~~~~~~~1/3~'" -#: ../../library/stdtypes.rst:3022 +#: ../../library/stdtypes.rst:3037 msgid "Template String Literals (t-strings)" msgstr "模板字串字面值 (t-strings)" -#: ../../library/stdtypes.rst:3024 +#: ../../library/stdtypes.rst:3039 msgid "" "An :dfn:`t-string` (formally a :dfn:`template string literal`) is a string " "literal that is prefixed with ``t`` or ``T``." msgstr "" -#: ../../library/stdtypes.rst:3027 +#: ../../library/stdtypes.rst:3042 msgid "" "These strings follow the same syntax and evaluation rules as :ref:`formatted " "string literals `, with for the following differences:" msgstr "" -#: ../../library/stdtypes.rst:3031 +#: ../../library/stdtypes.rst:3046 msgid "" "Rather than evaluating to a ``str`` object, template string literals " "evaluate to a :class:`string.templatelib.Template` object." msgstr "" -#: ../../library/stdtypes.rst:3034 +#: ../../library/stdtypes.rst:3049 msgid "" "The :func:`format` protocol is not used. Instead, the format specifier and " "conversions (if any) are passed to a new :class:`~string.templatelib." @@ -4870,7 +4894,7 @@ msgid "" "Template` object to decide how to handle format specifiers and conversions." msgstr "" -#: ../../library/stdtypes.rst:3041 +#: ../../library/stdtypes.rst:3056 msgid "" "Format specifiers containing nested replacement fields are evaluated " "eagerly, prior to being passed to the :class:`~string.templatelib." @@ -4880,7 +4904,7 @@ msgid "" "to be ``2``, the resulting format specifier would be ``'.2f'``." msgstr "" -#: ../../library/stdtypes.rst:3049 +#: ../../library/stdtypes.rst:3064 msgid "" "When the equals sign ``'='`` is provided in an interpolation expression, the " "text of the expression is appended to the literal string that precedes the " @@ -4892,18 +4916,18 @@ msgid "" "behaviour." msgstr "" -#: ../../library/stdtypes.rst:3063 +#: ../../library/stdtypes.rst:3078 msgid "``printf``-style String Formatting" msgstr "" -#: ../../library/stdtypes.rst:3076 +#: ../../library/stdtypes.rst:3091 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " "dictionaries correctly)." msgstr "" -#: ../../library/stdtypes.rst:3080 +#: ../../library/stdtypes.rst:3095 msgid "" "Using :ref:`formatted string literals `, the :meth:`str.format` " "interface, or :class:`string.Template` may help avoid these errors. Each of " @@ -4911,7 +4935,7 @@ msgid "" "flexibility, and/or extensibility." msgstr "" -#: ../../library/stdtypes.rst:3085 +#: ../../library/stdtypes.rst:3100 msgid "" "String objects have one unique built-in operation: the ``%`` operator " "(modulo). This is also known as the string *formatting* or *interpolation* " @@ -4921,7 +4945,7 @@ msgid "" "function in the C language. For example:" msgstr "" -#: ../../library/stdtypes.rst:3092 +#: ../../library/stdtypes.rst:3107 msgid "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." @@ -4929,7 +4953,7 @@ msgstr "" ">>> print('%s has %d quote types.' % ('Python', 2))\n" "Python has 2 quote types." -#: ../../library/stdtypes.rst:3097 +#: ../../library/stdtypes.rst:3112 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -4937,36 +4961,36 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:3107 ../../library/stdtypes.rst:4376 +#: ../../library/stdtypes.rst:3122 ../../library/stdtypes.rst:4391 msgid "" "A conversion specifier contains two or more characters and has the following " "components, which must occur in this order:" msgstr "" -#: ../../library/stdtypes.rst:3110 ../../library/stdtypes.rst:4379 +#: ../../library/stdtypes.rst:3125 ../../library/stdtypes.rst:4394 msgid "The ``'%'`` character, which marks the start of the specifier." msgstr "" -#: ../../library/stdtypes.rst:3112 ../../library/stdtypes.rst:4381 +#: ../../library/stdtypes.rst:3127 ../../library/stdtypes.rst:4396 msgid "" "Mapping key (optional), consisting of a parenthesised sequence of characters " "(for example, ``(somename)``)." msgstr "" -#: ../../library/stdtypes.rst:3115 ../../library/stdtypes.rst:4384 +#: ../../library/stdtypes.rst:3130 ../../library/stdtypes.rst:4399 msgid "" "Conversion flags (optional), which affect the result of some conversion " "types." msgstr "" -#: ../../library/stdtypes.rst:3118 ../../library/stdtypes.rst:4387 +#: ../../library/stdtypes.rst:3133 ../../library/stdtypes.rst:4402 msgid "" "Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " "actual width is read from the next element of the tuple in *values*, and the " "object to convert comes after the minimum field width and optional precision." msgstr "" -#: ../../library/stdtypes.rst:3122 ../../library/stdtypes.rst:4391 +#: ../../library/stdtypes.rst:3137 ../../library/stdtypes.rst:4406 msgid "" "Precision (optional), given as a ``'.'`` (dot) followed by the precision. " "If specified as ``'*'`` (an asterisk), the actual precision is read from the " @@ -4974,15 +4998,15 @@ msgid "" "the precision." msgstr "" -#: ../../library/stdtypes.rst:3127 ../../library/stdtypes.rst:4396 +#: ../../library/stdtypes.rst:3142 ../../library/stdtypes.rst:4411 msgid "Length modifier (optional)." msgstr "" -#: ../../library/stdtypes.rst:3129 ../../library/stdtypes.rst:4398 +#: ../../library/stdtypes.rst:3144 ../../library/stdtypes.rst:4413 msgid "Conversion type." msgstr "" -#: ../../library/stdtypes.rst:3131 +#: ../../library/stdtypes.rst:3146 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the string *must* include a parenthesised mapping key into that " @@ -4990,286 +5014,286 @@ msgid "" "selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:3140 ../../library/stdtypes.rst:4409 +#: ../../library/stdtypes.rst:3155 ../../library/stdtypes.rst:4424 msgid "" "In this case no ``*`` specifiers may occur in a format (since they require a " "sequential parameter list)." msgstr "" -#: ../../library/stdtypes.rst:3143 ../../library/stdtypes.rst:4412 +#: ../../library/stdtypes.rst:3158 ../../library/stdtypes.rst:4427 msgid "The conversion flag characters are:" msgstr "" -#: ../../library/stdtypes.rst:3152 ../../library/stdtypes.rst:4421 +#: ../../library/stdtypes.rst:3167 ../../library/stdtypes.rst:4436 msgid "Flag" msgstr "" -#: ../../library/stdtypes.rst:3154 ../../library/stdtypes.rst:4423 +#: ../../library/stdtypes.rst:3169 ../../library/stdtypes.rst:4438 msgid "``'#'``" msgstr "``'#'``" -#: ../../library/stdtypes.rst:3154 ../../library/stdtypes.rst:4423 +#: ../../library/stdtypes.rst:3169 ../../library/stdtypes.rst:4438 msgid "" "The value conversion will use the \"alternate form\" (where defined below)." msgstr "" -#: ../../library/stdtypes.rst:3157 ../../library/stdtypes.rst:4426 +#: ../../library/stdtypes.rst:3172 ../../library/stdtypes.rst:4441 msgid "``'0'``" msgstr "``'0'``" -#: ../../library/stdtypes.rst:3157 ../../library/stdtypes.rst:4426 +#: ../../library/stdtypes.rst:3172 ../../library/stdtypes.rst:4441 msgid "The conversion will be zero padded for numeric values." msgstr "" -#: ../../library/stdtypes.rst:3159 ../../library/stdtypes.rst:4428 +#: ../../library/stdtypes.rst:3174 ../../library/stdtypes.rst:4443 msgid "``'-'``" msgstr "``'-'``" -#: ../../library/stdtypes.rst:3159 ../../library/stdtypes.rst:4428 +#: ../../library/stdtypes.rst:3174 ../../library/stdtypes.rst:4443 msgid "" "The converted value is left adjusted (overrides the ``'0'`` conversion if " "both are given)." msgstr "" -#: ../../library/stdtypes.rst:3162 ../../library/stdtypes.rst:4431 +#: ../../library/stdtypes.rst:3177 ../../library/stdtypes.rst:4446 msgid "``' '``" msgstr "``' '``" -#: ../../library/stdtypes.rst:3162 ../../library/stdtypes.rst:4431 +#: ../../library/stdtypes.rst:3177 ../../library/stdtypes.rst:4446 msgid "" "(a space) A blank should be left before a positive number (or empty string) " "produced by a signed conversion." msgstr "" -#: ../../library/stdtypes.rst:3165 ../../library/stdtypes.rst:4434 +#: ../../library/stdtypes.rst:3180 ../../library/stdtypes.rst:4449 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/stdtypes.rst:3165 ../../library/stdtypes.rst:4434 +#: ../../library/stdtypes.rst:3180 ../../library/stdtypes.rst:4449 msgid "" "A sign character (``'+'`` or ``'-'``) will precede the conversion (overrides " "a \"space\" flag)." msgstr "" -#: ../../library/stdtypes.rst:3169 ../../library/stdtypes.rst:4438 +#: ../../library/stdtypes.rst:3184 ../../library/stdtypes.rst:4453 msgid "" "A length modifier (``h``, ``l``, or ``L``) may be present, but is ignored as " "it is not necessary for Python -- so e.g. ``%ld`` is identical to ``%d``." msgstr "" -#: ../../library/stdtypes.rst:3172 ../../library/stdtypes.rst:4441 +#: ../../library/stdtypes.rst:3187 ../../library/stdtypes.rst:4456 msgid "The conversion types are:" msgstr "" -#: ../../library/stdtypes.rst:3175 ../../library/stdtypes.rst:4444 +#: ../../library/stdtypes.rst:3190 ../../library/stdtypes.rst:4459 msgid "Conversion" msgstr "" -#: ../../library/stdtypes.rst:3177 ../../library/stdtypes.rst:4446 +#: ../../library/stdtypes.rst:3192 ../../library/stdtypes.rst:4461 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/stdtypes.rst:3177 ../../library/stdtypes.rst:3179 -#: ../../library/stdtypes.rst:4446 ../../library/stdtypes.rst:4448 +#: ../../library/stdtypes.rst:3192 ../../library/stdtypes.rst:3194 +#: ../../library/stdtypes.rst:4461 ../../library/stdtypes.rst:4463 msgid "Signed integer decimal." msgstr "" -#: ../../library/stdtypes.rst:3179 ../../library/stdtypes.rst:4448 +#: ../../library/stdtypes.rst:3194 ../../library/stdtypes.rst:4463 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/stdtypes.rst:3181 ../../library/stdtypes.rst:4450 +#: ../../library/stdtypes.rst:3196 ../../library/stdtypes.rst:4465 msgid "``'o'``" msgstr "``'o'``" -#: ../../library/stdtypes.rst:3181 ../../library/stdtypes.rst:4450 +#: ../../library/stdtypes.rst:3196 ../../library/stdtypes.rst:4465 msgid "Signed octal value." msgstr "" -#: ../../library/stdtypes.rst:3183 ../../library/stdtypes.rst:4452 +#: ../../library/stdtypes.rst:3198 ../../library/stdtypes.rst:4467 msgid "``'u'``" msgstr "``'u'``" -#: ../../library/stdtypes.rst:3183 ../../library/stdtypes.rst:4452 +#: ../../library/stdtypes.rst:3198 ../../library/stdtypes.rst:4467 msgid "Obsolete type -- it is identical to ``'d'``." msgstr "" -#: ../../library/stdtypes.rst:3185 ../../library/stdtypes.rst:4454 +#: ../../library/stdtypes.rst:3200 ../../library/stdtypes.rst:4469 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/stdtypes.rst:3185 ../../library/stdtypes.rst:4454 +#: ../../library/stdtypes.rst:3200 ../../library/stdtypes.rst:4469 msgid "Signed hexadecimal (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:3187 ../../library/stdtypes.rst:4456 +#: ../../library/stdtypes.rst:3202 ../../library/stdtypes.rst:4471 msgid "``'X'``" msgstr "``'X'``" -#: ../../library/stdtypes.rst:3187 ../../library/stdtypes.rst:4456 +#: ../../library/stdtypes.rst:3202 ../../library/stdtypes.rst:4471 msgid "Signed hexadecimal (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:3189 ../../library/stdtypes.rst:4458 +#: ../../library/stdtypes.rst:3204 ../../library/stdtypes.rst:4473 msgid "``'e'``" msgstr "``'e'``" -#: ../../library/stdtypes.rst:3189 ../../library/stdtypes.rst:4458 +#: ../../library/stdtypes.rst:3204 ../../library/stdtypes.rst:4473 msgid "Floating-point exponential format (lowercase)." msgstr "" -#: ../../library/stdtypes.rst:3191 ../../library/stdtypes.rst:4460 +#: ../../library/stdtypes.rst:3206 ../../library/stdtypes.rst:4475 msgid "``'E'``" msgstr "``'E'``" -#: ../../library/stdtypes.rst:3191 ../../library/stdtypes.rst:4460 +#: ../../library/stdtypes.rst:3206 ../../library/stdtypes.rst:4475 msgid "Floating-point exponential format (uppercase)." msgstr "" -#: ../../library/stdtypes.rst:3193 ../../library/stdtypes.rst:4462 +#: ../../library/stdtypes.rst:3208 ../../library/stdtypes.rst:4477 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/stdtypes.rst:3193 ../../library/stdtypes.rst:3195 -#: ../../library/stdtypes.rst:4462 ../../library/stdtypes.rst:4464 +#: ../../library/stdtypes.rst:3208 ../../library/stdtypes.rst:3210 +#: ../../library/stdtypes.rst:4477 ../../library/stdtypes.rst:4479 msgid "Floating-point decimal format." msgstr "" -#: ../../library/stdtypes.rst:3195 ../../library/stdtypes.rst:4464 +#: ../../library/stdtypes.rst:3210 ../../library/stdtypes.rst:4479 msgid "``'F'``" msgstr "``'F'``" -#: ../../library/stdtypes.rst:3197 ../../library/stdtypes.rst:4466 +#: ../../library/stdtypes.rst:3212 ../../library/stdtypes.rst:4481 msgid "``'g'``" msgstr "``'g'``" -#: ../../library/stdtypes.rst:3197 ../../library/stdtypes.rst:4466 +#: ../../library/stdtypes.rst:3212 ../../library/stdtypes.rst:4481 msgid "" "Floating-point format. Uses lowercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -#: ../../library/stdtypes.rst:3201 ../../library/stdtypes.rst:4470 +#: ../../library/stdtypes.rst:3216 ../../library/stdtypes.rst:4485 msgid "``'G'``" msgstr "``'G'``" -#: ../../library/stdtypes.rst:3201 ../../library/stdtypes.rst:4470 +#: ../../library/stdtypes.rst:3216 ../../library/stdtypes.rst:4485 msgid "" "Floating-point format. Uses uppercase exponential format if exponent is less " "than -4 or not less than precision, decimal format otherwise." msgstr "" -#: ../../library/stdtypes.rst:3205 ../../library/stdtypes.rst:4474 +#: ../../library/stdtypes.rst:3220 ../../library/stdtypes.rst:4489 msgid "``'c'``" msgstr "``'c'``" -#: ../../library/stdtypes.rst:3205 +#: ../../library/stdtypes.rst:3220 msgid "Single character (accepts integer or single character string)." msgstr "" -#: ../../library/stdtypes.rst:3208 ../../library/stdtypes.rst:4487 +#: ../../library/stdtypes.rst:3223 ../../library/stdtypes.rst:4502 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/stdtypes.rst:3208 +#: ../../library/stdtypes.rst:3223 msgid "String (converts any Python object using :func:`repr`)." msgstr "" -#: ../../library/stdtypes.rst:3211 ../../library/stdtypes.rst:4481 +#: ../../library/stdtypes.rst:3226 ../../library/stdtypes.rst:4496 msgid "``'s'``" msgstr "``'s'``" -#: ../../library/stdtypes.rst:3211 +#: ../../library/stdtypes.rst:3226 msgid "String (converts any Python object using :func:`str`)." msgstr "" -#: ../../library/stdtypes.rst:3214 ../../library/stdtypes.rst:4484 +#: ../../library/stdtypes.rst:3229 ../../library/stdtypes.rst:4499 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/stdtypes.rst:3214 +#: ../../library/stdtypes.rst:3229 msgid "String (converts any Python object using :func:`ascii`)." msgstr "" -#: ../../library/stdtypes.rst:3217 ../../library/stdtypes.rst:4490 +#: ../../library/stdtypes.rst:3232 ../../library/stdtypes.rst:4505 msgid "``'%'``" msgstr "``'%'``" -#: ../../library/stdtypes.rst:3217 ../../library/stdtypes.rst:4490 +#: ../../library/stdtypes.rst:3232 ../../library/stdtypes.rst:4505 msgid "No argument is converted, results in a ``'%'`` character in the result." msgstr "" -#: ../../library/stdtypes.rst:3221 +#: ../../library/stdtypes.rst:3236 msgid "" "For floating-point formats, the result should be correctly rounded to a " "given precision ``p`` of digits after the decimal point. The rounding mode " "matches that of the :func:`round` builtin." msgstr "" -#: ../../library/stdtypes.rst:3228 ../../library/stdtypes.rst:4497 +#: ../../library/stdtypes.rst:3243 ../../library/stdtypes.rst:4512 msgid "" "The alternate form causes a leading octal specifier (``'0o'``) to be " "inserted before the first digit." msgstr "" -#: ../../library/stdtypes.rst:3232 ../../library/stdtypes.rst:4501 +#: ../../library/stdtypes.rst:3247 ../../library/stdtypes.rst:4516 msgid "" "The alternate form causes a leading ``'0x'`` or ``'0X'`` (depending on " "whether the ``'x'`` or ``'X'`` format was used) to be inserted before the " "first digit." msgstr "" -#: ../../library/stdtypes.rst:3236 ../../library/stdtypes.rst:4505 +#: ../../library/stdtypes.rst:3251 ../../library/stdtypes.rst:4520 msgid "" "The alternate form causes the result to always contain a decimal point, even " "if no digits follow it." msgstr "" -#: ../../library/stdtypes.rst:3239 ../../library/stdtypes.rst:4508 +#: ../../library/stdtypes.rst:3254 ../../library/stdtypes.rst:4523 msgid "" "The precision determines the number of digits after the decimal point and " "defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:3243 ../../library/stdtypes.rst:4512 +#: ../../library/stdtypes.rst:3258 ../../library/stdtypes.rst:4527 msgid "" "The alternate form causes the result to always contain a decimal point, and " "trailing zeroes are not removed as they would otherwise be." msgstr "" -#: ../../library/stdtypes.rst:3246 ../../library/stdtypes.rst:4515 +#: ../../library/stdtypes.rst:3261 ../../library/stdtypes.rst:4530 msgid "" "The precision determines the number of significant digits before and after " "the decimal point and defaults to 6." msgstr "" -#: ../../library/stdtypes.rst:3250 ../../library/stdtypes.rst:4519 +#: ../../library/stdtypes.rst:3265 ../../library/stdtypes.rst:4534 msgid "If precision is ``N``, the output is truncated to ``N`` characters." msgstr "" -#: ../../library/stdtypes.rst:3253 ../../library/stdtypes.rst:4528 +#: ../../library/stdtypes.rst:3268 ../../library/stdtypes.rst:4543 msgid "See :pep:`237`." msgstr "參閱 :pep:`237`。" -#: ../../library/stdtypes.rst:3255 +#: ../../library/stdtypes.rst:3270 msgid "" "Since Python strings have an explicit length, ``%s`` conversions do not " "assume that ``'\\0'`` is the end of the string." msgstr "" -#: ../../library/stdtypes.rst:3260 +#: ../../library/stdtypes.rst:3275 msgid "" "``%f`` conversions for numbers whose absolute value is over 1e50 are no " "longer replaced by ``%g`` conversions." msgstr "" -#: ../../library/stdtypes.rst:3271 +#: ../../library/stdtypes.rst:3286 msgid "" "Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:" "`memoryview`" msgstr "" -#: ../../library/stdtypes.rst:3279 +#: ../../library/stdtypes.rst:3294 msgid "" "The core built-in types for manipulating binary data are :class:`bytes` and :" "class:`bytearray`. They are supported by :class:`memoryview` which uses the :" @@ -5277,17 +5301,17 @@ msgid "" "objects without needing to make a copy." msgstr "" -#: ../../library/stdtypes.rst:3284 +#: ../../library/stdtypes.rst:3299 msgid "" "The :mod:`array` module supports efficient storage of basic data types like " "32-bit integers and IEEE754 double-precision floating values." msgstr "" -#: ../../library/stdtypes.rst:3290 +#: ../../library/stdtypes.rst:3305 msgid "Bytes Objects" msgstr "" -#: ../../library/stdtypes.rst:3294 +#: ../../library/stdtypes.rst:3309 msgid "" "Bytes objects are immutable sequences of single bytes. Since many major " "binary protocols are based on the ASCII text encoding, bytes objects offer " @@ -5295,40 +5319,40 @@ msgid "" "and are closely related to string objects in a variety of other ways." msgstr "" -#: ../../library/stdtypes.rst:3302 +#: ../../library/stdtypes.rst:3317 msgid "" "Firstly, the syntax for bytes literals is largely the same as that for " "string literals, except that a ``b`` prefix is added:" msgstr "" -#: ../../library/stdtypes.rst:3305 +#: ../../library/stdtypes.rst:3320 msgid "Single quotes: ``b'still allows embedded \"double\" quotes'``" msgstr "" -#: ../../library/stdtypes.rst:3306 +#: ../../library/stdtypes.rst:3321 msgid "Double quotes: ``b\"still allows embedded 'single' quotes\"``" msgstr "" -#: ../../library/stdtypes.rst:3307 +#: ../../library/stdtypes.rst:3322 msgid "" "Triple quoted: ``b'''3 single quotes'''``, ``b\"\"\"3 double quotes\"\"\"``" msgstr "" -#: ../../library/stdtypes.rst:3309 +#: ../../library/stdtypes.rst:3324 msgid "" "Only ASCII characters are permitted in bytes literals (regardless of the " "declared source code encoding). Any binary values over 127 must be entered " "into bytes literals using the appropriate escape sequence." msgstr "" -#: ../../library/stdtypes.rst:3313 +#: ../../library/stdtypes.rst:3328 msgid "" "As with string literals, bytes literals may also use a ``r`` prefix to " "disable processing of escape sequences. See :ref:`strings` for more about " "the various forms of bytes literal, including supported escape sequences." msgstr "" -#: ../../library/stdtypes.rst:3317 +#: ../../library/stdtypes.rst:3332 msgid "" "While bytes literals and representations are based on ASCII text, bytes " "objects actually behave like immutable sequences of integers, with each " @@ -5341,29 +5365,29 @@ msgid "" "compatible will usually lead to data corruption)." msgstr "" -#: ../../library/stdtypes.rst:3327 +#: ../../library/stdtypes.rst:3342 msgid "" "In addition to the literal forms, bytes objects can be created in a number " "of other ways:" msgstr "" -#: ../../library/stdtypes.rst:3330 +#: ../../library/stdtypes.rst:3345 msgid "A zero-filled bytes object of a specified length: ``bytes(10)``" msgstr "" -#: ../../library/stdtypes.rst:3331 +#: ../../library/stdtypes.rst:3346 msgid "From an iterable of integers: ``bytes(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:3332 +#: ../../library/stdtypes.rst:3347 msgid "Copying existing binary data via the buffer protocol: ``bytes(obj)``" msgstr "" -#: ../../library/stdtypes.rst:3334 +#: ../../library/stdtypes.rst:3349 msgid "Also see the :ref:`bytes ` built-in." msgstr "另見內建的 :ref:`bytes `。" -#: ../../library/stdtypes.rst:3336 +#: ../../library/stdtypes.rst:3351 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -5371,38 +5395,38 @@ msgid "" "that format:" msgstr "" -#: ../../library/stdtypes.rst:3342 +#: ../../library/stdtypes.rst:3357 msgid "" "This :class:`bytes` class method returns a bytes object, decoding the given " "string object. The string must contain two hexadecimal digits per byte, " "with ASCII whitespace being ignored." msgstr "" -#: ../../library/stdtypes.rst:3349 +#: ../../library/stdtypes.rst:3364 msgid "" ":meth:`bytes.fromhex` now skips all ASCII whitespace in the string, not just " "spaces." msgstr "" -#: ../../library/stdtypes.rst:3353 +#: ../../library/stdtypes.rst:3368 msgid "" ":meth:`bytes.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-like " "objects ` as input." msgstr "" -#: ../../library/stdtypes.rst:3357 +#: ../../library/stdtypes.rst:3372 msgid "" "A reverse conversion function exists to transform a bytes object into its " "hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:3363 ../../library/stdtypes.rst:3454 +#: ../../library/stdtypes.rst:3378 ../../library/stdtypes.rst:3469 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the instance." msgstr "" -#: ../../library/stdtypes.rst:3369 +#: ../../library/stdtypes.rst:3384 msgid "" "If you want to make the hex string easier to read, you can specify a single " "character separator *sep* parameter to include in the output. By default, " @@ -5411,13 +5435,13 @@ msgid "" "the separator position from the right, negative values from the left." msgstr "" -#: ../../library/stdtypes.rst:3386 +#: ../../library/stdtypes.rst:3401 msgid "" ":meth:`bytes.hex` now supports optional *sep* and *bytes_per_sep* parameters " "to insert separators between bytes in the hex output." msgstr "" -#: ../../library/stdtypes.rst:3390 +#: ../../library/stdtypes.rst:3405 msgid "" "Since bytes objects are sequences of integers (akin to a tuple), for a bytes " "object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes " @@ -5425,58 +5449,58 @@ msgid "" "and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:3395 +#: ../../library/stdtypes.rst:3410 msgid "" "The representation of bytes objects uses the literal format (``b'...'``) " "since it is often more useful than e.g. ``bytes([46, 46, 46])``. You can " "always convert a bytes object into a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:3403 +#: ../../library/stdtypes.rst:3418 msgid "Bytearray Objects" msgstr "Bytearray 物件" -#: ../../library/stdtypes.rst:3407 +#: ../../library/stdtypes.rst:3422 msgid "" ":class:`bytearray` objects are a mutable counterpart to :class:`bytes` " "objects." msgstr "" -#: ../../library/stdtypes.rst:3413 +#: ../../library/stdtypes.rst:3428 msgid "" "There is no dedicated literal syntax for bytearray objects, instead they are " "always created by calling the constructor:" msgstr "" -#: ../../library/stdtypes.rst:3416 +#: ../../library/stdtypes.rst:3431 msgid "Creating an empty instance: ``bytearray()``" msgstr "建立一個空的實例:``bytearray()``" -#: ../../library/stdtypes.rst:3417 +#: ../../library/stdtypes.rst:3432 msgid "Creating a zero-filled instance with a given length: ``bytearray(10)``" msgstr "" -#: ../../library/stdtypes.rst:3418 +#: ../../library/stdtypes.rst:3433 msgid "From an iterable of integers: ``bytearray(range(20))``" msgstr "" -#: ../../library/stdtypes.rst:3419 +#: ../../library/stdtypes.rst:3434 msgid "" "Copying existing binary data via the buffer protocol: ``bytearray(b'Hi!')``" msgstr "" -#: ../../library/stdtypes.rst:3421 +#: ../../library/stdtypes.rst:3436 msgid "" "As bytearray objects are mutable, they support the :ref:`mutable ` sequence operations in addition to the common bytes and bytearray " "operations described in :ref:`bytes-methods`." msgstr "" -#: ../../library/stdtypes.rst:3425 +#: ../../library/stdtypes.rst:3440 msgid "Also see the :ref:`bytearray ` built-in." msgstr "另見內建的 :ref:`bytearray `。" -#: ../../library/stdtypes.rst:3427 +#: ../../library/stdtypes.rst:3442 msgid "" "Since 2 hexadecimal digits correspond precisely to a single byte, " "hexadecimal numbers are a commonly used format for describing binary data. " @@ -5484,64 +5508,64 @@ msgid "" "in that format:" msgstr "" -#: ../../library/stdtypes.rst:3433 +#: ../../library/stdtypes.rst:3448 msgid "" "This :class:`bytearray` class method returns bytearray object, decoding the " "given string object. The string must contain two hexadecimal digits per " "byte, with ASCII whitespace being ignored." msgstr "" -#: ../../library/stdtypes.rst:3440 +#: ../../library/stdtypes.rst:3455 msgid "" ":meth:`bytearray.fromhex` now skips all ASCII whitespace in the string, not " "just spaces." msgstr "" -#: ../../library/stdtypes.rst:3444 +#: ../../library/stdtypes.rst:3459 msgid "" ":meth:`bytearray.fromhex` now accepts ASCII :class:`bytes` and :term:`bytes-" "like objects ` as input." msgstr "" -#: ../../library/stdtypes.rst:3448 +#: ../../library/stdtypes.rst:3463 msgid "" "A reverse conversion function exists to transform a bytearray object into " "its hexadecimal representation." msgstr "" -#: ../../library/stdtypes.rst:3462 +#: ../../library/stdtypes.rst:3477 msgid "" "Similar to :meth:`bytes.hex`, :meth:`bytearray.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " "the hex output." msgstr "" -#: ../../library/stdtypes.rst:3469 +#: ../../library/stdtypes.rst:3484 msgid "" "Resize the :class:`bytearray` to contain *size* bytes. *size* must be " "greater than or equal to 0." msgstr "" -#: ../../library/stdtypes.rst:3472 +#: ../../library/stdtypes.rst:3487 msgid "" "If the :class:`bytearray` needs to shrink, bytes beyond *size* are truncated." msgstr "" -#: ../../library/stdtypes.rst:3474 +#: ../../library/stdtypes.rst:3489 msgid "" "If the :class:`bytearray` needs to grow, all new bytes, those beyond *size*, " "will be set to null bytes." msgstr "" -#: ../../library/stdtypes.rst:3478 +#: ../../library/stdtypes.rst:3493 msgid "This is equivalent to:" msgstr "等同於:" -#: ../../library/stdtypes.rst:3486 +#: ../../library/stdtypes.rst:3501 msgid "Examples:" msgstr "範例:" -#: ../../library/stdtypes.rst:3499 +#: ../../library/stdtypes.rst:3514 msgid "" "Since bytearray objects are sequences of integers (akin to a list), for a " "bytearray object *b*, ``b[0]`` will be an integer, while ``b[0:1]`` will be " @@ -5549,7 +5573,7 @@ msgid "" "both indexing and slicing will produce a string of length 1)" msgstr "" -#: ../../library/stdtypes.rst:3504 +#: ../../library/stdtypes.rst:3519 msgid "" "The representation of bytearray objects uses the bytes literal format " "(``bytearray(b'...')``) since it is often more useful than e.g. " @@ -5557,17 +5581,17 @@ msgid "" "a list of integers using ``list(b)``." msgstr "" -#: ../../library/stdtypes.rst:3511 +#: ../../library/stdtypes.rst:3526 msgid "" "For detailed information on thread-safety guarantees for :class:`bytearray` " "objects, see :ref:`thread-safety-bytearray`." msgstr "" -#: ../../library/stdtypes.rst:3518 +#: ../../library/stdtypes.rst:3533 msgid "Bytes and Bytearray Operations" msgstr "Bytes 和 Bytearray 的操作" -#: ../../library/stdtypes.rst:3523 +#: ../../library/stdtypes.rst:3538 msgid "" "Both bytes and bytearray objects support the :ref:`common ` " "sequence operations. They interoperate not just with operands of the same " @@ -5576,14 +5600,14 @@ msgid "" "return type of the result may depend on the order of operands." msgstr "" -#: ../../library/stdtypes.rst:3531 +#: ../../library/stdtypes.rst:3546 msgid "" "The methods on bytes and bytearray objects don't accept strings as their " "arguments, just as the methods on strings don't accept bytes as their " "arguments. For example, you have to write::" msgstr "" -#: ../../library/stdtypes.rst:3535 +#: ../../library/stdtypes.rst:3550 msgid "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" @@ -5591,11 +5615,11 @@ msgstr "" "a = \"abc\"\n" "b = a.replace(\"a\", \"f\")" -#: ../../library/stdtypes.rst:3538 +#: ../../library/stdtypes.rst:3553 msgid "and::" msgstr "和: ::" -#: ../../library/stdtypes.rst:3540 +#: ../../library/stdtypes.rst:3555 msgid "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" @@ -5603,60 +5627,60 @@ msgstr "" "a = b\"abc\"\n" "b = a.replace(b\"a\", b\"f\")" -#: ../../library/stdtypes.rst:3543 +#: ../../library/stdtypes.rst:3558 msgid "" "Some bytes and bytearray operations assume the use of ASCII compatible " "binary formats, and hence should be avoided when working with arbitrary " "binary data. These restrictions are covered below." msgstr "" -#: ../../library/stdtypes.rst:3548 +#: ../../library/stdtypes.rst:3563 msgid "" "Using these ASCII based operations to manipulate binary data that is not " "stored in an ASCII based format may lead to data corruption." msgstr "" -#: ../../library/stdtypes.rst:3551 +#: ../../library/stdtypes.rst:3566 msgid "" "The following methods on bytes and bytearray objects can be used with " "arbitrary binary data." msgstr "" -#: ../../library/stdtypes.rst:3557 +#: ../../library/stdtypes.rst:3572 msgid "" "Return the number of non-overlapping occurrences of subsequence *sub* in the " "range [*start*, *end*]. Optional arguments *start* and *end* are " "interpreted as in slice notation." msgstr "" -#: ../../library/stdtypes.rst:3561 ../../library/stdtypes.rst:3666 -#: ../../library/stdtypes.rst:3688 ../../library/stdtypes.rst:3754 -#: ../../library/stdtypes.rst:3767 +#: ../../library/stdtypes.rst:3576 ../../library/stdtypes.rst:3681 +#: ../../library/stdtypes.rst:3703 ../../library/stdtypes.rst:3769 +#: ../../library/stdtypes.rst:3782 msgid "" "The subsequence to search for may be any :term:`bytes-like object` or an " "integer in the range 0 to 255." msgstr "" -#: ../../library/stdtypes.rst:3564 +#: ../../library/stdtypes.rst:3579 msgid "" "If *sub* is empty, returns the number of empty slices between characters " "which is the length of the bytes object plus one." msgstr "" -#: ../../library/stdtypes.rst:3567 ../../library/stdtypes.rst:3678 -#: ../../library/stdtypes.rst:3691 ../../library/stdtypes.rst:3757 -#: ../../library/stdtypes.rst:3770 +#: ../../library/stdtypes.rst:3582 ../../library/stdtypes.rst:3693 +#: ../../library/stdtypes.rst:3706 ../../library/stdtypes.rst:3772 +#: ../../library/stdtypes.rst:3785 msgid "Also accept an integer in the range 0 to 255 as the subsequence." msgstr "" -#: ../../library/stdtypes.rst:3574 +#: ../../library/stdtypes.rst:3589 msgid "" "If the binary data starts with the *prefix* string, return " "``bytes[len(prefix):]``. Otherwise, return a copy of the original binary " "data::" msgstr "" -#: ../../library/stdtypes.rst:3578 +#: ../../library/stdtypes.rst:3593 msgid "" ">>> b'TestHook'.removeprefix(b'Test')\n" "b'Hook'\n" @@ -5668,32 +5692,32 @@ msgstr "" ">>> b'BaseTestCase'.removeprefix(b'Test')\n" "b'BaseTestCase'" -#: ../../library/stdtypes.rst:3583 +#: ../../library/stdtypes.rst:3598 msgid "The *prefix* may be any :term:`bytes-like object`." msgstr "*prefix* 可以是任何的 :term:`bytes-like object`。" -#: ../../library/stdtypes.rst:3587 ../../library/stdtypes.rst:3609 -#: ../../library/stdtypes.rst:3742 ../../library/stdtypes.rst:3835 -#: ../../library/stdtypes.rst:3849 ../../library/stdtypes.rst:3879 -#: ../../library/stdtypes.rst:3893 ../../library/stdtypes.rst:3934 -#: ../../library/stdtypes.rst:4004 ../../library/stdtypes.rst:4022 -#: ../../library/stdtypes.rst:4050 ../../library/stdtypes.rst:4189 -#: ../../library/stdtypes.rst:4244 ../../library/stdtypes.rst:4287 -#: ../../library/stdtypes.rst:4308 ../../library/stdtypes.rst:4330 -#: ../../library/stdtypes.rst:4532 +#: ../../library/stdtypes.rst:3602 ../../library/stdtypes.rst:3624 +#: ../../library/stdtypes.rst:3757 ../../library/stdtypes.rst:3850 +#: ../../library/stdtypes.rst:3864 ../../library/stdtypes.rst:3894 +#: ../../library/stdtypes.rst:3908 ../../library/stdtypes.rst:3949 +#: ../../library/stdtypes.rst:4019 ../../library/stdtypes.rst:4037 +#: ../../library/stdtypes.rst:4065 ../../library/stdtypes.rst:4204 +#: ../../library/stdtypes.rst:4259 ../../library/stdtypes.rst:4302 +#: ../../library/stdtypes.rst:4323 ../../library/stdtypes.rst:4345 +#: ../../library/stdtypes.rst:4547 msgid "" "The bytearray version of this method does *not* operate in place - it always " "produces a new object, even if no changes were made." msgstr "" -#: ../../library/stdtypes.rst:3596 +#: ../../library/stdtypes.rst:3611 msgid "" "If the binary data ends with the *suffix* string and that *suffix* is not " "empty, return ``bytes[:-len(suffix)]``. Otherwise, return a copy of the " "original binary data::" msgstr "" -#: ../../library/stdtypes.rst:3600 +#: ../../library/stdtypes.rst:3615 msgid "" ">>> b'MiscTests'.removesuffix(b'Tests')\n" "b'Misc'\n" @@ -5705,15 +5729,15 @@ msgstr "" ">>> b'TmpDirMixin'.removesuffix(b'Tests')\n" "b'TmpDirMixin'" -#: ../../library/stdtypes.rst:3605 +#: ../../library/stdtypes.rst:3620 msgid "The *suffix* may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3618 +#: ../../library/stdtypes.rst:3633 msgid "Return the bytes decoded to a :class:`str`." msgstr "" -#: ../../library/stdtypes.rst:3623 +#: ../../library/stdtypes.rst:3638 msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " @@ -5721,21 +5745,21 @@ msgid "" "`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" -#: ../../library/stdtypes.rst:3629 +#: ../../library/stdtypes.rst:3644 msgid "" "For performance reasons, the value of *errors* is not checked for validity " "unless a decoding error actually occurs, :ref:`devmode` is enabled or a :ref:" "`debug build ` is used." msgstr "" -#: ../../library/stdtypes.rst:3635 +#: ../../library/stdtypes.rst:3650 msgid "" "Passing the *encoding* argument to :class:`str` allows decoding any :term:" "`bytes-like object` directly, without needing to make a temporary :class:`!" "bytes` or :class:`!bytearray` object." msgstr "" -#: ../../library/stdtypes.rst:3650 +#: ../../library/stdtypes.rst:3665 msgid "" "Return ``True`` if the binary data ends with the specified *suffix*, " "otherwise return ``False``. *suffix* can also be a tuple of suffixes to " @@ -5743,11 +5767,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:3655 +#: ../../library/stdtypes.rst:3670 msgid "The suffix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3661 +#: ../../library/stdtypes.rst:3676 msgid "" "Return the lowest index in the data where the subsequence *sub* is found, " "such that *sub* is contained in the slice ``s[start:end]``. Optional " @@ -5755,14 +5779,14 @@ msgid "" "``-1`` if *sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:3671 +#: ../../library/stdtypes.rst:3686 msgid "" "The :meth:`~bytes.find` method should be used only if you need to know the " "position of *sub*. To check if *sub* is a substring or not, use the :" "keyword:`in` operator::" msgstr "" -#: ../../library/stdtypes.rst:3675 +#: ../../library/stdtypes.rst:3690 msgid "" ">>> b'Py' in b'Python'\n" "True" @@ -5770,13 +5794,13 @@ msgstr "" ">>> b'Py' in b'Python'\n" "True" -#: ../../library/stdtypes.rst:3685 +#: ../../library/stdtypes.rst:3700 msgid "" "Like :meth:`~bytes.find`, but raise :exc:`ValueError` when the subsequence " "is not found." msgstr "" -#: ../../library/stdtypes.rst:3698 +#: ../../library/stdtypes.rst:3713 msgid "" "Return a bytes or bytearray object which is the concatenation of the binary " "data sequences in *iterable*. A :exc:`TypeError` will be raised if there " @@ -5786,7 +5810,7 @@ msgid "" "method." msgstr "" -#: ../../library/stdtypes.rst:3709 +#: ../../library/stdtypes.rst:3724 msgid "" "This static method returns a translation table usable for :meth:`bytes." "translate` that will map each character in *from* into the character at the " @@ -5794,7 +5818,7 @@ msgid "" "objects ` and have the same length." msgstr "" -#: ../../library/stdtypes.rst:3720 +#: ../../library/stdtypes.rst:3735 msgid "" "Split the sequence at the first occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -5803,24 +5827,24 @@ msgid "" "by two empty bytes or bytearray objects." msgstr "" -#: ../../library/stdtypes.rst:3727 ../../library/stdtypes.rst:3784 +#: ../../library/stdtypes.rst:3742 ../../library/stdtypes.rst:3799 msgid "The separator to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3733 +#: ../../library/stdtypes.rst:3748 msgid "" "Return a copy of the sequence with all occurrences of subsequence *old* " "replaced by *new*. If the optional argument *count* is given, only the " "first *count* occurrences are replaced." msgstr "" -#: ../../library/stdtypes.rst:3737 +#: ../../library/stdtypes.rst:3752 msgid "" "The subsequence to search for and its replacement may be any :term:`bytes-" "like object`." msgstr "" -#: ../../library/stdtypes.rst:3749 +#: ../../library/stdtypes.rst:3764 msgid "" "Return the highest index in the sequence where the subsequence *sub* is " "found, such that *sub* is contained within ``s[start:end]``. Optional " @@ -5828,13 +5852,13 @@ msgid "" "``-1`` on failure." msgstr "" -#: ../../library/stdtypes.rst:3764 +#: ../../library/stdtypes.rst:3779 msgid "" "Like :meth:`~bytes.rfind` but raises :exc:`ValueError` when the subsequence " "*sub* is not found." msgstr "" -#: ../../library/stdtypes.rst:3777 +#: ../../library/stdtypes.rst:3792 msgid "" "Split the sequence at the last occurrence of *sep*, and return a 3-tuple " "containing the part before the separator, the separator itself or its " @@ -5843,7 +5867,7 @@ msgid "" "followed by a copy of the original sequence." msgstr "" -#: ../../library/stdtypes.rst:3790 +#: ../../library/stdtypes.rst:3805 msgid "" "Return ``True`` if the binary data starts with the specified *prefix*, " "otherwise return ``False``. *prefix* can also be a tuple of prefixes to " @@ -5851,11 +5875,11 @@ msgid "" "optional *end*, stop comparing at that position." msgstr "" -#: ../../library/stdtypes.rst:3795 +#: ../../library/stdtypes.rst:3810 msgid "The prefix(es) to search for may be any :term:`bytes-like object`." msgstr "" -#: ../../library/stdtypes.rst:3801 +#: ../../library/stdtypes.rst:3816 msgid "" "Return a copy of the bytes or bytearray object where all bytes occurring in " "the optional argument *delete* are removed, and the remaining bytes have " @@ -5863,18 +5887,18 @@ msgid "" "object of length 256." msgstr "" -#: ../../library/stdtypes.rst:3806 +#: ../../library/stdtypes.rst:3821 msgid "" "You can use the :func:`bytes.maketrans` method to create a translation table." msgstr "" -#: ../../library/stdtypes.rst:3809 +#: ../../library/stdtypes.rst:3824 msgid "" "Set the *table* argument to ``None`` for translations that only delete " "characters::" msgstr "" -#: ../../library/stdtypes.rst:3812 +#: ../../library/stdtypes.rst:3827 msgid "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" @@ -5882,11 +5906,11 @@ msgstr "" ">>> b'read this short text'.translate(None, b'aeiou')\n" "b'rd ths shrt txt'" -#: ../../library/stdtypes.rst:3815 +#: ../../library/stdtypes.rst:3830 msgid "*delete* is now supported as a keyword argument." msgstr "支援 *delete* 關鍵字引數。" -#: ../../library/stdtypes.rst:3819 +#: ../../library/stdtypes.rst:3834 msgid "" "The following methods on bytes and bytearray objects have default behaviours " "that assume the use of ASCII compatible binary formats, but can still be " @@ -5895,7 +5919,7 @@ msgid "" "instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:3828 +#: ../../library/stdtypes.rst:3843 msgid "" "Return a copy of the object centered in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -5903,7 +5927,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3842 +#: ../../library/stdtypes.rst:3857 msgid "" "Return a copy of the object left justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -5911,7 +5935,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3856 +#: ../../library/stdtypes.rst:3871 msgid "" "Return a copy of the sequence with specified leading bytes removed. The " "*bytes* argument is a binary sequence specifying the set of byte values to " @@ -5920,7 +5944,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3862 +#: ../../library/stdtypes.rst:3877 msgid "" ">>> b' spacious '.lstrip()\n" "b'spacious '\n" @@ -5932,14 +5956,14 @@ msgstr "" ">>> b'www.example.com'.lstrip(b'cmowz.')\n" "b'example.com'" -#: ../../library/stdtypes.rst:3867 +#: ../../library/stdtypes.rst:3882 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removeprefix` for a method that will remove a " "single prefix string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:3872 +#: ../../library/stdtypes.rst:3887 msgid "" ">>> b'Arthur: three!'.lstrip(b'Arthur: ')\n" "b'ee!'\n" @@ -5951,7 +5975,7 @@ msgstr "" ">>> b'Arthur: three!'.removeprefix(b'Arthur: ')\n" "b'three!'" -#: ../../library/stdtypes.rst:3886 +#: ../../library/stdtypes.rst:3901 msgid "" "Return a copy of the object right justified in a sequence of length *width*. " "Padding is done using the specified *fillbyte* (default is an ASCII space). " @@ -5959,7 +5983,7 @@ msgid "" "less than or equal to ``len(s)``." msgstr "" -#: ../../library/stdtypes.rst:3900 +#: ../../library/stdtypes.rst:3915 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given, at most *maxsplit* splits are " @@ -5969,7 +5993,7 @@ msgid "" "described in detail below." msgstr "" -#: ../../library/stdtypes.rst:3911 +#: ../../library/stdtypes.rst:3926 msgid "" "Return a copy of the sequence with specified trailing bytes removed. The " "*bytes* argument is a binary sequence specifying the set of byte values to " @@ -5978,7 +6002,7 @@ msgid "" "all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3917 +#: ../../library/stdtypes.rst:3932 msgid "" ">>> b' spacious '.rstrip()\n" "b' spacious'\n" @@ -5990,14 +6014,14 @@ msgstr "" ">>> b'mississippi'.rstrip(b'ipz')\n" "b'mississ'" -#: ../../library/stdtypes.rst:3922 +#: ../../library/stdtypes.rst:3937 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`. See :meth:`~bytes.removesuffix` for a method that will remove a " "single suffix string rather than all of a set of characters. For example::" msgstr "" -#: ../../library/stdtypes.rst:3927 +#: ../../library/stdtypes.rst:3942 msgid "" ">>> b'Monty Python'.rstrip(b' Python')\n" "b'M'\n" @@ -6009,7 +6033,7 @@ msgstr "" ">>> b'Monty Python'.removesuffix(b' Python')\n" "b'Monty'" -#: ../../library/stdtypes.rst:3941 +#: ../../library/stdtypes.rst:3956 msgid "" "Split the binary sequence into subsequences of the same type, using *sep* as " "the delimiter string. If *maxsplit* is given and non-negative, at most " @@ -6018,7 +6042,7 @@ msgid "" "limit on the number of splits (all possible splits are made)." msgstr "" -#: ../../library/stdtypes.rst:3947 +#: ../../library/stdtypes.rst:3962 msgid "" "If *sep* is given, consecutive delimiters are not grouped together and are " "deemed to delimit empty subsequences (for example, ``b'1,,2'.split(b',')`` " @@ -6029,7 +6053,7 @@ msgid "" "like object`." msgstr "" -#: ../../library/stdtypes.rst:3957 +#: ../../library/stdtypes.rst:3972 msgid "" ">>> b'1,2,3'.split(b',')\n" "[b'1', b'2', b'3']\n" @@ -6049,7 +6073,7 @@ msgstr "" ">>> b'1<>2<>3<4'.split(b'<>')\n" "[b'1', b'2', b'3<4']" -#: ../../library/stdtypes.rst:3966 +#: ../../library/stdtypes.rst:3981 msgid "" "If *sep* is not specified or is ``None``, a different splitting algorithm is " "applied: runs of consecutive ASCII whitespace are regarded as a single " @@ -6059,7 +6083,7 @@ msgid "" "without a specified separator returns ``[]``." msgstr "" -#: ../../library/stdtypes.rst:3976 +#: ../../library/stdtypes.rst:3991 msgid "" ">>> b'1 2 3'.split()\n" "[b'1', b'2', b'3']\n" @@ -6075,7 +6099,7 @@ msgstr "" ">>> b' 1 2 3 '.split()\n" "[b'1', b'2', b'3']" -#: ../../library/stdtypes.rst:3987 +#: ../../library/stdtypes.rst:4002 msgid "" "Return a copy of the sequence with specified leading and trailing bytes " "removed. The *bytes* argument is a binary sequence specifying the set of " @@ -6084,7 +6108,7 @@ msgid "" "or suffix; rather, all combinations of its values are stripped::" msgstr "" -#: ../../library/stdtypes.rst:3994 +#: ../../library/stdtypes.rst:4009 msgid "" ">>> b' spacious '.strip()\n" "b'spacious'\n" @@ -6096,13 +6120,13 @@ msgstr "" ">>> b'www.example.com'.strip(b'cmowz.')\n" "b'example'" -#: ../../library/stdtypes.rst:3999 +#: ../../library/stdtypes.rst:4014 msgid "" "The binary sequence of byte values to remove may be any :term:`bytes-like " "object`." msgstr "" -#: ../../library/stdtypes.rst:4008 +#: ../../library/stdtypes.rst:4023 msgid "" "The following methods on bytes and bytearray objects assume the use of ASCII " "compatible binary formats and should not be applied to arbitrary binary " @@ -6110,14 +6134,14 @@ msgid "" "operate in place, and instead produce new objects." msgstr "" -#: ../../library/stdtypes.rst:4016 +#: ../../library/stdtypes.rst:4031 msgid "" "Return a copy of the sequence with each byte interpreted as an ASCII " "character, and the first byte capitalized and the rest lowercased. Non-ASCII " "byte values are passed through unchanged." msgstr "" -#: ../../library/stdtypes.rst:4029 +#: ../../library/stdtypes.rst:4044 msgid "" "Return a copy of the sequence where all ASCII tab characters are replaced by " "one or more ASCII spaces, depending on the current column and the given tab " @@ -6133,7 +6157,7 @@ msgid "" "by one regardless of how the byte value is represented when printed::" msgstr "" -#: ../../library/stdtypes.rst:4043 +#: ../../library/stdtypes.rst:4058 msgid "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs()\n" "b'01 012 0123 01234'\n" @@ -6145,7 +6169,7 @@ msgstr "" ">>> b'01\\t012\\t0123\\t01234'.expandtabs(4)\n" "b'01 012 0123 01234'" -#: ../../library/stdtypes.rst:4057 +#: ../../library/stdtypes.rst:4072 msgid "" "Return ``True`` if all bytes in the sequence are alphabetical ASCII " "characters or ASCII decimal digits and the sequence is not empty, ``False`` " @@ -6154,7 +6178,7 @@ msgid "" "digits are those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:4065 +#: ../../library/stdtypes.rst:4080 msgid "" ">>> b'ABCabc1'.isalnum()\n" "True\n" @@ -6166,7 +6190,7 @@ msgstr "" ">>> b'ABC abc1'.isalnum()\n" "False" -#: ../../library/stdtypes.rst:4074 +#: ../../library/stdtypes.rst:4089 msgid "" "Return ``True`` if all bytes in the sequence are alphabetic ASCII characters " "and the sequence is not empty, ``False`` otherwise. Alphabetic ASCII " @@ -6174,7 +6198,7 @@ msgid "" "``b'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:4081 +#: ../../library/stdtypes.rst:4096 msgid "" ">>> b'ABCabc'.isalpha()\n" "True\n" @@ -6186,20 +6210,20 @@ msgstr "" ">>> b'ABCabc1'.isalpha()\n" "False" -#: ../../library/stdtypes.rst:4090 +#: ../../library/stdtypes.rst:4105 msgid "" "Return ``True`` if the sequence is empty or all bytes in the sequence are " "ASCII, ``False`` otherwise. ASCII bytes are in the range 0-0x7F." msgstr "" -#: ../../library/stdtypes.rst:4100 +#: ../../library/stdtypes.rst:4115 msgid "" "Return ``True`` if all bytes in the sequence are ASCII decimal digits and " "the sequence is not empty, ``False`` otherwise. ASCII decimal digits are " "those byte values in the sequence ``b'0123456789'``." msgstr "" -#: ../../library/stdtypes.rst:4106 +#: ../../library/stdtypes.rst:4121 msgid "" ">>> b'1234'.isdigit()\n" "True\n" @@ -6211,13 +6235,13 @@ msgstr "" ">>> b'1.23'.isdigit()\n" "False" -#: ../../library/stdtypes.rst:4115 +#: ../../library/stdtypes.rst:4130 msgid "" "Return ``True`` if there is at least one lowercase ASCII character in the " "sequence and no uppercase ASCII characters, ``False`` otherwise." msgstr "" -#: ../../library/stdtypes.rst:4120 +#: ../../library/stdtypes.rst:4135 msgid "" ">>> b'hello world'.islower()\n" "True\n" @@ -6229,16 +6253,16 @@ msgstr "" ">>> b'Hello world'.islower()\n" "False" -#: ../../library/stdtypes.rst:4125 ../../library/stdtypes.rst:4167 -#: ../../library/stdtypes.rst:4183 ../../library/stdtypes.rst:4233 -#: ../../library/stdtypes.rst:4302 +#: ../../library/stdtypes.rst:4140 ../../library/stdtypes.rst:4182 +#: ../../library/stdtypes.rst:4198 ../../library/stdtypes.rst:4248 +#: ../../library/stdtypes.rst:4317 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " "values in the sequence ``b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'``." msgstr "" -#: ../../library/stdtypes.rst:4133 +#: ../../library/stdtypes.rst:4148 msgid "" "Return ``True`` if all bytes in the sequence are ASCII whitespace and the " "sequence is not empty, ``False`` otherwise. ASCII whitespace characters are " @@ -6246,14 +6270,14 @@ msgid "" "newline, carriage return, vertical tab, form feed)." msgstr "" -#: ../../library/stdtypes.rst:4142 +#: ../../library/stdtypes.rst:4157 msgid "" "Return ``True`` if the sequence is ASCII titlecase and the sequence is not " "empty, ``False`` otherwise. See :meth:`bytes.title` for more details on the " "definition of \"titlecase\"." msgstr "" -#: ../../library/stdtypes.rst:4148 +#: ../../library/stdtypes.rst:4163 msgid "" ">>> b'Hello World'.istitle()\n" "True\n" @@ -6265,14 +6289,14 @@ msgstr "" ">>> b'Hello world'.istitle()\n" "False" -#: ../../library/stdtypes.rst:4157 +#: ../../library/stdtypes.rst:4172 msgid "" "Return ``True`` if there is at least one uppercase alphabetic ASCII " "character in the sequence and no lowercase ASCII characters, ``False`` " "otherwise." msgstr "" -#: ../../library/stdtypes.rst:4162 +#: ../../library/stdtypes.rst:4177 msgid "" ">>> b'HELLO WORLD'.isupper()\n" "True\n" @@ -6284,13 +6308,13 @@ msgstr "" ">>> b'Hello world'.isupper()\n" "False" -#: ../../library/stdtypes.rst:4175 +#: ../../library/stdtypes.rst:4190 msgid "" "Return a copy of the sequence with all the uppercase ASCII characters " "converted to their corresponding lowercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:4180 +#: ../../library/stdtypes.rst:4195 msgid "" ">>> b'Hello World'.lower()\n" "b'hello world'" @@ -6298,7 +6322,7 @@ msgstr "" ">>> b'Hello World'.lower()\n" "b'hello world'" -#: ../../library/stdtypes.rst:4200 +#: ../../library/stdtypes.rst:4215 msgid "" "Return a list of the lines in the binary sequence, breaking at ASCII line " "boundaries. This method uses the :term:`universal newlines` approach to " @@ -6306,7 +6330,7 @@ msgid "" "*keepends* is given and true." msgstr "" -#: ../../library/stdtypes.rst:4207 +#: ../../library/stdtypes.rst:4222 msgid "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n" "[b'ab c', b'', b'de fg', b'kl']\n" @@ -6318,14 +6342,14 @@ msgstr "" ">>> b'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines(keepends=True)\n" "[b'ab c\\n', b'\\n', b'de fg\\r', b'kl\\r\\n']" -#: ../../library/stdtypes.rst:4212 +#: ../../library/stdtypes.rst:4227 msgid "" "Unlike :meth:`~bytes.split` when a delimiter string *sep* is given, this " "method returns an empty list for the empty string, and a terminal line break " "does not result in an extra line::" msgstr "" -#: ../../library/stdtypes.rst:4216 +#: ../../library/stdtypes.rst:4231 msgid "" ">>> b\"\".split(b'\\n'), b\"Two lines\\n\".split(b'\\n')\n" "([b''], [b'Two lines', b''])\n" @@ -6337,13 +6361,13 @@ msgstr "" ">>> b\"\".splitlines(), b\"One line\\n\".splitlines()\n" "([], [b'One line'])" -#: ../../library/stdtypes.rst:4225 +#: ../../library/stdtypes.rst:4240 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart and vice-versa." msgstr "" -#: ../../library/stdtypes.rst:4230 +#: ../../library/stdtypes.rst:4245 msgid "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" @@ -6351,7 +6375,7 @@ msgstr "" ">>> b'Hello World'.swapcase()\n" "b'hELLO wORLD'" -#: ../../library/stdtypes.rst:4237 +#: ../../library/stdtypes.rst:4252 msgid "" "Unlike :func:`str.swapcase`, it is always the case that ``bin.swapcase()." "swapcase() == bin`` for the binary versions. Case conversions are " @@ -6359,14 +6383,14 @@ msgid "" "Unicode code points." msgstr "" -#: ../../library/stdtypes.rst:4251 +#: ../../library/stdtypes.rst:4266 msgid "" "Return a titlecased version of the binary sequence where words start with an " "uppercase ASCII character and the remaining characters are lowercase. " "Uncased byte values are left unmodified." msgstr "" -#: ../../library/stdtypes.rst:4257 +#: ../../library/stdtypes.rst:4272 msgid "" ">>> b'Hello world'.title()\n" "b'Hello World'" @@ -6374,7 +6398,7 @@ msgstr "" ">>> b'Hello world'.title()\n" "b'Hello World'" -#: ../../library/stdtypes.rst:4260 +#: ../../library/stdtypes.rst:4275 msgid "" "Lowercase ASCII characters are those byte values in the sequence " "``b'abcdefghijklmnopqrstuvwxyz'``. Uppercase ASCII characters are those byte " @@ -6382,7 +6406,7 @@ msgid "" "values are uncased." msgstr "" -#: ../../library/stdtypes.rst:4270 +#: ../../library/stdtypes.rst:4285 msgid "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" @@ -6390,12 +6414,12 @@ msgstr "" ">>> b\"they're bill's friends from the UK\".title()\n" "b\"They'Re Bill'S Friends From The Uk\"" -#: ../../library/stdtypes.rst:4273 +#: ../../library/stdtypes.rst:4288 msgid "" "A workaround for apostrophes can be constructed using regular expressions::" msgstr "" -#: ../../library/stdtypes.rst:4275 +#: ../../library/stdtypes.rst:4290 msgid "" ">>> import re\n" ">>> def titlecase(s):\n" @@ -6417,13 +6441,13 @@ msgstr "" ">>> titlecase(b\"they're bill's friends.\")\n" "b\"They're Bill's Friends.\"" -#: ../../library/stdtypes.rst:4294 +#: ../../library/stdtypes.rst:4309 msgid "" "Return a copy of the sequence with all the lowercase ASCII characters " "converted to their corresponding uppercase counterpart." msgstr "" -#: ../../library/stdtypes.rst:4299 +#: ../../library/stdtypes.rst:4314 msgid "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" @@ -6431,7 +6455,7 @@ msgstr "" ">>> b'Hello World'.upper()\n" "b'HELLO WORLD'" -#: ../../library/stdtypes.rst:4315 +#: ../../library/stdtypes.rst:4330 msgid "" "Return a copy of the sequence left filled with ASCII ``b'0'`` digits to make " "a sequence of length *width*. A leading sign prefix (``b'+'``/ ``b'-'``) is " @@ -6440,7 +6464,7 @@ msgid "" "*width* is less than or equal to ``len(seq)``." msgstr "" -#: ../../library/stdtypes.rst:4323 +#: ../../library/stdtypes.rst:4338 msgid "" ">>> b\"42\".zfill(5)\n" "b'00042'\n" @@ -6452,11 +6476,11 @@ msgstr "" ">>> b\"-42\".zfill(5)\n" "b'-0042'" -#: ../../library/stdtypes.rst:4337 +#: ../../library/stdtypes.rst:4352 msgid "``printf``-style Bytes Formatting" msgstr "" -#: ../../library/stdtypes.rst:4354 +#: ../../library/stdtypes.rst:4369 msgid "" "The formatting operations described here exhibit a variety of quirks that " "lead to a number of common errors (such as failing to display tuples and " @@ -6464,7 +6488,7 @@ msgid "" "dictionary, wrap it in a tuple." msgstr "" -#: ../../library/stdtypes.rst:4359 +#: ../../library/stdtypes.rst:4374 msgid "" "Bytes objects (``bytes``/``bytearray``) have one unique built-in operation: " "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " @@ -6474,7 +6498,7 @@ msgid "" "func:`sprintf` in the C language." msgstr "" -#: ../../library/stdtypes.rst:4366 +#: ../../library/stdtypes.rst:4381 msgid "" "If *format* requires a single argument, *values* may be a single non-tuple " "object. [5]_ Otherwise, *values* must be a tuple with exactly the number of " @@ -6482,7 +6506,7 @@ msgid "" "example, a dictionary)." msgstr "" -#: ../../library/stdtypes.rst:4400 +#: ../../library/stdtypes.rst:4415 msgid "" "When the right argument is a dictionary (or other mapping type), then the " "formats in the bytes object *must* include a parenthesised mapping key into " @@ -6490,77 +6514,77 @@ msgid "" "mapping key selects the value to be formatted from the mapping. For example:" msgstr "" -#: ../../library/stdtypes.rst:4452 +#: ../../library/stdtypes.rst:4467 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/stdtypes.rst:4474 +#: ../../library/stdtypes.rst:4489 msgid "Single byte (accepts integer or single byte objects)." msgstr "" -#: ../../library/stdtypes.rst:4477 +#: ../../library/stdtypes.rst:4492 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/stdtypes.rst:4477 +#: ../../library/stdtypes.rst:4492 msgid "" "Bytes (any object that follows the :ref:`buffer protocol ` or " "has :meth:`~object.__bytes__`)." msgstr "" -#: ../../library/stdtypes.rst:4481 +#: ../../library/stdtypes.rst:4496 msgid "" "``'s'`` is an alias for ``'b'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:4484 +#: ../../library/stdtypes.rst:4499 msgid "" "Bytes (converts any Python object using ``repr(obj).encode('ascii', " "'backslashreplace')``)." msgstr "" -#: ../../library/stdtypes.rst:4487 +#: ../../library/stdtypes.rst:4502 msgid "" "``'r'`` is an alias for ``'a'`` and should only be used for Python2/3 code " "bases." msgstr "" -#: ../../library/stdtypes.rst:4487 +#: ../../library/stdtypes.rst:4502 msgid "\\(7)" msgstr "\\(7)" -#: ../../library/stdtypes.rst:4522 +#: ../../library/stdtypes.rst:4537 msgid "``b'%s'`` is deprecated, but will not be removed during the 3.x series." msgstr "``b'%s'`` 已被棄用,但在 3.x 系列中不會被移除。" -#: ../../library/stdtypes.rst:4525 +#: ../../library/stdtypes.rst:4540 msgid "``b'%r'`` is deprecated, but will not be removed during the 3.x series." msgstr "``b'%r'`` 已被棄用,但在 3.x 系列中不會被移除。" -#: ../../library/stdtypes.rst:4537 +#: ../../library/stdtypes.rst:4552 msgid ":pep:`461` - Adding % formatting to bytes and bytearray" msgstr "" -#: ../../library/stdtypes.rst:4544 +#: ../../library/stdtypes.rst:4559 msgid "Memory Views" msgstr "" -#: ../../library/stdtypes.rst:4546 +#: ../../library/stdtypes.rst:4561 msgid "" ":class:`memoryview` objects allow Python code to access the internal data of " "an object that supports the :ref:`buffer protocol ` without " "copying." msgstr "" -#: ../../library/stdtypes.rst:4552 +#: ../../library/stdtypes.rst:4567 msgid "" "Create a :class:`memoryview` that references *object*. *object* must " "support the buffer protocol. Built-in objects that support the buffer " "protocol include :class:`bytes` and :class:`bytearray`." msgstr "" -#: ../../library/stdtypes.rst:4556 +#: ../../library/stdtypes.rst:4571 msgid "" "A :class:`memoryview` has the notion of an *element*, which is the atomic " "memory unit handled by the originating *object*. For many simple types such " @@ -6568,38 +6592,38 @@ msgid "" "other types such as :class:`array.array` may have bigger elements." msgstr "" -#: ../../library/stdtypes.rst:4561 +#: ../../library/stdtypes.rst:4576 msgid "" ":class:`!memoryview`\\s are :ref:`generic ` over the type of their " "underlying data." msgstr "" -#: ../../library/stdtypes.rst:4564 +#: ../../library/stdtypes.rst:4579 msgid "" "``len(view)`` is equal to the length of :class:`~memoryview.tolist`, which " "is the nested list representation of the view. If ``view.ndim = 1``, this is " "equal to the number of elements in the view." msgstr "" -#: ../../library/stdtypes.rst:4568 +#: ../../library/stdtypes.rst:4583 msgid "" "If ``view.ndim == 0``, ``len(view)`` now raises :exc:`TypeError` instead of " "returning 1." msgstr "" -#: ../../library/stdtypes.rst:4571 +#: ../../library/stdtypes.rst:4586 msgid "" "The :class:`~memoryview.itemsize` attribute will give you the number of " "bytes in a single element." msgstr "" -#: ../../library/stdtypes.rst:4574 +#: ../../library/stdtypes.rst:4589 msgid "" "A :class:`memoryview` supports slicing and indexing to expose its data. One-" "dimensional slicing will result in a subview::" msgstr "" -#: ../../library/stdtypes.rst:4577 +#: ../../library/stdtypes.rst:4592 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> v[1]\n" @@ -6621,7 +6645,7 @@ msgstr "" ">>> bytes(v[1:4])\n" "b'bce'" -#: ../../library/stdtypes.rst:4587 +#: ../../library/stdtypes.rst:4602 msgid "" "If :class:`~memoryview.format` is one of the native format specifiers from " "the :mod:`struct` module, indexing with an integer or a tuple of integers is " @@ -6632,11 +6656,11 @@ msgid "" "memoryviews can be indexed with the empty tuple." msgstr "" -#: ../../library/stdtypes.rst:4596 +#: ../../library/stdtypes.rst:4611 msgid "Here is an example with a non-byte format::" msgstr "" -#: ../../library/stdtypes.rst:4598 +#: ../../library/stdtypes.rst:4613 msgid "" ">>> import array\n" ">>> a = array.array('l', [-11111111, 22222222, -33333333, 44444444])\n" @@ -6658,13 +6682,13 @@ msgstr "" ">>> m[::2].tolist()\n" "[-11111111, -33333333]" -#: ../../library/stdtypes.rst:4608 +#: ../../library/stdtypes.rst:4623 msgid "" "If the underlying object is writable, the memoryview supports one-" "dimensional slice assignment. Resizing is not allowed::" msgstr "" -#: ../../library/stdtypes.rst:4611 +#: ../../library/stdtypes.rst:4626 msgid "" ">>> data = bytearray(b'abcefg')\n" ">>> v = memoryview(data)\n" @@ -6704,14 +6728,14 @@ msgstr "" ">>> data\n" "bytearray(b'z1spam')" -#: ../../library/stdtypes.rst:4629 +#: ../../library/stdtypes.rst:4644 msgid "" "One-dimensional memoryviews of :term:`hashable` (read-only) types with " "formats 'B', 'b' or 'c' are also hashable. The hash is defined as ``hash(m) " "== hash(m.tobytes())``::" msgstr "" -#: ../../library/stdtypes.rst:4633 +#: ../../library/stdtypes.rst:4648 msgid "" ">>> v = memoryview(b'abcefg')\n" ">>> hash(v) == hash(b'abcefg')\n" @@ -6729,44 +6753,44 @@ msgstr "" ">>> hash(v[::-2]) == hash(b'abcefg'[::-2])\n" "True" -#: ../../library/stdtypes.rst:4641 +#: ../../library/stdtypes.rst:4656 msgid "" "One-dimensional memoryviews can now be sliced. One-dimensional memoryviews " "with formats 'B', 'b' or 'c' are now :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:4645 +#: ../../library/stdtypes.rst:4660 msgid "" "memoryview is now registered automatically with :class:`collections.abc." "Sequence`" msgstr "" -#: ../../library/stdtypes.rst:4649 +#: ../../library/stdtypes.rst:4664 msgid "memoryviews can now be indexed with tuple of integers." msgstr "" -#: ../../library/stdtypes.rst:4652 +#: ../../library/stdtypes.rst:4667 msgid "memoryview is now a :term:`generic type`." msgstr "" -#: ../../library/stdtypes.rst:4655 +#: ../../library/stdtypes.rst:4670 msgid ":class:`memoryview` has several methods:" msgstr ":class:`memoryview` 有幾個方法:" -#: ../../library/stdtypes.rst:4659 +#: ../../library/stdtypes.rst:4674 msgid "" "A memoryview and a :pep:`3118` exporter are equal if their shapes are " "equivalent and if all corresponding values are equal when the operands' " "respective format codes are interpreted using :mod:`struct` syntax." msgstr "" -#: ../../library/stdtypes.rst:4663 +#: ../../library/stdtypes.rst:4678 msgid "" "For the subset of :mod:`struct` format strings currently supported by :meth:" "`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == w.tolist()``::" msgstr "" -#: ../../library/stdtypes.rst:4666 +#: ../../library/stdtypes.rst:4681 msgid "" ">>> import array\n" ">>> a = array.array('I', [1, 2, 3, 4, 5])\n" @@ -6800,14 +6824,14 @@ msgstr "" ">>> z.tolist() == c.tolist()\n" "True" -#: ../../library/stdtypes.rst:4682 +#: ../../library/stdtypes.rst:4697 msgid "" "If either format string is not supported by the :mod:`struct` module, then " "the objects will always compare as unequal (even if the format strings and " "buffer contents are identical)::" msgstr "" -#: ../../library/stdtypes.rst:4686 +#: ../../library/stdtypes.rst:4701 msgid "" ">>> from ctypes import BigEndianStructure, c_long\n" ">>> class BEPoint(BigEndianStructure):\n" @@ -6833,25 +6857,25 @@ msgstr "" ">>> a == b\n" "False" -#: ../../library/stdtypes.rst:4698 +#: ../../library/stdtypes.rst:4713 msgid "" "Note that, as with floating-point numbers, ``v is w`` does *not* imply ``v " "== w`` for memoryview objects." msgstr "" -#: ../../library/stdtypes.rst:4701 +#: ../../library/stdtypes.rst:4716 msgid "" "Previous versions compared the raw memory disregarding the item format and " "the logical array structure." msgstr "" -#: ../../library/stdtypes.rst:4707 +#: ../../library/stdtypes.rst:4722 msgid "" "Return the data in the buffer as a bytestring. This is equivalent to " "calling the :class:`bytes` constructor on the memoryview. ::" msgstr "" -#: ../../library/stdtypes.rst:4710 +#: ../../library/stdtypes.rst:4725 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.tobytes()\n" @@ -6865,7 +6889,7 @@ msgstr "" ">>> bytes(m)\n" "b'abc'" -#: ../../library/stdtypes.rst:4716 +#: ../../library/stdtypes.rst:4731 msgid "" "For non-contiguous arrays the result is equal to the flattened list " "representation with all elements converted to bytes. :meth:`tobytes` " @@ -6873,7 +6897,7 @@ msgid "" "module syntax." msgstr "" -#: ../../library/stdtypes.rst:4721 +#: ../../library/stdtypes.rst:4736 msgid "" "*order* can be {'C', 'F', 'A'}. When *order* is 'C' or 'F', the data of the " "original array is converted to C or Fortran order. For contiguous views, 'A' " @@ -6882,13 +6906,13 @@ msgid "" "to C first. *order=None* is the same as *order='C'*." msgstr "" -#: ../../library/stdtypes.rst:4731 +#: ../../library/stdtypes.rst:4746 msgid "" "Return a string object containing two hexadecimal digits for each byte in " "the buffer. ::" msgstr "" -#: ../../library/stdtypes.rst:4734 +#: ../../library/stdtypes.rst:4749 msgid "" ">>> m = memoryview(b\"abc\")\n" ">>> m.hex()\n" @@ -6898,18 +6922,18 @@ msgstr "" ">>> m.hex()\n" "'616263'" -#: ../../library/stdtypes.rst:4740 +#: ../../library/stdtypes.rst:4755 msgid "" "Similar to :meth:`bytes.hex`, :meth:`memoryview.hex` now supports optional " "*sep* and *bytes_per_sep* parameters to insert separators between bytes in " "the hex output." msgstr "" -#: ../../library/stdtypes.rst:4747 +#: ../../library/stdtypes.rst:4762 msgid "Return the data in the buffer as a list of elements. ::" msgstr "" -#: ../../library/stdtypes.rst:4749 +#: ../../library/stdtypes.rst:4764 msgid "" ">>> memoryview(b'abc').tolist()\n" "[97, 98, 99]\n" @@ -6927,19 +6951,19 @@ msgstr "" ">>> m.tolist()\n" "[1.1, 2.2, 3.3]" -#: ../../library/stdtypes.rst:4757 +#: ../../library/stdtypes.rst:4772 msgid "" ":meth:`tolist` now supports all single character native formats in :mod:" "`struct` module syntax as well as multi-dimensional representations." msgstr "" -#: ../../library/stdtypes.rst:4764 +#: ../../library/stdtypes.rst:4779 msgid "" "Return a readonly version of the memoryview object. The original memoryview " "object is unchanged. ::" msgstr "" -#: ../../library/stdtypes.rst:4767 +#: ../../library/stdtypes.rst:4782 msgid "" ">>> m = memoryview(bytearray(b'abc'))\n" ">>> mm = m.toreadonly()\n" @@ -6965,7 +6989,7 @@ msgstr "" ">>> mm.tolist()\n" "[43, 98, 99]" -#: ../../library/stdtypes.rst:4783 +#: ../../library/stdtypes.rst:4798 msgid "" "Release the underlying buffer exposed by the memoryview object. Many " "objects take special actions when a view is held on them (for example, a :" @@ -6974,14 +6998,14 @@ msgid "" "resources) as soon as possible." msgstr "" -#: ../../library/stdtypes.rst:4789 +#: ../../library/stdtypes.rst:4804 msgid "" "After this method has been called, any further operation on the view raises " "a :class:`ValueError` (except :meth:`release` itself which can be called " "multiple times)::" msgstr "" -#: ../../library/stdtypes.rst:4793 +#: ../../library/stdtypes.rst:4808 msgid "" ">>> m = memoryview(b'abc')\n" ">>> m.release()\n" @@ -6997,13 +7021,13 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" -#: ../../library/stdtypes.rst:4800 +#: ../../library/stdtypes.rst:4815 msgid "" "The context management protocol can be used for a similar effect, using the " "``with`` statement::" msgstr "" -#: ../../library/stdtypes.rst:4803 +#: ../../library/stdtypes.rst:4818 msgid "" ">>> with memoryview(b'abc') as m:\n" "... m[0]\n" @@ -7023,7 +7047,7 @@ msgstr "" " File \"\", line 1, in \n" "ValueError: operation forbidden on released memoryview object" -#: ../../library/stdtypes.rst:4817 +#: ../../library/stdtypes.rst:4832 msgid "" "Cast a memoryview to a new format or shape. *shape* defaults to " "``[byte_length//new_itemsize]``, which means that the result view will be " @@ -7032,7 +7056,7 @@ msgid "" "contiguous -> 1D." msgstr "" -#: ../../library/stdtypes.rst:4823 +#: ../../library/stdtypes.rst:4838 msgid "" "The destination format is restricted to a single element native format in :" "mod:`struct` syntax. One of the formats must be a byte format ('B', 'b' or " @@ -7040,11 +7064,11 @@ msgid "" "Note that all byte lengths may depend on the operating system." msgstr "" -#: ../../library/stdtypes.rst:4829 +#: ../../library/stdtypes.rst:4844 msgid "Cast 1D/long to 1D/unsigned bytes::" msgstr "" -#: ../../library/stdtypes.rst:4831 +#: ../../library/stdtypes.rst:4846 msgid "" ">>> import array\n" ">>> a = array.array('l', [1,2,3])\n" @@ -7088,11 +7112,11 @@ msgstr "" ">>> y.nbytes\n" "24" -#: ../../library/stdtypes.rst:4852 +#: ../../library/stdtypes.rst:4867 msgid "Cast 1D/unsigned bytes to 1D/char::" msgstr "" -#: ../../library/stdtypes.rst:4854 +#: ../../library/stdtypes.rst:4869 msgid "" ">>> b = bytearray(b'zyz')\n" ">>> x = memoryview(b)\n" @@ -7116,11 +7140,11 @@ msgstr "" ">>> b\n" "bytearray(b'ayz')" -#: ../../library/stdtypes.rst:4865 +#: ../../library/stdtypes.rst:4880 msgid "Cast 1D/bytes to 3D/ints to 1D/signed char::" msgstr "" -#: ../../library/stdtypes.rst:4867 +#: ../../library/stdtypes.rst:4882 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"i\"*12, *list(range(12)))\n" @@ -7170,11 +7194,11 @@ msgstr "" ">>> z.nbytes\n" "48" -#: ../../library/stdtypes.rst:4891 +#: ../../library/stdtypes.rst:4906 msgid "Cast 1D/unsigned long to 2D/unsigned long::" msgstr "" -#: ../../library/stdtypes.rst:4893 +#: ../../library/stdtypes.rst:4908 msgid "" ">>> buf = struct.pack(\"L\"*6, *list(range(6)))\n" ">>> x = memoryview(buf)\n" @@ -7196,33 +7220,33 @@ msgstr "" ">>> y.tolist()\n" "[[0, 1, 2], [3, 4, 5]]" -#: ../../library/stdtypes.rst:4905 +#: ../../library/stdtypes.rst:4920 msgid "The source format is no longer restricted when casting to a byte view." msgstr "" -#: ../../library/stdtypes.rst:4910 +#: ../../library/stdtypes.rst:4925 msgid "Count the number of occurrences of *value*." msgstr "計算 *value* 的出現次數" -#: ../../library/stdtypes.rst:4916 +#: ../../library/stdtypes.rst:4931 msgid "" "Return the index of the first occurrence of *value* (at or after index " "*start* and before index *stop*)." msgstr "" -#: ../../library/stdtypes.rst:4919 +#: ../../library/stdtypes.rst:4934 msgid "Raises a :exc:`ValueError` if *value* cannot be found." msgstr "在找不到 *value* 時引發 :exc:`ValueError`。" -#: ../../library/stdtypes.rst:4923 +#: ../../library/stdtypes.rst:4938 msgid "There are also several readonly attributes available:" msgstr "" -#: ../../library/stdtypes.rst:4927 +#: ../../library/stdtypes.rst:4942 msgid "The underlying object of the memoryview::" msgstr "memoryview 的底層物件: ::" -#: ../../library/stdtypes.rst:4929 +#: ../../library/stdtypes.rst:4944 msgid "" ">>> b = bytearray(b'xyz')\n" ">>> m = memoryview(b)\n" @@ -7234,14 +7258,14 @@ msgstr "" ">>> m.obj is b\n" "True" -#: ../../library/stdtypes.rst:4938 +#: ../../library/stdtypes.rst:4953 msgid "" "``nbytes == product(shape) * itemsize == len(m.tobytes())``. This is the " "amount of space in bytes that the array would use in a contiguous " "representation. It is not necessarily equal to ``len(m)``::" msgstr "" -#: ../../library/stdtypes.rst:4942 +#: ../../library/stdtypes.rst:4957 msgid "" ">>> import array\n" ">>> a = array.array('i', [1,2,3,4,5])\n" @@ -7273,11 +7297,11 @@ msgstr "" ">>> len(y.tobytes())\n" "12" -#: ../../library/stdtypes.rst:4957 +#: ../../library/stdtypes.rst:4972 msgid "Multi-dimensional arrays::" msgstr "" -#: ../../library/stdtypes.rst:4959 +#: ../../library/stdtypes.rst:4974 msgid "" ">>> import struct\n" ">>> buf = struct.pack(\"d\"*12, *[1.5*x for x in range(12)])\n" @@ -7301,11 +7325,11 @@ msgstr "" ">>> y.nbytes\n" "96" -#: ../../library/stdtypes.rst:4974 +#: ../../library/stdtypes.rst:4989 msgid "A bool indicating whether the memory is read only." msgstr "" -#: ../../library/stdtypes.rst:4978 +#: ../../library/stdtypes.rst:4993 msgid "" "A string containing the format (in :mod:`struct` module style) for each " "element in the view. A memoryview can be created from exporters with " @@ -7313,17 +7337,17 @@ msgid "" "restricted to native single element formats." msgstr "" -#: ../../library/stdtypes.rst:4983 +#: ../../library/stdtypes.rst:4998 msgid "" "format ``'B'`` is now handled according to the struct module syntax. This " "means that ``memoryview(b'abc')[0] == b'abc'[0] == 97``." msgstr "" -#: ../../library/stdtypes.rst:4989 +#: ../../library/stdtypes.rst:5004 msgid "The size in bytes of each element of the memoryview::" msgstr "" -#: ../../library/stdtypes.rst:4991 +#: ../../library/stdtypes.rst:5006 msgid "" ">>> import array, struct\n" ">>> m = memoryview(array.array('H', [32000, 32001, 32002]))\n" @@ -7343,55 +7367,55 @@ msgstr "" ">>> struct.calcsize('H') == m.itemsize\n" "True" -#: ../../library/stdtypes.rst:5002 +#: ../../library/stdtypes.rst:5017 msgid "" "An integer indicating how many dimensions of a multi-dimensional array the " "memory represents." msgstr "" -#: ../../library/stdtypes.rst:5007 +#: ../../library/stdtypes.rst:5022 msgid "" "A tuple of integers the length of :attr:`ndim` giving the shape of the " "memory as an N-dimensional array." msgstr "" -#: ../../library/stdtypes.rst:5010 ../../library/stdtypes.rst:5018 +#: ../../library/stdtypes.rst:5025 ../../library/stdtypes.rst:5033 msgid "An empty tuple instead of ``None`` when ndim = 0." msgstr "" -#: ../../library/stdtypes.rst:5015 +#: ../../library/stdtypes.rst:5030 msgid "" "A tuple of integers the length of :attr:`ndim` giving the size in bytes to " "access each element for each dimension of the array." msgstr "" -#: ../../library/stdtypes.rst:5023 +#: ../../library/stdtypes.rst:5038 msgid "Used internally for PIL-style arrays. The value is informational only." msgstr "" -#: ../../library/stdtypes.rst:5027 +#: ../../library/stdtypes.rst:5042 msgid "A bool indicating whether the memory is C-:term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:5033 +#: ../../library/stdtypes.rst:5048 msgid "A bool indicating whether the memory is Fortran :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:5039 +#: ../../library/stdtypes.rst:5054 msgid "A bool indicating whether the memory is :term:`contiguous`." msgstr "" -#: ../../library/stdtypes.rst:5043 +#: ../../library/stdtypes.rst:5058 msgid "" "For information on the thread safety of :class:`memoryview` objects in the :" "term:`free-threaded build`, see :ref:`thread-safety-memoryview`." msgstr "" -#: ../../library/stdtypes.rst:5050 +#: ../../library/stdtypes.rst:5065 msgid "Set Types --- :class:`set`, :class:`frozenset`" msgstr "" -#: ../../library/stdtypes.rst:5054 +#: ../../library/stdtypes.rst:5069 msgid "" "A :dfn:`set` object is an unordered collection of distinct :term:`hashable` " "objects. Common uses include membership testing, removing duplicates from a " @@ -7401,7 +7425,7 @@ msgid "" "`collections` module.)" msgstr "" -#: ../../library/stdtypes.rst:5061 +#: ../../library/stdtypes.rst:5076 msgid "" "Like other collections, sets support ``x in set``, ``len(set)``, and ``for x " "in set``. Being an unordered collection, sets do not record element " @@ -7409,7 +7433,7 @@ msgid "" "slicing, or other sequence-like behavior." msgstr "" -#: ../../library/stdtypes.rst:5066 +#: ../../library/stdtypes.rst:5081 msgid "" "There are currently two built-in set types, :class:`set` and :class:" "`frozenset`. The :class:`set` type is mutable --- the contents can be " @@ -7421,18 +7445,18 @@ msgid "" "of another set." msgstr "" -#: ../../library/stdtypes.rst:5075 +#: ../../library/stdtypes.rst:5090 msgid "" "Non-empty sets (not frozensets) can be created by placing a comma-separated " "list of elements within braces, for example: ``{'jack', 'sjoerd'}``, in " "addition to the :class:`set` constructor." msgstr "" -#: ../../library/stdtypes.rst:5079 +#: ../../library/stdtypes.rst:5094 msgid "The constructors for both classes work the same:" msgstr "" -#: ../../library/stdtypes.rst:5084 +#: ../../library/stdtypes.rst:5099 msgid "" "Return a new set or frozenset object whose elements are taken from " "*iterable*. The elements of a set must be :term:`hashable`. To represent " @@ -7440,92 +7464,92 @@ msgid "" "*iterable* is not specified, a new empty set is returned." msgstr "" -#: ../../library/stdtypes.rst:5090 +#: ../../library/stdtypes.rst:5105 msgid "Sets can be created by several means:" msgstr "集合可以以多種方式建立:" -#: ../../library/stdtypes.rst:5092 +#: ../../library/stdtypes.rst:5107 msgid "" "Use a comma-separated list of elements within braces: ``{'jack', 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:5093 +#: ../../library/stdtypes.rst:5108 msgid "" "Use a set comprehension: ``{c for c in 'abracadabra' if c not in 'abc'}``" msgstr "" -#: ../../library/stdtypes.rst:5094 +#: ../../library/stdtypes.rst:5109 msgid "" "Use the type constructor: ``set()``, ``set('foobar')``, ``set(['a', 'b', " "'foo'])``" msgstr "" -#: ../../library/stdtypes.rst:5096 +#: ../../library/stdtypes.rst:5111 msgid "" "Instances of :class:`set` and :class:`frozenset` provide the following " "operations:" msgstr "" -#: ../../library/stdtypes.rst:5101 +#: ../../library/stdtypes.rst:5116 msgid "Return the number of elements in set *s* (cardinality of *s*)." msgstr "" -#: ../../library/stdtypes.rst:5105 +#: ../../library/stdtypes.rst:5120 msgid "Test *x* for membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:5109 +#: ../../library/stdtypes.rst:5124 msgid "Test *x* for non-membership in *s*." msgstr "" -#: ../../library/stdtypes.rst:5114 +#: ../../library/stdtypes.rst:5129 msgid "" "Return ``True`` if the set has no elements in common with *other*. Sets are " "disjoint if and only if their intersection is the empty set." msgstr "" -#: ../../library/stdtypes.rst:5121 +#: ../../library/stdtypes.rst:5136 msgid "Test whether every element in the set is in *other*." msgstr "" -#: ../../library/stdtypes.rst:5125 +#: ../../library/stdtypes.rst:5140 msgid "" "Test whether the set is a proper subset of *other*, that is, ``set <= other " "and set != other``." msgstr "" -#: ../../library/stdtypes.rst:5132 +#: ../../library/stdtypes.rst:5147 msgid "Test whether every element in *other* is in the set." msgstr "" -#: ../../library/stdtypes.rst:5136 +#: ../../library/stdtypes.rst:5151 msgid "" "Test whether the set is a proper superset of *other*, that is, ``set >= " "other and set != other``." msgstr "" -#: ../../library/stdtypes.rst:5143 +#: ../../library/stdtypes.rst:5158 msgid "Return a new set with elements from the set and all others." msgstr "" -#: ../../library/stdtypes.rst:5149 +#: ../../library/stdtypes.rst:5164 msgid "Return a new set with elements common to the set and all others." msgstr "" -#: ../../library/stdtypes.rst:5155 +#: ../../library/stdtypes.rst:5170 msgid "Return a new set with elements in the set that are not in the others." msgstr "" -#: ../../library/stdtypes.rst:5161 +#: ../../library/stdtypes.rst:5176 msgid "" "Return a new set with elements in either the set or *other* but not both." msgstr "" -#: ../../library/stdtypes.rst:5166 +#: ../../library/stdtypes.rst:5181 msgid "Return a shallow copy of the set." msgstr "" -#: ../../library/stdtypes.rst:5169 +#: ../../library/stdtypes.rst:5184 msgid "" "Note, the non-operator versions of :meth:`~frozenset.union`, :meth:" "`~frozenset.intersection`, :meth:`~frozenset.difference`, :meth:`~frozenset." @@ -7536,7 +7560,7 @@ msgid "" "the more readable ``set('abc').intersection('cbs')``." msgstr "" -#: ../../library/stdtypes.rst:5176 +#: ../../library/stdtypes.rst:5191 msgid "" "Both :class:`set` and :class:`frozenset` support set to set comparisons. Two " "sets are equal if and only if every element of each set is contained in the " @@ -7546,14 +7570,14 @@ msgid "" "set is a proper superset of the second set (is a superset, but is not equal)." msgstr "" -#: ../../library/stdtypes.rst:5183 +#: ../../library/stdtypes.rst:5198 msgid "" "Instances of :class:`set` are compared to instances of :class:`frozenset` " "based on their members. For example, ``set('abc') == frozenset('abc')`` " "returns ``True`` and so does ``set('abc') in set([frozenset('abc')])``." msgstr "" -#: ../../library/stdtypes.rst:5187 +#: ../../library/stdtypes.rst:5202 msgid "" "The subset and equality comparisons do not generalize to a total ordering " "function. For example, any two nonempty disjoint sets are not equal and are " @@ -7561,78 +7585,78 @@ msgid "" "``ab``." msgstr "" -#: ../../library/stdtypes.rst:5192 +#: ../../library/stdtypes.rst:5207 msgid "" "Since sets only define partial ordering (subset relationships), the output " "of the :meth:`list.sort` method is undefined for lists of sets." msgstr "" -#: ../../library/stdtypes.rst:5195 +#: ../../library/stdtypes.rst:5210 msgid "Set elements, like dictionary keys, must be :term:`hashable`." msgstr "" -#: ../../library/stdtypes.rst:5197 +#: ../../library/stdtypes.rst:5212 msgid "" "Binary operations that mix :class:`set` instances with :class:`frozenset` " "return the type of the first operand. For example: ``frozenset('ab') | " "set('bc')`` returns an instance of :class:`frozenset`." msgstr "" -#: ../../library/stdtypes.rst:5201 +#: ../../library/stdtypes.rst:5216 msgid "" "The following table lists operations available for :class:`set` that do not " "apply to immutable instances of :class:`frozenset`:" msgstr "" -#: ../../library/stdtypes.rst:5207 +#: ../../library/stdtypes.rst:5222 msgid "Update the set, adding elements from all others." msgstr "" -#: ../../library/stdtypes.rst:5212 +#: ../../library/stdtypes.rst:5227 msgid "Update the set, keeping only elements found in it and all others." msgstr "" -#: ../../library/stdtypes.rst:5217 +#: ../../library/stdtypes.rst:5232 msgid "Update the set, removing elements found in others." msgstr "" -#: ../../library/stdtypes.rst:5222 +#: ../../library/stdtypes.rst:5237 msgid "" "Update the set, keeping only elements found in either set, but not in both." msgstr "" -#: ../../library/stdtypes.rst:5226 +#: ../../library/stdtypes.rst:5241 msgid "Add element *elem* to the set." msgstr "將元素 *elem* 加入集合。" -#: ../../library/stdtypes.rst:5230 +#: ../../library/stdtypes.rst:5245 msgid "" "Remove element *elem* from the set. Raises :exc:`KeyError` if *elem* is not " "contained in the set." msgstr "" -#: ../../library/stdtypes.rst:5235 +#: ../../library/stdtypes.rst:5250 msgid "Remove element *elem* from the set if it is present." msgstr "如果 *elem* 存在於集合中則將其移除。" -#: ../../library/stdtypes.rst:5239 +#: ../../library/stdtypes.rst:5254 msgid "" "Remove and return an arbitrary element from the set. Raises :exc:`KeyError` " "if the set is empty." msgstr "" -#: ../../library/stdtypes.rst:5244 +#: ../../library/stdtypes.rst:5259 msgid "Remove all elements from the set." msgstr "從集合中移除所有元素。" -#: ../../library/stdtypes.rst:5247 +#: ../../library/stdtypes.rst:5262 msgid "" "Note, the non-operator versions of the :meth:`~set.update`, :meth:`~set." "intersection_update`, :meth:`~set.difference_update`, and :meth:`~set." "symmetric_difference_update` methods will accept any iterable as an argument." msgstr "" -#: ../../library/stdtypes.rst:5252 +#: ../../library/stdtypes.rst:5267 msgid "" "Note, the *elem* argument to the :meth:`~object.__contains__`, :meth:`~set." "remove`, and :meth:`~set.discard` methods may be a set. To support " @@ -7640,23 +7664,23 @@ msgid "" "*elem*." msgstr "" -#: ../../library/stdtypes.rst:5259 +#: ../../library/stdtypes.rst:5274 msgid "" "For detailed information on thread-safety guarantees for :class:`set` " "objects, see :ref:`thread-safety-set`." msgstr "" -#: ../../library/stdtypes.rst:5262 +#: ../../library/stdtypes.rst:5277 msgid "" "Sets and frozensets are :ref:`generic ` over the type of their " "elements." msgstr "" -#: ../../library/stdtypes.rst:5268 +#: ../../library/stdtypes.rst:5283 msgid "Mapping Types --- :class:`dict`" msgstr "" -#: ../../library/stdtypes.rst:5278 +#: ../../library/stdtypes.rst:5293 msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " @@ -7665,7 +7689,7 @@ msgid "" "module.)" msgstr "" -#: ../../library/stdtypes.rst:5284 +#: ../../library/stdtypes.rst:5299 msgid "" "A dictionary's keys are *almost* arbitrary values. Values that are not :" "term:`hashable`, that is, values containing lists, dictionaries or other " @@ -7674,33 +7698,33 @@ msgid "" "and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" -#: ../../library/stdtypes.rst:5295 +#: ../../library/stdtypes.rst:5310 msgid "" "Return a new dictionary initialized from an optional positional argument and " "a possibly empty set of keyword arguments." msgstr "" -#: ../../library/stdtypes.rst:5298 +#: ../../library/stdtypes.rst:5313 msgid "Dictionaries can be created by several means:" msgstr "字典可以用數種方式建立:" -#: ../../library/stdtypes.rst:5300 +#: ../../library/stdtypes.rst:5315 msgid "" "Use a comma-separated list of ``key: value`` pairs within braces: ``{'jack': " "4098, 'sjoerd': 4127}`` or ``{4098: 'jack', 4127: 'sjoerd'}``" msgstr "" -#: ../../library/stdtypes.rst:5302 +#: ../../library/stdtypes.rst:5317 msgid "Use a dict comprehension: ``{}``, ``{x: x ** 2 for x in range(10)}``" msgstr "" -#: ../../library/stdtypes.rst:5303 +#: ../../library/stdtypes.rst:5318 msgid "" "Use the type constructor: ``dict()``, ``dict([('foo', 100), ('bar', " "200)])``, ``dict(foo=100, bar=200)``" msgstr "" -#: ../../library/stdtypes.rst:5306 +#: ../../library/stdtypes.rst:5321 msgid "" "If no positional argument is given, an empty dictionary is created. If a " "positional argument is given and it defines a ``keys()`` method, a " @@ -7713,7 +7737,7 @@ msgid "" "that key becomes the corresponding value in the new dictionary." msgstr "" -#: ../../library/stdtypes.rst:5316 +#: ../../library/stdtypes.rst:5331 msgid "" "If keyword arguments are given, the keyword arguments and their values are " "added to the dictionary created from the positional argument. If a key " @@ -7721,7 +7745,7 @@ msgid "" "the value from the positional argument." msgstr "" -#: ../../library/stdtypes.rst:5321 +#: ../../library/stdtypes.rst:5336 msgid "" "Dictionaries compare equal if and only if they have the same ``(key, " "value)`` pairs (regardless of ordering). Order comparisons ('<', '<=', '>=', " @@ -7730,7 +7754,7 @@ msgid "" "``{\"one\": 1, \"two\": 2, \"three\": 3}``::" msgstr "" -#: ../../library/stdtypes.rst:5327 +#: ../../library/stdtypes.rst:5342 msgid "" ">>> a = dict(one=1, two=2, three=3)\n" ">>> b = {'one': 1, 'two': 2, 'three': 3}\n" @@ -7750,19 +7774,19 @@ msgstr "" ">>> a == b == c == d == e == f\n" "True" -#: ../../library/stdtypes.rst:5336 +#: ../../library/stdtypes.rst:5351 msgid "" "Providing keyword arguments as in the first example only works for keys that " "are valid Python identifiers. Otherwise, any valid keys can be used." msgstr "" -#: ../../library/stdtypes.rst:5339 +#: ../../library/stdtypes.rst:5354 msgid "" "Dictionaries preserve insertion order. Note that updating a key does not " "affect the order. Keys added after deletion are inserted at the end. ::" msgstr "" -#: ../../library/stdtypes.rst:5342 +#: ../../library/stdtypes.rst:5357 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -7794,39 +7818,39 @@ msgstr "" ">>> d\n" "{'one': 42, 'three': 3, 'four': 4, 'two': None}" -#: ../../library/stdtypes.rst:5357 +#: ../../library/stdtypes.rst:5372 msgid "" "Dictionary order is guaranteed to be insertion order. This behavior was an " "implementation detail of CPython from 3.6." msgstr "" -#: ../../library/stdtypes.rst:5361 +#: ../../library/stdtypes.rst:5376 msgid "" "Dictionaries are :ref:`generic ` over two types, signifying " "(respectively) the types of the dictionary's keys and values." msgstr "" -#: ../../library/stdtypes.rst:5364 +#: ../../library/stdtypes.rst:5379 msgid "" "These are the operations that dictionaries support (and therefore, custom " "mapping types should support too):" msgstr "" -#: ../../library/stdtypes.rst:5369 +#: ../../library/stdtypes.rst:5384 msgid "Return a list of all the keys used in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:5373 +#: ../../library/stdtypes.rst:5388 msgid "Return the number of items in the dictionary *d*." msgstr "" -#: ../../library/stdtypes.rst:5377 +#: ../../library/stdtypes.rst:5392 msgid "" "Return the item of *d* with key *key*. Raises a :exc:`KeyError` if *key* is " "not in the map." msgstr "" -#: ../../library/stdtypes.rst:5382 +#: ../../library/stdtypes.rst:5397 msgid "" "If a subclass of dict defines a method :meth:`~object.__missing__` and *key* " "is not present, the ``d[key]`` operation calls that method with the key " @@ -7837,7 +7861,7 @@ msgid "" "__missing__` must be a method; it cannot be an instance variable::" msgstr "" -#: ../../library/stdtypes.rst:5390 +#: ../../library/stdtypes.rst:5405 msgid "" ">>> class Counter(dict):\n" "... def __missing__(self, key):\n" @@ -7861,51 +7885,51 @@ msgstr "" ">>> c['red']\n" "1" -#: ../../library/stdtypes.rst:5401 +#: ../../library/stdtypes.rst:5416 msgid "" "The example above shows part of the implementation of :class:`collections." "Counter`. A different :meth:`!__missing__` method is used by :class:" "`collections.defaultdict`." msgstr "" -#: ../../library/stdtypes.rst:5408 +#: ../../library/stdtypes.rst:5423 msgid "Set ``d[key]`` to *value*." msgstr "將 ``d[key]`` 設為 *value*。" -#: ../../library/stdtypes.rst:5412 +#: ../../library/stdtypes.rst:5427 msgid "" "Remove ``d[key]`` from *d*. Raises a :exc:`KeyError` if *key* is not in the " "map." msgstr "從 *d* 中移除 ``d[key]``。若 *key* 不在對映中則引發 :exc:`KeyError`。" -#: ../../library/stdtypes.rst:5417 +#: ../../library/stdtypes.rst:5432 msgid "Return ``True`` if *d* has a key *key*, else ``False``." msgstr "若 *d* 有鍵 *key* 則回傳 ``True``,否則回傳 ``False``。" -#: ../../library/stdtypes.rst:5421 +#: ../../library/stdtypes.rst:5436 msgid "Equivalent to ``not key in d``." msgstr "等價於 ``not key in d``。" -#: ../../library/stdtypes.rst:5425 +#: ../../library/stdtypes.rst:5440 msgid "" "Return an iterator over the keys of the dictionary. This is a shortcut for " "``iter(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:5430 +#: ../../library/stdtypes.rst:5445 msgid "Remove all items from the dictionary." msgstr "從字典中移除所有項目。" -#: ../../library/stdtypes.rst:5434 +#: ../../library/stdtypes.rst:5449 msgid "Return a shallow copy of the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5438 +#: ../../library/stdtypes.rst:5453 msgid "" "Create a new dictionary with keys from *iterable* and values set to *value*." msgstr "" -#: ../../library/stdtypes.rst:5440 +#: ../../library/stdtypes.rst:5455 msgid "" ":meth:`fromkeys` is a class method that returns a new dictionary. *value* " "defaults to ``None``. All of the values refer to just a single instance, so " @@ -7914,70 +7938,70 @@ msgid "" "` instead." msgstr "" -#: ../../library/stdtypes.rst:5448 +#: ../../library/stdtypes.rst:5463 msgid "" "Return the value for *key* if *key* is in the dictionary, else *default*. If " "*default* is not given, it defaults to ``None``, so that this method never " "raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:5454 +#: ../../library/stdtypes.rst:5469 msgid "" "Return a new view of the dictionary's items (``(key, value)`` pairs). See " "the :ref:`documentation of view objects `." msgstr "" -#: ../../library/stdtypes.rst:5459 +#: ../../library/stdtypes.rst:5474 msgid "" "Return a new view of the dictionary's keys. See the :ref:`documentation of " "view objects `." msgstr "" -#: ../../library/stdtypes.rst:5465 +#: ../../library/stdtypes.rst:5480 msgid "" "If *key* is in the dictionary, remove it and return its value, else return " "*default*. If *default* is not given and *key* is not in the dictionary, a :" "exc:`KeyError` is raised." msgstr "" -#: ../../library/stdtypes.rst:5471 +#: ../../library/stdtypes.rst:5486 msgid "" "Remove and return a ``(key, value)`` pair from the dictionary. Pairs are " "returned in :abbr:`LIFO (last-in, first-out)` order." msgstr "" -#: ../../library/stdtypes.rst:5474 +#: ../../library/stdtypes.rst:5489 msgid "" ":meth:`popitem` is useful to destructively iterate over a dictionary, as " "often used in set algorithms. If the dictionary is empty, calling :meth:" "`popitem` raises a :exc:`KeyError`." msgstr "" -#: ../../library/stdtypes.rst:5478 +#: ../../library/stdtypes.rst:5493 msgid "" "LIFO order is now guaranteed. In prior versions, :meth:`popitem` would " "return an arbitrary key/value pair." msgstr "" -#: ../../library/stdtypes.rst:5484 +#: ../../library/stdtypes.rst:5499 msgid "" "Return a reverse iterator over the keys of the dictionary. This is a " "shortcut for ``reversed(d.keys())``." msgstr "" -#: ../../library/stdtypes.rst:5491 +#: ../../library/stdtypes.rst:5506 msgid "" "If *key* is in the dictionary, return its value. If not, insert *key* with " "a value of *default* and return *default*. *default* defaults to ``None``." msgstr "" -#: ../../library/stdtypes.rst:5499 +#: ../../library/stdtypes.rst:5514 msgid "" "Update the dictionary with the key/value pairs from *mapping* or *iterable* " "and *kwargs*, overwriting existing keys. Return ``None``." msgstr "" -#: ../../library/stdtypes.rst:5502 +#: ../../library/stdtypes.rst:5517 msgid "" ":meth:`update` accepts either another object with a ``keys()`` method (in " "which case :meth:`~object.__getitem__` is called with every key returned " @@ -7986,20 +8010,20 @@ msgid "" "is then updated with those key/value pairs: ``d.update(red=1, blue=2)``." msgstr "" -#: ../../library/stdtypes.rst:5510 +#: ../../library/stdtypes.rst:5525 msgid "" "Return a new view of the dictionary's values. See the :ref:`documentation " "of view objects `." msgstr "" -#: ../../library/stdtypes.rst:5513 +#: ../../library/stdtypes.rst:5528 msgid "" "An equality comparison between one ``dict.values()`` view and another will " "always return ``False``. This also applies when comparing ``dict.values()`` " "to itself::" msgstr "" -#: ../../library/stdtypes.rst:5517 +#: ../../library/stdtypes.rst:5532 msgid "" ">>> d = {'a': 1}\n" ">>> d.values() == d.values()\n" @@ -8009,25 +8033,25 @@ msgstr "" ">>> d.values() == d.values()\n" "False" -#: ../../library/stdtypes.rst:5523 +#: ../../library/stdtypes.rst:5538 msgid "" "Create a new dictionary with the merged keys and values of *d* and *other*, " "which must both be dictionaries. The values of *other* take priority when " "*d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:5531 +#: ../../library/stdtypes.rst:5546 msgid "" "Update the dictionary *d* with keys and values from *other*, which may be " "either a :term:`mapping` or an :term:`iterable` of key/value pairs. The " "values of *other* take priority when *d* and *other* share keys." msgstr "" -#: ../../library/stdtypes.rst:5537 +#: ../../library/stdtypes.rst:5552 msgid "Dictionaries and dictionary views are reversible. ::" msgstr "" -#: ../../library/stdtypes.rst:5539 +#: ../../library/stdtypes.rst:5554 msgid "" ">>> d = {\"one\": 1, \"two\": 2, \"three\": 3, \"four\": 4}\n" ">>> d\n" @@ -8049,27 +8073,27 @@ msgstr "" ">>> list(reversed(d.items()))\n" "[('four', 4), ('three', 3), ('two', 2), ('one', 1)]" -#: ../../library/stdtypes.rst:5549 +#: ../../library/stdtypes.rst:5564 msgid "Dictionaries are now reversible." msgstr "" -#: ../../library/stdtypes.rst:5554 +#: ../../library/stdtypes.rst:5569 msgid "" ":class:`types.MappingProxyType` can be used to create a read-only view of a :" "class:`dict`." msgstr "" -#: ../../library/stdtypes.rst:5560 +#: ../../library/stdtypes.rst:5575 msgid "" "For detailed information on thread-safety guarantees for :class:`dict` " "objects, see :ref:`thread-safety-dict`." msgstr "" -#: ../../library/stdtypes.rst:5567 +#: ../../library/stdtypes.rst:5582 msgid "Dictionary view objects" msgstr "字典視圖物件" -#: ../../library/stdtypes.rst:5569 +#: ../../library/stdtypes.rst:5584 msgid "" "The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:" "`dict.items` are *view objects*. They provide a dynamic view on the " @@ -8077,23 +8101,23 @@ msgid "" "reflects these changes." msgstr "" -#: ../../library/stdtypes.rst:5574 +#: ../../library/stdtypes.rst:5589 msgid "" "Dictionary views can be iterated over to yield their respective data, and " "support membership tests:" msgstr "" -#: ../../library/stdtypes.rst:5579 +#: ../../library/stdtypes.rst:5594 msgid "Return the number of entries in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5583 +#: ../../library/stdtypes.rst:5598 msgid "" "Return an iterator over the keys, values or items (represented as tuples of " "``(key, value)``) in the dictionary." msgstr "" -#: ../../library/stdtypes.rst:5586 +#: ../../library/stdtypes.rst:5601 msgid "" "Keys and values are iterated over in insertion order. This allows the " "creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." @@ -8101,39 +8125,39 @@ msgid "" "[(v, k) for (k, v) in d.items()]``." msgstr "" -#: ../../library/stdtypes.rst:5591 +#: ../../library/stdtypes.rst:5606 msgid "" "Iterating views while adding or deleting entries in the dictionary may raise " "a :exc:`RuntimeError` or fail to iterate over all entries." msgstr "" -#: ../../library/stdtypes.rst:5594 +#: ../../library/stdtypes.rst:5609 msgid "Dictionary order is guaranteed to be insertion order." msgstr "" -#: ../../library/stdtypes.rst:5599 +#: ../../library/stdtypes.rst:5614 msgid "" "Return ``True`` if *x* is in the underlying dictionary's keys, values or " "items (in the latter case, *x* should be a ``(key, value)`` tuple)." msgstr "" -#: ../../library/stdtypes.rst:5604 +#: ../../library/stdtypes.rst:5619 msgid "" "Return a reverse iterator over the keys, values or items of the dictionary. " "The view will be iterated in reverse order of the insertion." msgstr "" -#: ../../library/stdtypes.rst:5607 +#: ../../library/stdtypes.rst:5622 msgid "Dictionary views are now reversible." msgstr "" -#: ../../library/stdtypes.rst:5612 +#: ../../library/stdtypes.rst:5627 msgid "" "Return a :class:`types.MappingProxyType` that wraps the original dictionary " "to which the view refers." msgstr "" -#: ../../library/stdtypes.rst:5617 +#: ../../library/stdtypes.rst:5632 msgid "" "Keys views are set-like since their entries are unique and :term:`hashable`. " "Items views also have set-like operations since the (key, value) pairs are " @@ -8147,11 +8171,11 @@ msgid "" "input." msgstr "" -#: ../../library/stdtypes.rst:5629 +#: ../../library/stdtypes.rst:5644 msgid "An example of dictionary view usage::" msgstr "" -#: ../../library/stdtypes.rst:5631 +#: ../../library/stdtypes.rst:5646 msgid "" ">>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}\n" ">>> keys = dishes.keys()\n" @@ -8192,11 +8216,11 @@ msgid "" "500" msgstr "" -#: ../../library/stdtypes.rst:5673 +#: ../../library/stdtypes.rst:5688 msgid "Context Manager Types" msgstr "情境管理器型別" -#: ../../library/stdtypes.rst:5680 +#: ../../library/stdtypes.rst:5695 msgid "" "Python's :keyword:`with` statement supports the concept of a runtime context " "defined by a context manager. This is implemented using a pair of methods " @@ -8207,7 +8231,7 @@ msgstr "" "要使用兩個方法來實作,該方法讓使用者定義類別能夠去定義 runtime 情境,且該情境" "在執行陳述式主體 (statement body) 之前進入、在陳述式結束時退出:" -#: ../../library/stdtypes.rst:5688 +#: ../../library/stdtypes.rst:5703 msgid "" "Enter the runtime context and return either this object or another object " "related to the runtime context. The value returned by this method is bound " @@ -8218,7 +8242,7 @@ msgstr "" "的值有被綁定到使用此情境管理器的 :keyword:`with` 陳述式的 :keyword:`!as` 子句" "中的識別字。" -#: ../../library/stdtypes.rst:5693 +#: ../../library/stdtypes.rst:5708 msgid "" "An example of a context manager that returns itself is a :term:`file " "object`. File objects return themselves from __enter__() to allow :func:" @@ -8227,7 +8251,7 @@ msgstr "" "一個會回傳自己的情境管理器範例是 :term:`file object`。檔案物件從 __enter__() " "回傳自己,以允許將 :func:`open` 用作 :keyword:`with` 陳述式中的情境運算式。" -#: ../../library/stdtypes.rst:5697 +#: ../../library/stdtypes.rst:5712 msgid "" "An example of a context manager that returns a related object is the one " "returned by :func:`decimal.localcontext`. These managers set the active " @@ -8241,7 +8265,7 @@ msgstr "" "本。這允許對 :keyword:`with` 陳述式主體中的目前十進位情境進行更改,而不會影" "響 :keyword:`!with` 陳述式外部的程式碼。" -#: ../../library/stdtypes.rst:5707 +#: ../../library/stdtypes.rst:5722 msgid "" "Exit the runtime context and return a Boolean flag indicating if any " "exception that occurred should be suppressed. If an exception occurred while " @@ -8253,7 +8277,7 @@ msgstr "" "keyword:`with` 陳述式主體時發生例外,則引數包含例外型別、值和回溯 " "(traceback) 資訊。否則,所有三個引數都是 ``None``。" -#: ../../library/stdtypes.rst:5712 +#: ../../library/stdtypes.rst:5727 msgid "" "Returning a true value from this method will cause the :keyword:`with` " "statement to suppress the exception and continue execution with the " @@ -8264,14 +8288,14 @@ msgstr "" "keyword:`!with` 陳述式之後的陳述式。否則,該例外將在該方法執行完畢後繼續傳播 " "(propagate)。" -#: ../../library/stdtypes.rst:5717 +#: ../../library/stdtypes.rst:5732 msgid "" "If this method raises an exception while handling an earlier exception from " "the :keyword:`with` block, the new exception is raised, and the original " "exception is stored in its :attr:`~BaseException.__context__` attribute." msgstr "" -#: ../../library/stdtypes.rst:5721 +#: ../../library/stdtypes.rst:5736 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " @@ -8283,7 +8307,7 @@ msgstr "" "已成功完成且不希望抑制引發的例外。這讓情境管理程式碼能輕鬆檢測 :meth:" "`~object.__exit__` 方法是否曾實際失敗過。" -#: ../../library/stdtypes.rst:5727 +#: ../../library/stdtypes.rst:5742 msgid "" "Python defines several context managers to support easy thread " "synchronisation, prompt closure of files or other objects, and simpler " @@ -8295,7 +8319,7 @@ msgstr "" "及對有效十進位算術情境的更簡單操作。除了情境管理協定的實作之外,不會對特定型" "別進行特殊處理。更多範例請參閱 :mod:`contextlib` 模組。" -#: ../../library/stdtypes.rst:5733 +#: ../../library/stdtypes.rst:5748 msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " @@ -8310,7 +8334,7 @@ msgstr "" "`~contextmanager.__enter__` 和 :meth:`~contextmanager.__exit__` 方法的情境管" "理器,而不是由未裝飾產生器函式產生的疊代器。" -#: ../../library/stdtypes.rst:5740 +#: ../../library/stdtypes.rst:5755 msgid "" "Note that there is no specific slot for any of these methods in the type " "structure for Python objects in the Python/C API. Extension types wanting to " @@ -8322,7 +8346,7 @@ msgstr "" "定義這些方法的擴充型別必須將它們作為普通的 Python 可存取方法提供。與設定 " "runtime 情境的開銷相比,單一類別字典查找的開銷可以忽略不計。" -#: ../../library/stdtypes.rst:5748 +#: ../../library/stdtypes.rst:5763 msgid "" "Type Annotation Types --- :ref:`Generic Alias `, :ref:" "`Union `" @@ -8330,7 +8354,7 @@ msgstr "" "型別註釋的型別 --- :ref:`泛型別名 (Generic Alias) `、:" "ref:`聯合 (Union) `" -#: ../../library/stdtypes.rst:5753 +#: ../../library/stdtypes.rst:5768 msgid "" "The core built-in types for :term:`type annotations ` are :ref:" "`Generic Alias ` and :ref:`Union `." @@ -8338,11 +8362,11 @@ msgstr "" ":term:`型別註釋 ` 的核心內建型別是\\ :ref:`泛型別名 `\\ 和\\ :ref:`聯合 `。" -#: ../../library/stdtypes.rst:5760 +#: ../../library/stdtypes.rst:5775 msgid "Generic Alias Type" msgstr "泛型別名型別" -#: ../../library/stdtypes.rst:5766 +#: ../../library/stdtypes.rst:5781 msgid "" "``GenericAlias`` objects are generally created by :ref:`subscripting " "` a class. They are most often used with :ref:`container " @@ -8358,7 +8382,7 @@ msgstr "" "立的。``GenericAlias`` 物件主要會與\\ :term:`型別註釋 ` 一起使" "用。" -#: ../../library/stdtypes.rst:5776 +#: ../../library/stdtypes.rst:5791 msgid "" "It is generally only possible to subscript a class if the class implements " "the special method :meth:`~object.__class_getitem__`." @@ -8366,7 +8390,7 @@ msgstr "" "通常只有當類別有實作特殊方法 :meth:`~object.__class_getitem__` 時才可以去下標" "該類別。" -#: ../../library/stdtypes.rst:5779 +#: ../../library/stdtypes.rst:5794 msgid "" "A ``GenericAlias`` object acts as a proxy for a :term:`generic type`, " "implementing *parameterized generics*." @@ -8374,7 +8398,7 @@ msgstr "" "將一個 ``GenericAlias`` 物件用作 :term:`generic type` 的代理,實作\\ *參數化" "泛型 (parameterized generics)*。" -#: ../../library/stdtypes.rst:5782 +#: ../../library/stdtypes.rst:5797 msgid "" "For a container class, the argument(s) supplied to a :ref:`subscription " "` of the class may indicate the type(s) of the elements an " @@ -8386,7 +8410,7 @@ msgstr "" "物件所包含元素的型別。例如 ``set[bytes]`` 可以用於型別註釋來表示一個 :class:" "`set`,其中所有元素的型別都是 :class:`bytes`。" -#: ../../library/stdtypes.rst:5788 +#: ../../library/stdtypes.rst:5803 msgid "" "For a class which defines :meth:`~object.__class_getitem__` but is not a " "container, the argument(s) supplied to a subscription of the class will " @@ -8398,7 +8422,7 @@ msgstr "" "標引數通常會指示物件上有定義的一個或多個方法的回傳型別。例如\\ :mod:`正規表示" "式 `\\ 可以用於 :class:`str` 和 :class:`bytes` 資料型別:" -#: ../../library/stdtypes.rst:5794 +#: ../../library/stdtypes.rst:5809 msgid "" "If ``x = re.search('foo', 'foo')``, ``x`` will be a :ref:`re.Match ` object where the return values of ``x.group(0)`` and ``x[0]`` will " @@ -8410,7 +8434,7 @@ msgstr "" "別。我們就可以用 ``GenericAlias`` ``re.Match[str]`` 在型別註釋中表示這種物" "件。" -#: ../../library/stdtypes.rst:5800 +#: ../../library/stdtypes.rst:5815 msgid "" "If ``y = re.search(b'bar', b'bar')``, (note the ``b`` for :class:`bytes`), " "``y`` will also be an instance of ``re.Match``, but the return values of ``y." @@ -8423,7 +8447,7 @@ msgstr "" "別都是 :class:`bytes`。在型別註釋中,我們將用 ``re.Match[bytes]`` 來表示各" "種 :ref:`re.Match ` 物件。" -#: ../../library/stdtypes.rst:5806 +#: ../../library/stdtypes.rst:5821 msgid "" "``GenericAlias`` objects are instances of the class :class:`types." "GenericAlias`, which can also be used to create ``GenericAlias`` objects " @@ -8436,7 +8460,7 @@ msgstr "" "classes>`\\ 的特化可能不是 :class:`types.GenericAlias` 的實例,但它們提供類似" "的功能。" -#: ../../library/stdtypes.rst:5813 +#: ../../library/stdtypes.rst:5828 msgid "" "Creates a ``GenericAlias`` representing a type ``T`` parameterized by types " "*X*, *Y*, and more depending on the ``T`` used. For example, a function " @@ -8446,7 +8470,7 @@ msgstr "" "所使用的 ``T``)來參數化。例如,一個函式需要一個包含 :class:`float` 元素的 :" "class:`list`: ::" -#: ../../library/stdtypes.rst:5818 +#: ../../library/stdtypes.rst:5833 msgid "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" @@ -8454,7 +8478,7 @@ msgstr "" "def average(values: list[float]) -> float:\n" " return sum(values) / len(values)" -#: ../../library/stdtypes.rst:5821 +#: ../../library/stdtypes.rst:5836 msgid "" "Another example for :term:`mapping` objects, using a :class:`dict`, which is " "a generic type expecting two type parameters representing the key type and " @@ -8465,7 +8489,7 @@ msgstr "" "別,需要兩個型別參數,分別表示鍵型別和值型別。在此範例中,函式需要一個 " "``dict``,其帶有 :class:`str` 型別的鍵和 :class:`int` 型別的值: ::" -#: ../../library/stdtypes.rst:5826 +#: ../../library/stdtypes.rst:5841 msgid "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." @@ -8473,7 +8497,7 @@ msgstr "" "def send_post_request(url: str, body: dict[str, int]) -> None:\n" " ..." -#: ../../library/stdtypes.rst:5829 +#: ../../library/stdtypes.rst:5844 msgid "" "The builtin functions :func:`isinstance` and :func:`issubclass` do not " "accept ``GenericAlias`` types for their second argument::" @@ -8481,7 +8505,7 @@ msgstr "" "內建函式 :func:`isinstance` 和 :func:`issubclass` 不接受 ``GenericAlias`` 型" "別作為第二個引數: ::" -#: ../../library/stdtypes.rst:5832 +#: ../../library/stdtypes.rst:5847 msgid "" ">>> isinstance([1, 2], list[str])\n" "Traceback (most recent call last):\n" @@ -8493,7 +8517,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: isinstance() argument 2 cannot be a parameterized generic" -#: ../../library/stdtypes.rst:5837 +#: ../../library/stdtypes.rst:5852 msgid "" "The Python runtime does not enforce :term:`type annotations `. " "This extends to generic types and their type parameters. When creating a " @@ -8505,7 +8529,7 @@ msgstr "" "及其型別參數。當從 ``GenericAlias`` 建立容器物件時,不會檢查容器中元素的型" "別。例如,不鼓勵使用以下程式碼,但 runtime 不會出現錯誤: ::" -#: ../../library/stdtypes.rst:5843 +#: ../../library/stdtypes.rst:5858 msgid "" ">>> t = list[str]\n" ">>> t([1, 2, 3])\n" @@ -8515,13 +8539,13 @@ msgstr "" ">>> t([1, 2, 3])\n" "[1, 2, 3]" -#: ../../library/stdtypes.rst:5847 +#: ../../library/stdtypes.rst:5862 msgid "" "Furthermore, parameterized generics erase type parameters during object " "creation::" msgstr "此外,參數化泛型在物件建立期間會擦除 (erase) 型別參數: ::" -#: ../../library/stdtypes.rst:5850 +#: ../../library/stdtypes.rst:5865 msgid "" ">>> t = list[str]\n" ">>> type(t)\n" @@ -8539,13 +8563,31 @@ msgstr "" ">>> type(l)\n" "" -#: ../../library/stdtypes.rst:5858 +#: ../../library/stdtypes.rst:5874 +msgid "" +"Instances of ``GenericAlias`` are not classes at runtime, even though they " +"behave like classes (they can be instantiated and subclassed)::" +msgstr "" + +#: ../../library/stdtypes.rst:5876 +msgid "" +">>> import inspect\n" +">>> inspect.isclass(list[int])\n" +"False" +msgstr "" + +#: ../../library/stdtypes.rst:5880 +msgid "" +"This is true for :ref:`user-defined generics ` also." +msgstr "這對\\ :ref:`使用者定義泛型 `\\ 也是成立的。" + +#: ../../library/stdtypes.rst:5882 msgid "" "Calling :func:`repr` or :func:`str` on a generic shows the parameterized " "type::" msgstr "在泛型上呼叫 :func:`repr` 或 :func:`str` 會顯示參數化型別: ::" -#: ../../library/stdtypes.rst:5860 +#: ../../library/stdtypes.rst:5884 msgid "" ">>> repr(list[int])\n" "'list[int]'\n" @@ -8559,7 +8601,7 @@ msgstr "" ">>> str(list[int])\n" "'list[int]'" -#: ../../library/stdtypes.rst:5866 +#: ../../library/stdtypes.rst:5890 msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" @@ -8567,7 +8609,7 @@ msgstr "" "為防止像是 ``dict[str][str]`` 的錯誤出現,泛型容器的 :meth:`~object." "__getitem__` 方法會在這種情況下引發例外: ::" -#: ../../library/stdtypes.rst:5869 +#: ../../library/stdtypes.rst:5893 msgid "" ">>> dict[str][str]\n" "Traceback (most recent call last):\n" @@ -8579,7 +8621,7 @@ msgstr "" " ...\n" "TypeError: dict[str] is not a generic class" -#: ../../library/stdtypes.rst:5874 +#: ../../library/stdtypes.rst:5898 msgid "" "However, such expressions are valid when :ref:`type variables ` " "are used. The index must have as many elements as there are type variable " @@ -8589,7 +8631,7 @@ msgstr "" "的。索引的元素數量必須與 ``GenericAlias`` 物件的 :attr:`~genericalias." "__args__` 中的型別變數項目一樣多: ::" -#: ../../library/stdtypes.rst:5878 +#: ../../library/stdtypes.rst:5902 msgid "" ">>> from typing import TypeVar\n" ">>> Y = TypeVar('Y')\n" @@ -8601,253 +8643,253 @@ msgstr "" ">>> dict[str, Y][int]\n" "dict[str, int]" -#: ../../library/stdtypes.rst:5885 +#: ../../library/stdtypes.rst:5909 msgid "Standard Generic Classes" msgstr "標準泛型類別" -#: ../../library/stdtypes.rst:5887 +#: ../../library/stdtypes.rst:5911 msgid "" "The following standard library classes support parameterized generics. This " "list is non-exhaustive." msgstr "以下標準函式庫類別有支援參數化泛型。此列表並非詳盡無遺。" -#: ../../library/stdtypes.rst:5890 +#: ../../library/stdtypes.rst:5914 msgid ":class:`tuple`" msgstr ":class:`tuple`" -#: ../../library/stdtypes.rst:5891 +#: ../../library/stdtypes.rst:5915 msgid ":class:`list`" msgstr ":class:`list`" -#: ../../library/stdtypes.rst:5892 +#: ../../library/stdtypes.rst:5916 msgid ":class:`dict`" msgstr ":class:`dict`" -#: ../../library/stdtypes.rst:5893 +#: ../../library/stdtypes.rst:5917 msgid ":class:`set`" msgstr ":class:`set`" -#: ../../library/stdtypes.rst:5894 +#: ../../library/stdtypes.rst:5918 msgid ":class:`frozenset`" msgstr ":class:`frozenset`" -#: ../../library/stdtypes.rst:5895 +#: ../../library/stdtypes.rst:5919 msgid ":class:`type`" msgstr ":class:`type`" -#: ../../library/stdtypes.rst:5896 +#: ../../library/stdtypes.rst:5920 msgid ":class:`asyncio.Future`" msgstr ":class:`asyncio.Future`" -#: ../../library/stdtypes.rst:5897 +#: ../../library/stdtypes.rst:5921 msgid ":class:`asyncio.Task`" msgstr ":class:`asyncio.Task`" -#: ../../library/stdtypes.rst:5898 +#: ../../library/stdtypes.rst:5922 msgid ":class:`collections.deque`" msgstr ":class:`collections.deque`" -#: ../../library/stdtypes.rst:5899 +#: ../../library/stdtypes.rst:5923 msgid ":class:`collections.defaultdict`" msgstr ":class:`collections.defaultdict`" -#: ../../library/stdtypes.rst:5900 +#: ../../library/stdtypes.rst:5924 msgid ":class:`collections.OrderedDict`" msgstr ":class:`collections.OrderedDict`" -#: ../../library/stdtypes.rst:5901 +#: ../../library/stdtypes.rst:5925 msgid ":class:`collections.Counter`" msgstr ":class:`collections.Counter`" -#: ../../library/stdtypes.rst:5902 +#: ../../library/stdtypes.rst:5926 msgid ":class:`collections.ChainMap`" msgstr ":class:`collections.ChainMap`" -#: ../../library/stdtypes.rst:5903 +#: ../../library/stdtypes.rst:5927 msgid ":class:`collections.abc.Awaitable`" msgstr ":class:`collections.abc.Awaitable`" -#: ../../library/stdtypes.rst:5904 +#: ../../library/stdtypes.rst:5928 msgid ":class:`collections.abc.Coroutine`" msgstr ":class:`collections.abc.Coroutine`" -#: ../../library/stdtypes.rst:5905 +#: ../../library/stdtypes.rst:5929 msgid ":class:`collections.abc.AsyncIterable`" msgstr ":class:`collections.abc.AsyncIterable`" -#: ../../library/stdtypes.rst:5906 +#: ../../library/stdtypes.rst:5930 msgid ":class:`collections.abc.AsyncIterator`" msgstr ":class:`collections.abc.AsyncIterator`" -#: ../../library/stdtypes.rst:5907 +#: ../../library/stdtypes.rst:5931 msgid ":class:`collections.abc.AsyncGenerator`" msgstr ":class:`collections.abc.AsyncGenerator`" -#: ../../library/stdtypes.rst:5908 +#: ../../library/stdtypes.rst:5932 msgid ":class:`collections.abc.Iterable`" msgstr ":class:`collections.abc.Iterable`" -#: ../../library/stdtypes.rst:5909 +#: ../../library/stdtypes.rst:5933 msgid ":class:`collections.abc.Iterator`" msgstr ":class:`collections.abc.Iterator`" -#: ../../library/stdtypes.rst:5910 +#: ../../library/stdtypes.rst:5934 msgid ":class:`collections.abc.Generator`" msgstr ":class:`collections.abc.Generator`" -#: ../../library/stdtypes.rst:5911 +#: ../../library/stdtypes.rst:5935 msgid ":class:`collections.abc.Reversible`" msgstr ":class:`collections.abc.Reversible`" -#: ../../library/stdtypes.rst:5912 +#: ../../library/stdtypes.rst:5936 msgid ":class:`collections.abc.Container`" msgstr ":class:`collections.abc.Container`" -#: ../../library/stdtypes.rst:5913 +#: ../../library/stdtypes.rst:5937 msgid ":class:`collections.abc.Collection`" msgstr ":class:`collections.abc.Collection`" -#: ../../library/stdtypes.rst:5914 +#: ../../library/stdtypes.rst:5938 msgid ":class:`collections.abc.Callable`" msgstr ":class:`collections.abc.Callable`" -#: ../../library/stdtypes.rst:5915 +#: ../../library/stdtypes.rst:5939 msgid ":class:`collections.abc.Set`" msgstr ":class:`collections.abc.Set`" -#: ../../library/stdtypes.rst:5916 +#: ../../library/stdtypes.rst:5940 msgid ":class:`collections.abc.MutableSet`" msgstr ":class:`collections.abc.MutableSet`" -#: ../../library/stdtypes.rst:5917 +#: ../../library/stdtypes.rst:5941 msgid ":class:`collections.abc.Mapping`" msgstr ":class:`collections.abc.Mapping`" -#: ../../library/stdtypes.rst:5918 +#: ../../library/stdtypes.rst:5942 msgid ":class:`collections.abc.MutableMapping`" msgstr ":class:`collections.abc.MutableMapping`" -#: ../../library/stdtypes.rst:5919 +#: ../../library/stdtypes.rst:5943 msgid ":class:`collections.abc.Sequence`" msgstr ":class:`collections.abc.Sequence`" -#: ../../library/stdtypes.rst:5920 +#: ../../library/stdtypes.rst:5944 msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" -#: ../../library/stdtypes.rst:5921 +#: ../../library/stdtypes.rst:5945 msgid ":class:`collections.abc.ByteString`" msgstr ":class:`collections.abc.ByteString`" -#: ../../library/stdtypes.rst:5922 +#: ../../library/stdtypes.rst:5946 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:5923 +#: ../../library/stdtypes.rst:5947 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:5924 +#: ../../library/stdtypes.rst:5948 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:5925 +#: ../../library/stdtypes.rst:5949 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:5926 +#: ../../library/stdtypes.rst:5950 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5927 +#: ../../library/stdtypes.rst:5951 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5928 +#: ../../library/stdtypes.rst:5952 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5929 +#: ../../library/stdtypes.rst:5953 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5930 +#: ../../library/stdtypes.rst:5954 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5931 +#: ../../library/stdtypes.rst:5955 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5932 +#: ../../library/stdtypes.rst:5956 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5933 +#: ../../library/stdtypes.rst:5957 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5934 +#: ../../library/stdtypes.rst:5958 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5935 +#: ../../library/stdtypes.rst:5959 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5936 +#: ../../library/stdtypes.rst:5960 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5937 +#: ../../library/stdtypes.rst:5961 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5938 +#: ../../library/stdtypes.rst:5962 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5939 +#: ../../library/stdtypes.rst:5963 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5940 +#: ../../library/stdtypes.rst:5964 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5941 +#: ../../library/stdtypes.rst:5965 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5942 +#: ../../library/stdtypes.rst:5966 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5943 +#: ../../library/stdtypes.rst:5967 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5944 +#: ../../library/stdtypes.rst:5968 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5945 +#: ../../library/stdtypes.rst:5969 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5950 +#: ../../library/stdtypes.rst:5974 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "``GenericAlias`` 物件的特殊屬性" -#: ../../library/stdtypes.rst:5952 +#: ../../library/stdtypes.rst:5976 msgid "All parameterized generics implement special read-only attributes." msgstr "所有參數化泛型都有實作特殊的唯讀屬性。" -#: ../../library/stdtypes.rst:5956 +#: ../../library/stdtypes.rst:5980 msgid "This attribute points at the non-parameterized generic class::" msgstr "此屬性指向非參數化泛型類別: ::" -#: ../../library/stdtypes.rst:5958 +#: ../../library/stdtypes.rst:5982 msgid "" ">>> list[int].__origin__\n" "" @@ -8855,7 +8897,7 @@ msgstr "" ">>> list[int].__origin__\n" "" -#: ../../library/stdtypes.rst:5964 +#: ../../library/stdtypes.rst:5988 msgid "" "This attribute is a :class:`tuple` (possibly of length 1) of generic types " "passed to the original :meth:`~object.__class_getitem__` of the generic " @@ -8864,7 +8906,7 @@ msgstr "" "此屬性是傳遞給泛型類別之原始 :meth:`~object.__class_getitem__` 的泛型型別 :" "class:`tuple`\\ (長度可以為 1): ::" -#: ../../library/stdtypes.rst:5968 +#: ../../library/stdtypes.rst:5992 msgid "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" @@ -8872,7 +8914,7 @@ msgstr "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" -#: ../../library/stdtypes.rst:5974 +#: ../../library/stdtypes.rst:5998 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" @@ -8880,7 +8922,7 @@ msgstr "" "此屬性是個會被延遲計算 (lazily computed) 的元組(可能為空),包含了在 " "``__args__`` 中找得到的不重複型別變數: ::" -#: ../../library/stdtypes.rst:5977 +#: ../../library/stdtypes.rst:6001 msgid "" ">>> from typing import TypeVar\n" "\n" @@ -8894,7 +8936,7 @@ msgstr "" ">>> list[T].__parameters__\n" "(~T,)" -#: ../../library/stdtypes.rst:5985 +#: ../../library/stdtypes.rst:6009 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " "have correct ``__parameters__`` after substitution because :class:`typing." @@ -8904,7 +8946,7 @@ msgstr "" "有正確的 ``__parameters__``,因為 :class:`typing.ParamSpec` 主要用於靜態型別" "檢查。" -#: ../../library/stdtypes.rst:5992 +#: ../../library/stdtypes.rst:6016 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." @@ -8912,19 +8954,19 @@ msgstr "" "如果別名已使用 ``*`` 運算子解包 (unpack) 則為 true 的布林值(請參閱 :data:" "`~typing.TypeVarTuple`\\ )。" -#: ../../library/stdtypes.rst:6000 +#: ../../library/stdtypes.rst:6024 msgid ":pep:`484` - Type Hints" msgstr ":pep:`484` - 型別提示" -#: ../../library/stdtypes.rst:6001 +#: ../../library/stdtypes.rst:6025 msgid "Introducing Python's framework for type annotations." msgstr "引入 Python 的型別註釋框架。" -#: ../../library/stdtypes.rst:6003 +#: ../../library/stdtypes.rst:6027 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr ":pep:`585` - 標準集合 (Standard Collections) 中的型別提示泛型" -#: ../../library/stdtypes.rst:6004 +#: ../../library/stdtypes.rst:6028 msgid "" "Introducing the ability to natively parameterize standard-library classes, " "provided they implement the special class method :meth:`~object." @@ -8933,7 +8975,7 @@ msgstr "" "引入原生參數化標準函式庫類別的能力,前提是它們有實作特殊的類別方法 :meth:" "`~object.__class_getitem__`。" -#: ../../library/stdtypes.rst:6008 +#: ../../library/stdtypes.rst:6032 msgid "" ":ref:`Generics`, :ref:`user-defined generics ` and :" "class:`typing.Generic`" @@ -8941,18 +8983,18 @@ msgstr "" ":ref:`Generics`、:ref:`使用者定義泛型 `\\ 和 :class:" "`typing.Generic`" -#: ../../library/stdtypes.rst:6009 +#: ../../library/stdtypes.rst:6033 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" "有關如何實作可以在 runtime 參數化並能被靜態型別檢查器理解的泛型類別的文件。" -#: ../../library/stdtypes.rst:6018 +#: ../../library/stdtypes.rst:6042 msgid "Union Type" msgstr "聯合型別 (Union Type)" -#: ../../library/stdtypes.rst:6024 +#: ../../library/stdtypes.rst:6048 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " @@ -8965,7 +9007,7 @@ msgstr "" "釋 (type annotation) `。與下標 :data:`typing.Union` 相比,聯合型" "別運算式可以讓型別提示語法更清晰簡潔。" -#: ../../library/stdtypes.rst:6031 +#: ../../library/stdtypes.rst:6055 msgid "" "Defines a union object which holds types *X*, *Y*, and so forth. ``X | Y`` " "means either X or Y. It is equivalent to ``typing.Union[X, Y]``. For " @@ -8976,7 +9018,7 @@ msgstr "" "``typing.Union[X, Y]``。舉例來說,下列函式需要一個型別為 :class:`int` 或 :" "class:`float` 的引數: ::" -#: ../../library/stdtypes.rst:6036 +#: ../../library/stdtypes.rst:6060 msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" @@ -8984,7 +9026,7 @@ msgstr "" "def square(number: int | float) -> int | float:\n" " return number ** 2" -#: ../../library/stdtypes.rst:6041 +#: ../../library/stdtypes.rst:6065 msgid "" "The ``|`` operand cannot be used at runtime to define unions where one or " "more members is a forward reference. For example, ``int | \"Foo\"``, where " @@ -8997,40 +9039,40 @@ msgstr "" "義類別的參照,將在 runtime 失敗。對於包含向前參照的聯合,請將整個運算式以字串" "呈現,例如 ``\"int | Foo\"``。" -#: ../../library/stdtypes.rst:6049 +#: ../../library/stdtypes.rst:6073 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "聯合物件可以與其他聯合物件一起進行相等性測試。細節如下:" -#: ../../library/stdtypes.rst:6051 +#: ../../library/stdtypes.rst:6075 msgid "Unions of unions are flattened::" msgstr "聯合的聯合會被扁平化: ::" -#: ../../library/stdtypes.rst:6053 +#: ../../library/stdtypes.rst:6077 msgid "(int | str) | float == int | str | float" msgstr "(int | str) | float == int | str | float" -#: ../../library/stdtypes.rst:6055 +#: ../../library/stdtypes.rst:6079 msgid "Redundant types are removed::" msgstr "冗餘型別會被刪除: ::" -#: ../../library/stdtypes.rst:6057 +#: ../../library/stdtypes.rst:6081 msgid "int | str | int == int | str" msgstr "int | str | int == int | str" -#: ../../library/stdtypes.rst:6059 +#: ../../library/stdtypes.rst:6083 msgid "When comparing unions, the order is ignored::" msgstr "比較聯合時,順序會被忽略: ::" -#: ../../library/stdtypes.rst:6061 +#: ../../library/stdtypes.rst:6085 msgid "int | str == str | int" msgstr "int | str == str | int" -#: ../../library/stdtypes.rst:6063 +#: ../../library/stdtypes.rst:6087 msgid "It creates instances of :class:`typing.Union`::" msgstr "它會建立 :class:`typing.Union` 的實例: ::" -#: ../../library/stdtypes.rst:6065 +#: ../../library/stdtypes.rst:6089 msgid "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" @@ -9038,21 +9080,21 @@ msgstr "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" -#: ../../library/stdtypes.rst:6068 +#: ../../library/stdtypes.rst:6092 msgid "Optional types can be spelled as a union with ``None``::" msgstr "可選型別可以表示為與 ``None`` 的聯合: ::" -#: ../../library/stdtypes.rst:6070 +#: ../../library/stdtypes.rst:6094 msgid "str | None == typing.Optional[str]" msgstr "str | None == typing.Optional[str]" -#: ../../library/stdtypes.rst:6075 +#: ../../library/stdtypes.rst:6099 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "聯合物件也支援 :func:`isinstance` 和 :func:`issubclass` 的呼叫: ::" -#: ../../library/stdtypes.rst:6078 +#: ../../library/stdtypes.rst:6102 msgid "" ">>> isinstance(\"\", int | str)\n" "True" @@ -9060,14 +9102,14 @@ msgstr "" ">>> isinstance(\"\", int | str)\n" "True" -#: ../../library/stdtypes.rst:6081 +#: ../../library/stdtypes.rst:6105 msgid "" "However, :ref:`parameterized generics ` in union objects " "cannot be checked::" msgstr "" "然而聯合物件中的\\ :ref:`參數化泛型 `\\ 則無法被檢查: ::" -#: ../../library/stdtypes.rst:6084 +#: ../../library/stdtypes.rst:6108 msgid "" ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" "True\n" @@ -9077,7 +9119,7 @@ msgid "" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" -#: ../../library/stdtypes.rst:6091 +#: ../../library/stdtypes.rst:6115 msgid "" "The user-exposed type for the union object can be accessed from :class:" "`typing.Union` and used for :func:`isinstance` checks::" @@ -9085,7 +9127,7 @@ msgstr "" "構成聯合物件的對使用者公開型別 (user-exposed type) 可以透過 :data:`typing." "Union` 存取並用於 :func:`isinstance` 檢查: ::" -#: ../../library/stdtypes.rst:6094 +#: ../../library/stdtypes.rst:6118 msgid "" ">>> import typing\n" ">>> isinstance(int | str, typing.Union)\n" @@ -9103,7 +9145,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: cannot create 'typing.Union' instances" -#: ../../library/stdtypes.rst:6103 +#: ../../library/stdtypes.rst:6127 msgid "" "The :meth:`!__or__` method for type objects was added to support the syntax " "``X | Y``. If a metaclass implements :meth:`!__or__`, the Union may " @@ -9112,7 +9154,7 @@ msgstr "" "新增了型別物件的 :meth:`!__or__` 方法來支援 ``X | Y`` 語法。如果元類別有實" "作 :meth:`!__or__`,則 Union 可以覆寫 (override) 它: ::" -#: ../../library/stdtypes.rst:6107 +#: ../../library/stdtypes.rst:6131 msgid "" ">>> class M(type):\n" "... def __or__(self, other):\n" @@ -9138,32 +9180,32 @@ msgstr "" ">>> int | C\n" "int | C" -#: ../../library/stdtypes.rst:6123 +#: ../../library/stdtypes.rst:6147 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr ":pep:`604` -- PEP 提出 ``X | Y`` 語法和聯合型別。" -#: ../../library/stdtypes.rst:6129 +#: ../../library/stdtypes.rst:6153 msgid "" "Union objects are now instances of :class:`typing.Union`. Previously, they " "were instances of :class:`types.UnionType`, which remains an alias for :" "class:`typing.Union`." msgstr "" -#: ../../library/stdtypes.rst:6136 +#: ../../library/stdtypes.rst:6160 msgid "Other Built-in Types" msgstr "其他內建型別" -#: ../../library/stdtypes.rst:6138 +#: ../../library/stdtypes.rst:6162 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:6145 +#: ../../library/stdtypes.rst:6169 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:6147 +#: ../../library/stdtypes.rst:6171 msgid "" "The only special operation on a module is attribute access: ``m.name``, " "where *m* is a module and *name* accesses a name defined in *m*'s symbol " @@ -9174,7 +9216,7 @@ msgid "" "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:6154 +#: ../../library/stdtypes.rst:6178 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " @@ -9185,32 +9227,32 @@ msgid "" "recommended." msgstr "" -#: ../../library/stdtypes.rst:6162 +#: ../../library/stdtypes.rst:6186 msgid "" "Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:6170 +#: ../../library/stdtypes.rst:6194 msgid "Classes and Class Instances" msgstr "類別與類別實例" -#: ../../library/stdtypes.rst:6172 +#: ../../library/stdtypes.rst:6196 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "請見 :ref:`objects` 和 :ref:`class`。" -#: ../../library/stdtypes.rst:6178 +#: ../../library/stdtypes.rst:6202 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:6180 +#: ../../library/stdtypes.rst:6204 msgid "" "Function objects are created by function definitions. The only operation on " "a function object is to call it: ``func(argument-list)``." msgstr "" -#: ../../library/stdtypes.rst:6183 +#: ../../library/stdtypes.rst:6207 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -9218,15 +9260,15 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:6187 +#: ../../library/stdtypes.rst:6211 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`。" -#: ../../library/stdtypes.rst:6193 +#: ../../library/stdtypes.rst:6217 msgid "Methods" msgstr "方法" -#: ../../library/stdtypes.rst:6197 +#: ../../library/stdtypes.rst:6221 msgid "" "Methods are functions that are called using the attribute notation. There " "are two flavors: :ref:`built-in methods ` (such as :meth:" @@ -9234,7 +9276,7 @@ msgid "" "methods>`. Built-in methods are described with the types that support them." msgstr "" -#: ../../library/stdtypes.rst:6203 +#: ../../library/stdtypes.rst:6227 msgid "" "If you access a method (a function defined in a class namespace) through an " "instance, you get a special object: a :dfn:`bound method` (also called :ref:" @@ -9247,7 +9289,7 @@ msgid "" "arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:6214 +#: ../../library/stdtypes.rst:6238 msgid "" "Like :ref:`function objects `, bound method objects " "support getting arbitrary attributes. However, since method attributes are " @@ -9258,7 +9300,7 @@ msgid "" "underlying function object:" msgstr "" -#: ../../library/stdtypes.rst:6222 +#: ../../library/stdtypes.rst:6246 msgid "" ">>> class C:\n" "... def method(self):\n" @@ -9286,15 +9328,15 @@ msgstr "" ">>> c.method.whoami\n" "'my name is method'" -#: ../../library/stdtypes.rst:6237 +#: ../../library/stdtypes.rst:6261 msgid "See :ref:`instance-methods` for more information." msgstr "更多資訊請見 :ref:`instance-methods`。" -#: ../../library/stdtypes.rst:6245 +#: ../../library/stdtypes.rst:6269 msgid "Code Objects" msgstr "程式碼物件" -#: ../../library/stdtypes.rst:6251 +#: ../../library/stdtypes.rst:6275 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " @@ -9304,7 +9346,7 @@ msgid "" "`~function.__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:6258 +#: ../../library/stdtypes.rst:6282 msgid "" "Accessing :attr:`~function.__code__` raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and " @@ -9313,21 +9355,21 @@ msgstr "" "存取 :attr:`~function.__code__` 會引發一個附帶引數 ``obj`` 與 " "``\"__code__\"`` 的\\ :ref:`稽核事件 ` ``object.__getattr__``。" -#: ../../library/stdtypes.rst:6265 +#: ../../library/stdtypes.rst:6289 msgid "" "A code object can be executed or evaluated by passing it (instead of a " "source string) to the :func:`exec` or :func:`eval` built-in functions." msgstr "" -#: ../../library/stdtypes.rst:6268 +#: ../../library/stdtypes.rst:6292 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`。" -#: ../../library/stdtypes.rst:6274 +#: ../../library/stdtypes.rst:6298 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:6280 +#: ../../library/stdtypes.rst:6304 msgid "" "Type objects represent the various object types. An object's type is " "accessed by the built-in function :func:`type`. There are no special " @@ -9335,30 +9377,30 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:6285 +#: ../../library/stdtypes.rst:6309 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:6291 +#: ../../library/stdtypes.rst:6315 msgid "The Null Object" msgstr "Null 物件" -#: ../../library/stdtypes.rst:6293 +#: ../../library/stdtypes.rst:6317 msgid "" "This object is returned by functions that don't explicitly return a value. " "It supports no special operations. There is exactly one null object, named " "``None`` (a built-in name). ``type(None)()`` produces the same singleton." msgstr "" -#: ../../library/stdtypes.rst:6297 +#: ../../library/stdtypes.rst:6321 msgid "It is written as ``None``." msgstr "它被寫為 ``None``。" -#: ../../library/stdtypes.rst:6304 +#: ../../library/stdtypes.rst:6328 msgid "The Ellipsis Object" msgstr "Ellipsis 物件" -#: ../../library/stdtypes.rst:6306 +#: ../../library/stdtypes.rst:6330 msgid "" "This object is commonly used to indicate that something is omitted. It " "supports no special operations. There is exactly one ellipsis object, " @@ -9366,63 +9408,63 @@ msgid "" "the :const:`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:6311 +#: ../../library/stdtypes.rst:6335 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "它被寫為 ``Ellipsis`` 或 ``...``。" -#: ../../library/stdtypes.rst:6313 +#: ../../library/stdtypes.rst:6337 msgid "" "In typical use, ``...`` as the ``Ellipsis`` object appears in a few " "different places, for instance:" msgstr "" -#: ../../library/stdtypes.rst:6316 +#: ../../library/stdtypes.rst:6340 msgid "" "In type annotations, such as :ref:`callable arguments ` or :ref:`tuple elements `." msgstr "" -#: ../../library/stdtypes.rst:6319 +#: ../../library/stdtypes.rst:6343 msgid "" "As the body of a function instead of a :ref:`pass statement `." msgstr "" -#: ../../library/stdtypes.rst:6321 +#: ../../library/stdtypes.rst:6345 msgid "" "In third-party libraries, such as `Numpy's slicing and striding `_." msgstr "" -#: ../../library/stdtypes.rst:6324 +#: ../../library/stdtypes.rst:6348 msgid "" "Python also uses three dots in ways that are not ``Ellipsis`` objects, for " "instance:" msgstr "" -#: ../../library/stdtypes.rst:6326 +#: ../../library/stdtypes.rst:6350 msgid "" "Doctest's :const:`ELLIPSIS `, as a pattern for missing " "content." msgstr "" -#: ../../library/stdtypes.rst:6328 +#: ../../library/stdtypes.rst:6352 msgid "" "The default Python prompt of the :term:`interactive` shell when partial " "input is incomplete." msgstr "" -#: ../../library/stdtypes.rst:6330 +#: ../../library/stdtypes.rst:6354 msgid "" "Lastly, the Python documentation often uses three dots in conventional " "English usage to mean omitted content, even in code examples that also use " "them as the ``Ellipsis``." msgstr "" -#: ../../library/stdtypes.rst:6338 +#: ../../library/stdtypes.rst:6362 msgid "The NotImplemented Object" msgstr "NotImplemented 物件" -#: ../../library/stdtypes.rst:6340 +#: ../../library/stdtypes.rst:6364 msgid "" "This object is returned from comparisons and binary operations when they are " "asked to operate on types they don't support. See :ref:`comparisons` for " @@ -9430,64 +9472,64 @@ msgid "" "`type(NotImplemented)()` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:6345 +#: ../../library/stdtypes.rst:6369 msgid "It is written as :code:`NotImplemented`." msgstr "它被寫為 :code:`NotImplemented`。" -#: ../../library/stdtypes.rst:6351 +#: ../../library/stdtypes.rst:6375 msgid "Internal Objects" msgstr "內部物件" -#: ../../library/stdtypes.rst:6353 +#: ../../library/stdtypes.rst:6377 msgid "" "See :ref:`types` for this information. It describes :ref:`stack frame " "objects `, :ref:`traceback objects `, and " "slice objects." msgstr "" -#: ../../library/stdtypes.rst:6361 +#: ../../library/stdtypes.rst:6385 msgid "Special Attributes" msgstr "特殊屬性" -#: ../../library/stdtypes.rst:6363 +#: ../../library/stdtypes.rst:6387 msgid "" "The implementation adds a few special read-only attributes to several object " "types, where they are relevant. Some of these are not reported by the :func:" "`dir` built-in function." msgstr "" -#: ../../library/stdtypes.rst:6370 +#: ../../library/stdtypes.rst:6394 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:6376 +#: ../../library/stdtypes.rst:6400 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:6384 +#: ../../library/stdtypes.rst:6408 msgid "The name of the module in which a class or function was defined." msgstr "" -#: ../../library/stdtypes.rst:6389 +#: ../../library/stdtypes.rst:6413 msgid "" "The documentation string of a class or function, or ``None`` if undefined." msgstr "" -#: ../../library/stdtypes.rst:6394 +#: ../../library/stdtypes.rst:6418 msgid "" "The :ref:`type parameters ` of generic classes, functions, and :" "ref:`type aliases `. For classes and functions that are not " "generic, this will be an empty tuple." msgstr "" -#: ../../library/stdtypes.rst:6404 +#: ../../library/stdtypes.rst:6428 msgid "Integer string conversion length limitation" msgstr "整數字串轉換長度限制" -#: ../../library/stdtypes.rst:6406 +#: ../../library/stdtypes.rst:6430 msgid "" "CPython has a global limit for converting between :class:`int` and :class:" "`str` to mitigate denial of service attacks. This limit *only* applies to " @@ -9499,7 +9541,7 @@ msgstr "" "進位的數值。十六進位、八進位,還有二進位的轉換則沒有長度限制。此限制值可以被" "調整。" -#: ../../library/stdtypes.rst:6411 +#: ../../library/stdtypes.rst:6435 msgid "" "The :class:`int` type in CPython is an arbitrary length number stored in " "binary form (commonly known as a \"bignum\"). There exists no algorithm that " @@ -9509,24 +9551,24 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:6418 +#: ../../library/stdtypes.rst:6442 msgid "" "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" -#: ../../library/stdtypes.rst:6420 +#: ../../library/stdtypes.rst:6444 msgid "" "The limit is applied to the number of digit characters in the input or " "output string when a non-linear conversion algorithm would be involved. " "Underscores and the sign are not counted towards the limit." msgstr "" -#: ../../library/stdtypes.rst:6424 +#: ../../library/stdtypes.rst:6448 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:6426 +#: ../../library/stdtypes.rst:6450 msgid "" ">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" @@ -9550,7 +9592,7 @@ msgid "" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" -#: ../../library/stdtypes.rst:6446 +#: ../../library/stdtypes.rst:6470 msgid "" "The default limit is 4300 digits as provided in :data:`sys.int_info." "default_max_str_digits `. The lowest limit that can be " @@ -9558,11 +9600,11 @@ msgid "" "str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:6451 +#: ../../library/stdtypes.rst:6475 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:6453 +#: ../../library/stdtypes.rst:6477 msgid "" ">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" @@ -9580,11 +9622,11 @@ msgstr "" "... '571186405732').to_bytes(53, 'big')\n" "..." -#: ../../library/stdtypes.rst:6466 +#: ../../library/stdtypes.rst:6490 msgid "Affected APIs" msgstr "受影響的 API" -#: ../../library/stdtypes.rst:6468 +#: ../../library/stdtypes.rst:6492 msgid "" "The limitation only applies to potentially slow conversions between :class:" "`int` and :class:`str` or :class:`bytes`:" @@ -9592,74 +9634,74 @@ msgstr "" "此限制僅適用於 :class:`int` 與 :class:`str` 或 :class:`bytes` 之間可能較慢的" "轉換:" -#: ../../library/stdtypes.rst:6471 +#: ../../library/stdtypes.rst:6495 msgid "``int(string)`` with default base 10." msgstr "``int(string)`` 以預設的 10 為底。" -#: ../../library/stdtypes.rst:6472 +#: ../../library/stdtypes.rst:6496 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "``int(string, base)`` 用於所有非 2 冪次方的底。" -#: ../../library/stdtypes.rst:6473 +#: ../../library/stdtypes.rst:6497 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:6474 +#: ../../library/stdtypes.rst:6498 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:6475 +#: ../../library/stdtypes.rst:6499 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:6478 +#: ../../library/stdtypes.rst:6502 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:6480 +#: ../../library/stdtypes.rst:6504 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "``int(string, base)`` 以 2、4、8、16 或 32 為底。" -#: ../../library/stdtypes.rst:6481 +#: ../../library/stdtypes.rst:6505 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr ":func:`int.from_bytes` 和 :func:`int.to_bytes`。" -#: ../../library/stdtypes.rst:6482 +#: ../../library/stdtypes.rst:6506 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr ":func:`hex`、:func:`oct`、:func:`bin`。" -#: ../../library/stdtypes.rst:6483 +#: ../../library/stdtypes.rst:6507 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr ":ref:`formatspec` 用於十六進位、八進位和二進位數字。" -#: ../../library/stdtypes.rst:6484 +#: ../../library/stdtypes.rst:6508 msgid ":class:`str` to :class:`float`." msgstr ":class:`str` 轉換為 :class:`float`。" -#: ../../library/stdtypes.rst:6485 +#: ../../library/stdtypes.rst:6509 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr ":class:`str` 轉換為 :class:`decimal.Decimal`。" -#: ../../library/stdtypes.rst:6488 +#: ../../library/stdtypes.rst:6512 msgid "Configuring the limit" msgstr "設定限制" -#: ../../library/stdtypes.rst:6490 +#: ../../library/stdtypes.rst:6514 msgid "" "Before Python starts up you can use an environment variable or an " "interpreter command line flag to configure the limit:" msgstr "" -#: ../../library/stdtypes.rst:6493 +#: ../../library/stdtypes.rst:6517 msgid "" ":envvar:`PYTHONINTMAXSTRDIGITS`, e.g. ``PYTHONINTMAXSTRDIGITS=640 python3`` " "to set the limit to 640 or ``PYTHONINTMAXSTRDIGITS=0 python3`` to disable " "the limitation." msgstr "" -#: ../../library/stdtypes.rst:6496 +#: ../../library/stdtypes.rst:6520 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" @@ -9667,7 +9709,7 @@ msgstr "" ":option:`-X int_max_str_digits <-X>`,例如 ``python3 -X " "int_max_str_digits=640``" -#: ../../library/stdtypes.rst:6498 +#: ../../library/stdtypes.rst:6522 msgid "" ":data:`sys.flags.int_max_str_digits` contains the value of :envvar:" "`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the " @@ -9676,38 +9718,38 @@ msgid "" "int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:6504 +#: ../../library/stdtypes.rst:6528 msgid "" "From code, you can inspect the current limit and set a new one using these :" "mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:6507 +#: ../../library/stdtypes.rst:6531 msgid "" ":func:`sys.get_int_max_str_digits` and :func:`sys.set_int_max_str_digits` " "are a getter and setter for the interpreter-wide limit. Subinterpreters have " "their own limit." msgstr "" -#: ../../library/stdtypes.rst:6511 +#: ../../library/stdtypes.rst:6535 msgid "" "Information about the default and minimum can be found in :data:`sys." "int_info`:" msgstr "" -#: ../../library/stdtypes.rst:6513 +#: ../../library/stdtypes.rst:6537 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:6515 +#: ../../library/stdtypes.rst:6539 msgid "" ":data:`sys.int_info.str_digits_check_threshold ` is the lowest " "accepted value for the limit (other than 0 which disables it)." msgstr "" -#: ../../library/stdtypes.rst:6522 +#: ../../library/stdtypes.rst:6546 msgid "" "Setting a low limit *can* lead to problems. While rare, code exists that " "contains integer constants in decimal in their source that exceed the " @@ -9719,7 +9761,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:6531 +#: ../../library/stdtypes.rst:6555 msgid "" "Test your application thoroughly if you use a low limit. Ensure your tests " "run with the limit set early via the environment or flag so that it applies " @@ -9727,11 +9769,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:6537 +#: ../../library/stdtypes.rst:6561 msgid "Recommended configuration" msgstr "建議的配置" -#: ../../library/stdtypes.rst:6539 +#: ../../library/stdtypes.rst:6563 msgid "" "The default :data:`sys.int_info.default_max_str_digits` is expected to be " "reasonable for most applications. If your application requires a different " @@ -9739,11 +9781,11 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.12." msgstr "" -#: ../../library/stdtypes.rst:6544 +#: ../../library/stdtypes.rst:6568 msgid "Example::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:6546 +#: ../../library/stdtypes.rst:6570 msgid "" ">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" @@ -9765,38 +9807,38 @@ msgstr "" "... elif current_limit < lower_bound:\n" "... sys.set_int_max_str_digits(lower_bound)" -#: ../../library/stdtypes.rst:6556 +#: ../../library/stdtypes.rst:6580 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:6560 +#: ../../library/stdtypes.rst:6584 msgid "Footnotes" msgstr "註腳" -#: ../../library/stdtypes.rst:6561 +#: ../../library/stdtypes.rst:6585 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:6564 +#: ../../library/stdtypes.rst:6588 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:6567 +#: ../../library/stdtypes.rst:6591 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:6569 +#: ../../library/stdtypes.rst:6593 msgid "" "Cased characters are those with general category property being one of " "\"Lu\" (Letter, uppercase), \"Ll\" (Letter, lowercase), or \"Lt\" (Letter, " "titlecase)." msgstr "" -#: ../../library/stdtypes.rst:6572 +#: ../../library/stdtypes.rst:6596 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -9809,13 +9851,13 @@ msgstr "built-in(內建)" #: ../../library/stdtypes.rst:13 ../../library/stdtypes.rst:332 #: ../../library/stdtypes.rst:409 ../../library/stdtypes.rst:1002 #: ../../library/stdtypes.rst:1192 ../../library/stdtypes.rst:1214 -#: ../../library/stdtypes.rst:1229 ../../library/stdtypes.rst:5270 -#: ../../library/stdtypes.rst:6276 +#: ../../library/stdtypes.rst:1229 ../../library/stdtypes.rst:5285 +#: ../../library/stdtypes.rst:6300 msgid "types" msgstr "type(型別)" #: ../../library/stdtypes.rst:34 ../../library/stdtypes.rst:1229 -#: ../../library/stdtypes.rst:5270 +#: ../../library/stdtypes.rst:5285 msgid "statement" msgstr "statement(陳述式)" @@ -9937,11 +9979,11 @@ msgstr "is not" #: ../../library/stdtypes.rst:1214 ../../library/stdtypes.rst:1379 #: ../../library/stdtypes.rst:1465 ../../library/stdtypes.rst:1513 #: ../../library/stdtypes.rst:1634 ../../library/stdtypes.rst:1764 -#: ../../library/stdtypes.rst:3273 ../../library/stdtypes.rst:3292 -#: ../../library/stdtypes.rst:3405 ../../library/stdtypes.rst:5052 -#: ../../library/stdtypes.rst:5270 ../../library/stdtypes.rst:5762 -#: ../../library/stdtypes.rst:6020 ../../library/stdtypes.rst:6195 -#: ../../library/stdtypes.rst:6240 +#: ../../library/stdtypes.rst:3288 ../../library/stdtypes.rst:3307 +#: ../../library/stdtypes.rst:3420 ../../library/stdtypes.rst:5067 +#: ../../library/stdtypes.rst:5285 ../../library/stdtypes.rst:5777 +#: ../../library/stdtypes.rst:6044 ../../library/stdtypes.rst:6219 +#: ../../library/stdtypes.rst:6264 msgid "object" msgstr "object(物件)" @@ -10033,9 +10075,9 @@ msgid "arithmetic" msgstr "arithmetic(算術)" #: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:1002 -#: ../../library/stdtypes.rst:1192 ../../library/stdtypes.rst:5270 -#: ../../library/stdtypes.rst:6247 ../../library/stdtypes.rst:6261 -#: ../../library/stdtypes.rst:6276 +#: ../../library/stdtypes.rst:1192 ../../library/stdtypes.rst:5285 +#: ../../library/stdtypes.rst:6271 ../../library/stdtypes.rst:6285 +#: ../../library/stdtypes.rst:6300 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -10051,8 +10093,8 @@ msgstr "float" msgid "complex" msgstr "complex(複數)" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3145 -#: ../../library/stdtypes.rst:4414 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3160 +#: ../../library/stdtypes.rst:4429 msgid "+ (plus)" msgstr "+ (加號)" @@ -10064,13 +10106,13 @@ msgstr "unary operator(一元運算子)" msgid "binary operator" msgstr "binary operator(二元運算子)" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3145 -#: ../../library/stdtypes.rst:4414 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3160 +#: ../../library/stdtypes.rst:4429 msgid "- (minus)" msgstr "- (減號)" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3102 -#: ../../library/stdtypes.rst:4371 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3117 +#: ../../library/stdtypes.rst:4386 msgid "* (asterisk)" msgstr "* (星號)" @@ -10082,8 +10124,8 @@ msgstr "/ (斜線)" msgid "//" msgstr "//" -#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3065 -#: ../../library/stdtypes.rst:4339 +#: ../../library/stdtypes.rst:251 ../../library/stdtypes.rst:3080 +#: ../../library/stdtypes.rst:4354 msgid "% (percent)" msgstr "% (百分號)" @@ -10093,7 +10135,7 @@ msgstr "**" #: ../../library/stdtypes.rst:332 ../../library/stdtypes.rst:409 #: ../../library/stdtypes.rst:1002 ../../library/stdtypes.rst:1229 -#: ../../library/stdtypes.rst:5270 +#: ../../library/stdtypes.rst:5285 msgid "operations on" msgstr "operations on(操作於)" @@ -10102,7 +10144,7 @@ msgid "conjugate() (complex number method)" msgstr "conjugate()(複數方法)" #: ../../library/stdtypes.rst:351 ../../library/stdtypes.rst:1832 -#: ../../library/stdtypes.rst:3273 ../../library/stdtypes.rst:6276 +#: ../../library/stdtypes.rst:3288 ../../library/stdtypes.rst:6300 msgid "module" msgstr "模組" @@ -10170,7 +10212,7 @@ msgstr "values" msgid "iterator protocol" msgstr "iterator protocol(疊代器協定)" -#: ../../library/stdtypes.rst:899 ../../library/stdtypes.rst:5675 +#: ../../library/stdtypes.rst:899 ../../library/stdtypes.rst:5690 msgid "protocol" msgstr "protocol(協定)" @@ -10196,7 +10238,7 @@ msgstr "container(容器)" msgid "iteration over" msgstr "iteration over(疊代於)" -#: ../../library/stdtypes.rst:1002 ../../library/stdtypes.rst:5270 +#: ../../library/stdtypes.rst:1002 ../../library/stdtypes.rst:5285 msgid "len" msgstr "len" @@ -10265,14 +10307,14 @@ msgstr "mutable(可變)" msgid "list" msgstr "list(串列)" -#: ../../library/stdtypes.rst:1214 ../../library/stdtypes.rst:3273 -#: ../../library/stdtypes.rst:3405 ../../library/stdtypes.rst:3520 -#: ../../library/stdtypes.rst:4339 +#: ../../library/stdtypes.rst:1214 ../../library/stdtypes.rst:3288 +#: ../../library/stdtypes.rst:3420 ../../library/stdtypes.rst:3535 +#: ../../library/stdtypes.rst:4354 msgid "bytearray" msgstr "bytearray(位元組陣列)" -#: ../../library/stdtypes.rst:1229 ../../library/stdtypes.rst:5270 -#: ../../library/stdtypes.rst:6020 ../../library/stdtypes.rst:6276 +#: ../../library/stdtypes.rst:1229 ../../library/stdtypes.rst:5285 +#: ../../library/stdtypes.rst:6044 ../../library/stdtypes.rst:6300 msgid "type" msgstr "type(型別)" @@ -10280,7 +10322,7 @@ msgstr "type(型別)" msgid "assignment" msgstr "assignment(賦值)" -#: ../../library/stdtypes.rst:1229 ../../library/stdtypes.rst:5270 +#: ../../library/stdtypes.rst:1229 ../../library/stdtypes.rst:5285 msgid "del" msgstr "del" @@ -10289,8 +10331,8 @@ msgid "range" msgstr "range" #: ../../library/stdtypes.rst:1634 ../../library/stdtypes.rst:1777 -#: ../../library/stdtypes.rst:1824 ../../library/stdtypes.rst:2893 -#: ../../library/stdtypes.rst:3065 +#: ../../library/stdtypes.rst:1824 ../../library/stdtypes.rst:2908 +#: ../../library/stdtypes.rst:3080 msgid "string" msgstr "string(字串)" @@ -10311,17 +10353,17 @@ msgstr "(亦請見 string)" msgid "io.StringIO" msgstr "io.StringIO" -#: ../../library/stdtypes.rst:1797 ../../library/stdtypes.rst:3265 +#: ../../library/stdtypes.rst:1797 ../../library/stdtypes.rst:3280 msgid "buffer protocol" msgstr "buffer protocol(緩衝區協定)" -#: ../../library/stdtypes.rst:1797 ../../library/stdtypes.rst:3273 -#: ../../library/stdtypes.rst:3292 ../../library/stdtypes.rst:3520 -#: ../../library/stdtypes.rst:4339 +#: ../../library/stdtypes.rst:1797 ../../library/stdtypes.rst:3288 +#: ../../library/stdtypes.rst:3307 ../../library/stdtypes.rst:3535 +#: ../../library/stdtypes.rst:4354 msgid "bytes" msgstr "bytes(位元組)" -#: ../../library/stdtypes.rst:1824 ../../library/stdtypes.rst:3520 +#: ../../library/stdtypes.rst:1824 ../../library/stdtypes.rst:3535 msgid "methods" msgstr "methods(方法)" @@ -10329,242 +10371,249 @@ msgstr "methods(方法)" msgid "re" msgstr "re" -#: ../../library/stdtypes.rst:2663 ../../library/stdtypes.rst:4193 +#: ../../library/stdtypes.rst:2678 ../../library/stdtypes.rst:4208 msgid "universal newlines" msgstr "universal newlines" -#: ../../library/stdtypes.rst:2663 +#: ../../library/stdtypes.rst:2678 msgid "str.splitlines method" msgstr "str.splitlines 方法" -#: ../../library/stdtypes.rst:2893 +#: ../../library/stdtypes.rst:2908 msgid "! formatted string literal" msgstr "! formatted string literals(! 格式化字串常數)" -#: ../../library/stdtypes.rst:2893 +#: ../../library/stdtypes.rst:2908 msgid "formatted string literals" msgstr "formatted string literals(格式化字串常數)" -#: ../../library/stdtypes.rst:2893 +#: ../../library/stdtypes.rst:2908 msgid "! f-string" msgstr "! f-string(! f 字串)" -#: ../../library/stdtypes.rst:2893 +#: ../../library/stdtypes.rst:2908 msgid "f-strings" msgstr "f-string(f 字串)" -#: ../../library/stdtypes.rst:2893 +#: ../../library/stdtypes.rst:2908 msgid "fstring" msgstr "fstring(f 字串)" -#: ../../library/stdtypes.rst:2893 +#: ../../library/stdtypes.rst:2908 msgid "interpolated string literal" msgstr "interpolated string literal(插值字串常數)" -#: ../../library/stdtypes.rst:2893 +#: ../../library/stdtypes.rst:2908 msgid "formatted literal" msgstr "formatted literal(格式化常數)" -#: ../../library/stdtypes.rst:2893 +#: ../../library/stdtypes.rst:2908 msgid "interpolated literal" msgstr "interpolated literal(插值常數)" -#: ../../library/stdtypes.rst:2893 +#: ../../library/stdtypes.rst:2908 msgid "{} (curly brackets)" msgstr "{} (花括號)" -#: ../../library/stdtypes.rst:2893 +#: ../../library/stdtypes.rst:2908 msgid "in formatted string literal" msgstr "於格式化字串常數中" -#: ../../library/stdtypes.rst:2893 +#: ../../library/stdtypes.rst:2908 msgid "! (exclamation mark)" msgstr "! (驚嘆號)" -#: ../../library/stdtypes.rst:2893 +#: ../../library/stdtypes.rst:2908 msgid ": (colon)" msgstr ": (冒號)" -#: ../../library/stdtypes.rst:2893 +#: ../../library/stdtypes.rst:2908 msgid "= (equals)" msgstr "= (等號)" -#: ../../library/stdtypes.rst:2893 +#: ../../library/stdtypes.rst:2908 msgid "for help in debugging using string literals" msgstr "" -#: ../../library/stdtypes.rst:3065 +#: ../../library/stdtypes.rst:3080 msgid "formatting, string (%)" msgstr "formatting(格式化)、字串 (%)" -#: ../../library/stdtypes.rst:3065 +#: ../../library/stdtypes.rst:3080 msgid "interpolation, string (%)" msgstr "interpolation(插值)、字串 (%)" -#: ../../library/stdtypes.rst:3065 +#: ../../library/stdtypes.rst:3080 msgid "formatting, printf" msgstr "formatting(格式化)、printf" -#: ../../library/stdtypes.rst:3065 +#: ../../library/stdtypes.rst:3080 msgid "interpolation, printf" msgstr "interpolation(插值)、printf" -#: ../../library/stdtypes.rst:3065 ../../library/stdtypes.rst:4339 +#: ../../library/stdtypes.rst:3080 ../../library/stdtypes.rst:4354 msgid "printf-style formatting" msgstr "printf 風格格式化" -#: ../../library/stdtypes.rst:3065 ../../library/stdtypes.rst:4339 +#: ../../library/stdtypes.rst:3080 ../../library/stdtypes.rst:4354 msgid "sprintf-style formatting" msgstr "sprintf 風格格式化" -#: ../../library/stdtypes.rst:3102 ../../library/stdtypes.rst:4371 +#: ../../library/stdtypes.rst:3117 ../../library/stdtypes.rst:4386 msgid "() (parentheses)" msgstr "() (圓括號)" -#: ../../library/stdtypes.rst:3102 ../../library/stdtypes.rst:3145 -#: ../../library/stdtypes.rst:4371 ../../library/stdtypes.rst:4414 +#: ../../library/stdtypes.rst:3117 ../../library/stdtypes.rst:3160 +#: ../../library/stdtypes.rst:4386 ../../library/stdtypes.rst:4429 msgid "in printf-style formatting" msgstr "於 printf 風格格式化" -#: ../../library/stdtypes.rst:3102 ../../library/stdtypes.rst:4371 +#: ../../library/stdtypes.rst:3117 ../../library/stdtypes.rst:4386 msgid ". (dot)" msgstr ". (點)" -#: ../../library/stdtypes.rst:3145 ../../library/stdtypes.rst:4414 +#: ../../library/stdtypes.rst:3160 ../../library/stdtypes.rst:4429 msgid "# (hash)" msgstr "# (井字號)" -#: ../../library/stdtypes.rst:3145 ../../library/stdtypes.rst:4414 +#: ../../library/stdtypes.rst:3160 ../../library/stdtypes.rst:4429 msgid "space" msgstr "space(空白)" -#: ../../library/stdtypes.rst:3265 +#: ../../library/stdtypes.rst:3280 msgid "binary sequence types" msgstr "binary sequence types(二進位序列型別)" -#: ../../library/stdtypes.rst:3273 +#: ../../library/stdtypes.rst:3288 msgid "memoryview" msgstr "memoryview(記憶體視圖)" -#: ../../library/stdtypes.rst:3273 +#: ../../library/stdtypes.rst:3288 msgid "array" msgstr "array(陣列)" -#: ../../library/stdtypes.rst:4193 +#: ../../library/stdtypes.rst:4208 msgid "bytes.splitlines method" msgstr "bytes.splitlines 方法" -#: ../../library/stdtypes.rst:4193 +#: ../../library/stdtypes.rst:4208 msgid "bytearray.splitlines method" msgstr "bytearray.splitlines 方法" -#: ../../library/stdtypes.rst:4339 +#: ../../library/stdtypes.rst:4354 msgid "formatting" msgstr "formatting(格式化)" -#: ../../library/stdtypes.rst:4339 +#: ../../library/stdtypes.rst:4354 msgid "bytes (%)" msgstr "bytes (%)" -#: ../../library/stdtypes.rst:4339 +#: ../../library/stdtypes.rst:4354 msgid "bytearray (%)" msgstr "bytearray (%)" -#: ../../library/stdtypes.rst:4339 +#: ../../library/stdtypes.rst:4354 msgid "interpolation" msgstr "interpolation(插值)" -#: ../../library/stdtypes.rst:5052 +#: ../../library/stdtypes.rst:5067 msgid "set" msgstr "set(集合)" -#: ../../library/stdtypes.rst:5270 +#: ../../library/stdtypes.rst:5285 msgid "mapping" msgstr "mapping(對映)" -#: ../../library/stdtypes.rst:5270 +#: ../../library/stdtypes.rst:5285 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../library/stdtypes.rst:5380 +#: ../../library/stdtypes.rst:5395 msgid "__missing__()" msgstr "__missing__()" -#: ../../library/stdtypes.rst:5675 +#: ../../library/stdtypes.rst:5690 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../library/stdtypes.rst:5675 +#: ../../library/stdtypes.rst:5690 msgid "context management protocol" msgstr "context management protocol(情境管理協定)" -#: ../../library/stdtypes.rst:5675 +#: ../../library/stdtypes.rst:5690 msgid "context management" msgstr "context management(情境管理)" -#: ../../library/stdtypes.rst:5750 +#: ../../library/stdtypes.rst:5765 msgid "annotation" msgstr "annotation(註記)" -#: ../../library/stdtypes.rst:5750 +#: ../../library/stdtypes.rst:5765 msgid "type annotation; type hint" msgstr "type annotation(型別註記);type hint(型別提示)" -#: ../../library/stdtypes.rst:5762 +#: ../../library/stdtypes.rst:5777 msgid "GenericAlias" msgstr "GenericAlias(泛型別名)" -#: ../../library/stdtypes.rst:5762 +#: ../../library/stdtypes.rst:5777 msgid "Generic" msgstr "Generic(泛型)" -#: ../../library/stdtypes.rst:5762 +#: ../../library/stdtypes.rst:5777 msgid "Alias" msgstr "Alias(別名)" -#: ../../library/stdtypes.rst:6020 +#: ../../library/stdtypes.rst:6044 msgid "Union" msgstr "Union(聯合)" -#: ../../library/stdtypes.rst:6020 +#: ../../library/stdtypes.rst:6044 msgid "union" msgstr "union(聯集)" -#: ../../library/stdtypes.rst:6195 +#: ../../library/stdtypes.rst:6219 msgid "method" msgstr "method(方法)" -#: ../../library/stdtypes.rst:6240 +#: ../../library/stdtypes.rst:6264 msgid "code" msgstr "code(程式碼)" -#: ../../library/stdtypes.rst:6240 +#: ../../library/stdtypes.rst:6264 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../library/stdtypes.rst:6247 +#: ../../library/stdtypes.rst:6271 msgid "compile" msgstr "compile(編譯)" -#: ../../library/stdtypes.rst:6247 +#: ../../library/stdtypes.rst:6271 msgid "__code__ (function object attribute)" msgstr "__code__(函式物件屬性)" -#: ../../library/stdtypes.rst:6261 +#: ../../library/stdtypes.rst:6285 msgid "exec" msgstr "exec" -#: ../../library/stdtypes.rst:6261 +#: ../../library/stdtypes.rst:6285 msgid "eval" msgstr "eval" -#: ../../library/stdtypes.rst:6300 +#: ../../library/stdtypes.rst:6324 msgid "..." msgstr "..." -#: ../../library/stdtypes.rst:6300 +#: ../../library/stdtypes.rst:6324 msgid "ellipsis literal" msgstr "ellipsis literal(刪節號字面值)" +#~ msgid "" +#~ "See also :meth:`isdecimal` and :meth:`isdigit`. Numeric characters are a " +#~ "superset of decimal numbers." +#~ msgstr "" +#~ "也請參閱 :meth:`isdecimal` 和 :meth:`isdigit`。數字字元是十進位數字的超" +#~ "集。" + #~ msgid "See also :meth:`join`." #~ msgstr "另請參閱 :meth:`join`。" diff --git a/library/tkinter.colorchooser.po b/library/tkinter.colorchooser.po index 3fb8ba09f1..d7ff30aa1a 100644 --- a/library/tkinter.colorchooser.po +++ b/library/tkinter.colorchooser.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-20 00:18+0000\n" +"POT-Creation-Date: 2026-06-19 00:50+0000\n" "PO-Revision-Date: 2024-02-15 12:16+0800\n" "Last-Translator: Li-Hung Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -36,19 +36,41 @@ msgstr "" "器對話框的介面。``Chooser`` 實作了一個顏色選擇的互動視窗。類別 ``Chooser`` 繼" "承了類別 :class:`~tkinter.commondialog.Dialog`。" -#: ../../library/tkinter.colorchooser.rst:20 +#: ../../library/tkinter.colorchooser.rst:18 msgid "" -"Create a color choosing dialog. A call to this method will show the window, " -"wait for the user to make a selection, and return the selected color (or " -"``None``) to the caller." +"The class implementing the modal color-choosing dialog. Most applications " +"use the :func:`askcolor` convenience function rather than instantiating this " +"class directly." msgstr "" -"建立一個顏色選擇對話框。一旦呼叫這個方法便會顯示視窗,等待使用者做出選擇後," -"回傳選擇的顏色(或者是 ``None``)給呼叫者。" -#: ../../library/tkinter.colorchooser.rst:27 +#: ../../library/tkinter.colorchooser.rst:24 +msgid "" +"Show a modal color-choosing dialog and return the chosen color. *color* is " +"the color selected when the dialog opens. The return value is a tuple ``((r, " +"g, b), hexstr)``, where ``r``, ``g`` and ``b`` are the red, green and blue " +"components as integers in the range 0–255 and *hexstr* is the equivalent Tk " +"color string, such as ``'#ff8000'``. If the user cancels the dialog, " +"``(None, None)`` is returned." +msgstr "" + +#: ../../library/tkinter.colorchooser.rst:31 +msgid "" +"The RGB values in the returned color are now integers in the range 0–255 " +"instead of floats." +msgstr "" + +#: ../../library/tkinter.colorchooser.rst:38 msgid "Module :mod:`tkinter.commondialog`" msgstr ":mod:`tkinter.commondialog` 模組" -#: ../../library/tkinter.colorchooser.rst:28 +#: ../../library/tkinter.colorchooser.rst:39 msgid "Tkinter standard dialog module" msgstr "Tkinter 標準對話框模組" + +#~ msgid "" +#~ "Create a color choosing dialog. A call to this method will show the " +#~ "window, wait for the user to make a selection, and return the selected " +#~ "color (or ``None``) to the caller." +#~ msgstr "" +#~ "建立一個顏色選擇對話框。一旦呼叫這個方法便會顯示視窗,等待使用者做出選擇" +#~ "後,回傳選擇的顏色(或者是 ``None``)給呼叫者。" diff --git a/library/tkinter.dnd.po b/library/tkinter.dnd.po index 786e9a8864..f97faaf6a0 100644 --- a/library/tkinter.dnd.po +++ b/library/tkinter.dnd.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-20 00:18+0000\n" +"POT-Creation-Date: 2026-06-19 00:50+0000\n" "PO-Revision-Date: 2025-08-21 00:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -41,11 +41,11 @@ msgid "" "dragged, and 'event' is the event that invoked the call (the argument to " "your callback function)." msgstr "" -":mod:`!tkinter.dnd` 模組為單一應用程式內、同一個視窗內或視窗之間的物件提供拖放" -"支援。要讓一個物件可以被拖動,你必須為它建立一個事件繫結來啟動拖放過程。你通" -"常會將一個 ButtonPress 事件繫結到你所寫的回呼函式(請參閱 :ref:`Bindings-and-" -"Events`)。該函式應該呼叫 :func:`dnd_start`,其中 'source' 是要被拖動的物件," -"而 'event' 是觸發呼叫的事件(你的回呼函式的引數)。" +":mod:`!tkinter.dnd` 模組為單一應用程式內、同一個視窗內或視窗之間的物件提供拖" +"放支援。要讓一個物件可以被拖動,你必須為它建立一個事件繫結來啟動拖放過程。你" +"通常會將一個 ButtonPress 事件繫結到你所寫的回呼函式(請參閱 :ref:`Bindings-" +"and-Events`)。該函式應該呼叫 :func:`dnd_start`,其中 'source' 是要被拖動的物" +"件,而 'event' 是觸發呼叫的事件(你的回呼函式的引數)。" #: ../../library/tkinter.dnd.rst:22 msgid "Selection of a target object occurs as follows:" @@ -103,17 +103,24 @@ msgid "Execute end of drag-and-drop functions." msgstr "執行拖放結束函式。" #: ../../library/tkinter.dnd.rst:51 -msgid "Inspect area below mouse for target objects while drag is performed." +#, fuzzy +msgid "Inspect area below mouse for target objects while a drag is performed." msgstr "在拖動過程中檢查滑鼠下方的區域以尋找目標物件。" -#: ../../library/tkinter.dnd.rst:55 +#: ../../library/tkinter.dnd.rst:56 msgid "Signal end of drag when the release pattern is triggered." msgstr "當釋放模式被觸發時,發出拖動結束的訊號。" -#: ../../library/tkinter.dnd.rst:59 -msgid "Factory function for drag-and-drop process." -msgstr "用於拖放過程的工廠函式。" +#: ../../library/tkinter.dnd.rst:60 +msgid "" +"Factory function for the drag-and-drop process. Return the :class:" +"`DndHandler` instance managing the drag, or ``None`` if a drag could not be " +"started." +msgstr "" -#: ../../library/tkinter.dnd.rst:63 +#: ../../library/tkinter.dnd.rst:66 msgid ":ref:`Bindings-and-Events`" msgstr ":ref:`Bindings-and-Events`" + +#~ msgid "Factory function for drag-and-drop process." +#~ msgstr "用於拖放過程的工廠函式。" diff --git a/library/tkinter.font.po b/library/tkinter.font.po index 2e113b761b..b1e939ecf0 100644 --- a/library/tkinter.font.po +++ b/library/tkinter.font.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-20 00:18+0000\n" +"POT-Creation-Date: 2026-06-19 00:50+0000\n" "PO-Revision-Date: 2024-02-15 23:09+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -49,6 +49,12 @@ msgstr "" "建立及辨識字型為單一物件的方式,而不是每次出現時特指字型的屬性。" #: ../../library/tkinter.font.rst:29 +msgid "" +"Two fonts now compare equal (``==``) only when both are :class:`Font` " +"instances with the same name belonging to the same Tcl interpreter." +msgstr "" + +#: ../../library/tkinter.font.rst:33 msgid "arguments:" msgstr "引數:" @@ -64,12 +70,13 @@ msgstr "*name* - 獨特字型名稱" msgid "*exists* - self points to existing named font if true" msgstr "*exists* - 如果存在的話,指向現有的已命名字型" -#: ../../library/tkinter.font.rst:35 +#: ../../library/tkinter.font.rst:39 msgid "additional keyword options (ignored if *font* is specified):" msgstr "額外的關鍵字選項(若已指定 *font* 則會忽略):" #: ../../library/tkinter.font.rst:0 -msgid "*family* - font family i.e. Courier, Times" +#, fuzzy +msgid "*family* - font family, for example, Courier, Times" msgstr "*family* - 字型家族,例如:Courier、Times" #: ../../library/tkinter.font.rst:0 @@ -104,71 +111,105 @@ msgstr "*underline* - 字型加上底線(0 - 無底線、 1 - 加上底線)" msgid "*overstrike* - font strikeout (0 - none, 1 - strikeout)" msgstr "*overstrike* - 字型加上刪除線(0 - 無刪除線、 1 - 加上刪除線)" -#: ../../library/tkinter.font.rst:49 -msgid "Return the attributes of the font." -msgstr "回傳字型的屬性。" - #: ../../library/tkinter.font.rst:53 +msgid "" +"Return the actual attributes of the font, which may differ from the " +"requested ones because of platform limitations. With no *option*, return a " +"dictionary of all the attributes; if *option* is given, return the value of " +"that single attribute." +msgstr "" + +#: ../../library/tkinter.font.rst:60 msgid "Retrieve an attribute of the font." msgstr "取得字型的其中一個屬性。" -#: ../../library/tkinter.font.rst:57 -msgid "Modify attributes of the font." -msgstr "修改字體的多個屬性。" +#: ../../library/tkinter.font.rst:67 +msgid "" +"Modify one or more attributes of the font. With no arguments, return a " +"dictionary of the current attributes." +msgstr "" + +#: ../../library/tkinter.font.rst:70 +msgid ":meth:`config` is an alias of :meth:`!configure`." +msgstr "" -#: ../../library/tkinter.font.rst:61 +#: ../../library/tkinter.font.rst:74 msgid "Return new instance of the current font." msgstr "回傳目前字體的新實例。" -#: ../../library/tkinter.font.rst:65 +#: ../../library/tkinter.font.rst:78 +#, fuzzy msgid "" "Return amount of space the text would occupy on the specified display when " -"formatted in the current font. If no display is specified then the main " -"application window is assumed." +"formatted in the current font, as an integer number of pixels. If no display " +"is specified then the main application window is assumed." msgstr "" "回傳目前字型被格式化時,在特定顯示區域中文字所用的空間。若顯示區域沒有被指" "定,則會假定主程式視窗為顯示區域。" -#: ../../library/tkinter.font.rst:71 -msgid "Return font-specific data. Options include:" -msgstr "回傳字型特定的資料。其選項包含:" +#: ../../library/tkinter.font.rst:84 +msgid "" +"Return font-specific data. With no options, return a dictionary mapping each " +"metric name to its integer value; if one option name is given, return that " +"metric's value as an integer. Options include:" +msgstr "" -#: ../../library/tkinter.font.rst:74 +#: ../../library/tkinter.font.rst:90 msgid "*ascent* - distance between baseline and highest point that a" msgstr "*ascent* - 基準線以及最高點的距離" -#: ../../library/tkinter.font.rst:75 ../../library/tkinter.font.rst:78 +#: ../../library/tkinter.font.rst:91 ../../library/tkinter.font.rst:94 msgid "character of the font can occupy" msgstr "在字型中的一個字母可以佔用的空間" -#: ../../library/tkinter.font.rst:77 +#: ../../library/tkinter.font.rst:93 msgid "*descent* - distance between baseline and lowest point that a" msgstr "*descent* - 基準線以及最低點的距離" -#: ../../library/tkinter.font.rst:80 +#: ../../library/tkinter.font.rst:96 msgid "*linespace* - minimum vertical separation necessary between any two" msgstr "*linespace* - 最小所需的垂直間距" -#: ../../library/tkinter.font.rst:81 +#: ../../library/tkinter.font.rst:97 msgid "characters of the font that ensures no vertical overlap between lines." msgstr "在字型中的任兩個字母之間,確保跨行時不會有垂直重疊。" -#: ../../library/tkinter.font.rst:83 +#: ../../library/tkinter.font.rst:99 msgid "*fixed* - 1 if font is fixed-width else 0" msgstr "*fixed* - 若字型為等寬 (fixed-width) 的則為 1,否則為 0" -#: ../../library/tkinter.font.rst:87 -msgid "Return the different font families." -msgstr "回傳不同的字型家族。" +#: ../../library/tkinter.font.rst:103 +#, fuzzy +msgid "Return a tuple of the names of the available font families." +msgstr "回傳已定義字型的名字。" -#: ../../library/tkinter.font.rst:91 -msgid "Return the names of defined fonts." +#: ../../library/tkinter.font.rst:107 +#, fuzzy +msgid "Return a tuple of the names of all the defined fonts." msgstr "回傳已定義字型的名字。" -#: ../../library/tkinter.font.rst:95 -msgid "Return a :class:`Font` representation of a tk named font." -msgstr "回傳一個 :class:`Font`,代表一個 tk 已命名字型。" +#: ../../library/tkinter.font.rst:111 +msgid "" +"Return a :class:`Font` representation of the existing named font *name*. " +"*root* is the widget whose Tcl interpreter owns the font; if omitted, the " +"default root window is used." +msgstr "" -#: ../../library/tkinter.font.rst:97 +#: ../../library/tkinter.font.rst:115 msgid "The *root* parameter was added." msgstr "新增 *root* 參數。" + +#~ msgid "Return the attributes of the font." +#~ msgstr "回傳字型的屬性。" + +#~ msgid "Modify attributes of the font." +#~ msgstr "修改字體的多個屬性。" + +#~ msgid "Return font-specific data. Options include:" +#~ msgstr "回傳字型特定的資料。其選項包含:" + +#~ msgid "Return the different font families." +#~ msgstr "回傳不同的字型家族。" + +#~ msgid "Return a :class:`Font` representation of a tk named font." +#~ msgstr "回傳一個 :class:`Font`,代表一個 tk 已命名字型。" diff --git a/library/tkinter.messagebox.po b/library/tkinter.messagebox.po index db6ec74075..e97ad6a950 100644 --- a/library/tkinter.messagebox.po +++ b/library/tkinter.messagebox.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-20 00:18+0000\n" +"POT-Creation-Date: 2026-06-19 00:50+0000\n" "PO-Revision-Date: 2024-02-22 15:59+0800\n" "Last-Translator: Li-Hung Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -26,20 +26,23 @@ msgid "**Source code:** :source:`Lib/tkinter/messagebox.py`" msgstr "**原始碼:**\\ :source:`Lib/tkinter/messagebox.py`" #: ../../library/tkinter.messagebox.rst:11 +#, fuzzy msgid "" "The :mod:`!tkinter.messagebox` module provides a template base class as well " "as a variety of convenience methods for commonly used configurations. The " -"message boxes are modal and will return a subset of (``True``, ``False``, " -"``None``, :data:`OK`, :data:`CANCEL`, :data:`YES`, :data:`NO`) based on the " -"user's selection. Common message box styles and layouts include but are not " -"limited to:" +"message boxes are modal: each blocks until the user responds, then returns a " +"value that depends on the function. The ``show*`` functions and :meth:" +"`Message.show` return the symbolic name of the button the user pressed, as a " +"string (such as :data:`OK` or :data:`YES`), while the ``ask*`` functions " +"return a :class:`bool` or ``None`` (see each function below). Common message " +"box styles and layouts include but are not limited to:" msgstr "" ":mod:`!tkinter.messagebox` 模組提供了模板基底類別以及各種常用配置的便捷方法。" "訊息框 (message box) 是互動視窗 (modal),會基於使用者的選擇回傳(``True``、" "``False``、``None``、:data:`OK`、:data:`CANCEL`、:data:`YES`、:data:`NO`)的" "子集。常見的訊息框樣式 (style) 和版面配置 (layout) 包括但不限於:" -#: ../../library/tkinter.messagebox.rst:22 +#: ../../library/tkinter.messagebox.rst:25 msgid "" "Create a message window with an application-specified message, an icon and a " "set of buttons. Each of the buttons in the message window is identified by a " @@ -48,15 +51,15 @@ msgstr "" "建立一個訊息視窗,其中包含應用程式指定的訊息、一個圖示和一組按鈕。訊息視窗中" "的每個按鈕都有唯一的符號名稱作為識別(請參考 *type* 選項)。" -#: ../../library/tkinter.messagebox.rst:26 +#: ../../library/tkinter.messagebox.rst:29 msgid "The following options are supported:" msgstr "支援以下選項:" -#: ../../library/tkinter.messagebox.rst:28 +#: ../../library/tkinter.messagebox.rst:31 msgid "*command*" msgstr "*command*" -#: ../../library/tkinter.messagebox.rst:29 +#: ../../library/tkinter.messagebox.rst:32 msgid "" "Specifies the function to invoke when the user closes the dialog. The name " "of the button clicked by the user to close the dialog is passed as argument. " @@ -65,11 +68,11 @@ msgstr "" "指定當使用者關閉對話框 (dialog) 時要呼叫的函式。使用者按一下以關閉對話框的按" "鈕的名稱作為引數傳遞。此選項僅適用於 macOS。" -#: ../../library/tkinter.messagebox.rst:34 +#: ../../library/tkinter.messagebox.rst:37 msgid "*default*" msgstr "*default*" -#: ../../library/tkinter.messagebox.rst:35 +#: ../../library/tkinter.messagebox.rst:38 msgid "" "Gives the :ref:`symbolic name ` of the default button " "for this message window (:data:`OK`, :data:`CANCEL`, and so on). If this " @@ -80,11 +83,11 @@ msgstr "" "`OK`、:data:`CANCEL` 等)。如果未指定此選項,則對話框中的第一個按鈕將成為預設" "按鈕。" -#: ../../library/tkinter.messagebox.rst:40 +#: ../../library/tkinter.messagebox.rst:43 msgid "*detail*" msgstr "*detail*" -#: ../../library/tkinter.messagebox.rst:41 +#: ../../library/tkinter.messagebox.rst:44 msgid "" "Specifies an auxiliary message to the main message given by the *message* " "option. The message detail will be presented beneath the main message and, " @@ -93,11 +96,11 @@ msgstr "" "透過 *message* 選項指定將輔助訊息給主訊息。訊息詳細資訊將顯示在主要訊息下方," "並且在作業系統支援的情況下,將以比主要訊息更不強調的字體顯示。" -#: ../../library/tkinter.messagebox.rst:47 +#: ../../library/tkinter.messagebox.rst:50 msgid "*icon*" msgstr "*icon*" -#: ../../library/tkinter.messagebox.rst:48 +#: ../../library/tkinter.messagebox.rst:51 msgid "" "Specifies an :ref:`icon ` to display. If this option is " "not specified, then the :data:`INFO` icon will be displayed." @@ -105,21 +108,21 @@ msgstr "" "指定要顯示的\\ :ref:`圖示 `。如果未指定此選項,則會顯示 :" "data:`INFO` 圖示。" -#: ../../library/tkinter.messagebox.rst:52 +#: ../../library/tkinter.messagebox.rst:55 msgid "*message*" msgstr "*message*" -#: ../../library/tkinter.messagebox.rst:53 +#: ../../library/tkinter.messagebox.rst:56 msgid "" "Specifies the message to display in this message box. The default value is " "an empty string." msgstr "指定要在此訊息框中顯示的訊息。預設值為空字串。" -#: ../../library/tkinter.messagebox.rst:56 +#: ../../library/tkinter.messagebox.rst:59 msgid "*parent*" msgstr "*parent*" -#: ../../library/tkinter.messagebox.rst:57 +#: ../../library/tkinter.messagebox.rst:60 msgid "" "Makes the specified window the logical parent of the message box. The " "message box is displayed on top of its parent window." @@ -127,11 +130,11 @@ msgstr "" "使指定視窗成為訊息框的邏輯父視窗 (logical parent window)。訊息框顯示在其父視" "窗的頂部。" -#: ../../library/tkinter.messagebox.rst:60 +#: ../../library/tkinter.messagebox.rst:63 msgid "*title*" msgstr "*title*" -#: ../../library/tkinter.messagebox.rst:61 +#: ../../library/tkinter.messagebox.rst:64 msgid "" "Specifies a string to display as the title of the message box. This option " "is ignored on macOS, where platform guidelines forbid the use of a title on " @@ -140,17 +143,21 @@ msgstr "" "指定顯示為訊息框標題的字串。此選項在 macOS 上被忽略,其平台指南禁止在此類對話" "方塊上使用標題。" -#: ../../library/tkinter.messagebox.rst:65 +#: ../../library/tkinter.messagebox.rst:68 msgid "*type*" msgstr "*type*" -#: ../../library/tkinter.messagebox.rst:66 +#: ../../library/tkinter.messagebox.rst:69 msgid "" "Arranges for a :ref:`predefined set of buttons ` to be " "displayed." msgstr "安排一組需顯示的\\ :ref:`預先定義的按鈕組合 `。" -#: ../../library/tkinter.messagebox.rst:71 +#: ../../library/tkinter.messagebox.rst:74 +msgid "Tk 8.6 added the *command* option." +msgstr "" + +#: ../../library/tkinter.messagebox.rst:78 msgid "" "Display a message window and wait for the user to select one of the buttons. " "Then return the symbolic name of the selected button. Keyword arguments can " @@ -159,44 +166,44 @@ msgstr "" "顯示訊息視窗並等待使用者選擇其中一個按鈕。然後回傳所選按鈕的符號名稱。關鍵字" "引數可以覆寫建構函式中指定的選項。" -#: ../../library/tkinter.messagebox.rst:75 +#: ../../library/tkinter.messagebox.rst:82 msgid "**Information message box**" msgstr "**資訊訊息框**" -#: ../../library/tkinter.messagebox.rst:79 +#: ../../library/tkinter.messagebox.rst:86 msgid "" "Creates and displays an information message box with the specified title and " "message." msgstr "建立並顯示具有指定標題和訊息的資訊訊息框。" -#: ../../library/tkinter.messagebox.rst:82 +#: ../../library/tkinter.messagebox.rst:89 msgid "**Warning message boxes**" msgstr "**警告訊息框**" -#: ../../library/tkinter.messagebox.rst:86 +#: ../../library/tkinter.messagebox.rst:93 msgid "" "Creates and displays a warning message box with the specified title and " "message." msgstr "建立並顯示具有指定標題和訊息的警告訊息框。" -#: ../../library/tkinter.messagebox.rst:91 +#: ../../library/tkinter.messagebox.rst:98 msgid "" "Creates and displays an error message box with the specified title and " "message." msgstr "建立並顯示具有指定標題和訊息的錯誤訊息框。" -#: ../../library/tkinter.messagebox.rst:94 +#: ../../library/tkinter.messagebox.rst:101 msgid "**Question message boxes**" msgstr "**問題留言框**" -#: ../../library/tkinter.messagebox.rst:98 +#: ../../library/tkinter.messagebox.rst:105 msgid "" "Ask a question. By default shows buttons :data:`YES` and :data:`NO`. Returns " "the symbolic name of the selected button." msgstr "" "問一個問題。預設顯示按鈕 :data:`YES` 和 :data:`NO`。回傳所選按鈕的符號名稱。" -#: ../../library/tkinter.messagebox.rst:103 +#: ../../library/tkinter.messagebox.rst:110 msgid "" "Ask if operation should proceed. Shows buttons :data:`OK` and :data:" "`CANCEL`. Returns ``True`` if the answer is ok and ``False`` otherwise." @@ -204,7 +211,7 @@ msgstr "" "詢問操作是否應該繼續。顯示按鈕 :data:`OK` 和 :data:`CANCEL`。如果答案正確則傳" "回 ``True``,否則回傳 ``False``。" -#: ../../library/tkinter.messagebox.rst:108 +#: ../../library/tkinter.messagebox.rst:115 msgid "" "Ask if operation should be retried. Shows buttons :data:`RETRY` and :data:" "`CANCEL`. Return ``True`` if the answer is yes and ``False`` otherwise." @@ -212,7 +219,7 @@ msgstr "" "詢問是否應重試操作。顯示按鈕 :data:`RETRY` 和 :data:`CANCEL`。如果答案為是," "則回傳 ``True``,否則回傳 ``False``。" -#: ../../library/tkinter.messagebox.rst:113 +#: ../../library/tkinter.messagebox.rst:120 msgid "" "Ask a question. Shows buttons :data:`YES` and :data:`NO`. Returns ``True`` " "if the answer is yes and ``False`` otherwise." @@ -220,7 +227,7 @@ msgstr "" "問一個問題。顯示按鈕 :data:`YES` 和 :data:`NO`。如果答案為是,則回傳 " "``True``,否則回傳 ``False``。" -#: ../../library/tkinter.messagebox.rst:118 +#: ../../library/tkinter.messagebox.rst:125 msgid "" "Ask a question. Shows buttons :data:`YES`, :data:`NO` and :data:`CANCEL`. " "Return ``True`` if the answer is yes, ``None`` if cancelled, and ``False`` " @@ -229,47 +236,47 @@ msgstr "" "問一個問題。顯示按鈕 :data:`YES`、:data:`NO` 和 :data:`CANCEL`。如果答案為" "是,則回傳 ``True``;如果取消則回傳 ``None``,否則回傳 ``False``。" -#: ../../library/tkinter.messagebox.rst:125 +#: ../../library/tkinter.messagebox.rst:132 msgid "Symbolic names of buttons:" msgstr "按鈕的符號名稱:" -#: ../../library/tkinter.messagebox.rst:144 +#: ../../library/tkinter.messagebox.rst:151 msgid "Predefined sets of buttons:" msgstr "預先定義的按鈕組合:" -#: ../../library/tkinter.messagebox.rst:149 +#: ../../library/tkinter.messagebox.rst:156 msgid "" "Displays three buttons whose symbolic names are :data:`ABORT`, :data:`RETRY` " "and :data:`IGNORE`." msgstr "" "顯示三個按鈕,其符號名稱為 :data:`ABORT`、:data:`RETRY` 和 :data:`IGNORE`。" -#: ../../library/tkinter.messagebox.rst:156 +#: ../../library/tkinter.messagebox.rst:163 msgid "Displays one button whose symbolic name is :data:`OK`." msgstr "顯示一個按鈕,其符號名稱為 :data:`OK`。" -#: ../../library/tkinter.messagebox.rst:161 +#: ../../library/tkinter.messagebox.rst:168 msgid "" "Displays two buttons whose symbolic names are :data:`OK` and :data:`CANCEL`." msgstr "顯示兩個按鈕,其符號名稱為 :data:`OK` 和 :data:`CANCEL`。" -#: ../../library/tkinter.messagebox.rst:167 +#: ../../library/tkinter.messagebox.rst:174 msgid "" "Displays two buttons whose symbolic names are :data:`RETRY` and :data:" "`CANCEL`." msgstr "顯示兩個按鈕,其符號名稱為 :data:`RETRY` 和 :data:`CANCEL`。" -#: ../../library/tkinter.messagebox.rst:173 +#: ../../library/tkinter.messagebox.rst:180 msgid "" "Displays two buttons whose symbolic names are :data:`YES` and :data:`NO`." msgstr "顯示兩個按鈕,其符號名稱為 :data:`YES` 和 :data:`NO`。" -#: ../../library/tkinter.messagebox.rst:179 +#: ../../library/tkinter.messagebox.rst:186 msgid "" "Displays three buttons whose symbolic names are :data:`YES`, :data:`NO` and :" "data:`CANCEL`." msgstr "顯示三個按鈕,其符號名稱為 :data:`YES`、:data:`NO` 和 :data:`CANCEL`。" -#: ../../library/tkinter.messagebox.rst:184 +#: ../../library/tkinter.messagebox.rst:191 msgid "Icon images:" msgstr "圖示圖像:" diff --git a/library/tkinter.po b/library/tkinter.po index f4cab4e1b9..bbdef2e555 100644 --- a/library/tkinter.po +++ b/library/tkinter.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-07 00:19+0000\n" +"POT-Creation-Date: 2026-06-19 00:50+0000\n" "PO-Revision-Date: 2025-07-13 20:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -34,9 +34,9 @@ msgid "" "available on most Unix platforms, including macOS, as well as on Windows " "systems." msgstr "" -":mod:`!tkinter` 套件(「Tk 介面」)是 Tcl/Tk GUI 工具集的標準 Python 介面。Tk " -"和 :mod:`!tkinter` 在大多數 Unix 平台(包含 macOS)以及 Windows 系統上都可以使" -"用。" +":mod:`!tkinter` 套件(「Tk 介面」)是 Tcl/Tk GUI 工具集的標準 Python 介面。" +"Tk 和 :mod:`!tkinter` 在大多數 Unix 平台(包含 macOS)以及 Windows 系統上都可" +"以使用。" #: ../../library/tkinter.rst:17 msgid "" @@ -51,17 +51,22 @@ msgstr "" "本,這樣你就可以閱讀該版本專屬的 Tcl/Tk 文件。" #: ../../library/tkinter.rst:22 +#, fuzzy msgid "" "Tkinter supports a range of Tcl/Tk versions, built either with or without " -"thread support. The official Python binary release bundles Tcl/Tk 8.6 " -"threaded. See the source code for the :mod:`_tkinter` module for more " -"information about supported versions." +"thread support. Tcl/Tk 8.5.12 is the minimum supported version; the official " +"Python binary release bundles Tcl/Tk 8.6. See the source code for the :mod:" +"`_tkinter` module for more information about supported versions." msgstr "" "Tkinter 支援一系列的 Tcl/Tk 版本,這些版本可以是有或沒有執行緒支援的建構版" "本。官方的 Python 二進位發行版捆綁了有執行緒支援的 Tcl/Tk 8.6。關於支援版本的" "更多資訊,請參閱 :mod:`_tkinter` 模組的原始碼。" -#: ../../library/tkinter.rst:27 +#: ../../library/tkinter.rst:29 +msgid "Support for Tcl/Tk versions older than 8.5.12 was removed." +msgstr "" + +#: ../../library/tkinter.rst:32 msgid "" "Tkinter is not a thin wrapper, but adds a fair amount of its own logic to " "make the experience more pythonic. This documentation will concentrate on " @@ -72,7 +77,7 @@ msgstr "" "Python 風格(pythonic)。本文件將著重於這些新增和變更,對於未變更的細節,則會" "引導讀者參閱官方的 Tcl/Tk 文件。" -#: ../../library/tkinter.rst:34 +#: ../../library/tkinter.rst:39 msgid "" "Tcl/Tk 8.5 (2007) introduced a modern set of themed user interface " "components along with a new API to use them. Both old and new APIs are still " @@ -90,16 +95,15 @@ msgid "" "provided Python to you). If you are the distributor, see :ref:`optional-" "module-requirements`." msgstr "" -"這是一個\\ :term:`可選模組 `。如果你的 CPython " -"副本中缺少它,請查閱你的發行者(即提供 Python " -"給你的人)的文件。如果你就是發行者,請參閱 :ref:`optional-module-" -"requirements`。" +"這是一個\\ :term:`可選模組 `。如果你的 CPython 副本中缺少" +"它,請查閱你的發行者(即提供 Python 給你的人)的文件。如果你就是發行者,請參" +"閱 :ref:`optional-module-requirements`。" -#: ../../library/tkinter.rst:43 +#: ../../library/tkinter.rst:48 msgid "`TkDocs `_" msgstr "`TkDocs `_" -#: ../../library/tkinter.rst:44 +#: ../../library/tkinter.rst:49 msgid "" "Extensive tutorial on creating user interfaces with Tkinter. Explains key " "concepts, and illustrates recommended approaches using the modern API." @@ -107,55 +111,56 @@ msgstr "" "關於使用 Tkinter 建立使用者介面的詳盡教學。內容解釋了關鍵概念,並使用現代 " "API 來說明建議的方法。" -#: ../../library/tkinter.rst:47 +#: ../../library/tkinter.rst:52 msgid "" "`Tkinter 8.5 reference: a GUI for Python `_" msgstr "" "`Tkinter 8.5 reference: a GUI for Python `_" -#: ../../library/tkinter.rst:48 +#: ../../library/tkinter.rst:53 msgid "" "Reference documentation for Tkinter 8.5 detailing available classes, " "methods, and options." msgstr "Tkinter 8.5 的參考文件,詳細說明了可用的類別、方法和選項。" -#: ../../library/tkinter.rst:50 +#: ../../library/tkinter.rst:55 msgid "Tcl/Tk Resources:" msgstr "Tcl/Tk 相關資源:" -#: ../../library/tkinter.rst:52 -msgid "`Tk commands `_" +#: ../../library/tkinter.rst:57 +#, fuzzy +msgid "`Tk commands `_" msgstr "`Tk 指令 `_" -#: ../../library/tkinter.rst:53 +#: ../../library/tkinter.rst:58 msgid "" "Comprehensive reference to each of the underlying Tcl/Tk commands used by " "Tkinter." msgstr "Tkinter 所使用的每個底層 Tcl/Tk 指令的綜合參考資料。" -#: ../../library/tkinter.rst:55 +#: ../../library/tkinter.rst:60 msgid "`Tcl/Tk Home Page `_" msgstr "`Tcl/Tk 首頁 `_" -#: ../../library/tkinter.rst:56 +#: ../../library/tkinter.rst:61 msgid "Additional documentation, and links to Tcl/Tk core development." msgstr "額外的文件,以及連至 Tcl/Tk 核心開發的連結。" -#: ../../library/tkinter.rst:58 +#: ../../library/tkinter.rst:63 msgid "Books:" msgstr "書籍:" -#: ../../library/tkinter.rst:60 +#: ../../library/tkinter.rst:65 msgid "" "`Modern Tkinter for Busy Python Developers `_" msgstr "" "`Modern Tkinter for Busy Python Developers `_" -#: ../../library/tkinter.rst:61 +#: ../../library/tkinter.rst:66 msgid "By Mark Roseman. (ISBN 978-1999149567)" msgstr "由 Mark Roseman 所著。(ISBN 978-1999149567)" -#: ../../library/tkinter.rst:63 +#: ../../library/tkinter.rst:68 msgid "" "`Python GUI programming with Tkinter `_" @@ -163,19 +168,19 @@ msgstr "" "`Python GUI programming with Tkinter `_" -#: ../../library/tkinter.rst:64 +#: ../../library/tkinter.rst:69 msgid "By Alan D. Moore. (ISBN 978-1788835886)" msgstr "由 Alan D. Moore 所著。(ISBN 978-1788835886)" -#: ../../library/tkinter.rst:66 +#: ../../library/tkinter.rst:71 msgid "`Programming Python `_" msgstr "`Programming Python `_" -#: ../../library/tkinter.rst:67 +#: ../../library/tkinter.rst:72 msgid "By Mark Lutz; has excellent coverage of Tkinter. (ISBN 978-0596158101)" msgstr "由 Mark Lutz 所著;對 Tkinter 有極佳的涵蓋。(ISBN 978-0596158101)" -#: ../../library/tkinter.rst:69 +#: ../../library/tkinter.rst:74 msgid "" "`Tcl and the Tk Toolkit (2nd edition) `_" @@ -183,7 +188,7 @@ msgstr "" "`Tcl and the Tk Toolkit (2nd edition) `_" -#: ../../library/tkinter.rst:70 +#: ../../library/tkinter.rst:75 msgid "" "By John Ousterhout, inventor of Tcl/Tk, and Ken Jones; does not cover " "Tkinter. (ISBN 978-0321336330)" @@ -191,11 +196,11 @@ msgstr "" "由 Tcl/Tk 發明者 John Ousterhout 與 Ken Jones 所著;不包含 Tkinter。(ISBN " "978-0321336330)" -#: ../../library/tkinter.rst:74 +#: ../../library/tkinter.rst:79 msgid "Architecture" msgstr "架構" -#: ../../library/tkinter.rst:76 +#: ../../library/tkinter.rst:81 msgid "" "Tcl/Tk is not a single library but rather consists of a few distinct " "modules, each with separate functionality and its own official " @@ -205,11 +210,11 @@ msgstr "" "Tcl/Tk 並非單一函式庫,而是由幾個不同的模組所組成,每個模組都有獨立的功能和官" "方文件。Python 的二進位發行版也隨附了一個附加模組。" -#: ../../library/tkinter.rst:81 +#: ../../library/tkinter.rst:86 msgid "Tcl" msgstr "Tcl" -#: ../../library/tkinter.rst:82 +#: ../../library/tkinter.rst:87 msgid "" "Tcl is a dynamic interpreted programming language, just like Python. Though " "it can be used on its own as a general-purpose programming language, it is " @@ -230,11 +235,11 @@ msgstr "" "繞著協同多工(cooperative multitasking)設計的,而 Tkinter 則彌合了這種差異" "(詳情請參閱 `Threading model`_)。" -#: ../../library/tkinter.rst:94 ../../library/tkinter.rst:908 +#: ../../library/tkinter.rst:99 ../../library/tkinter.rst:975 msgid "Tk" msgstr "Tk" -#: ../../library/tkinter.rst:95 +#: ../../library/tkinter.rst:100 msgid "" "Tk is a `Tcl package `_ implemented in C " "that adds custom commands to create and manipulate GUI widgets. Each :class:" @@ -247,11 +252,11 @@ msgstr "" "Tcl 直譯器實例。Tk 的元件非常可自訂,但代價是外觀較為過時。Tk 使用 Tcl 的事件" "佇列來產生和處理 GUI 事件。" -#: ../../library/tkinter.rst:101 +#: ../../library/tkinter.rst:106 msgid "Ttk" msgstr "Ttk" -#: ../../library/tkinter.rst:102 +#: ../../library/tkinter.rst:107 msgid "" "Themed Tk (Ttk) is a newer family of Tk widgets that provide a much better " "appearance on different platforms than many of the classic Tk widgets. Ttk " @@ -262,42 +267,46 @@ msgstr "" "上提供了更好的外觀。從 Tk 8.5 版開始,Ttk 作為 Tk 的一部分發行。Python 的繫結" "(bindings)則在一個獨立的模組 :mod:`tkinter.ttk` 中提供。" -#: ../../library/tkinter.rst:107 +#: ../../library/tkinter.rst:112 +#, fuzzy msgid "" -"Internally, Tk and Ttk use facilities of the underlying operating system, i." -"e., Xlib on Unix/X11, Cocoa on macOS, GDI on Windows." +"Internally, Tk and Ttk use facilities of the underlying operating system, " +"that is, Xlib on Unix/X11, Cocoa on macOS, GDI on Windows." msgstr "" "在內部,Tk 和 Ttk 使用底層作業系統的設施,即 Unix/X11 上的 Xlib、macOS 上的 " "Cocoa、Windows 上的 GDI。" -#: ../../library/tkinter.rst:110 +#: ../../library/tkinter.rst:115 +#, fuzzy msgid "" -"When your Python application uses a class in Tkinter, e.g., to create a " -"widget, the :mod:`!tkinter` module first assembles a Tcl/Tk command string. " -"It passes that Tcl command string to an internal :mod:`_tkinter` binary " -"module, which then calls the Tcl interpreter to evaluate it. The Tcl " +"When your Python application uses a class in Tkinter, for example, to create " +"a widget, the :mod:`!tkinter` module first assembles a Tcl/Tk command " +"string. It passes that Tcl command string to an internal :mod:`_tkinter` " +"binary module, which then calls the Tcl interpreter to evaluate it. The Tcl " "interpreter will then call into the Tk and/or Ttk packages, which will in " "turn make calls to Xlib, Cocoa, or GDI." msgstr "" -"當你的 Python 應用程式使用 Tkinter 中的類別(例如,建立一個元件)時,:mod:" -"`!tkinter` 模組會先組合一個 Tcl/Tk 指令字串。它將該 Tcl 指令字串傳遞給一個內部" +"當你的 Python 應用程式使用 Tkinter 中的類別(例如,建立一個元件)時,:mod:`!" +"tkinter` 模組會先組合一個 Tcl/Tk 指令字串。它將該 Tcl 指令字串傳遞給一個內部" "的 :mod:`_tkinter` 二進位模組,後者再呼叫 Tcl 直譯器來對其進行計算。Tcl 直譯" "器接著會呼叫 Tk 和/或 Ttk 套件,而這些套件又會再呼叫 Xlib、Cocoa 或 GDI。" -#: ../../library/tkinter.rst:118 -msgid "Tkinter Modules" +#: ../../library/tkinter.rst:123 +#, fuzzy +msgid "Tkinter modules" msgstr "Tkinter 模組" -#: ../../library/tkinter.rst:120 +#: ../../library/tkinter.rst:125 msgid "" "Support for Tkinter is spread across several modules. Most applications will " "need the main :mod:`!tkinter` module, as well as the :mod:`tkinter.ttk` " "module, which provides the modern themed widget set and API::" msgstr "" -"對 Tkinter 的支援分散在數個模組中。大多數應用程式將需要主要的 :mod:`!tkinter` " -"模組,以及 :mod:`tkinter.ttk` 模組,後者提供了現代主題式元件集和 API: ::" +"對 Tkinter 的支援分散在數個模組中。大多數應用程式將需要主要的 :mod:`!" +"tkinter` 模組,以及 :mod:`tkinter.ttk` 模組,後者提供了現代主題式元件集和 " +"API: ::" -#: ../../library/tkinter.rst:125 +#: ../../library/tkinter.rst:130 msgid "" "from tkinter import *\n" "from tkinter import ttk" @@ -305,7 +314,7 @@ msgstr "" "from tkinter import *\n" "from tkinter import ttk" -#: ../../library/tkinter.rst:131 +#: ../../library/tkinter.rst:136 msgid "" "Construct a toplevel Tk widget, which is usually the main window of an " "application, and initialize a Tcl interpreter for this widget. Each " @@ -314,28 +323,28 @@ msgstr "" "建構一個頂層 Tk 元件,它通常是應用程式的主視窗,並為此元件初始化一個 Tcl 直譯" "器。每個實例都有其自己關聯的 Tcl 直譯器。" -#: ../../library/tkinter.rst:135 +#: ../../library/tkinter.rst:140 msgid "" "The :class:`Tk` class is typically instantiated using all default values. " "However, the following keyword arguments are currently recognized:" msgstr "" ":class:`Tk` 類別通常使用所有預設值來實例化。然而,目前可辨識下列關鍵字引數:" -#: ../../library/tkinter.rst:138 +#: ../../library/tkinter.rst:143 msgid "*screenName*" msgstr "*screenName*" -#: ../../library/tkinter.rst:139 +#: ../../library/tkinter.rst:144 msgid "" "When given (as a string), sets the :envvar:`DISPLAY` environment variable. " "(X11 only)" msgstr "當給定(作為字串)時,設定 :envvar:`DISPLAY` 環境變數。(僅限 X11)" -#: ../../library/tkinter.rst:141 +#: ../../library/tkinter.rst:146 msgid "*baseName*" msgstr "*baseName*" -#: ../../library/tkinter.rst:142 +#: ../../library/tkinter.rst:147 msgid "" "Name of the profile file. By default, *baseName* is derived from the " "program name (``sys.argv[0]``)." @@ -343,11 +352,11 @@ msgstr "" "設定檔的名稱。預設情況下,*baseName* 是從程式名稱(``sys.argv[0]``)衍生而" "來。" -#: ../../library/tkinter.rst:144 +#: ../../library/tkinter.rst:149 msgid "*className*" msgstr "*className*" -#: ../../library/tkinter.rst:145 +#: ../../library/tkinter.rst:150 msgid "" "Name of the widget class. Used as a profile file and also as the name with " "which Tcl is invoked (*argv0* in *interp*)." @@ -355,11 +364,11 @@ msgstr "" "元件類別的名稱。用作設定檔,也用作呼叫 Tcl 時的名稱(*interp* 中的 " "*argv0*)。" -#: ../../library/tkinter.rst:147 +#: ../../library/tkinter.rst:152 msgid "*useTk*" msgstr "*useTk*" -#: ../../library/tkinter.rst:148 +#: ../../library/tkinter.rst:153 msgid "" "If ``True``, initialize the Tk subsystem. The :func:`tkinter.Tcl() ` " "function sets this to ``False``." @@ -367,11 +376,11 @@ msgstr "" "若為 ``True``,則初始化 Tk 子系統。:func:`tkinter.Tcl() ` 函式會將此設定" "為 ``False``。" -#: ../../library/tkinter.rst:150 +#: ../../library/tkinter.rst:155 msgid "*sync*" msgstr "*sync*" -#: ../../library/tkinter.rst:151 +#: ../../library/tkinter.rst:156 msgid "" "If ``True``, execute all X server commands synchronously, so that errors are " "reported immediately. Can be used for debugging. (X11 only)" @@ -379,22 +388,24 @@ msgstr "" "若為 ``True``,則同步執行所有 X 伺服器指令,以便立即回報錯誤。可用於偵錯。" "(僅限 X11)" -#: ../../library/tkinter.rst:153 +#: ../../library/tkinter.rst:158 msgid "*use*" msgstr "*use*" -#: ../../library/tkinter.rst:154 +#: ../../library/tkinter.rst:159 +#, fuzzy msgid "" "Specifies the *id* of the window in which to embed the application, instead " "of it being created as an independent toplevel window. *id* must be " "specified in the same way as the value for the -use option for toplevel " -"widgets (that is, it has a form like that returned by :meth:`winfo_id`)." +"widgets (that is, it has a form like that returned by :meth:`~Misc." +"winfo_id`)." msgstr "" "指定要嵌入應用程式的視窗 *id*,而不是將其建立為獨立的頂層視窗。*id* 必須以與" "頂層元件的 -use 選項值相同的方式指定(也就是說,其形式類似 :meth:`winfo_id` " "回傳的形式)。" -#: ../../library/tkinter.rst:160 +#: ../../library/tkinter.rst:165 msgid "" "Note that on some platforms this will only work correctly if *id* refers to " "a Tk frame or toplevel that has its -container option enabled." @@ -402,7 +413,7 @@ msgstr "" "請注意,在某些平台上,只有當 *id* 指向一個已啟用 -container 選項的 Tk 框架或" "頂層視窗時,此功能才能正常運作。" -#: ../../library/tkinter.rst:163 +#: ../../library/tkinter.rst:168 msgid "" ":class:`Tk` reads and interprets profile files, named :file:`.{className}." "tcl` and :file:`.{baseName}.tcl`, into the Tcl interpreter and calls :func:" @@ -415,7 +426,7 @@ msgstr "" "{baseName}.py` 的內容呼叫 :func:`exec`。設定檔的路徑是 :envvar:`HOME` 環境變" "數,如果未定義,則是 :data:`os.curdir`。" -#: ../../library/tkinter.rst:172 +#: ../../library/tkinter.rst:177 msgid "" "The Tk application object created by instantiating :class:`Tk`. This " "provides access to the Tcl interpreter. Each widget that is attached the " @@ -424,15 +435,16 @@ msgstr "" "透過實例化 :class:`Tk` 建立的 Tk 應用程式物件。這提供了對 Tcl 直譯器的存取。" "每個附加到同一個 :class:`Tk` 實例的元件,其 :attr:`tk` 屬性都具有相同的值。" -#: ../../library/tkinter.rst:179 +#: ../../library/tkinter.rst:184 +#, fuzzy msgid "" -"The widget object that contains this widget. For :class:`Tk`, the :attr:`!" -"master` is :const:`None` because it is the main window. The terms *master* " +"The widget object that contains this widget. For :class:`Tk`, the :attr:`!" +"master` is :const:`None` because it is the main window. The terms *master* " "and *parent* are similar and sometimes used interchangeably as argument " -"names; however, calling :meth:`winfo_parent` returns a string of the widget " -"name whereas :attr:`!master` returns the object. *parent*/*child* reflects " -"the tree-like relationship while *master* (or *container*)/*content* " -"reflects the container structure." +"names; however, calling :meth:`~Misc.winfo_parent` returns a string of the " +"widget name whereas :attr:`!master` returns the object. *parent*/*child* " +"reflects the tree-like relationship while *master* (or *container*)/" +"*content* reflects the container structure." msgstr "" "包含此元件的元件物件。對於 :class:`Tk`,:attr:`!master` 是 :const:`None`,因" "為它是主視窗。*master* 和 *parent* 這兩個術語很相似,有時會作為引數名稱互換使" @@ -440,7 +452,7 @@ msgstr "" "則回傳物件。*parent*/*child* 反映了樹狀關係,而 *master* (或 *container*)/" "*content* 反映了容器結構。" -#: ../../library/tkinter.rst:189 +#: ../../library/tkinter.rst:196 msgid "" "The immediate descendants of this widget as a :class:`dict` with the child " "widget names as the keys and the child instance objects as the values." @@ -448,16 +460,53 @@ msgstr "" "此元件的直接子代,形式為一個 :class:`dict`,其中鍵為子元件的名稱,值為子實例" "物件。" -#: ../../library/tkinter.rst:196 +#: ../../library/tkinter.rst:202 +msgid "" +"Destroy this and all descendant widgets and, for the main window, end the " +"connection to the underlying Tcl interpreter." +msgstr "" + +#: ../../library/tkinter.rst:207 +msgid "" +"Finish loading and initializing the Tk subsystem. This is needed only when " +"the interpreter was created without Tk (for example through :func:`Tcl`); it " +"is called automatically when *useTk* is true." +msgstr "" + +#: ../../library/tkinter.rst:214 +#, fuzzy +msgid "" +"Read and source the user's profile files :file:`.{className}.tcl` and :file:" +"`.{baseName}.tcl` into the Tcl interpreter, and execute the corresponding :" +"file:`.{className}.py` and :file:`.{baseName}.py` files. This is called " +"during initialization; see the description of the constructor above." +msgstr "" +":class:`Tk` 會讀取名為 :file:`.{className}.tcl` 和 :file:`.{baseName}.tcl` 的" +"設定檔,並在 Tcl 直譯器中進行直譯,並對 :file:`.{className}.py` 和 :file:`." +"{baseName}.py` 的內容呼叫 :func:`exec`。設定檔的路徑是 :envvar:`HOME` 環境變" +"數,如果未定義,則是 :data:`os.curdir`。" + +#: ../../library/tkinter.rst:222 +msgid "" +"Report a callback exception. This is called when an exception propagates out " +"of a Tkinter callback; *exc*, *val* and *tb* are the exception type, value " +"and traceback as returned by :func:`sys.exc_info`. The default " +"implementation prints a traceback to :data:`sys.stderr`. It can be " +"overridden to customize error handling, for example to display the traceback " +"in a dialog." +msgstr "" + +#: ../../library/tkinter.rst:233 +#, fuzzy msgid "" "The :func:`Tcl` function is a factory function which creates an object much " "like that created by the :class:`Tk` class, except that it does not " -"initialize the Tk subsystem. This is most often useful when driving the Tcl " +"initialize the Tk subsystem. This is most often useful when driving the Tcl " "interpreter in an environment where one doesn't want to create extraneous " "toplevel windows, or where one cannot (such as Unix/Linux systems without an " -"X server). An object created by the :func:`Tcl` object can have a Toplevel " -"window created (and the Tk subsystem initialized) by calling its :meth:" -"`loadtk` method." +"X server). An object created by the :func:`Tcl` object can have a Toplevel " +"window created (and the Tk subsystem initialized) by calling its :meth:`~Tk." +"loadtk` method." msgstr "" ":func:`Tcl` 函式是一個工廠函式,它建立的物件與 :class:`Tk` 類別建立的物件非常" "相似,只是它不會初始化 Tk 子系統。這在驅動 Tcl 直譯器時最為有用,尤其是在不希" @@ -465,79 +514,79 @@ msgstr "" "Linux 系統)。由 :func:`Tcl` 物件建立的物件可以透過呼叫其 :meth:`loadtk` 方法" "來建立一個頂層視窗(並初始化 Tk 子系統)。" -#: ../../library/tkinter.rst:205 +#: ../../library/tkinter.rst:244 msgid "The modules that provide Tk support include:" msgstr "提供 Tk 支援的模組包括:" -#: ../../library/tkinter.rst:207 +#: ../../library/tkinter.rst:246 msgid ":mod:`!tkinter`" msgstr ":mod:`!tkinter`" -#: ../../library/tkinter.rst:208 +#: ../../library/tkinter.rst:247 msgid "Main Tkinter module." msgstr "主要的 Tkinter 模組。" -#: ../../library/tkinter.rst:210 +#: ../../library/tkinter.rst:249 msgid ":mod:`tkinter.colorchooser`" msgstr ":mod:`tkinter.colorchooser`" -#: ../../library/tkinter.rst:211 +#: ../../library/tkinter.rst:250 msgid "Dialog to let the user choose a color." msgstr "讓使用者選擇顏色的對話方塊。" -#: ../../library/tkinter.rst:213 +#: ../../library/tkinter.rst:252 msgid ":mod:`tkinter.commondialog`" msgstr ":mod:`tkinter.commondialog`" -#: ../../library/tkinter.rst:214 +#: ../../library/tkinter.rst:253 msgid "Base class for the dialogs defined in the other modules listed here." msgstr "此處列出的其他模組中定義的對話方塊的基底類別。" -#: ../../library/tkinter.rst:216 +#: ../../library/tkinter.rst:255 msgid ":mod:`tkinter.filedialog`" msgstr ":mod:`tkinter.filedialog`" -#: ../../library/tkinter.rst:217 +#: ../../library/tkinter.rst:256 msgid "Common dialogs to allow the user to specify a file to open or save." msgstr "讓使用者指定要開啟或儲存的檔案的通用對話方塊。" -#: ../../library/tkinter.rst:219 +#: ../../library/tkinter.rst:258 msgid ":mod:`tkinter.font`" msgstr ":mod:`tkinter.font`" -#: ../../library/tkinter.rst:220 +#: ../../library/tkinter.rst:259 msgid "Utilities to help work with fonts." msgstr "協助處理字型的工具程式。" -#: ../../library/tkinter.rst:222 +#: ../../library/tkinter.rst:261 msgid ":mod:`tkinter.messagebox`" msgstr ":mod:`tkinter.messagebox`" -#: ../../library/tkinter.rst:223 +#: ../../library/tkinter.rst:262 msgid "Access to standard Tk dialog boxes." msgstr "存取標準的 Tk 對話方塊。" -#: ../../library/tkinter.rst:225 +#: ../../library/tkinter.rst:264 msgid ":mod:`tkinter.scrolledtext`" msgstr ":mod:`tkinter.scrolledtext`" -#: ../../library/tkinter.rst:226 +#: ../../library/tkinter.rst:265 msgid "Text widget with a vertical scroll bar built in." msgstr "內建垂直捲軸的文字元件。" -#: ../../library/tkinter.rst:228 +#: ../../library/tkinter.rst:267 msgid ":mod:`tkinter.simpledialog`" msgstr ":mod:`tkinter.simpledialog`" -#: ../../library/tkinter.rst:229 +#: ../../library/tkinter.rst:268 msgid "Basic dialogs and convenience functions." msgstr "基本的對話方塊和便利函式。" -#: ../../library/tkinter.rst:231 +#: ../../library/tkinter.rst:270 msgid ":mod:`tkinter.ttk`" msgstr ":mod:`tkinter.ttk`" -#: ../../library/tkinter.rst:232 +#: ../../library/tkinter.rst:271 msgid "" "Themed widget set introduced in Tk 8.5, providing modern alternatives for " "many of the classic widgets in the main :mod:`!tkinter` module." @@ -545,15 +594,15 @@ msgstr "" "在 Tk 8.5 中引入的主題式元件集,為主 :mod:`!tkinter` 模組中的許多傳統元件提供" "了現代化的替代方案。" -#: ../../library/tkinter.rst:235 +#: ../../library/tkinter.rst:274 msgid "Additional modules:" msgstr "額外模組:" -#: ../../library/tkinter.rst:240 +#: ../../library/tkinter.rst:279 msgid ":mod:`_tkinter`" msgstr ":mod:`_tkinter`" -#: ../../library/tkinter.rst:241 +#: ../../library/tkinter.rst:280 msgid "" "A binary module that contains the low-level interface to Tcl/Tk. It is " "automatically imported by the main :mod:`!tkinter` module, and should never " @@ -565,53 +614,55 @@ msgstr "" "用程式開發者不應直接使用它。它通常是一個共享函式庫(或 DLL),但在某些情況下" "可能會與 Python 直譯器靜態連結。" -#: ../../library/tkinter.rst:247 +#: ../../library/tkinter.rst:286 msgid ":mod:`idlelib`" msgstr ":mod:`idlelib`" -#: ../../library/tkinter.rst:248 +#: ../../library/tkinter.rst:287 msgid "" "Python's Integrated Development and Learning Environment (IDLE). Based on :" "mod:`!tkinter`." msgstr "Python 的整合開發與學習環境(IDLE)。基於 :mod:`!tkinter`。" -#: ../../library/tkinter.rst:251 -msgid ":mod:`tkinter.constants`" +#: ../../library/tkinter.rst:290 +#, fuzzy +msgid ":mod:`!tkinter.constants`" msgstr ":mod:`tkinter.constants`" -#: ../../library/tkinter.rst:252 +#: ../../library/tkinter.rst:291 msgid "" "Symbolic constants that can be used in place of strings when passing various " "parameters to Tkinter calls. Automatically imported by the main :mod:`!" "tkinter` module." msgstr "" -"在將各種參數傳遞給 Tkinter 呼叫時,可用於替代字串的符號常數。由主 :mod:" -"`!tkinter` 模組自動引入。" +"在將各種參數傳遞給 Tkinter 呼叫時,可用於替代字串的符號常數。由主 :mod:`!" +"tkinter` 模組自動引入。" -#: ../../library/tkinter.rst:256 +#: ../../library/tkinter.rst:295 msgid ":mod:`tkinter.dnd`" msgstr ":mod:`tkinter.dnd`" -#: ../../library/tkinter.rst:257 +#: ../../library/tkinter.rst:296 msgid "" "(experimental) Drag-and-drop support for :mod:`!tkinter`. This will become " "deprecated when it is replaced with the Tk DND." msgstr "" "(實驗性)對 :mod:`!tkinter` 的拖放支援。當它被 Tk DND 取代時,將會被棄用。" -#: ../../library/tkinter.rst:260 +#: ../../library/tkinter.rst:299 msgid ":mod:`turtle`" msgstr ":mod:`turtle`" -#: ../../library/tkinter.rst:261 +#: ../../library/tkinter.rst:300 msgid "Turtle graphics in a Tk window." msgstr "在 Tk 視窗中的海龜繪圖。" -#: ../../library/tkinter.rst:265 -msgid "Tkinter Life Preserver" +#: ../../library/tkinter.rst:306 +#, fuzzy +msgid "Tkinter life preserver" msgstr "Tkinter 應急指南" -#: ../../library/tkinter.rst:267 +#: ../../library/tkinter.rst:308 msgid "" "This section is not designed to be an exhaustive tutorial on either Tk or " "Tkinter. For that, refer to one of the external resources noted earlier. " @@ -623,7 +674,7 @@ msgstr "" "一。相反地,本節提供了一個快速導覽,介紹 Tkinter 應用程式的外觀、識別基礎的 " "Tk 概念,並解釋 Tkinter 包裝器的結構。" -#: ../../library/tkinter.rst:273 +#: ../../library/tkinter.rst:314 msgid "" "The remainder of this section will help you to identify the classes, " "methods, and options you'll need in your Tkinter application, and where to " @@ -633,11 +684,12 @@ msgstr "" "本節的其餘部分將幫助你識別在 Tkinter 應用程式中所需的類別、方法和選項,以及在" "哪裡可以找到關於它們的更詳細文件,包括在官方的 Tcl/Tk 參考手冊中。" -#: ../../library/tkinter.rst:280 -msgid "A Hello World Program" +#: ../../library/tkinter.rst:321 +#, fuzzy +msgid "A Hello World program" msgstr "一個 Hello World 程式" -#: ../../library/tkinter.rst:282 +#: ../../library/tkinter.rst:323 msgid "" "We'll start by walking through a \"Hello World\" application in Tkinter. " "This isn't the smallest one we could write, but has enough to illustrate " @@ -646,7 +698,7 @@ msgstr "" "我們將從一個 Tkinter 的 \"Hello World\" 應用程式開始。這不是我們能寫出的最小" "程式,但足以說明一些你需要知道的關鍵概念。" -#: ../../library/tkinter.rst:288 +#: ../../library/tkinter.rst:329 msgid "" "from tkinter import *\n" "from tkinter import ttk\n" @@ -666,7 +718,7 @@ msgstr "" "ttk.Button(frm, text=\"Quit\", command=root.destroy).grid(column=1, row=0)\n" "root.mainloop()" -#: ../../library/tkinter.rst:298 +#: ../../library/tkinter.rst:339 msgid "" "After the imports, the next line creates an instance of the :class:`Tk` " "class, which initializes Tk and creates its associated Tcl interpreter. It " @@ -676,7 +728,7 @@ msgstr "" "在引入之後,下一行建立了一個 :class:`Tk` 類別的實例,它會初始化 Tk 並建立其關" "聯的 Tcl 直譯器。它還會建立一個頂層視窗,稱為根視窗,作為應用程式的主視窗。" -#: ../../library/tkinter.rst:303 +#: ../../library/tkinter.rst:344 msgid "" "The following line creates a frame widget, which in this case will contain a " "label and a button we'll create next. The frame is fit inside the root " @@ -685,24 +737,26 @@ msgstr "" "接下來的一行建立了一個框架元件,在本例中,它將包含我們接下來要建立的一個標籤" "和一個按鈕。該框架被放置在根視窗內。" -#: ../../library/tkinter.rst:307 +#: ../../library/tkinter.rst:348 +#, fuzzy msgid "" "The next line creates a label widget holding a static text string. The :meth:" -"`grid` method is used to specify the relative layout (position) of the label " -"within its containing frame widget, similar to how tables in HTML work." +"`~Grid.grid` method is used to specify the relative layout (position) of the " +"label within its containing frame widget, similar to how tables in HTML work." msgstr "" "下一行建立了一個包含靜態文字字串的標籤元件。:meth:`grid` 方法用於指定標籤在其" "包含的框架元件中的相對佈局(位置),類似於 HTML 中表格的運作方式。" -#: ../../library/tkinter.rst:311 +#: ../../library/tkinter.rst:353 +#, fuzzy msgid "" "A button widget is then created, and placed to the right of the label. When " -"pressed, it will call the :meth:`destroy` method of the root window." +"pressed, it will call the :meth:`~Misc.destroy` method of the root window." msgstr "" "然後建立一個按鈕元件,並放置在標籤的右側。當按下時,它將呼叫根視窗的 :meth:" "`destroy` 方法。" -#: ../../library/tkinter.rst:314 +#: ../../library/tkinter.rst:356 msgid "" "Finally, the :meth:`mainloop` method puts everything on the display, and " "responds to user input until the program terminates." @@ -710,19 +764,20 @@ msgstr "" "最後,:meth:`mainloop` 方法將所有內容顯示在螢幕上,並回應使用者輸入,直到程式" "終止。" -#: ../../library/tkinter.rst:320 -msgid "Important Tk Concepts" +#: ../../library/tkinter.rst:362 +#, fuzzy +msgid "Important Tk concepts" msgstr "重要的 Tk 概念" -#: ../../library/tkinter.rst:322 +#: ../../library/tkinter.rst:364 msgid "Even this simple program illustrates the following key Tk concepts:" msgstr "即使是這個簡單的程式也說明了以下關鍵的 Tk 概念:" -#: ../../library/tkinter.rst:324 +#: ../../library/tkinter.rst:366 msgid "widgets" msgstr "元件(widgets)" -#: ../../library/tkinter.rst:325 +#: ../../library/tkinter.rst:367 msgid "" "A Tkinter user interface is made up of individual *widgets*. Each widget is " "represented as a Python object, instantiated from classes like :class:`ttk." @@ -732,11 +787,11 @@ msgstr "" "Python 物件,從 :class:`ttk.Frame`、:class:`ttk.Label` 和 :class:`ttk." "Button` 等類別實例化而來。" -#: ../../library/tkinter.rst:329 +#: ../../library/tkinter.rst:371 msgid "widget hierarchy" msgstr "元件階層(widget hierarchy)" -#: ../../library/tkinter.rst:330 +#: ../../library/tkinter.rst:372 msgid "" "Widgets are arranged in a *hierarchy*. The label and button were contained " "within a frame, which in turn was contained within the root window. When " @@ -747,11 +802,11 @@ msgstr "" "在根視窗內。在建立每個\\ *子*\\ 元件時,其\\ *父*\\ 元件會作為第一個引數傳遞" "給元件的建構函式。" -#: ../../library/tkinter.rst:335 +#: ../../library/tkinter.rst:377 msgid "configuration options" msgstr "設定選項(configuration options)" -#: ../../library/tkinter.rst:336 +#: ../../library/tkinter.rst:378 msgid "" "Widgets have *configuration options*, which modify their appearance and " "behavior, such as the text to display in a label or button. Different " @@ -760,11 +815,11 @@ msgstr "" "元件具有\\ *設定選項*,可以修改其外觀和行為,例如在標籤或按鈕中顯示的文字。不" "同類別的元件會有不同的選項集。" -#: ../../library/tkinter.rst:340 +#: ../../library/tkinter.rst:382 msgid "geometry management" msgstr "佈局管理(geometry management)" -#: ../../library/tkinter.rst:341 +#: ../../library/tkinter.rst:383 msgid "" "Widgets aren't automatically added to the user interface when they are " "created. A *geometry manager* like ``grid`` controls where in the user " @@ -773,11 +828,11 @@ msgstr "" "元件在建立時不會自動新增到使用者介面中。像 ``grid`` 這樣的\\ *佈局管理器*\\ " "(geometry manager)會控制它們在使用者介面中的放置位置。" -#: ../../library/tkinter.rst:345 +#: ../../library/tkinter.rst:387 msgid "event loop" msgstr "事件迴圈(event loop)" -#: ../../library/tkinter.rst:346 +#: ../../library/tkinter.rst:388 msgid "" "Tkinter reacts to user input, changes from your program, and even refreshes " "the display only when actively running an *event loop*. If your program " @@ -786,11 +841,12 @@ msgstr "" "Tkinter 只有在主動執行\\ *事件迴圈*\\ 時,才會對使用者輸入、程式的變更,甚至" "螢幕刷新做出反應。如果你的程式沒有執行事件迴圈,你的使用者介面將不會更新。" -#: ../../library/tkinter.rst:352 -msgid "Understanding How Tkinter Wraps Tcl/Tk" +#: ../../library/tkinter.rst:394 +#, fuzzy +msgid "Understanding how Tkinter wraps Tcl/Tk" msgstr "了解 Tkinter 如何包裝 Tcl/Tk" -#: ../../library/tkinter.rst:354 +#: ../../library/tkinter.rst:396 msgid "" "When your application uses Tkinter's classes and methods, internally Tkinter " "is assembling strings representing Tcl/Tk commands, and executing those " @@ -800,7 +856,7 @@ msgstr "" "當你的應用程式使用 Tkinter 的類別和方法時,Tkinter 內部正在組合代表 Tcl/Tk 指" "令的字串,並在附加到你應用程式 :class:`Tk` 實例的 Tcl 直譯器中執行這些指令。" -#: ../../library/tkinter.rst:359 +#: ../../library/tkinter.rst:401 msgid "" "Whether it's trying to navigate reference documentation, trying to find the " "right method or option, adapting some existing code, or debugging your " @@ -810,13 +866,13 @@ msgstr "" "無論是試圖瀏覽參考文件、尋找正確的方法或選項、改寫一些現有程式碼,還是偵錯你" "的 Tkinter 應用程式,在某些時候,了解那些底層 Tcl/Tk 指令的樣貌會很有幫助。" -#: ../../library/tkinter.rst:364 +#: ../../library/tkinter.rst:406 msgid "" "To illustrate, here is the Tcl/Tk equivalent of the main part of the Tkinter " "script above." msgstr "為了說明,以下是上面 Tkinter 腳本主要部分的 Tcl/Tk 對等程式碼。" -#: ../../library/tkinter.rst:369 +#: ../../library/tkinter.rst:411 msgid "" "ttk::frame .frm -padding 10\n" "grid .frm\n" @@ -830,7 +886,7 @@ msgstr "" "grid [ttk::button .frm.btn -text \"Quit\" -command \"destroy .\"] -column 1 -" "row 0" -#: ../../library/tkinter.rst:375 +#: ../../library/tkinter.rst:417 msgid "" "Tcl's syntax is similar to many shell languages, where the first word is the " "command to be executed, with arguments to that command following it, " @@ -840,19 +896,19 @@ msgstr "" "Tcl 的語法類似於許多 shell 語言,第一個字是要執行的指令,後面跟著該指令的引" "數,以空格分隔。在不深入太多細節的情況下,請注意以下幾點:" -#: ../../library/tkinter.rst:379 +#: ../../library/tkinter.rst:421 msgid "" "The commands used to create widgets (like ``ttk::frame``) correspond to " "widget classes in Tkinter." msgstr "用於建立元件的指令(如 ``ttk::frame``)對應於 Tkinter 中的元件類別。" -#: ../../library/tkinter.rst:382 +#: ../../library/tkinter.rst:424 msgid "" "Tcl widget options (like ``-text``) correspond to keyword arguments in " "Tkinter." msgstr "Tcl 元件選項(如 ``-text``)對應於 Tkinter 中的關鍵字引數。" -#: ../../library/tkinter.rst:385 +#: ../../library/tkinter.rst:427 msgid "" "Widgets are referred to by a *pathname* in Tcl (like ``.frm.btn``), whereas " "Tkinter doesn't use names but object references." @@ -860,7 +916,7 @@ msgstr "" "在 Tcl 中,元件是透過\\ *路徑名稱*\\ (如 ``.frm.btn``)來參照,而 Tkinter 不" "使用名稱,而是使用物件參照。" -#: ../../library/tkinter.rst:388 +#: ../../library/tkinter.rst:430 msgid "" "A widget's place in the widget hierarchy is encoded in its (hierarchical) " "pathname, which uses a ``.`` (dot) as a path separator. The pathname for the " @@ -871,7 +927,7 @@ msgstr "" "(點)作為路徑分隔符。根視窗的路徑名稱就是 ``.``\\ (點)。在 Tkinter 中,階" "層不是由路徑名稱定義的,而是在建立每個子元件時指定父元件來定義的。" -#: ../../library/tkinter.rst:394 +#: ../../library/tkinter.rst:436 msgid "" "Operations which are implemented as separate *commands* in Tcl (like " "``grid`` or ``destroy``) are represented as *methods* on Tkinter widget " @@ -883,11 +939,11 @@ msgstr "" "Tkinter 中則表示為元件物件上的\\ *方法*。正如你稍後會看到的,在其他時候,Tcl " "使用的看起來像是對元件物件的方法呼叫,這更接近 Tkinter 中的用法。" -#: ../../library/tkinter.rst:402 +#: ../../library/tkinter.rst:444 msgid "How do I...? What option does...?" msgstr "我該如何...?哪個選項可以...?" -#: ../../library/tkinter.rst:404 +#: ../../library/tkinter.rst:446 msgid "" "If you're not sure how to do something in Tkinter, and you can't immediately " "find it in the tutorial or reference documentation you're using, there are a " @@ -896,7 +952,7 @@ msgstr "" "如果你不確定如何在 Tkinter 中做某件事,並且無法立即在你正在使用的教學或參考文" "件中找到它,這裡有一些可能有幫助的策略。" -#: ../../library/tkinter.rst:408 +#: ../../library/tkinter.rst:450 msgid "" "First, remember that the details of how individual widgets work may vary " "across different versions of both Tkinter and Tcl/Tk. If you're searching " @@ -906,7 +962,7 @@ msgstr "" "首先,請記住,個別元件的運作細節可能會因 Tkinter 和 Tcl/Tk 的不同版本而異。如" "果你正在搜尋文件,請確保它對應於你系統上安裝的 Python 和 Tcl/Tk 版本。" -#: ../../library/tkinter.rst:413 +#: ../../library/tkinter.rst:455 msgid "" "When searching for how to use an API, it helps to know the exact name of the " "class, option, or method that you're using. Introspection, either in an " @@ -917,18 +973,19 @@ msgstr "" "自省(Introspection),無論是在互動式 Python shell 中還是使用 :func:`print`," "都可以幫助你識別所需內容。" -#: ../../library/tkinter.rst:418 +#: ../../library/tkinter.rst:460 +#, fuzzy msgid "" "To find out what configuration options are available on any widget, call " -"its :meth:`configure` method, which returns a dictionary containing a " +"its :meth:`~Misc.configure` method, which returns a dictionary containing a " "variety of information about each object, including its default and current " -"values. Use :meth:`keys` to get just the names of each option." +"values. Use :meth:`~Misc.keys` to get just the names of each option." msgstr "" "要找出任何元件上有哪些可用的設定選項,請呼叫其 :meth:`configure` 方法,該方法" "會回傳一個字典,其中包含有關每個物件的各種資訊,包括其預設值和目前值。使用 :" "meth:`keys` 僅取得每個選項的名稱。" -#: ../../library/tkinter.rst:425 +#: ../../library/tkinter.rst:467 msgid "" "btn = ttk.Button(frm, ...)\n" "print(btn.configure().keys())" @@ -936,7 +993,7 @@ msgstr "" "btn = ttk.Button(frm, ...)\n" "print(btn.configure().keys())" -#: ../../library/tkinter.rst:428 +#: ../../library/tkinter.rst:470 msgid "" "As most widgets have many configuration options in common, it can be useful " "to find out which are specific to a particular widget class. Comparing the " @@ -946,11 +1003,11 @@ msgstr "" "由於大多數元件有許多共通的設定選項,找出特定於某個元件類別的選項會很有用。將" "選項串列與像框架這樣較簡單的元件的選項串列進行比較,是做到這一點的一種方法。" -#: ../../library/tkinter.rst:435 +#: ../../library/tkinter.rst:477 msgid "print(set(btn.configure().keys()) - set(frm.configure().keys()))" msgstr "print(set(btn.configure().keys()) - set(frm.configure().keys()))" -#: ../../library/tkinter.rst:437 +#: ../../library/tkinter.rst:479 msgid "" "Similarly, you can find the available methods for a widget object using the " "standard :func:`dir` function. If you try it, you'll see there are over 200 " @@ -961,7 +1018,7 @@ msgstr "" "下,你會看到有超過 200 個常見的元件方法,所以再次強調,識別特定於某個元件類別" "的方法是很有幫助的。" -#: ../../library/tkinter.rst:444 +#: ../../library/tkinter.rst:486 msgid "" "print(dir(btn))\n" "print(set(dir(btn)) - set(dir(frm)))" @@ -969,14 +1026,16 @@ msgstr "" "print(dir(btn))\n" "print(set(dir(btn)) - set(dir(frm)))" -#: ../../library/tkinter.rst:449 -msgid "Navigating the Tcl/Tk Reference Manual" +#: ../../library/tkinter.rst:491 +#, fuzzy +msgid "Navigating the Tcl/Tk reference manual" msgstr "瀏覽 Tcl/Tk 參考手冊" -#: ../../library/tkinter.rst:451 +#: ../../library/tkinter.rst:493 +#, fuzzy msgid "" -"As noted, the official `Tk commands `_ reference manual (man pages) is often the most accurate " +"As noted, the official `Tk commands `_ reference manual (man pages) is often the most accurate " "description of what specific operations on widgets do. Even when you know " "the name of the option or method that you need, you may still have a few " "places to look." @@ -985,18 +1044,19 @@ msgstr "" "htm>`_ 參考手冊(man pages)通常是對元件上特定操作作用的最準確描述。即使你知" "道所需選項或方法的名稱,你可能仍有幾個地方需要查看。" -#: ../../library/tkinter.rst:456 +#: ../../library/tkinter.rst:500 +#, fuzzy msgid "" "While all operations in Tkinter are implemented as method calls on widget " "objects, you've seen that many Tcl/Tk operations appear as commands that " "take a widget pathname as its first parameter, followed by optional " -"parameters, e.g." +"parameters, for example" msgstr "" "雖然 Tkinter 中的所有操作都實作為對元件物件的方法呼叫,但你已經看到許多 Tcl/" "Tk 操作顯示為指令,這些指令將元件路徑名稱作為其第一個參數,後面跟著可選的參" "數,例如:" -#: ../../library/tkinter.rst:463 +#: ../../library/tkinter.rst:507 msgid "" "destroy .\n" "grid .frm.btn -column 0 -row 0" @@ -1004,7 +1064,7 @@ msgstr "" "destroy .\n" "grid .frm.btn -column 0 -row 0" -#: ../../library/tkinter.rst:466 +#: ../../library/tkinter.rst:510 msgid "" "Others, however, look more like methods called on a widget object (in fact, " "when you create a widget in Tcl/Tk, it creates a Tcl command with the name " @@ -1015,7 +1075,7 @@ msgstr "" "個元件時,它會建立一個以元件路徑名稱為名的 Tcl 指令,該指令的第一個參數是要呼" "叫的方法名稱)。" -#: ../../library/tkinter.rst:473 +#: ../../library/tkinter.rst:517 msgid "" ".frm.btn invoke\n" ".frm.lbl configure -text \"Goodbye\"" @@ -1023,14 +1083,16 @@ msgstr "" ".frm.btn invoke\n" ".frm.lbl configure -text \"Goodbye\"" -#: ../../library/tkinter.rst:477 +#: ../../library/tkinter.rst:521 +#, fuzzy msgid "" "In the official Tcl/Tk reference documentation, you'll find most operations " -"that look like method calls on the man page for a specific widget (e.g., " -"you'll find the :meth:`invoke` method on the `ttk::button `_ man page), while functions that take a " -"widget as a parameter often have their own man page (e.g., `grid `_)." +"that look like method calls on the man page for a specific widget (for " +"example, you'll find the :meth:`~tkinter.ttk.Button.invoke` method on the " +"`ttk::button `_ " +"man page), while functions that take a widget as a parameter often have " +"their own man page (for example, `grid `_)." msgstr "" "在官方的 Tcl/Tk 參考文件中,你會在特定元件的 man page 上找到大多數看起來像方" "法呼叫的操作(例如,你可以在 `ttk::button `_)。" -#: ../../library/tkinter.rst:485 +#: ../../library/tkinter.rst:529 +#, fuzzy msgid "" -"You'll find many common options and methods in the `options `_ or `ttk::widget `_ man pages, while others are found in the man " -"page for a specific widget class." +"You'll find many common options and methods in the `options `_ or `ttk::widget `_ man pages, while others are " +"found in the man page for a specific widget class." msgstr "" "你可以在 `options `_ 或 " "`ttk::widget `_ man page " "中找到許多常見的選項和方法,而其他的則在特定元件類別的 man page 中找到。" -#: ../../library/tkinter.rst:490 +#: ../../library/tkinter.rst:534 +#, fuzzy msgid "" -"You'll also find that many Tkinter methods have compound names, e.g., :func:" -"`winfo_x`, :func:`winfo_height`, :func:`winfo_viewable`. You'd find " -"documentation for all of these in the `winfo `_ man page." +"You'll also find that many Tkinter methods have compound names, for " +"example, :meth:`~Misc.winfo_x`, :meth:`~Misc.winfo_height`, :meth:`~Misc." +"winfo_viewable`. You'd find documentation for all of these in the `winfo " +"`_ man page." msgstr "" "你還會發現許多 Tkinter 方法有複合名稱,例如 :func:`winfo_x`、:func:" "`winfo_height`、:func:`winfo_viewable`。你可以在 `winfo `_ man page 中找到所有這些文件的說明。" -#: ../../library/tkinter.rst:496 +#: ../../library/tkinter.rst:541 msgid "" "Somewhat confusingly, there are also methods on all Tkinter widgets that " "don't actually operate on the widget, but operate at a global scope, " @@ -1073,11 +1137,11 @@ msgstr "" "法。(它們恰好被實作為所有 Tkinter 元件都繼承的基底 :class:`Widget` 類別中的" "方法)。" -#: ../../library/tkinter.rst:505 +#: ../../library/tkinter.rst:550 msgid "Threading model" msgstr "執行緒模型" -#: ../../library/tkinter.rst:507 +#: ../../library/tkinter.rst:552 msgid "" "Python and Tcl/Tk have very different threading models, which :mod:`!" "tkinter` tries to bridge. If you use threads, you may need to be aware of " @@ -1086,7 +1150,7 @@ msgstr "" "Python 和 Tcl/Tk 有非常不同的執行緒模型,:mod:`!tkinter` 試圖彌合這種差異。如" "果你使用執行緒,你可能需要意識到這一點。" -#: ../../library/tkinter.rst:510 +#: ../../library/tkinter.rst:555 msgid "" "A Python interpreter may have many threads associated with it. In Tcl, " "multiple threads can be created, but each thread has a separate Tcl " @@ -1098,7 +1162,7 @@ msgstr "" "但每個執行緒都有一個獨立的 Tcl 直譯器實例與之關聯。執行緒也可以建立多個直譯器" "實例,但每個直譯器實例只能由建立它的那個執行緒使用。" -#: ../../library/tkinter.rst:515 +#: ../../library/tkinter.rst:560 msgid "" "Each :class:`Tk` object created by :mod:`!tkinter` contains a Tcl " "interpreter. It also keeps track of which thread created that interpreter. " @@ -1108,21 +1172,22 @@ msgid "" "executed, the result is returned to the calling Python thread." msgstr "" "由 :mod:`!tkinter` 建立的每個 :class:`Tk` 物件都包含一個 Tcl 直譯器。它還會追" -"蹤是哪個執行緒建立了該直譯器。可以從任何 Python 執行緒呼叫 :mod:`!tkinter`。在" -"內部,如果呼叫來自建立 :class:`Tk` 物件的執行緒以外的執行緒,則會將一個事件發" -"佈到直譯器的事件佇列中,執行後,結果會回傳給呼叫的 Python 執行緒。" +"蹤是哪個執行緒建立了該直譯器。可以從任何 Python 執行緒呼叫 :mod:`!tkinter`。" +"在內部,如果呼叫來自建立 :class:`Tk` 物件的執行緒以外的執行緒,則會將一個事件" +"發佈到直譯器的事件佇列中,執行後,結果會回傳給呼叫的 Python 執行緒。" -#: ../../library/tkinter.rst:522 +#: ../../library/tkinter.rst:567 +#, fuzzy msgid "" "Tcl/Tk applications are normally event-driven, meaning that after " -"initialization, the interpreter runs an event loop (i.e. :func:`Tk." -"mainloop`) and responds to events. Because it is single-threaded, event " -"handlers must respond quickly, otherwise they will block other events from " -"being processed. To avoid this, any long-running computations should not run " -"in an event handler, but are either broken into smaller pieces using timers, " -"or run in another thread. This is different from many GUI toolkits where the " -"GUI runs in a completely separate thread from all application code including " -"event handlers." +"initialization, the interpreter runs an event loop (that is, :meth:`Tk." +"mainloop `) and responds to events. Because it is single-" +"threaded, event handlers must respond quickly, otherwise they will block " +"other events from being processed. To avoid this, any long-running " +"computations should not run in an event handler, but are either broken into " +"smaller pieces using timers, or run in another thread. This is different " +"from many GUI toolkits where the GUI runs in a completely separate thread " +"from all application code including event handlers." msgstr "" "Tcl/Tk 應用程式通常是事件驅動的,這意味著在初始化之後,直譯器會執行一個事件迴" "圈(即 :func:`Tk.mainloop`)並回應事件。因為它是單執行緒的,事件處理常式必須" @@ -1131,7 +1196,7 @@ msgstr "" "行緒中執行。這與許多 GUI 工具集不同,在那些工具集中,GUI 在一個與所有應用程式" "碼(包括事件處理常式)完全分離的執行緒中執行。" -#: ../../library/tkinter.rst:531 +#: ../../library/tkinter.rst:578 msgid "" "If the Tcl interpreter is not running the event loop and processing events, " "any :mod:`!tkinter` calls made from threads other than the one running the " @@ -1140,22 +1205,25 @@ msgstr "" "如果 Tcl 直譯器沒有在執行事件迴圈和處理事件,那麼從執行 Tcl 直譯器的執行緒以" "外的執行緒發出的任何 :mod:`!tkinter` 呼叫都將失敗。" -#: ../../library/tkinter.rst:535 +#: ../../library/tkinter.rst:582 msgid "A number of special cases exist:" msgstr "存在一些特殊情況:" -#: ../../library/tkinter.rst:537 +#: ../../library/tkinter.rst:584 +#, fuzzy msgid "" -"Tcl/Tk libraries can be built so they are not thread-aware. In this case, :" -"mod:`!tkinter` calls the library from the originating Python thread, even if " -"this is different than the thread that created the Tcl interpreter. A global " -"lock ensures only one call occurs at a time." +"Tcl/Tk libraries built without thread support are now rare: the bundled Tcl/" +"Tk 8.6 is built with thread support, so this case only arises with some " +"older non-threaded builds. When the library is not thread-aware, :mod:`!" +"tkinter` calls the library from the originating Python thread, even if this " +"is different than the thread that created the Tcl interpreter. A global lock " +"ensures only one call occurs at a time." msgstr "" "Tcl/Tk 函式庫可以被建構成不具備執行緒感知能力。在這種情況下,:mod:`!tkinter` " "會從原始的 Python 執行緒呼叫該函式庫,即使這與建立 Tcl 直譯器的執行緒不同。一" "個全域鎖確保一次只發生一個呼叫。" -#: ../../library/tkinter.rst:542 +#: ../../library/tkinter.rst:591 msgid "" "While :mod:`!tkinter` allows you to create more than one instance of a :" "class:`Tk` object (with its own interpreter), all interpreters that are part " @@ -1164,12 +1232,12 @@ msgid "" "Otherwise, it's best to create them in separate threads and ensure you're " "running a thread-aware Tcl/Tk build." msgstr "" -"雖然 :mod:`!tkinter` 允許你建立多個 :class:`Tk` 物件的實例(每個都有自己的直譯" -"器),但屬於同一個執行緒的所有直譯器共享一個共同的事件佇列,這很快就會變得混" -"亂。在實務上,不要一次建立多個 :class:`Tk` 的實例。否則,最好在不同的執行緒中" -"建立它們,並確保你正在執行一個具備執行緒感知能力的 Tcl/Tk 建構版本。" +"雖然 :mod:`!tkinter` 允許你建立多個 :class:`Tk` 物件的實例(每個都有自己的直" +"譯器),但屬於同一個執行緒的所有直譯器共享一個共同的事件佇列,這很快就會變得" +"混亂。在實務上,不要一次建立多個 :class:`Tk` 的實例。否則,最好在不同的執行緒" +"中建立它們,並確保你正在執行一個具備執行緒感知能力的 Tcl/Tk 建構版本。" -#: ../../library/tkinter.rst:548 +#: ../../library/tkinter.rst:597 msgid "" "Blocking event handlers are not the only way to prevent the Tcl interpreter " "from reentering the event loop. It is even possible to run multiple nested " @@ -1180,41 +1248,43 @@ msgstr "" "多個巢狀的事件迴圈或完全放棄事件迴圈。如果你在事件或執行緒方面做任何複雜的操" "作,請注意這些可能性。" -#: ../../library/tkinter.rst:553 +#: ../../library/tkinter.rst:602 msgid "" "There are a few select :mod:`!tkinter` functions that presently work only " "when called from the thread that created the Tcl interpreter." msgstr "" -"目前有少數幾個 :mod:`!tkinter` 函式只有在從建立 Tcl 直譯器的執行緒中呼叫時才能" -"正常運作。" +"目前有少數幾個 :mod:`!tkinter` 函式只有在從建立 Tcl 直譯器的執行緒中呼叫時才" +"能正常運作。" -#: ../../library/tkinter.rst:558 -msgid "Handy Reference" +#: ../../library/tkinter.rst:607 +#, fuzzy +msgid "Handy reference" msgstr "實用參考" -#: ../../library/tkinter.rst:564 -msgid "Setting Options" +#: ../../library/tkinter.rst:613 +#, fuzzy +msgid "Setting options" msgstr "設定選項" -#: ../../library/tkinter.rst:566 +#: ../../library/tkinter.rst:615 msgid "" "Options control things like the color and border width of a widget. Options " "can be set in three ways:" msgstr "選項控制著諸如元件的顏色和邊框寬度等。選項可以透過三種方式設定:" -#: ../../library/tkinter.rst:569 +#: ../../library/tkinter.rst:618 msgid "At object creation time, using keyword arguments" msgstr "在物件建立時,使用關鍵字引數" -#: ../../library/tkinter.rst:572 +#: ../../library/tkinter.rst:621 msgid "fred = Button(self, fg=\"red\", bg=\"blue\")" msgstr "fred = Button(self, fg=\"red\", bg=\"blue\")" -#: ../../library/tkinter.rst:574 +#: ../../library/tkinter.rst:623 msgid "After object creation, treating the option name like a dictionary index" msgstr "在物件建立後,將選項名稱視為字典索引" -#: ../../library/tkinter.rst:577 +#: ../../library/tkinter.rst:626 msgid "" "fred[\"fg\"] = \"red\"\n" "fred[\"bg\"] = \"blue\"" @@ -1222,23 +1292,23 @@ msgstr "" "fred[\"fg\"] = \"red\"\n" "fred[\"bg\"] = \"blue\"" -#: ../../library/tkinter.rst:580 +#: ../../library/tkinter.rst:629 msgid "" "Use the config() method to update multiple attrs subsequent to object " "creation" msgstr "在物件建立後,使用 config() 方法更新多個屬性" -#: ../../library/tkinter.rst:583 +#: ../../library/tkinter.rst:632 msgid "fred.config(fg=\"red\", bg=\"blue\")" msgstr "fred.config(fg=\"red\", bg=\"blue\")" -#: ../../library/tkinter.rst:585 +#: ../../library/tkinter.rst:634 msgid "" "For a complete explanation of a given option and its behavior, see the Tk " "man pages for the widget in question." msgstr "有關給定選項及其行為的完整解釋,請參閱相關元件的 Tk man pages。" -#: ../../library/tkinter.rst:588 +#: ../../library/tkinter.rst:637 msgid "" "Note that the man pages list \"STANDARD OPTIONS\" and \"WIDGET SPECIFIC " "OPTIONS\" for each widget. The former is a list of options that are common " @@ -1250,7 +1320,7 @@ msgstr "" "元件共有的選項串列,後者是該特定元件特有的選項。標準選項記錄在 :manpage:" "`options(3)` man page 中。" -#: ../../library/tkinter.rst:594 +#: ../../library/tkinter.rst:643 msgid "" "No distinction between standard and widget-specific options is made in this " "document. Some options don't apply to some kinds of widgets. Whether a " @@ -1261,19 +1331,21 @@ msgstr "" "給定元件是否回應特定選項取決於該元件的類別;按鈕有 ``command`` 選項,標籤則沒" "有。" -#: ../../library/tkinter.rst:599 +#: ../../library/tkinter.rst:648 +#, fuzzy msgid "" "The options supported by a given widget are listed in that widget's man " -"page, or can be queried at runtime by calling the :meth:`config` method " -"without arguments, or by calling the :meth:`keys` method on that widget. " -"The return value of these calls is a dictionary whose key is the name of the " -"option as a string (for example, ``'relief'``) and whose values are 5-tuples." +"page, or can be queried at runtime by calling the :meth:`~Misc.config` " +"method without arguments, or by calling the :meth:`~Misc.keys` method on " +"that widget. The return value of these calls is a dictionary whose key is " +"the name of the option as a string (for example, ``'relief'``) and whose " +"values are 5-tuples." msgstr "" "給定元件支援的選項列在該元件的 man page 中,或者可以在 runtime 透過不帶引數呼" "叫 :meth:`config` 方法,或對該元件呼叫 :meth:`keys` 方法來查詢。這些呼叫的回" "傳值是一個字典,其鍵是選項名稱的字串(例如 ``'relief'``),其值是 5-tuples。" -#: ../../library/tkinter.rst:605 +#: ../../library/tkinter.rst:654 msgid "" "Some options, like ``bg`` are synonyms for common options with long names " "(``bg`` is shorthand for \"background\"). Passing the ``config()`` method " @@ -1286,79 +1358,79 @@ msgstr "" "2-tuple,而不是 5-tuple。回傳的 2-tuple 將包含同義詞的名稱和「真實」選項(例" "如 ``('bg', 'background')``)。" -#: ../../library/tkinter.rst:612 +#: ../../library/tkinter.rst:661 msgid "Index" msgstr "索引" -#: ../../library/tkinter.rst:612 +#: ../../library/tkinter.rst:661 msgid "Meaning" msgstr "含義" -#: ../../library/tkinter.rst:612 +#: ../../library/tkinter.rst:661 msgid "Example" msgstr "範例" -#: ../../library/tkinter.rst:614 +#: ../../library/tkinter.rst:663 msgid "0" msgstr "0" -#: ../../library/tkinter.rst:614 +#: ../../library/tkinter.rst:663 msgid "option name" msgstr "選項名稱" -#: ../../library/tkinter.rst:614 ../../library/tkinter.rst:616 +#: ../../library/tkinter.rst:663 ../../library/tkinter.rst:665 msgid "``'relief'``" msgstr "``'relief'``" -#: ../../library/tkinter.rst:616 +#: ../../library/tkinter.rst:665 msgid "1" msgstr "1" -#: ../../library/tkinter.rst:616 +#: ../../library/tkinter.rst:665 msgid "option name for database lookup" msgstr "用於資料庫查詢的選項名稱" -#: ../../library/tkinter.rst:618 +#: ../../library/tkinter.rst:667 msgid "2" msgstr "2" -#: ../../library/tkinter.rst:618 +#: ../../library/tkinter.rst:667 msgid "option class for database lookup" msgstr "用於資料庫查詢的選項類別" -#: ../../library/tkinter.rst:618 +#: ../../library/tkinter.rst:667 msgid "``'Relief'``" msgstr "``'Relief'``" -#: ../../library/tkinter.rst:621 +#: ../../library/tkinter.rst:670 msgid "3" msgstr "3" -#: ../../library/tkinter.rst:621 +#: ../../library/tkinter.rst:670 msgid "default value" msgstr "預設值" -#: ../../library/tkinter.rst:621 +#: ../../library/tkinter.rst:670 msgid "``'raised'``" msgstr "``'raised'``" -#: ../../library/tkinter.rst:623 +#: ../../library/tkinter.rst:672 msgid "4" msgstr "4" -#: ../../library/tkinter.rst:623 +#: ../../library/tkinter.rst:672 msgid "current value" msgstr "目前值" -#: ../../library/tkinter.rst:623 +#: ../../library/tkinter.rst:672 msgid "``'groove'``" msgstr "``'groove'``" -#: ../../library/tkinter.rst:626 +#: ../../library/tkinter.rst:675 msgid "Example::" msgstr "範例: ::" -#: ../../library/tkinter.rst:628 +#: ../../library/tkinter.rst:677 msgid "" ">>> print(fred.config())\n" "{'relief': ('relief', 'relief', 'Relief', 'raised', 'groove')}" @@ -1366,17 +1438,18 @@ msgstr "" ">>> print(fred.config())\n" "{'relief': ('relief', 'relief', 'Relief', 'raised', 'groove')}" -#: ../../library/tkinter.rst:631 +#: ../../library/tkinter.rst:680 msgid "" "Of course, the dictionary printed will include all the options available and " "their values. This is meant only as an example." msgstr "當然,印出的字典將包含所有可用的選項及其值。這僅作為一個範例。" -#: ../../library/tkinter.rst:636 -msgid "The Packer" +#: ../../library/tkinter.rst:687 +#, fuzzy +msgid "The packer" msgstr "Packer 佈局管理器" -#: ../../library/tkinter.rst:640 +#: ../../library/tkinter.rst:691 msgid "" "The packer is one of Tk's geometry-management mechanisms. Geometry " "managers are used to specify the relative positioning of widgets within " @@ -1390,7 +1463,7 @@ msgstr "" "用,我們在此不予介紹)相比,packer 採用定性的關係規範——*上方*、*左方*、*填滿" "*\\ 等——並為你計算出確切的放置座標。" -#: ../../library/tkinter.rst:647 +#: ../../library/tkinter.rst:698 msgid "" "The size of any container widget is determined by the size of the \"content " "widgets\" inside. The packer is used to control where content widgets " @@ -1405,20 +1478,21 @@ msgstr "" "再將框架 pack 到其他框架中,以達到你想要的佈局。此外,一旦 packed,佈局會動態" "調整以適應設定的增量變更。" -#: ../../library/tkinter.rst:654 +#: ../../library/tkinter.rst:705 +#, fuzzy msgid "" "Note that widgets do not appear until they have had their geometry specified " -"with a geometry manager. It's a common early mistake to leave out the " +"with a geometry manager. It's a common early mistake to leave out the " "geometry specification, and then be surprised when the widget is created but " -"nothing appears. A widget will appear only after it has had, for example, " -"the packer's :meth:`pack` method applied to it." +"nothing appears. A widget will appear only after it has had, for example, " +"the packer's :meth:`~Pack.pack` method applied to it." msgstr "" "請注意,元件在透過佈局管理器(geometry manager)指定其佈局(geometry)之前是" "不會出現的。一個常見的早期錯誤是忽略了佈局(geometry)指定,然後在元件被建立" "但沒有任何東西出現時感到驚訝。一個元件只有在例如 packer 的 :meth:`pack` 方法" "被應用於其上之後才會出現。" -#: ../../library/tkinter.rst:660 +#: ../../library/tkinter.rst:712 msgid "" "The pack() method can be called with keyword-option/value pairs that control " "where the widget is to appear within its container, and how it is to behave " @@ -1427,7 +1501,7 @@ msgstr "" "pack() 方法可以與關鍵字選項/值對一起呼叫,以控制元件在其容器中出現的位置,以" "及當主應用程式視窗調整大小時它的行為方式。以下是一些範例: ::" -#: ../../library/tkinter.rst:664 +#: ../../library/tkinter.rst:716 msgid "" "fred.pack() # defaults to side = \"top\"\n" "fred.pack(side=\"left\")\n" @@ -1437,11 +1511,12 @@ msgstr "" "fred.pack(side=\"left\")\n" "fred.pack(expand=1)" -#: ../../library/tkinter.rst:670 -msgid "Packer Options" +#: ../../library/tkinter.rst:722 +#, fuzzy +msgid "Packer options" msgstr "Packer 選項" -#: ../../library/tkinter.rst:672 +#: ../../library/tkinter.rst:724 msgid "" "For more extensive information on the packer and the options that it can " "take, see the man pages and page 183 of John Ousterhout's book." @@ -1449,61 +1524,63 @@ msgstr "" "有關 packer 及其可接受選項的更詳盡資訊,請參閱 man pages 和 John Ousterhout " "書中的第 183 頁。" -#: ../../library/tkinter.rst:675 ../../library/tkinter.rst:794 +#: ../../library/tkinter.rst:727 ../../library/tkinter.rst:854 msgid "anchor" msgstr "anchor" -#: ../../library/tkinter.rst:676 +#: ../../library/tkinter.rst:728 msgid "" "Anchor type. Denotes where the packer is to place each content in its " "parcel." msgstr "錨點類型。表示 packer 將每個內容放置在其區域中的位置。" -#: ../../library/tkinter.rst:678 +#: ../../library/tkinter.rst:730 msgid "expand" msgstr "expand" -#: ../../library/tkinter.rst:679 -msgid "Boolean, ``0`` or ``1``." +#: ../../library/tkinter.rst:731 +#, fuzzy +msgid "boolean, ``0`` or ``1``." msgstr "布林值,``0`` 或 ``1``。" -#: ../../library/tkinter.rst:681 +#: ../../library/tkinter.rst:733 msgid "fill" msgstr "fill" -#: ../../library/tkinter.rst:682 +#: ../../library/tkinter.rst:734 msgid "Legal values: ``'x'``, ``'y'``, ``'both'``, ``'none'``." msgstr "合法值:``'x'``、``'y'``、``'both'``、``'none'``。" -#: ../../library/tkinter.rst:684 +#: ../../library/tkinter.rst:736 msgid "ipadx and ipady" msgstr "ipadx 和 ipady" -#: ../../library/tkinter.rst:685 +#: ../../library/tkinter.rst:737 msgid "A distance - designating internal padding on each side of the content." msgstr "一個距離 —— 指定內容每一側的內部填充。" -#: ../../library/tkinter.rst:687 +#: ../../library/tkinter.rst:739 msgid "padx and pady" msgstr "padx 和 pady" -#: ../../library/tkinter.rst:688 +#: ../../library/tkinter.rst:740 msgid "A distance - designating external padding on each side of the content." msgstr "一個距離 —— 指定內容每一側的外部填充。" -#: ../../library/tkinter.rst:690 +#: ../../library/tkinter.rst:742 msgid "side" msgstr "side" -#: ../../library/tkinter.rst:691 +#: ../../library/tkinter.rst:743 msgid "Legal values are: ``'left'``, ``'right'``, ``'top'``, ``'bottom'``." msgstr "合法值為:``'left'``、``'right'``、``'top'``、``'bottom'``。" -#: ../../library/tkinter.rst:695 -msgid "Coupling Widget Variables" +#: ../../library/tkinter.rst:749 +#, fuzzy +msgid "Coupling widget variables" msgstr "耦合元件變數" -#: ../../library/tkinter.rst:697 +#: ../../library/tkinter.rst:751 msgid "" "The current-value setting of some widgets (like text entry widgets) can be " "connected directly to application variables by using special options. These " @@ -1517,7 +1594,7 @@ msgstr "" "和 ``value``。這種連接是雙向的:如果變數因任何原因發生變化,與之連接的元件將" "會更新以反映新值。" -#: ../../library/tkinter.rst:703 +#: ../../library/tkinter.rst:757 msgid "" "Unfortunately, in the current implementation of :mod:`!tkinter` it is not " "possible to hand over an arbitrary Python variable to a widget through a " @@ -1529,25 +1606,26 @@ msgstr "" "``textvariable`` 選項將任意的 Python 變數傳遞給元件。唯一適用此功能的變數類型" "是從 :mod:`!tkinter` 中定義的一個名為 Variable 的類別繼承的子類別變數。" -#: ../../library/tkinter.rst:709 +#: ../../library/tkinter.rst:763 +#, fuzzy msgid "" "There are many useful subclasses of Variable already defined: :class:" -"`StringVar`, :class:`IntVar`, :class:`DoubleVar`, and :class:`BooleanVar`. " -"To read the current value of such a variable, call the :meth:`get` method on " -"it, and to change its value you call the :meth:`!set` method. If you follow " -"this protocol, the widget will always track the value of the variable, with " -"no further intervention on your part." +"`StringVar`, :class:`IntVar`, :class:`DoubleVar`, and :class:`BooleanVar`. " +"To read the current value of such a variable, call the :meth:`~Variable.get` " +"method on it, and to change its value you call the :meth:`!set` method. If " +"you follow this protocol, the widget will always track the value of the " +"variable, with no further intervention on your part." msgstr "" "已經定義了許多有用的 Variable 子類別::class:`StringVar`、:class:`IntVar`、:" "class:`DoubleVar` 和 :class:`BooleanVar`。要讀取此類變數的目前值,請對其呼" "叫 :meth:`get` 方法,要更改其值,則呼叫 :meth:`!set` 方法。如果你遵循此協定," "元件將始終追蹤變數的值,無需你進一步干預。" -#: ../../library/tkinter.rst:716 ../../library/tkinter.rst:895 +#: ../../library/tkinter.rst:771 ../../library/tkinter.rst:962 msgid "For example::" msgstr "舉例來說: ::" -#: ../../library/tkinter.rst:718 +#: ../../library/tkinter.rst:773 msgid "" "import tkinter as tk\n" "\n" @@ -1609,11 +1687,12 @@ msgstr "" "myapp = App(root)\n" "myapp.mainloop()" -#: ../../library/tkinter.rst:749 -msgid "The Window Manager" +#: ../../library/tkinter.rst:804 +#, fuzzy +msgid "The window manager" msgstr "視窗管理器" -#: ../../library/tkinter.rst:753 +#: ../../library/tkinter.rst:808 msgid "" "In Tk, there is a utility command, ``wm``, for interacting with the window " "manager. Options to the ``wm`` command allow you to control things like " @@ -1627,26 +1706,29 @@ msgstr "" "class:`Wm` 類別上的方法。頂層元件是 :class:`Wm` 類別的子類別,因此可以直接呼" "叫 :class:`Wm` 方法。" -#: ../../library/tkinter.rst:760 +#: ../../library/tkinter.rst:815 +#, fuzzy msgid "" "To get at the toplevel window that contains a given widget, you can often " -"just refer to the widget's :attr:`master`. Of course if the widget has been " -"packed inside of a frame, the :attr:`!master` won't represent a toplevel " -"window. To get at the toplevel window that contains an arbitrary widget, " -"you can call the :meth:`_root` method. This method begins with an underscore " -"to denote the fact that this function is part of the implementation, and not " -"an interface to Tk functionality." +"just refer to the widget's :attr:`~Tk.master`. Of course if the widget has " +"been packed inside of a frame, the :attr:`!master` won't represent a " +"toplevel window. To get at the toplevel window that contains an arbitrary " +"widget, you can call the :meth:`~Misc.winfo_toplevel` method. There is also " +"a :meth:`!_root` method; it begins with an underscore to denote the fact " +"that this function is part of the implementation, and not an interface to Tk " +"functionality. It returns the application's root window rather than the " +"nearest enclosing toplevel." msgstr "" "要取得包含給定元件的頂層視窗,你通常可以直接參照該元件的 :attr:`master`。當" "然,如果該元件被 packed 在一個框架內,:attr:`!master` 將不代表一個頂層視窗。" "要取得包含任意元件的頂層視窗,你可以呼叫 :meth:`_root` 方法。此方法以底線開" "頭,表示此函式是實作的一部分,而不是 Tk 功能的介面。" -#: ../../library/tkinter.rst:767 +#: ../../library/tkinter.rst:827 msgid "Here are some examples of typical usage::" msgstr "以下是一些常見用法範例: ::" -#: ../../library/tkinter.rst:769 +#: ../../library/tkinter.rst:829 msgid "" "import tkinter as tk\n" "\n" @@ -1686,11 +1768,12 @@ msgstr "" "# 啟動程式\n" "myapp.mainloop()" -#: ../../library/tkinter.rst:790 ../../library/tkinter.rst:792 -msgid "Tk Option Data Types" +#: ../../library/tkinter.rst:850 +#, fuzzy +msgid "Tk option data types" msgstr "Tk 選項資料型別" -#: ../../library/tkinter.rst:795 +#: ../../library/tkinter.rst:855 msgid "" "Legal values are points of the compass: ``\"n\"``, ``\"ne\"``, ``\"e\"``, " "``\"se\"``, ``\"s\"``, ``\"sw\"``, ``\"w\"``, ``\"nw\"``, and also " @@ -1699,39 +1782,41 @@ msgstr "" "合法值為羅盤方位點:``\"n\"``、``\"ne\"``、``\"e\"``、``\"se\"``、``\"s\"``、" "``\"sw\"``、``\"w\"``、``\"nw\"``,以及 ``\"center\"``。" -#: ../../library/tkinter.rst:798 +#: ../../library/tkinter.rst:858 msgid "bitmap" msgstr "bitmap" -#: ../../library/tkinter.rst:799 +#: ../../library/tkinter.rst:859 +#, fuzzy msgid "" -"There are eight built-in, named bitmaps: ``'error'``, ``'gray25'``, " -"``'gray50'``, ``'hourglass'``, ``'info'``, ``'questhead'``, ``'question'``, " -"``'warning'``. To specify an X bitmap filename, give the full path to the " -"file, preceded with an ``@``, as in ``\"@/usr/contrib/bitmap/gumby.bit\"``." +"There are ten built-in, named bitmaps: ``'error'``, ``'gray12'``, " +"``'gray25'``, ``'gray50'``, ``'gray75'``, ``'hourglass'``, ``'info'``, " +"``'questhead'``, ``'question'``, ``'warning'``. To specify an X bitmap " +"filename, give the full path to the file, preceded with an ``@``, as in " +"``\"@/usr/contrib/bitmap/gumby.bit\"``." msgstr "" "有八個內建的、命名的點陣圖:``'error'``、``'gray25'``、``'gray50'``、" "``'hourglass'``、``'info'``、``'questhead'``、``'question'``、``'warning'``。" "要指定一個 X 點陣圖檔名,請給出檔案的完整路徑,並在前面加上一個 ``@``,例如 " "``\"@/usr/contrib/bitmap/gumby.bit\"``。" -#: ../../library/tkinter.rst:804 +#: ../../library/tkinter.rst:865 msgid "boolean" msgstr "boolean" -#: ../../library/tkinter.rst:805 +#: ../../library/tkinter.rst:866 msgid "You can pass integers 0 or 1 or the strings ``\"yes\"`` or ``\"no\"``." msgstr "你可以傳遞整數 0 或 1,或字串 ``\"yes\"`` 或 ``\"no\"``。" -#: ../../library/tkinter.rst:807 +#: ../../library/tkinter.rst:868 msgid "callback" msgstr "callback" -#: ../../library/tkinter.rst:808 +#: ../../library/tkinter.rst:869 msgid "This is any Python function that takes no arguments. For example::" msgstr "這是任何不帶引數的 Python 函式。例如: ::" -#: ../../library/tkinter.rst:810 +#: ../../library/tkinter.rst:871 msgid "" "def print_it():\n" " print(\"hi there\")\n" @@ -1741,11 +1826,11 @@ msgstr "" " print(\"hi there\")\n" "fred[\"command\"] = print_it" -#: ../../library/tkinter.rst:814 +#: ../../library/tkinter.rst:875 msgid "color" msgstr "color" -#: ../../library/tkinter.rst:815 +#: ../../library/tkinter.rst:876 msgid "" "Colors can be given as the names of X colors in the rgb.txt file, or as " "strings representing RGB values in 4 bit: ``\"#RGB\"``, 8 bit: " @@ -1758,26 +1843,27 @@ msgstr "" "``\"#RRRGGGBBB\"`` 或 16 位元:``\"#RRRRGGGGBBBB\"``,其中 R、G、B 在此代表任" "何合法的十六進位數字。詳情請參閱 Ousterhout 書中的第 160 頁。" -#: ../../library/tkinter.rst:820 +#: ../../library/tkinter.rst:881 msgid "cursor" msgstr "cursor" -#: ../../library/tkinter.rst:821 +#: ../../library/tkinter.rst:882 +#, fuzzy msgid "" "The standard X cursor names from :file:`cursorfont.h` can be used, without " -"the ``XC_`` prefix. For example to get a hand cursor (:const:`XC_hand2`), " -"use the string ``\"hand2\"``. You can also specify a bitmap and mask file " -"of your own. See page 179 of Ousterhout's book." +"the ``XC_`` prefix. For example to get a hand cursor (``XC_hand2``), use " +"the string ``\"hand2\"``. You can also specify a bitmap and mask file of " +"your own. See page 179 of Ousterhout's book." msgstr "" "可以使用 :file:`cursorfont.h` 中的標準 X 游標名稱,無需 ``XC_`` 前綴。例如," "要取得手形游標(:const:`XC_hand2`),請使用字串 ``\"hand2\"``。你也可以指定自" "己的點陣圖和遮罩檔案。請參閱 Ousterhout 書中的第 179 頁。" -#: ../../library/tkinter.rst:826 +#: ../../library/tkinter.rst:887 msgid "distance" msgstr "distance" -#: ../../library/tkinter.rst:827 +#: ../../library/tkinter.rst:888 msgid "" "Screen distances can be specified in either pixels or absolute distances. " "Pixels are given as numbers and absolute distances as strings, with the " @@ -1789,24 +1875,27 @@ msgstr "" "元表示單位:``c`` 代表公分,``i`` 代表英寸,``m`` 代表毫米,``p`` 代表印刷的" "點。例如,3.5 英寸表示為 ``\"3.5i\"``。" -#: ../../library/tkinter.rst:833 +#: ../../library/tkinter.rst:894 msgid "font" msgstr "font" -#: ../../library/tkinter.rst:834 +#: ../../library/tkinter.rst:895 +#, fuzzy msgid "" -"Tk uses a list font name format, such as ``{courier 10 bold}``. Font sizes " -"with positive numbers are measured in points; sizes with negative numbers " -"are measured in pixels." +"Tk uses a font description such as ``{courier 10 bold}``; in :mod:`!tkinter` " +"this is most naturally passed as a tuple of ``(family, size, *styles)`` (or " +"as the equivalent string ``\"Courier 10 bold\"``). Font sizes with positive " +"numbers are measured in points; sizes with negative numbers are measured in " +"pixels." msgstr "" "Tk 使用串列字型名稱格式,例如 ``{courier 10 bold}``。帶有正數的字型大小以點為" "單位;帶有負數的大小以像素為單位。" -#: ../../library/tkinter.rst:838 +#: ../../library/tkinter.rst:901 msgid "geometry" msgstr "geometry" -#: ../../library/tkinter.rst:839 +#: ../../library/tkinter.rst:902 msgid "" "This is a string of the form ``widthxheight``, where width and height are " "measured in pixels for most widgets (in characters for widgets displaying " @@ -1816,21 +1905,21 @@ msgstr "" "像素為單位(對於顯示文字的元件則以字元為單位)。例如:``fred[\"geometry\"] = " "\"200x100\"``。" -#: ../../library/tkinter.rst:843 +#: ../../library/tkinter.rst:906 msgid "justify" msgstr "justify" -#: ../../library/tkinter.rst:844 +#: ../../library/tkinter.rst:907 msgid "" "Legal values are the strings: ``\"left\"``, ``\"center\"``, and " "``\"right\"``." msgstr "合法值為字串:``\"left\"``、``\"center\"`` 和 ``\"right\"``。" -#: ../../library/tkinter.rst:846 +#: ../../library/tkinter.rst:909 msgid "region" msgstr "region" -#: ../../library/tkinter.rst:847 +#: ../../library/tkinter.rst:910 msgid "" "This is a string with four space-delimited elements, each of which is a " "legal distance (see above). For example: ``\"2 3 4 5\"`` and ``\"3i 2i 4.5i " @@ -1840,24 +1929,25 @@ msgstr "" "文)。例如:``\"2 3 4 5\"``、``\"3i 2i 4.5i 2i\"`` 和 ``\"3c 2c 4c " "10.43c\"`` 都是合法的區域。" -#: ../../library/tkinter.rst:851 +#: ../../library/tkinter.rst:914 msgid "relief" msgstr "relief" -#: ../../library/tkinter.rst:852 +#: ../../library/tkinter.rst:915 +#, fuzzy msgid "" "Determines what the border style of a widget will be. Legal values are: " -"``\"raised\"``, ``\"sunken\"``, ``\"flat\"``, ``\"groove\"``, and " -"``\"ridge\"``." +"``\"raised\"``, ``\"sunken\"``, ``\"flat\"``, ``\"groove\"``, ``\"ridge\"``, " +"and ``\"solid\"``." msgstr "" "決定元件的邊框樣式。合法值為:``\"raised\"``、``\"sunken\"``、``\"flat\"``、" "``\"groove\"`` 和 ``\"ridge\"``。" -#: ../../library/tkinter.rst:855 +#: ../../library/tkinter.rst:919 msgid "scrollcommand" msgstr "scrollcommand" -#: ../../library/tkinter.rst:856 +#: ../../library/tkinter.rst:920 msgid "" "This is almost always the :meth:`!set` method of some scrollbar widget, but " "can be any widget method that takes a single argument." @@ -1865,19 +1955,20 @@ msgstr "" "這幾乎總是某個捲軸元件的 :meth:`!set` 方法,但也可以是任何接受單一引數的元件" "方法。" -#: ../../library/tkinter.rst:859 +#: ../../library/tkinter.rst:923 msgid "wrap" msgstr "wrap" -#: ../../library/tkinter.rst:860 +#: ../../library/tkinter.rst:924 msgid "Must be one of: ``\"none\"``, ``\"char\"``, or ``\"word\"``." msgstr "必須是以下之一:``\"none\"``、``\"char\"`` 或 ``\"word\"``。" -#: ../../library/tkinter.rst:865 -msgid "Bindings and Events" +#: ../../library/tkinter.rst:929 +#, fuzzy +msgid "Bindings and events" msgstr "繫結與事件" -#: ../../library/tkinter.rst:871 +#: ../../library/tkinter.rst:935 msgid "" "The bind method from the widget command allows you to watch for certain " "events and to have a callback function trigger when that event type occurs. " @@ -1886,33 +1977,37 @@ msgstr "" "來自元件指令的 bind 方法允許你監視某些事件,並在該事件類型發生時觸發一個回呼" "函式。bind 方法的形式是: ::" -#: ../../library/tkinter.rst:875 +#: ../../library/tkinter.rst:939 msgid "def bind(self, sequence, func, add=''):" msgstr "def bind(self, sequence, func, add=''):" -#: ../../library/tkinter.rst:877 +#: ../../library/tkinter.rst:941 msgid "where:" msgstr "其中:" -#: ../../library/tkinter.rst:879 +#: ../../library/tkinter.rst:943 msgid "sequence" msgstr "sequence" -#: ../../library/tkinter.rst:880 +#: ../../library/tkinter.rst:944 +#, fuzzy msgid "" -"is a string that denotes the target kind of event. (See the :manpage:" -"`bind(3tk)` man page, and page 201 of John Ousterhout's book, :title-" -"reference:`Tcl and the Tk Toolkit (2nd edition)`, for details)." +"is a string that denotes the target kind of event. Physical events use the " +"```` form (for example ``\"\"`` or " +"``\"\"``); application-defined virtual events use double " +"angle brackets, as in ``\"<>\"``. (See the :manpage:`bind(3tk)` man " +"page, and page 201 of John Ousterhout's book, :title-reference:`Tcl and the " +"Tk Toolkit (2nd edition)`, for details)." msgstr "" "是一個表示目標事件類型的字串。(詳情請參閱 :manpage:`bind(3tk)` man page,以" "及 John Ousterhout 的書 :title-reference:`Tcl and the Tk Toolkit (2nd " "edition)` 的第 201 頁)。" -#: ../../library/tkinter.rst:884 +#: ../../library/tkinter.rst:951 msgid "func" msgstr "func" -#: ../../library/tkinter.rst:885 +#: ../../library/tkinter.rst:952 msgid "" "is a Python function, taking one argument, to be invoked when the event " "occurs. An Event instance will be passed as the argument. (Functions " @@ -1921,11 +2016,11 @@ msgstr "" "是一個 Python 函式,接受一個引數,在事件發生時被呼叫。一個 Event 實例將作為引" "數傳遞。(以這種方式部署的函式通常稱為\\ *回呼*。)" -#: ../../library/tkinter.rst:889 +#: ../../library/tkinter.rst:956 msgid "add" msgstr "add" -#: ../../library/tkinter.rst:890 +#: ../../library/tkinter.rst:957 msgid "" "is optional, either ``''`` or ``'+'``. Passing an empty string denotes that " "this binding is to replace any other bindings that this event is associated " @@ -1936,7 +2031,7 @@ msgstr "" "聯的任何其他繫結。傳遞一個 ``'+'`` 意味著此函式將被新增到繫結到此事件類型的函" "式串列中。" -#: ../../library/tkinter.rst:897 +#: ../../library/tkinter.rst:964 msgid "" "def turn_red(self, event):\n" " event.widget[\"activeforeground\"] = \"red\"\n" @@ -1948,7 +2043,7 @@ msgstr "" "\n" "self.button.bind(\"\", self.turn_red)" -#: ../../library/tkinter.rst:902 +#: ../../library/tkinter.rst:969 msgid "" "Notice how the widget field of the event is being accessed in the " "``turn_red()`` callback. This field contains the widget that caught the X " @@ -1960,143 +2055,176 @@ msgstr "" "件的元件。下表列出了你可以存取的其他事件欄位,以及它們在 Tk 中的表示方式,這" "在參閱 Tk man pages 時可能很有用。" -#: ../../library/tkinter.rst:908 +#: ../../library/tkinter.rst:975 msgid "Tkinter Event Field" msgstr "Tkinter 事件欄位" -#: ../../library/tkinter.rst:910 +#: ../../library/tkinter.rst:977 msgid "%f" msgstr "%f" -#: ../../library/tkinter.rst:910 +#: ../../library/tkinter.rst:977 msgid "focus" msgstr "focus" -#: ../../library/tkinter.rst:910 +#: ../../library/tkinter.rst:977 msgid "%A" msgstr "%A" -#: ../../library/tkinter.rst:910 +#: ../../library/tkinter.rst:977 msgid "char" msgstr "char" -#: ../../library/tkinter.rst:912 +#: ../../library/tkinter.rst:979 msgid "%h" msgstr "%h" -#: ../../library/tkinter.rst:912 +#: ../../library/tkinter.rst:979 msgid "height" msgstr "height" -#: ../../library/tkinter.rst:912 +#: ../../library/tkinter.rst:979 msgid "%E" msgstr "%E" -#: ../../library/tkinter.rst:912 +#: ../../library/tkinter.rst:979 msgid "send_event" msgstr "send_event" -#: ../../library/tkinter.rst:914 +#: ../../library/tkinter.rst:981 msgid "%k" msgstr "%k" -#: ../../library/tkinter.rst:914 +#: ../../library/tkinter.rst:981 msgid "keycode" msgstr "keycode" -#: ../../library/tkinter.rst:914 +#: ../../library/tkinter.rst:981 msgid "%K" msgstr "%K" -#: ../../library/tkinter.rst:914 +#: ../../library/tkinter.rst:981 msgid "keysym" msgstr "keysym" -#: ../../library/tkinter.rst:916 +#: ../../library/tkinter.rst:983 msgid "%s" msgstr "%s" -#: ../../library/tkinter.rst:916 +#: ../../library/tkinter.rst:983 msgid "state" msgstr "state" -#: ../../library/tkinter.rst:916 +#: ../../library/tkinter.rst:983 msgid "%N" msgstr "%N" -#: ../../library/tkinter.rst:916 +#: ../../library/tkinter.rst:983 msgid "keysym_num" msgstr "keysym_num" -#: ../../library/tkinter.rst:918 +#: ../../library/tkinter.rst:985 msgid "%t" msgstr "%t" -#: ../../library/tkinter.rst:918 +#: ../../library/tkinter.rst:985 msgid "time" msgstr "time" -#: ../../library/tkinter.rst:918 +#: ../../library/tkinter.rst:985 msgid "%T" msgstr "%T" -#: ../../library/tkinter.rst:918 +#: ../../library/tkinter.rst:985 msgid "type" msgstr "type" -#: ../../library/tkinter.rst:920 +#: ../../library/tkinter.rst:987 msgid "%w" msgstr "%w" -#: ../../library/tkinter.rst:920 +#: ../../library/tkinter.rst:987 msgid "width" msgstr "width" -#: ../../library/tkinter.rst:920 +#: ../../library/tkinter.rst:987 msgid "%W" msgstr "%W" -#: ../../library/tkinter.rst:920 +#: ../../library/tkinter.rst:987 msgid "widget" msgstr "widget" -#: ../../library/tkinter.rst:922 +#: ../../library/tkinter.rst:989 msgid "%x" msgstr "%x" -#: ../../library/tkinter.rst:922 +#: ../../library/tkinter.rst:989 msgid "x" msgstr "x" -#: ../../library/tkinter.rst:922 +#: ../../library/tkinter.rst:989 msgid "%X" msgstr "%X" -#: ../../library/tkinter.rst:922 +#: ../../library/tkinter.rst:989 msgid "x_root" msgstr "x_root" -#: ../../library/tkinter.rst:924 +#: ../../library/tkinter.rst:991 msgid "%y" msgstr "%y" -#: ../../library/tkinter.rst:924 +#: ../../library/tkinter.rst:991 msgid "y" msgstr "y" -#: ../../library/tkinter.rst:924 +#: ../../library/tkinter.rst:991 msgid "%Y" msgstr "%Y" -#: ../../library/tkinter.rst:924 +#: ../../library/tkinter.rst:991 msgid "y_root" msgstr "y_root" -#: ../../library/tkinter.rst:929 -msgid "The index Parameter" +#: ../../library/tkinter.rst:993 +msgid "%#" +msgstr "" + +#: ../../library/tkinter.rst:993 +msgid "serial" +msgstr "" + +#: ../../library/tkinter.rst:993 +msgid "%b" +msgstr "" + +#: ../../library/tkinter.rst:993 +msgid "num" +msgstr "" + +#: ../../library/tkinter.rst:995 +msgid "%d" +msgstr "" + +#: ../../library/tkinter.rst:995 +msgid "detail" +msgstr "" + +#: ../../library/tkinter.rst:995 +msgid "%D" +msgstr "" + +#: ../../library/tkinter.rst:995 +msgid "delta" +msgstr "" + +#: ../../library/tkinter.rst:1000 +#, fuzzy +msgid "The index parameter" msgstr "index 參數" -#: ../../library/tkinter.rst:931 +#: ../../library/tkinter.rst:1002 msgid "" "A number of widgets require \"index\" parameters to be passed. These are " "used to point at a specific place in a Text widget, or to particular " @@ -2105,11 +2233,11 @@ msgstr "" "許多元件需要傳遞 \"index\" 參數。這些參數用於指向 Text 元件中的特定位置、" "Entry 元件中的特定字元,或 Menu 元件中的特定選單項目。" -#: ../../library/tkinter.rst:935 +#: ../../library/tkinter.rst:1006 msgid "Entry widget indexes (index, view index, etc.)" msgstr "Entry 元件索引(index、view index 等)" -#: ../../library/tkinter.rst:936 +#: ../../library/tkinter.rst:1007 msgid "" "Entry widgets have options that refer to character positions in the text " "being displayed. You can use these :mod:`!tkinter` functions to access " @@ -2118,21 +2246,21 @@ msgstr "" "Entry 元件具有參照所顯示文字中字元位置的選項。你可以使用這些 :mod:`!tkinter` " "函式來存取文字元件中的這些特殊點:" -#: ../../library/tkinter.rst:940 +#: ../../library/tkinter.rst:1011 msgid "Text widget indexes" msgstr "Text 元件索引" -#: ../../library/tkinter.rst:941 +#: ../../library/tkinter.rst:1012 msgid "" "The index notation for Text widgets is very rich and is best described in " "the Tk man pages." msgstr "Text 元件的索引表示法非常豐富,在 Tk man pages 中有最好的描述。" -#: ../../library/tkinter.rst:944 +#: ../../library/tkinter.rst:1015 msgid "Menu indexes (menu.invoke(), menu.entryconfig(), etc.)" msgstr "選單索引(menu.invoke()、menu.entryconfig() 等)" -#: ../../library/tkinter.rst:945 +#: ../../library/tkinter.rst:1016 msgid "" "Some options and methods for menus manipulate specific menu entries. Anytime " "a menu index is needed for an option or a parameter, you may pass in:" @@ -2140,23 +2268,23 @@ msgstr "" "選單的某些選項和方法會操作特定的選單項目。每當選項或參數需要選單索引時,你可" "以傳入:" -#: ../../library/tkinter.rst:948 +#: ../../library/tkinter.rst:1019 msgid "" "an integer which refers to the numeric position of the entry in the widget, " "counted from the top, starting with 0;" msgstr "一個整數,它參照元件中項目的數字位置,從頂部開始計數,從 0 開始;" -#: ../../library/tkinter.rst:951 +#: ../../library/tkinter.rst:1022 msgid "" "the string ``\"active\"``, which refers to the menu position that is " "currently under the cursor;" msgstr "字串 ``\"active\"``,它參照目前在游標下的選單位置;" -#: ../../library/tkinter.rst:954 +#: ../../library/tkinter.rst:1025 msgid "the string ``\"last\"`` which refers to the last menu item;" msgstr "字串 ``\"last\"``,它參照最後一個選單項目;" -#: ../../library/tkinter.rst:956 +#: ../../library/tkinter.rst:1027 msgid "" "An integer preceded by ``@``, as in ``@6``, where the integer is interpreted " "as a y pixel coordinate in the menu's coordinate system;" @@ -2164,7 +2292,7 @@ msgstr "" "一個以 ``@`` 為前綴的整數,如 ``@6``,其中該整數被解釋為選單座標系統中的 y 像" "素座標;" -#: ../../library/tkinter.rst:959 +#: ../../library/tkinter.rst:1030 msgid "" "the string ``\"none\"``, which indicates no menu entry at all, most often " "used with menu.activate() to deactivate all entries, and finally," @@ -2172,7 +2300,7 @@ msgstr "" "字串 ``\"none\"``,表示完全沒有選單項目,最常用於 menu.activate() 以停用所有" "項目,最後," -#: ../../library/tkinter.rst:962 +#: ../../library/tkinter.rst:1033 msgid "" "a text string that is pattern matched against the label of the menu entry, " "as scanned from the top of the menu to the bottom. Note that this index " @@ -2184,21 +2312,21 @@ msgstr "" "此索引類型在所有其他類型之後考慮,這意味著標籤為 ``last``、``active`` 或 " "``none`` 的選單項目的匹配可能會被解釋為上述的字面值。" -#: ../../library/tkinter.rst:970 +#: ../../library/tkinter.rst:1041 msgid "Images" msgstr "圖片" -#: ../../library/tkinter.rst:972 +#: ../../library/tkinter.rst:1043 msgid "" "Images of different formats can be created through the corresponding " "subclass of :class:`tkinter.Image`:" msgstr "可以透過 :class:`tkinter.Image` 的相應子類別來建立不同格式的圖片:" -#: ../../library/tkinter.rst:975 +#: ../../library/tkinter.rst:1046 msgid ":class:`BitmapImage` for images in XBM format." msgstr ":class:`BitmapImage` 用於 XBM 格式的圖片。" -#: ../../library/tkinter.rst:977 +#: ../../library/tkinter.rst:1048 msgid "" ":class:`PhotoImage` for images in PGM, PPM, GIF and PNG formats. The latter " "is supported starting with Tk 8.6." @@ -2206,14 +2334,14 @@ msgstr "" ":class:`PhotoImage` 用於 PGM、PPM、GIF 和 PNG 格式的圖片。後者從 Tk 8.6 開始" "支援。" -#: ../../library/tkinter.rst:980 +#: ../../library/tkinter.rst:1051 msgid "" "Either type of image is created through either the ``file`` or the ``data`` " "option (other options are available as well)." msgstr "" "任一類型的圖片都是透過 ``file`` 或 ``data`` 選項建立的(也有其他選項可用)。" -#: ../../library/tkinter.rst:983 +#: ../../library/tkinter.rst:1054 msgid "" "Added the :class:`!PhotoImage` method :meth:`!copy_replace` to copy a region " "from one image to other image, possibly with pixel zooming and/or " @@ -2227,19 +2355,20 @@ msgstr "" "subsample`。將 *zoom* 和 *subsample* 參數新增到 :class:`!PhotoImage` 方法 :" "meth:`!copy`。" -#: ../../library/tkinter.rst:992 +#: ../../library/tkinter.rst:1063 +#, fuzzy msgid "" "The image object can then be used wherever an ``image`` option is supported " -"by some widget (e.g. labels, buttons, menus). In these cases, Tk will not " -"keep a reference to the image. When the last Python reference to the image " -"object is deleted, the image data is deleted as well, and Tk will display an " -"empty box wherever the image was used." +"by some widget (for example, labels, buttons, menus). In these cases, Tk " +"will not keep a reference to the image. When the last Python reference to " +"the image object is deleted, the image data is deleted as well, and Tk will " +"display an empty box wherever the image was used." msgstr "" "然後,圖片物件可以在任何支援 ``image`` 選項的元件(例如標籤、按鈕、選單)中使" "用。在這些情況下,Tk 將不會保留對圖片的參照。當對圖片物件的最後一個 Python 參" "照被刪除時,圖片資料也會被刪除,Tk 將在使用該圖片的任何地方顯示一個空框。" -#: ../../library/tkinter.rst:1000 +#: ../../library/tkinter.rst:1071 msgid "" "The `Pillow `_ package adds support for formats " "such as BMP, JPEG, TIFF, and WebP, among others." @@ -2247,11 +2376,12 @@ msgstr "" "`Pillow `_ 套件新增了對 BMP、JPEG、TIFF 和 WebP " "等格式的支援。" -#: ../../library/tkinter.rst:1006 -msgid "File Handlers" +#: ../../library/tkinter.rst:1077 +#, fuzzy +msgid "File handlers" msgstr "檔案處理常式" -#: ../../library/tkinter.rst:1008 +#: ../../library/tkinter.rst:1079 msgid "" "Tk allows you to register and unregister a callback function which will be " "called from the Tk mainloop when I/O is possible on a file descriptor. Only " @@ -2260,7 +2390,7 @@ msgstr "" "Tk 允許你註冊和取消註冊一個回呼函式,當檔案描述器上可以進行 I/O 時,該函式將" "從 Tk 主迴圈中被呼叫。每個檔案描述器只能註冊一個處理常式。範例程式碼: ::" -#: ../../library/tkinter.rst:1012 +#: ../../library/tkinter.rst:1083 msgid "" "import tkinter\n" "widget = tkinter.Tk()\n" @@ -2276,11 +2406,11 @@ msgstr "" "...\n" "widget.tk.deletefilehandler(file)" -#: ../../library/tkinter.rst:1019 +#: ../../library/tkinter.rst:1090 msgid "This feature is not available on Windows." msgstr "此功能在 Windows 上不可用。" -#: ../../library/tkinter.rst:1021 +#: ../../library/tkinter.rst:1092 msgid "" "Since you don't know how many bytes are available for reading, you may not " "want to use the :class:`~io.BufferedIOBase` or :class:`~io.TextIOBase` :meth:" @@ -2297,7 +2427,7 @@ msgstr "" "法可以正常運作;對於其他檔案,請使用原始讀取或 ``os.read(file.fileno(), " "maxbytecount)``。" -#: ../../library/tkinter.rst:1032 +#: ../../library/tkinter.rst:1103 msgid "" "Registers the file handler callback function *func*. The *file* argument may " "either be an object with a :meth:`~io.IOBase.fileno` method (such as a file " @@ -2310,30 +2440,5597 @@ msgstr "" "器。*mask* 引數是下面三個常數中任意一個的 OR 組合。回呼函式被呼叫的方式如" "下: ::" -#: ../../library/tkinter.rst:1038 +#: ../../library/tkinter.rst:1109 msgid "callback(file, mask)" msgstr "callback(file, mask)" -#: ../../library/tkinter.rst:1043 +#: ../../library/tkinter.rst:1114 msgid "Unregisters a file handler." msgstr "取消註冊檔案處理常式。" -#: ../../library/tkinter.rst:1050 +#: ../../library/tkinter.rst:1121 msgid "Constants used in the *mask* arguments." msgstr "用於 *mask* 引數的常數。" -#: ../../library/tkinter.rst:638 -msgid "packing (widgets)" -msgstr "packing(元件)" +#: ../../library/tkinter.rst:1125 +#, fuzzy +msgid "Reference" +msgstr "實用參考" -#: ../../library/tkinter.rst:751 -msgid "window manager (widgets)" -msgstr "視窗管理器(元件)" +#: ../../library/tkinter.rst:1129 +msgid "" +"This section documents the classes, methods, functions and constants of the :" +"mod:`!tkinter` module. Most of them wrap Tcl/Tk commands; consult the " +"official Tcl/Tk manual pages for the full list of widget options and further " +"details." +msgstr "" -#: ../../library/tkinter.rst:867 -msgid "bind (widgets)" -msgstr "bind(元件)" +#: ../../library/tkinter.rst:1136 +msgid "" +"The exception raised when a call into the Tcl interpreter fails, for example " +"when a widget is given an unknown option or an invalid value." +msgstr "" + +#: ../../library/tkinter.rst:1140 +msgid "Base and mixin classes" +msgstr "" + +#: ../../library/tkinter.rst:1144 +msgid "" +"The :class:`!Misc` class is a mix-in inherited by :class:`Tk` and, through :" +"class:`BaseWidget`, by every widget. It provides the large set of methods " +"common to all Tk objects: querying window information, managing event " +"bindings and the event loop, controlling the keyboard focus and pointer " +"grabs, accessing the selection, clipboard and option database, and assorted " +"utility and introspection services. Because they are inherited, these " +"methods are available on every widget and on the :class:`Tk` application " +"object, and are documented here once rather than repeated for each widget." +msgstr "" + +#: ../../library/tkinter.rst:1156 +msgid "" +"Return the current value of the configuration option named *key* for this " +"widget, as a string. The expression ``widget[key]`` is equivalent and may be " +"used instead." +msgstr "" + +#: ../../library/tkinter.rst:1165 +msgid "" +"Query or modify the configuration options of the widget. With no arguments, " +"return a dictionary mapping every available option name to a tuple " +"describing it (its name, X resource name, X resource class, default value " +"and current value). If a single option name is given as a string, return the " +"tuple for just that option. If one or more keyword arguments are given, or a " +"dictionary is passed as *cnf*, set each named option to the corresponding " +"value; the expression ``widget[key] = value`` sets a single option in the " +"same way." +msgstr "" + +#: ../../library/tkinter.rst:1175 +msgid ":meth:`config` is an alias of :meth:`!configure`." +msgstr "" + +#: ../../library/tkinter.rst:1179 +msgid "Return a list of the names of all configuration options of this widget." +msgstr "" + +#: ../../library/tkinter.rst:1183 +msgid "" +"Interpret the string *s* as a Tcl boolean and return the corresponding :" +"class:`bool`. Tcl accepts values such as ``'1'``, ``'0'``, ``'yes'``, " +"``'no'``, ``'true'`` and ``'false'``. Raise :exc:`ValueError` if *s* is not " +"a valid boolean." +msgstr "" + +#: ../../library/tkinter.rst:1191 +msgid "" +"Interpret the string *s* as a Tcl floating-point number and return it as a :" +"class:`float`. Raise :exc:`ValueError` if *s* is not a valid number." +msgstr "" + +#: ../../library/tkinter.rst:1200 +msgid "" +"Interpret the string *s* as a Tcl integer and return it as an :class:`int`. " +"Raise :exc:`ValueError` if *s* is not a valid integer." +msgstr "" -#: ../../library/tkinter.rst:867 +#: ../../library/tkinter.rst:1206 +msgid "Return the value of the Tcl global variable named *name*." +msgstr "" + +#: ../../library/tkinter.rst:1210 +msgid "Set the Tcl global variable named *name* to *value*." +msgstr "" + +#: ../../library/tkinter.rst:1212 +msgid "" +"The :meth:`!getvar` and :meth:`!setvar` methods give direct access to Tcl " +"variables. In most code you will instead use a :class:`Variable` subclass " +"such as :class:`StringVar` or :class:`IntVar`, which wraps a Tcl variable " +"and converts its value to and from a Python type." +msgstr "" + +#: ../../library/tkinter.rst:1220 +msgid "" +"Register the Python callable *func* as a Tcl command and return the name of " +"the new command as a string. Whenever Tcl invokes that command, *func* is " +"called; if *subst* is given, it is applied to the command's arguments first. " +"This is the mechanism used internally to turn Python callbacks into the " +"command names passed to Tk options such as *command*. Unless *needcleanup* " +"is false, the command is deleted automatically when the widget is destroyed." +msgstr "" + +#: ../../library/tkinter.rst:1229 +msgid "The arguments passed to *func* are no longer converted to strings." +msgstr "" + +#: ../../library/tkinter.rst:1234 +msgid "" +"Delete the Tcl command named *name*, such as one previously returned by :" +"meth:`register`." +msgstr "" + +#: ../../library/tkinter.rst:1239 +msgid "Return the widget instance corresponding to the Tk pathname *name*." +msgstr "" + +#: ../../library/tkinter.rst:1243 +msgid "" +"Send the Tcl command *cmd*, with the given *args*, to the Tcl interpreter " +"registered under the name *interp*, and return its result. This is not " +"available on all platforms." +msgstr "" + +#: ../../library/tkinter.rst:1249 +msgid "" +"Destroy this widget and all of its descendant widgets, and delete the Tcl " +"commands associated with them." +msgstr "" + +#: ../../library/tkinter.rst:1257 +msgid "" +"Raise this widget in the stacking order so that it is drawn on top of its " +"siblings. If *aboveThis* is given, the widget is moved to be just above it " +"in the stacking order instead." +msgstr "" + +#: ../../library/tkinter.rst:1262 +msgid ":meth:`lift` is an alias of :meth:`!tkraise`." +msgstr "" + +#: ../../library/tkinter.rst:1266 +msgid "" +"Lower this widget in the stacking order so that it is drawn beneath its " +"siblings. If *belowThis* is given, the widget is moved to be just below it " +"in the stacking order instead." +msgstr "" + +#: ../../library/tkinter.rst:1273 +msgid "" +"Return the names of all images that currently exist in the Tcl interpreter." +msgstr "" + +#: ../../library/tkinter.rst:1278 +msgid "Return the available image types, such as ``'photo'`` and ``'bitmap'``." +msgstr "" + +#: ../../library/tkinter.rst:1285 +msgid "" +"Set the anchor that controls where the grid is placed inside this container " +"when the container is larger than the grid and no row or column has a non-" +"zero weight. *anchor* is one of the usual anchor strings, such as ``'nw'`` " +"(the default) or ``'center'``. Called with no argument, this method has no " +"effect." +msgstr "" + +#: ../../library/tkinter.rst:1292 +msgid ":meth:`anchor` is an alias of :meth:`!grid_anchor`." +msgstr "" + +#: ../../library/tkinter.rst:1301 +msgid "" +"Return the bounding box, in pixels, of a region of the grid laid out in this " +"container, as a 4-tuple ``(xoffset, yoffset, width, height)``. With no " +"arguments the bounding box of the whole grid is returned. If *column* and " +"*row* are given, the box spans from the cell at row and column 0 to that " +"cell; if *col2* and *row2* are also given, it spans from the cell (*column*, " +"*row*) to the cell (*col2*, *row2*)." +msgstr "" + +#: ../../library/tkinter.rst:1308 +msgid ":meth:`bbox` is an alias of :meth:`!grid_bbox`." +msgstr "" + +#: ../../library/tkinter.rst:1315 +msgid "" +"Query or set the properties of the column (or columns) *index* of the grid " +"managed by this container. *index* may be a column number; when setting " +"options it may also be a list of column numbers, the string ``'all'`` to " +"affect every column, or a child widget whose occupied columns are affected. " +"The supported options are:" +msgstr "" + +#: ../../library/tkinter.rst:1322 +msgid "*minsize*" +msgstr "" + +#: ../../library/tkinter.rst:1323 +msgid "The column's minimum size, in pixels." +msgstr "" + +#: ../../library/tkinter.rst:1325 +#, fuzzy +msgid "*weight*" +msgstr "height" + +#: ../../library/tkinter.rst:1326 +msgid "" +"An integer setting how much of any extra space is apportioned to the column. " +"A weight of ``0`` keeps the column at its requested size, and a column of " +"weight two grows twice as fast as a column of weight one." +msgstr "" + +#: ../../library/tkinter.rst:1331 +msgid "*uniform*" +msgstr "" + +#: ../../library/tkinter.rst:1332 +msgid "" +"The name of a uniform group. Columns sharing a non-empty group name are kept " +"in sizes that are strictly proportional to their weights." +msgstr "" + +#: ../../library/tkinter.rst:1336 +msgid "*pad*" +msgstr "" + +#: ../../library/tkinter.rst:1337 +msgid "" +"Extra space, in pixels, added to the largest widget in the column when " +"computing the column's size." +msgstr "" + +#: ../../library/tkinter.rst:1340 +msgid "" +"With a single option name, return that option's value; with no options, " +"return a dictionary of all of them." +msgstr "" + +#: ../../library/tkinter.rst:1343 +msgid ":meth:`columnconfigure` is an alias of :meth:`!grid_columnconfigure`." +msgstr "" + +#: ../../library/tkinter.rst:1350 +msgid "" +"Query or set the properties of the row (or rows) *index* of the grid managed " +"by this container. *index* is interpreted as for :meth:" +"`grid_columnconfigure`, and the supported options (*minsize*, *weight*, " +"*uniform* and *pad*) are the same, applied to a row instead of a column." +msgstr "" + +#: ../../library/tkinter.rst:1356 +msgid ":meth:`rowconfigure` is an alias of :meth:`!grid_rowconfigure`." +msgstr "" + +#: ../../library/tkinter.rst:1360 +msgid "" +"Return the ``(column, row)`` of the grid cell that contains the pixel at " +"position (*x*, *y*), given in pixels relative to this container. For " +"locations above or to the left of the grid, ``-1`` is returned for the " +"corresponding coordinate." +msgstr "" + +#: ../../library/tkinter.rst:1368 +msgid "" +"Enable or disable geometry propagation for this container when it manages " +"its children with the grid geometry manager. When *flag* is true, the " +"container resizes itself to fit the requested sizes of its children; when it " +"is false, its size is left under your control. Called with no argument, " +"return the current setting as a boolean." +msgstr "" + +#: ../../library/tkinter.rst:1380 +msgid "" +"Return the size of the grid managed by this container as a ``(columns, " +"rows)`` tuple." +msgstr "" + +#: ../../library/tkinter.rst:1383 +msgid ":meth:`size` is an alias of :meth:`!grid_size`." +msgstr "" + +#: ../../library/tkinter.rst:1387 +msgid "" +"Return a list of the child widgets managed in this container's grid, most " +"recently managed first. If *row* or *column* is given, only the children in " +"that row or column are returned." +msgstr "" + +#: ../../library/tkinter.rst:1399 +msgid "" +"Enable or disable geometry propagation for this container when it manages " +"its children with the pack geometry manager. When *flag* is true, the " +"container resizes itself to fit the requested sizes of its children; when it " +"is false, its size is left under your control. Called with no argument, " +"return the current setting as a boolean." +msgstr "" + +#: ../../library/tkinter.rst:1406 +msgid ":meth:`propagate` is an alias of :meth:`!pack_propagate`." +msgstr "" + +#: ../../library/tkinter.rst:1413 +msgid "" +"Return a list of the child widgets managed by this container with the pack " +"geometry manager, in packing order." +msgstr "" + +#: ../../library/tkinter.rst:1416 +msgid ":meth:`slaves` is an alias of :meth:`!pack_slaves`." +msgstr "" + +#: ../../library/tkinter.rst:1420 +msgid "" +"Return a list of the child widgets managed by this container with the place " +"geometry manager." +msgstr "" + +#: ../../library/tkinter.rst:1425 +msgid "" +"Bind the event pattern *sequence* on this widget to the callable *func*." +msgstr "" + +#: ../../library/tkinter.rst:1427 +msgid "" +"*sequence* is an event pattern, such as ``''`` (a mouse click) or " +"``''``, optionally a concatenation of several such patterns that " +"must occur shortly after one another. When the event occurs, *func* is " +"called with an :class:`Event` instance describing it as its only argument; " +"if *func* returns the string ``'break'``, no further bindings for the event " +"are invoked." +msgstr "" + +#: ../../library/tkinter.rst:1434 +msgid "" +"If *add* is true, *func* is added to any functions already bound to " +"*sequence*; otherwise it replaces them. The binding applies only to this " +"widget." +msgstr "" + +#: ../../library/tkinter.rst:1438 +msgid "" +":meth:`!bind` returns a string identifier (a *funcid*) that can later be " +"passed to :meth:`unbind` to remove the binding without leaking the " +"associated Tcl command." +msgstr "" + +#: ../../library/tkinter.rst:1442 +msgid "" +"If *func* is omitted, return the binding currently associated with " +"*sequence*; if *sequence* is also omitted, return a list of all the " +"sequences for which bindings exist on this widget." +msgstr "" + +#: ../../library/tkinter.rst:1448 +msgid "" +"Like :meth:`bind`, but bind *func* to the binding tag *className* rather " +"than to a single widget, so that the binding applies to every widget having " +"that tag. *className* is usually the name of a widget class, such as " +"``'Button'``, in which case the binding affects all widgets of that class. " +"The set of binding tags for a widget can be inspected and changed with :meth:" +"`bindtags`." +msgstr "" + +#: ../../library/tkinter.rst:1456 ../../library/tkinter.rst:1463 +msgid "The remaining arguments and the return value are as for :meth:`bind`." +msgstr "" + +#: ../../library/tkinter.rst:1460 +msgid "" +"Like :meth:`bind`, but bind *func* to the special binding tag ``'all'``, so " +"that the binding applies to every widget in the application." +msgstr "" + +#: ../../library/tkinter.rst:1467 +msgid "Remove bindings for the event pattern *sequence* on this widget." +msgstr "" + +#: ../../library/tkinter.rst:1469 +msgid "" +"If *funcid* is given, only the function identified by it (a value returned " +"from a previous call to :meth:`bind`) is removed, and its associated Tcl " +"command is deleted. Otherwise all bindings for *sequence* are destroyed, " +"leaving it unbound." +msgstr "" + +#: ../../library/tkinter.rst:1474 +msgid "" +"If *funcid* is given, only that callback is unbound; other callbacks bound " +"to *sequence* are kept." +msgstr "" + +#: ../../library/tkinter.rst:1481 +msgid "" +"Remove all bindings for the event pattern *sequence* from the binding tag " +"*className*. See :meth:`bind_class`." +msgstr "" + +#: ../../library/tkinter.rst:1487 +msgid "" +"Remove all bindings for the event pattern *sequence* from the special " +"binding tag ``'all'``. See :meth:`bind_all`." +msgstr "" + +#: ../../library/tkinter.rst:1493 +msgid "" +"If *tagList* is omitted, return a tuple of the binding tags associated with " +"this widget. When an event occurs in a widget, it is applied to each of the " +"widget's binding tags in order, and for each tag the most specific matching " +"binding is executed. By default a widget has four binding tags: its own " +"pathname, its widget class, the pathname of its nearest toplevel ancestor, " +"and ``'all'``, in that order." +msgstr "" + +#: ../../library/tkinter.rst:1502 +msgid "" +"If *tagList* is given, it must be a sequence of strings; the widget's " +"binding tags are set to its elements, which determines the order in which " +"bindings are evaluated." +msgstr "" + +#: ../../library/tkinter.rst:1508 +msgid "" +"Associate the virtual event *virtual*, whose name has the form " +"``'<>'``, with each of the physical event patterns given by " +"*sequences*, so that the virtual event triggers whenever any of them occurs. " +"If *virtual* is already defined, the new sequences are added to its existing " +"ones." +msgstr "" + +#: ../../library/tkinter.rst:1517 +msgid "" +"Remove each of *sequences* from those associated with the virtual event " +"*virtual*. Sequences that are not currently associated with *virtual* are " +"ignored. If no *sequences* are given, all physical event sequences are " +"removed, so that *virtual* no longer triggers." +msgstr "" + +#: ../../library/tkinter.rst:1525 +msgid "" +"Generate the event *sequence* on this widget and arrange for it to be " +"processed just as if it had come from the window system. *sequence* must be " +"a single event pattern, such as ``''`` or ``'<>'``, not a " +"concatenation of several. Keyword arguments specify additional fields of the " +"event, for example *x* and *y* for the pointer position, or *when* to " +"control when the event is processed; refer to the Tk ``event`` manual page " +"for the full list." +msgstr "" + +#: ../../library/tkinter.rst:1535 +msgid "" +"If *virtual* is omitted, return a tuple of all the virtual events that are " +"currently defined. If *virtual* is given, return a tuple of the physical " +"event sequences currently associated with it, or an empty tuple if it is not " +"defined." +msgstr "" + +#: ../../library/tkinter.rst:1542 +msgid "" +"Schedule the callable *func* to be called after *ms* milliseconds, with " +"*args* and *kw* passed to it as positional and keyword arguments. Return an " +"identifier that can be passed to :meth:`after_cancel` to cancel the call." +msgstr "" + +#: ../../library/tkinter.rst:1547 +msgid "" +"If *func* is omitted, sleep for *ms* milliseconds instead, processing no " +"events during that time, and return ``None``." +msgstr "" + +#: ../../library/tkinter.rst:1550 +msgid "*func* can now be any callable object, not only a function." +msgstr "" + +#: ../../library/tkinter.rst:1553 ../../library/tkinter.rst:1578 +msgid "Keyword arguments are now passed to *func*." +msgstr "" + +#: ../../library/tkinter.rst:1559 +msgid "" +"Cancel a callback previously scheduled with :meth:`after` or :meth:" +"`after_idle`. *id* must be an identifier returned by one of those methods; " +"passing a value that is not such an identifier raises :exc:`ValueError`. If " +"the callback has already run or been cancelled, this has no effect." +msgstr "" + +#: ../../library/tkinter.rst:1565 +msgid "" +"Passing ``None`` (or any false value) as *id* now raises :exc:`ValueError`." +msgstr "" + +#: ../../library/tkinter.rst:1572 +msgid "" +"Schedule the callable *func* to be called, with *args* and *kw* passed to " +"it, when the Tk main loop next becomes idle, that is, when it has no other " +"events to process. Return an identifier that can be passed to :meth:" +"`after_cancel` to cancel the call." +msgstr "" + +#: ../../library/tkinter.rst:1584 +msgid "" +"If *id* is omitted, return a tuple of the identifiers of all callbacks " +"currently scheduled with :meth:`after` and :meth:`after_idle` for this " +"interpreter." +msgstr "" + +#: ../../library/tkinter.rst:1588 +msgid "" +"If *id* is given, it must identify a callback that has not yet run or been " +"cancelled, and the return value is a tuple ``(script, type)``, where " +"*script* refers to the function to be called and *type* is either ``'idle'`` " +"or ``'timer'``. A :exc:`TclError` is raised if *id* does not exist." +msgstr "" + +#: ../../library/tkinter.rst:1599 +msgid "" +"Enter the Tk event loop, which processes events until all windows are " +"destroyed. This is normally called once, on the root window, to run the " +"application." +msgstr "" + +#: ../../library/tkinter.rst:1605 +msgid "Quit the Tcl interpreter, causing :meth:`mainloop` to return." +msgstr "" + +#: ../../library/tkinter.rst:1609 +msgid "" +"Enter the event loop until all pending events, including idle callbacks, " +"have been processed. This brings the display up to date and handles any " +"events that are already queued, then returns." +msgstr "" + +#: ../../library/tkinter.rst:1616 +msgid "" +"Enter the event loop until all pending idle callbacks have been called. This " +"updates the display of windows, for example after geometry changes, but does " +"not process events caused by the user." +msgstr "" + +#: ../../library/tkinter.rst:1625 +msgid "" +"Wait until the Tcl variable *name* is modified, continuing to process events " +"in the meantime so that the application stays responsive. *name* is usually " +"a :class:`Variable` instance, such as an :class:`IntVar` or :class:" +"`StringVar`." +msgstr "" + +#: ../../library/tkinter.rst:1630 +msgid ":meth:`waitvar` is an alias of :meth:`!wait_variable`." +msgstr "" + +#: ../../library/tkinter.rst:1634 +msgid "" +"Wait until *window* is destroyed, continuing to process events in the " +"meantime. If *window* is omitted, this widget is used. This is typically " +"used to wait for the user to finish interacting with a dialog box." +msgstr "" + +#: ../../library/tkinter.rst:1642 +msgid "" +"Wait until the visibility state of *window* changes, for example when it " +"first appears on the screen, continuing to process events in the meantime. " +"If *window* is omitted, this widget is used. This is typically used to wait " +"for a newly created window to become visible before acting on it." +msgstr "" + +#: ../../library/tkinter.rst:1653 +msgid "" +"Direct the keyboard input focus for this widget's display to this widget. If " +"the application does not currently have the input focus on this widget's " +"display, the widget is remembered as the focus window for its top level, and " +"the focus will be redirected to it the next time the window manager gives " +"the focus to the top level. :meth:`focus` is an alias of :meth:`!focus_set`." +msgstr "" + +#: ../../library/tkinter.rst:1662 +msgid "" +"Direct the keyboard input focus to this widget even if the application does " +"not currently have the input focus for the widget's display. This method " +"should be used sparingly, if at all; normally an application should wait for " +"the window manager to give it the focus rather than claiming it." +msgstr "" + +#: ../../library/tkinter.rst:1670 +msgid "" +"Return the widget that currently has the keyboard focus in the application, " +"or ``None`` if no widget in the application has the focus. Use :meth:" +"`focus_displayof` to work correctly with several displays." +msgstr "" + +#: ../../library/tkinter.rst:1676 +msgid "" +"Return the widget that currently has the keyboard focus on the display where " +"this widget is located, or ``None`` if no widget in the application has the " +"focus on that display." +msgstr "" + +#: ../../library/tkinter.rst:1682 +msgid "" +"Return the most recent widget to have had the keyboard focus among all the " +"widgets in the same top level as this widget; this is the widget that will " +"receive the focus the next time the window manager gives the focus to the " +"top level. If no widget in that top level has ever had the focus, or if the " +"most recent focus widget has been deleted, the top level itself is returned." +msgstr "" + +#: ../../library/tkinter.rst:1691 +msgid "" +"Reconfigure Tk to use an implicit focus model in which the focus is set to a " +"widget whenever the mouse pointer enters it. This cannot easily be disabled " +"once enabled." +msgstr "" + +#: ../../library/tkinter.rst:1697 +msgid "" +"Return the next widget after this one in the keyboard traversal order, or " +"``None`` if there is none. The traversal order goes first to the next child, " +"then recursively to the children of that child, and then to the next sibling " +"higher in the stacking order. A widget is skipped if its ``takefocus`` " +"option is set to ``0``. This method is used in the default bindings for the :" +"kbd:`Tab` key." +msgstr "" + +#: ../../library/tkinter.rst:1707 +msgid "" +"Return the previous widget before this one in the keyboard traversal order, " +"or ``None`` if there is none. See :meth:`tk_focusNext` for how the order is " +"defined. This method is used in the default bindings for the :kbd:`Shift-" +"Tab` key." +msgstr "" + +#: ../../library/tkinter.rst:1714 +msgid "" +"Set a local grab on this widget. A grab confines pointer events to this " +"widget and its descendants: while the pointer is outside the widget's " +"subtree, button presses and releases and pointer motion are reported to the " +"grab widget, and windows outside the subtree become insensitive until the " +"grab is released. A local grab affects only the grabbing application. Any " +"grab previously set by this application on the widget's display is " +"automatically released. Setting a grab is the usual way to make a dialog " +"modal: while the grab is in effect the user cannot interact with the other " +"windows of the application." +msgstr "" + +#: ../../library/tkinter.rst:1728 +msgid "" +"Set a global grab on this widget. A global grab is like the local grab set " +"by :meth:`grab_set`, but it locks out all other applications on the screen, " +"so that only this widget's subtree is sensitive to pointer events, and it " +"also grabs the keyboard. Use with caution: it is easy to render a display " +"unusable with a global grab, since other applications stop receiving events " +"until it is released." +msgstr "" + +#: ../../library/tkinter.rst:1739 +msgid "Release the grab on this widget if there is one; otherwise do nothing." +msgstr "" + +#: ../../library/tkinter.rst:1743 +msgid "" +"Return the widget that currently holds the grab in this application for this " +"widget's display, or ``None`` if there is no such widget." +msgstr "" + +#: ../../library/tkinter.rst:1748 +msgid "" +"Return ``None`` if no grab is currently set on this widget, ``\"local\"`` if " +"a local grab is set, or ``\"global\"`` if a global grab is set." +msgstr "" + +#: ../../library/tkinter.rst:1753 +msgid "" +"Clear the X selection, so that no window owns it anymore. The selection to " +"clear is given by the keyword argument *selection*, an atom name such as " +"``'PRIMARY'`` or ``'CLIPBOARD'``; it defaults to ``PRIMARY``. The " +"*displayof* keyword argument names a widget that determines the display on " +"which to operate, and defaults to this widget." +msgstr "" + +#: ../../library/tkinter.rst:1762 +msgid "" +"Return the contents of the current X selection. The keyword argument " +"*selection* names the selection and defaults to ``PRIMARY``. The keyword " +"argument *type* specifies the form in which the data is to be returned (the " +"desired conversion target), an atom name such as ``'STRING'`` or " +"``'FILE_NAME'``; it defaults to ``STRING``, except on X11, where " +"``UTF8_STRING`` is tried first and ``STRING`` is used as a fallback. The " +"*displayof* keyword argument names a widget that determines the display from " +"which to retrieve the selection, and defaults to this widget." +msgstr "" + +#: ../../library/tkinter.rst:1776 +msgid "" +"Register *command* as a handler to supply the X selection owned by this " +"widget when another application requests it. When the selection is " +"retrieved, *command* is called with two arguments, the starting character " +"offset and the maximum number of characters to return, and must return at " +"most that many characters of the selection starting at that offset; for very " +"long selections it is called repeatedly with increasing offsets. The keyword " +"argument *selection* names the selection (default ``PRIMARY``) and the " +"keyword argument *type* gives the form of the selection that the handler " +"supplies (such as ``'STRING'`` or ``'FILE_NAME'``, default ``STRING``)." +msgstr "" + +#: ../../library/tkinter.rst:1790 +msgid "" +"Make this widget the owner of the X selection on its display. The previous " +"owner, if any, is notified that it has lost the selection. The keyword " +"argument *selection* names the selection and defaults to ``PRIMARY``." +msgstr "" + +#: ../../library/tkinter.rst:1797 +msgid "" +"Return the widget in this application that owns the X selection on the " +"display containing this widget, or ``None`` if no widget in this application " +"owns the selection. The keyword argument *selection* names the selection and " +"defaults to ``PRIMARY``. The *displayof* keyword argument names a widget " +"that determines the display to query, and defaults to this widget." +msgstr "" + +#: ../../library/tkinter.rst:1807 +msgid "" +"Append *string* to the Tk clipboard and claim ownership of the clipboard on " +"this widget's display. Before appending, the clipboard should be emptied " +"with :meth:`clipboard_clear`; all appends should be completed before " +"returning to the event loop so that the clipboard is updated atomically. The " +"keyword argument *type* specifies the form of the data, an atom name such as " +"``'STRING'`` or ``'FILE_NAME'`` (default ``STRING``), and the keyword " +"argument *format* specifies the representation used to transmit it (default " +"``STRING``). The *displayof* keyword argument names a widget that determines " +"the target display, and defaults to this widget. The contents can be " +"retrieved with :meth:`clipboard_get` or :meth:`selection_get`." +msgstr "" + +#: ../../library/tkinter.rst:1823 +msgid "" +"Claim ownership of the clipboard on this widget's display and remove any " +"previous contents. The *displayof* keyword argument names a widget that " +"determines the target display, and defaults to this widget." +msgstr "" + +#: ../../library/tkinter.rst:1830 +msgid "" +"Retrieve data from the clipboard on this widget's display. The keyword " +"argument *type* specifies the form in which the data is to be returned, an " +"atom name such as ``'STRING'`` or ``'FILE_NAME'``; it defaults to " +"``STRING``, except on X11, where ``UTF8_STRING`` is tried first and " +"``STRING`` is used as a fallback. The *displayof* keyword argument names a " +"widget that determines the display, and defaults to the root window of the " +"application. This is equivalent to ``selection_get(selection= 'CLIPBOARD')``." +msgstr "" + +#: ../../library/tkinter.rst:1841 +msgid "" +"Add an option to the Tk option database that associates *value* with " +"*pattern*. *pattern* consists of names and/or classes separated by asterisks " +"or dots, in the usual X format. *priority* is an integer between 0 and 100, " +"or one of the symbolic names ``'widgetDefault'`` (20), ``'startupFile'`` " +"(40), ``'userDefault'`` (60), or ``'interactive'`` (80); it defaults to " +"``interactive``." +msgstr "" + +#: ../../library/tkinter.rst:1851 +msgid "" +"Clear the Tk option database. Default options from the :envvar:`!" +"RESOURCE_MANAGER` property or the :file:`.Xdefaults` file are reloaded " +"automatically the next time an option is added to or removed from the " +"database." +msgstr "" + +#: ../../library/tkinter.rst:1858 +msgid "" +"Return the value of the option matching this widget under *name* and " +"*className* from the Tk option database, or an empty string if there is no " +"matching entry. When several entries match, the one with the highest " +"priority is returned, and among entries of equal priority the most recently " +"added one." +msgstr "" + +#: ../../library/tkinter.rst:1867 +msgid "" +"Read the file named *fileName*, which should have the standard format for an " +"X resource database such as :file:`.Xdefaults`, and add all the options it " +"specifies to the Tk option database. *priority* is interpreted as for :meth:" +"`option_add` and defaults to ``interactive``." +msgstr "" + +#: ../../library/tkinter.rst:1875 +msgid "" +"Ring the bell on the display for this widget, using the display's current " +"bell-related settings, and reset the screen saver for the screen. If " +"*displayof* is given as a widget, the bell is rung on that widget's display " +"instead." +msgstr "" + +#: ../../library/tkinter.rst:1883 +msgid "" +"Set a new color scheme for all Tk widget elements. Existing widgets are " +"updated and the option database is changed so that future widgets use the " +"new colors. A single color argument is taken as the normal background color, " +"from which a complete palette is computed. Alternatively, the arguments may " +"be given as keyword *name*/*value* pairs naming individual options in the " +"option database. The recognized option names are ``activeBackground``, " +"``activeForeground``, ``background``, ``disabledForeground``, " +"``foreground``, ``highlightBackground``, ``highlightColor``, " +"``insertBackground``, ``selectColor``, ``selectBackground``, " +"``selectForeground``, and ``troughColor``; reasonable defaults are computed " +"for any that are not specified." +msgstr "" + +#: ../../library/tkinter.rst:1899 +msgid "" +"Restore the application's colors to the light brown (bisque) color scheme " +"used in Tk 3.6 and earlier versions. Provided for backward compatibility." +msgstr "" + +#: ../../library/tkinter.rst:1905 +msgid "" +"Query or set whether Tk's look and feel should strictly adhere to Motif. A " +"true *boolean* value enables strict Motif compliance (for example, no color " +"change when the mouse passes over a slider). Return the resulting setting." +msgstr "" + +#: ../../library/tkinter.rst:1920 +msgid "" +"Make this widget appear busy. A transparent window is placed in front of the " +"widget, so that it and all of its descendants in the widget hierarchy are " +"blocked from pointer events and display a busy cursor. Normally :meth:" +"`update` should be called immediately afterwards to ensure that the hold " +"operation is in effect before the application starts its processing." +msgstr "" + +#: ../../library/tkinter.rst:1928 +msgid "" +"The only supported configuration option is *cursor*, the cursor to be " +"displayed while the widget is busy; it may have any of the values accepted " +"by :meth:`!configure`." +msgstr "" + +#: ../../library/tkinter.rst:1932 +msgid "" +":meth:`busy_hold`, :meth:`busy` and :meth:`tk_busy` are aliases of :meth:`!" +"tk_busy_hold`." +msgstr "" + +#: ../../library/tkinter.rst:1949 +msgid "" +"Query or modify the configuration options of the busy window. The widget " +"must have been previously made busy by :meth:`tk_busy_hold`. With no " +"arguments, return a dictionary describing all of the available options; if " +"*cnf* is the name of an option, return a tuple describing that one option. " +"Otherwise set the given options to the given values. Options may have any of " +"the values accepted by :meth:`tk_busy_hold`." +msgstr "" + +#: ../../library/tkinter.rst:1957 +msgid "" +"The option database is referenced through the widget name or class. For " +"example, if a :class:`Frame` widget named ``frame`` is to be made busy, the " +"busy cursor can be specified for it by either of the calls::" +msgstr "" + +#: ../../library/tkinter.rst:1961 +msgid "" +"w.option_add('*frame.busyCursor', 'gumby')\n" +"w.option_add('*Frame.BusyCursor', 'gumby')" +msgstr "" + +#: ../../library/tkinter.rst:1964 +msgid "" +":meth:`busy_configure`, :meth:`busy_config` and :meth:`tk_busy_config` are " +"aliases of :meth:`!tk_busy_configure`." +msgstr "" + +#: ../../library/tkinter.rst:1975 +msgid "" +"Return the current value of the busy configuration *option*. The widget must " +"have been previously made busy by :meth:`tk_busy_hold`, and *option* may " +"have any of the values accepted by that method." +msgstr "" + +#: ../../library/tkinter.rst:1979 +msgid ":meth:`busy_cget` is an alias of :meth:`!tk_busy_cget`." +msgstr "" + +#: ../../library/tkinter.rst:1989 +msgid "" +"Make this widget no longer busy, releasing the resources (including the " +"transparent window) allocated when it was made busy. User events will again " +"be received by the widget. These resources are also released when the widget " +"is destroyed." +msgstr "" + +#: ../../library/tkinter.rst:1994 +msgid ":meth:`busy_forget` is an alias of :meth:`!tk_busy_forget`." +msgstr "" + +#: ../../library/tkinter.rst:2004 +msgid "Return ``True`` if the widget is currently busy, ``False`` otherwise." +msgstr "" + +#: ../../library/tkinter.rst:2006 +msgid ":meth:`busy_status` is an alias of :meth:`!tk_busy_status`." +msgstr "" + +#: ../../library/tkinter.rst:2016 +msgid "" +"Return a list of widgets that are currently busy. If *pattern* is given, " +"only busy widgets whose path names match the pattern are returned." +msgstr "" + +#: ../../library/tkinter.rst:2020 +msgid ":meth:`busy_current` is an alias of :meth:`!tk_busy_current`." +msgstr "" + +#: ../../library/tkinter.rst:2026 +msgid "" +"Return the integer identifier for the atom whose name is *name*, creating a " +"new atom if none exists. If *displayof* is given, the atom is looked up on " +"the display of that window; otherwise it is looked up on the display of the " +"application's main window." +msgstr "" + +#: ../../library/tkinter.rst:2034 +msgid "" +"Return the textual name for the atom whose integer identifier is *id*. This " +"is the inverse of :meth:`winfo_atom`. If *displayof* is given, the " +"identifier is looked up on the display of that window; otherwise it is " +"looked up on the display of the application's main window." +msgstr "" + +#: ../../library/tkinter.rst:2042 +msgid "Return the number of cells in the colormap for the widget." +msgstr "" + +#: ../../library/tkinter.rst:2046 +msgid "" +"Return a list containing the widgets that are children of the widget, in " +"stacking order from lowest to highest. Toplevel windows are returned as " +"children of their logical parents." +msgstr "" + +#: ../../library/tkinter.rst:2052 +msgid "Return the class name of the widget." +msgstr "" + +#: ../../library/tkinter.rst:2056 +msgid "" +"Return ``True`` if the colormap for the widget is known to be full, " +"``False`` otherwise." +msgstr "" + +#: ../../library/tkinter.rst:2061 +msgid "" +"Return the widget containing the point given by *rootX* and *rootY*, or " +"``None`` if no window in this application contains the point. The " +"coordinates are in screen units in the coordinate system of the root window. " +"If *displayof* is given, the coordinates refer to the screen containing that " +"window; otherwise they refer to the screen of the application's main window." +msgstr "" + +#: ../../library/tkinter.rst:2071 +msgid "Return the depth of the widget, that is, the number of bits per pixel." +msgstr "" + +#: ../../library/tkinter.rst:2075 +msgid "Return ``1`` if the widget exists, ``0`` otherwise." +msgstr "" + +#: ../../library/tkinter.rst:2079 +msgid "" +"Return a floating-point value giving the number of pixels in the widget " +"corresponding to the screen distance *number* (for example, ``\"2.0c\"`` or " +"``\"1i\"``). The result may be fractional; for a rounded integer value use :" +"meth:`winfo_pixels`." +msgstr "" + +#: ../../library/tkinter.rst:2087 +msgid "" +"Return the geometry of the widget, in the form ``widthxheight+x+y``. All " +"dimensions are in pixels." +msgstr "" + +#: ../../library/tkinter.rst:2092 +msgid "" +"Return the height of the widget in pixels. When a window is first created " +"its height is 1 pixel; it is eventually changed by a geometry manager. See " +"also :meth:`winfo_reqheight`." +msgstr "" + +#: ../../library/tkinter.rst:2099 +msgid "" +"Return a low-level platform-specific identifier for the widget. On Unix this " +"is the X window identifier, and on Windows it is the window handle." +msgstr "" + +#: ../../library/tkinter.rst:2105 +msgid "" +"Return a tuple of the names of all Tcl interpreters currently registered for " +"a particular display. If *displayof* is given, the return value refers to " +"the display of that window; otherwise it refers to the display of the " +"application's main window." +msgstr "" + +#: ../../library/tkinter.rst:2113 +msgid "Return ``1`` if the widget is currently mapped, ``0`` otherwise." +msgstr "" + +#: ../../library/tkinter.rst:2117 +msgid "" +"Return the name of the geometry manager currently responsible for the " +"widget, or an empty string if it is not managed by any geometry manager." +msgstr "" + +#: ../../library/tkinter.rst:2122 +msgid "" +"Return the widget's name within its parent, as opposed to its full path name." +msgstr "" + +#: ../../library/tkinter.rst:2127 +msgid "" +"Return the path name of the widget's parent, or an empty string if the " +"widget is the main window of the application." +msgstr "" + +#: ../../library/tkinter.rst:2132 +msgid "" +"Return the path name of the window whose identifier is *id*. If *displayof* " +"is given, the identifier is looked up on the display of that window; " +"otherwise it is looked up on the display of the application's main window." +msgstr "" + +#: ../../library/tkinter.rst:2139 +msgid "" +"Return the number of pixels in the widget corresponding to the screen " +"distance *number* (for example, ``\"2.0c\"`` or ``\"1i\"``). The result is " +"rounded to the nearest integer; for a fractional result use :meth:" +"`winfo_fpixels`." +msgstr "" + +#: ../../library/tkinter.rst:2146 +msgid "" +"Return the pointer's *x* coordinate, in pixels, relative to the screen's " +"root window (or virtual root, if one is in use). Return ``-1`` if the " +"pointer is not on the same screen as the widget." +msgstr "" + +#: ../../library/tkinter.rst:2152 +msgid "" +"Return the pointer's coordinates as an ``(x, y)`` tuple, in pixels, relative " +"to the screen's root window (or virtual root, if one is in use). Both " +"coordinates are ``-1`` if the pointer is not on the same screen as the " +"widget." +msgstr "" + +#: ../../library/tkinter.rst:2159 +msgid "" +"Return the pointer's *y* coordinate, in pixels, relative to the screen's " +"root window (or virtual root, if one is in use). Return ``-1`` if the " +"pointer is not on the same screen as the widget." +msgstr "" + +#: ../../library/tkinter.rst:2165 +msgid "" +"Return the widget's requested height in pixels. This is the value used by " +"the widget's geometry manager to compute its geometry." +msgstr "" + +#: ../../library/tkinter.rst:2171 +msgid "" +"Return the widget's requested width in pixels. This is the value used by the " +"widget's geometry manager to compute its geometry." +msgstr "" + +#: ../../library/tkinter.rst:2177 +msgid "" +"Return an ``(r, g, b)`` tuple of the red, green, and blue intensities, in " +"the range 0 to 65535, that correspond to *color* in the widget. *color* may " +"be specified in any of the forms acceptable for a color option." +msgstr "" + +#: ../../library/tkinter.rst:2184 +msgid "" +"Return the *x* coordinate, in the root window of the screen, of the upper-" +"left corner of the widget's border (or of the widget itself if it has no " +"border)." +msgstr "" + +#: ../../library/tkinter.rst:2190 +msgid "" +"Return the *y* coordinate, in the root window of the screen, of the upper-" +"left corner of the widget's border (or of the widget itself if it has no " +"border)." +msgstr "" + +#: ../../library/tkinter.rst:2196 +msgid "" +"Return the name of the screen associated with the widget, in the form " +"``displayName.screenIndex``." +msgstr "" + +#: ../../library/tkinter.rst:2201 +msgid "" +"Return the number of cells in the default colormap for the widget's screen." +msgstr "" + +#: ../../library/tkinter.rst:2206 +msgid "" +"Return the depth of the root window of the widget's screen, that is, the " +"number of bits per pixel." +msgstr "" + +#: ../../library/tkinter.rst:2211 +msgid "Return the height of the widget's screen in pixels." +msgstr "" + +#: ../../library/tkinter.rst:2215 +msgid "Return the height of the widget's screen in millimeters." +msgstr "" + +#: ../../library/tkinter.rst:2219 +msgid "Return the width of the widget's screen in millimeters." +msgstr "" + +#: ../../library/tkinter.rst:2223 +msgid "" +"Return the default visual class for the widget's screen, one of " +"``\"directcolor\"``, ``\"grayscale\"``, ``\"pseudocolor\"``, " +"``\"staticcolor\"``, ``\"staticgray\"``, or ``\"truecolor\"``." +msgstr "" + +#: ../../library/tkinter.rst:2229 +msgid "Return the width of the widget's screen in pixels." +msgstr "" + +#: ../../library/tkinter.rst:2233 +msgid "" +"Return a string containing information about the server for the widget's " +"display. The exact format of this string may vary from platform to platform." +msgstr "" + +#: ../../library/tkinter.rst:2239 +msgid "" +"Return the top-of-hierarchy window containing the widget. In standard Tk " +"this is always a :class:`Toplevel` widget." +msgstr "" + +#: ../../library/tkinter.rst:2244 +msgid "" +"Return ``1`` if the widget and all of its ancestors up through the nearest " +"toplevel window are mapped, ``0`` otherwise." +msgstr "" + +#: ../../library/tkinter.rst:2249 +msgid "" +"Return the visual class for the widget, one of ``\"directcolor\"``, " +"``\"grayscale\"``, ``\"pseudocolor\"``, ``\"staticcolor\"``, " +"``\"staticgray\"``, or ``\"truecolor\"``." +msgstr "" + +#: ../../library/tkinter.rst:2255 +msgid "Return the X identifier for the visual for the widget." +msgstr "" + +#: ../../library/tkinter.rst:2259 +msgid "" +"Return a list describing the visuals available for the widget's screen. Each " +"item consists of a visual class (see :meth:`winfo_visual`) followed by an " +"integer depth. If *includeids* is true, the X identifier for the visual is " +"also included." +msgstr "" + +#: ../../library/tkinter.rst:2267 +msgid "" +"Return the height of the virtual root window associated with the widget if " +"there is one; otherwise return the height of the widget's screen." +msgstr "" + +#: ../../library/tkinter.rst:2272 +msgid "" +"Return the width of the virtual root window associated with the widget if " +"there is one; otherwise return the width of the widget's screen." +msgstr "" + +#: ../../library/tkinter.rst:2277 +msgid "" +"Return the *x* offset of the virtual root window associated with the widget, " +"relative to the root window of its screen. This is normally zero or " +"negative, and is ``0`` if there is no virtual root window." +msgstr "" + +#: ../../library/tkinter.rst:2284 +msgid "" +"Return the *y* offset of the virtual root window associated with the widget, " +"relative to the root window of its screen. This is normally zero or " +"negative, and is ``0`` if there is no virtual root window." +msgstr "" + +#: ../../library/tkinter.rst:2291 +msgid "" +"Return the width of the widget in pixels. When a window is first created its " +"width is 1 pixel; it is eventually changed by a geometry manager. See also :" +"meth:`winfo_reqwidth`." +msgstr "" + +#: ../../library/tkinter.rst:2298 +msgid "" +"Return the *x* coordinate, in the widget's parent, of the upper-left corner " +"of the widget's border (or of the widget itself if it has no border)." +msgstr "" + +#: ../../library/tkinter.rst:2304 +msgid "" +"Return the *y* coordinate, in the widget's parent, of the upper-left corner " +"of the widget's border (or of the widget itself if it has no border)." +msgstr "" + +#: ../../library/tkinter.rst:2310 +msgid "" +"Return the Tcl/Tk patch level as a named tuple with the same five fields as :" +"data:`sys.version_info`: *major*, *minor*, *micro*, *releaselevel* and " +"*serial*. *releaselevel* is ``'alpha'``, ``'beta'`` or ``'final'``. " +"Converting it to a string gives the version in the usual Tcl/Tk notation, " +"for example ``'9.0.3'`` for a final release or ``'9.1b2'`` for a pre-release." +msgstr "" + +#: ../../library/tkinter.rst:2324 +msgid "" +"The :class:`!Wm` mixin provides access to the window manager, allowing an " +"application to control such things as the title, geometry and icon of a top-" +"level window, the way it is resized, and how it responds to window manager " +"protocols. It is mixed into :class:`Tk` and :class:`Toplevel`, so its " +"methods are available on every top-level window. Each method has two " +"equivalent spellings: a short name and a ``wm_``-prefixed name (for " +"example, :meth:`title` and :meth:`wm_title`)." +msgstr "" + +#: ../../library/tkinter.rst:2338 +msgid "" +"Constrain the aspect ratio (the ratio of width to height) of the window. If " +"all four arguments are given, the window manager keeps the ratio between " +"``minNumer/minDenom`` and ``maxNumer/maxDenom``; passing empty strings " +"removes any existing restriction. With no arguments, return a tuple of the " +"four current values, or an empty string if no aspect restriction is in " +"effect. :meth:`wm_aspect` is an alias of :meth:`!aspect`." +msgstr "" + +#: ../../library/tkinter.rst:2351 +msgid "" +"Query or set platform-specific attributes of the window. With no arguments, " +"return the platform-specific flags and their values; pass " +"*return_python_dict* as true to get them as a dictionary. A single option " +"name such as ``'alpha'`` returns the value of that option, and options are " +"set using keyword arguments (``alpha=0.5``)." +msgstr "" + +#: ../../library/tkinter.rst:2357 +msgid "The available attributes differ by platform. All platforms support:" +msgstr "" + +#: ../../library/tkinter.rst:2360 +msgid "*alpha*" +msgstr "" + +#: ../../library/tkinter.rst:2361 +msgid "" +"The window's opacity, from ``0.0`` (fully transparent) to ``1.0`` (opaque). " +"Where transparency is unsupported the value stays at ``1.0``." +msgstr "" + +#: ../../library/tkinter.rst:2365 +msgid "*appearance*" +msgstr "" + +#: ../../library/tkinter.rst:2366 +msgid "" +"Whether the window is rendered in dark mode on Windows and macOS: " +"``'auto'``, ``'light'`` or ``'dark'`` (this has no effect on X11)." +msgstr "" + +#: ../../library/tkinter.rst:2369 +#, fuzzy +msgid "*fullscreen*" +msgstr "*screenName*" + +#: ../../library/tkinter.rst:2370 +msgid "Whether the window takes up the entire screen and has no borders." +msgstr "" + +#: ../../library/tkinter.rst:2372 +msgid "*topmost*" +msgstr "" + +#: ../../library/tkinter.rst:2373 +msgid "Whether the window is displayed above all other windows." +msgstr "" + +#: ../../library/tkinter.rst:2375 +msgid "Windows additionally supports:" +msgstr "" + +#: ../../library/tkinter.rst:2377 +msgid "*disabled*" +msgstr "" + +#: ../../library/tkinter.rst:2378 +msgid "Whether the window is in a disabled state." +msgstr "" + +#: ../../library/tkinter.rst:2380 +msgid "*toolwindow*" +msgstr "" + +#: ../../library/tkinter.rst:2381 +msgid "Whether the window uses the tool window style." +msgstr "" + +#: ../../library/tkinter.rst:2383 +msgid "*transparentcolor*" +msgstr "" + +#: ../../library/tkinter.rst:2384 +msgid "The color that is made fully transparent, or an empty string for none." +msgstr "" + +#: ../../library/tkinter.rst:2386 +msgid "macOS additionally supports:" +msgstr "" + +#: ../../library/tkinter.rst:2388 +#, fuzzy +msgid "*class*" +msgstr "*className*" + +#: ../../library/tkinter.rst:2389 +msgid "" +"Whether the underlying Aqua window is an ``nswindow`` or an ``nspanel``; " +"this can only be set before the window is created." +msgstr "" + +#: ../../library/tkinter.rst:2392 +msgid "*modified*" +msgstr "" + +#: ../../library/tkinter.rst:2393 +msgid "" +"The modification state shown by the window's close button and proxy icon." +msgstr "" + +#: ../../library/tkinter.rst:2396 +msgid "*notify*" +msgstr "" + +#: ../../library/tkinter.rst:2397 +msgid "Whether the application's dock icon bounces to request attention." +msgstr "" + +#: ../../library/tkinter.rst:2399 +msgid "*stylemask*" +msgstr "" + +#: ../../library/tkinter.rst:2400 +msgid "" +"The style mask of the underlying Aqua window, given as a list of bit names " +"such as ``titled`` or ``resizable``." +msgstr "" + +#: ../../library/tkinter.rst:2403 +msgid "*tabbingid*" +msgstr "" + +#: ../../library/tkinter.rst:2404 +msgid "The identifier of the tab group that the window belongs to." +msgstr "" + +#: ../../library/tkinter.rst:2406 +msgid "*tabbingmode*" +msgstr "" + +#: ../../library/tkinter.rst:2407 +msgid "" +"Whether the window may be opened as a tab: ``'auto'``, ``'preferred'`` or " +"``'disallowed'``." +msgstr "" + +#: ../../library/tkinter.rst:2410 +msgid "*titlepath*" +msgstr "" + +#: ../../library/tkinter.rst:2411 +msgid "The path of the file represented by the window's proxy icon." +msgstr "" + +#: ../../library/tkinter.rst:2413 +msgid "*transparent*" +msgstr "" + +#: ../../library/tkinter.rst:2414 +msgid "" +"Whether the content area is transparent and the window shadow is turned off." +msgstr "" + +#: ../../library/tkinter.rst:2417 +msgid "X11 additionally supports:" +msgstr "" + +#: ../../library/tkinter.rst:2419 +#, fuzzy +msgid "*type*" +msgstr "type" + +#: ../../library/tkinter.rst:2420 +msgid "" +"The window type, or a list of types in order of preference, that the window " +"manager should use to interpret the window, such as ``'dialog'`` or " +"``'splash'``." +msgstr "" + +#: ../../library/tkinter.rst:2424 +msgid "*zoomed*" +msgstr "" + +#: ../../library/tkinter.rst:2425 +msgid "Whether the window is maximized." +msgstr "" + +#: ../../library/tkinter.rst:2429 +msgid "" +"Tk 8.6 added the *type* attribute, and Tk 9.0 added the *appearance*, " +"*class*, *stylemask*, *tabbingid* and *tabbingmode* attributes." +msgstr "" + +#: ../../library/tkinter.rst:2432 +msgid "" +"On X11 changes are applied asynchronously, so a queried value may not yet " +"reflect the most recent request. :meth:`wm_attributes` is an alias of :meth:" +"`!attributes`." +msgstr "" + +#: ../../library/tkinter.rst:2436 +msgid "" +"A single attribute may now be queried by name without the leading ``-``, and " +"attributes may be set using keyword arguments. The *return_python_dict* " +"parameter was added." +msgstr "" + +#: ../../library/tkinter.rst:2441 +msgid "" +"Setting an attribute by passing the option name (with a leading ``-``) and " +"its value as two positional arguments, as in ``w.attributes('-alpha', " +"0.5)``, is deprecated; use keyword arguments instead." +msgstr "" + +#: ../../library/tkinter.rst:2453 +msgid "" +"Store *name*, which should be the name of the host on which the application " +"is running, in the window's ``WM_CLIENT_MACHINE`` property for use by the " +"window or session manager. An empty string deletes the property. With no " +"argument, return the last name set, or an empty string. :meth:`wm_client` is " +"an alias of :meth:`!client`." +msgstr "" + +#: ../../library/tkinter.rst:2465 +msgid "" +"Manipulate the ``WM_COLORMAP_WINDOWS`` property, which tells the window " +"manager about windows that have private colormaps. If *wlist* is given, " +"overwrite the property with those windows (their order is a priority order " +"for installing colormaps). With no arguments, return the list of windows " +"currently named in the property. :meth:`wm_colormapwindows` is an alias of :" +"meth:`!colormapwindows`." +msgstr "" + +#: ../../library/tkinter.rst:2478 +msgid "" +"Store *value* in the window's ``WM_COMMAND`` property for use by the window " +"or session manager; it should be a list giving the words of the command used " +"to invoke the application. An empty string deletes the property. With no " +"argument, return the last value set, or an empty string. :meth:`wm_command` " +"is an alias of :meth:`!command`." +msgstr "" + +#: ../../library/tkinter.rst:2490 +msgid "" +"Display the window in normal (non-iconified) form by mapping it. If the " +"window has never been mapped, this ensures it appears de-iconified when it " +"is first mapped. On Windows the window is also raised and given the focus. :" +"meth:`wm_deiconify` is an alias of :meth:`!deiconify`." +msgstr "" + +#: ../../library/tkinter.rst:2501 +msgid "" +"Set or query the focus model for the window. *model* is either ``'active'`` " +"(the window claims the input focus for itself or its descendants, even when " +"the focus is in another application) or ``'passive'`` (the window relies on " +"the window manager to give it the focus). With no argument, return the " +"current model. The default is ``'passive'``, which is what the :meth:`!" +"focus` command assumes. :meth:`wm_focusmodel` is an alias of :meth:`!" +"focusmodel`." +msgstr "" + +#: ../../library/tkinter.rst:2516 +msgid "" +"Unmap *window* from the screen so that it is no longer managed by the window " +"manager. A :class:`Toplevel` is then treated like a :class:`Frame`, although " +"its ``-menu`` configuration is remembered and the menu reappears if the " +"widget is managed again. :meth:`wm_forget` is an alias of :meth:`!forget`." +msgstr "" + +#: ../../library/tkinter.rst:2530 +msgid "" +"Return the platform-specific window identifier for the outermost decorative " +"frame containing the window, if the window manager has reparented it into " +"such a frame; otherwise return the identifier of the window itself. :meth:" +"`wm_frame` is an alias of :meth:`!frame`." +msgstr "" + +#: ../../library/tkinter.rst:2541 +msgid "" +"Set or query the geometry of the window. *newGeometry* has the form " +"``=widthxheight+x+y``, where any of ``=``, ``widthxheight`` and the ``+x+y`` " +"position may be omitted. *width* and *height* are in pixels (or grid units " +"for a gridded window); a position preceded by ``+`` is measured from the " +"left or top edge of the screen and one preceded by ``-`` from the right or " +"bottom edge. An empty string cancels any user-specified geometry, letting " +"the window revert to its natural size. With no argument, return the current " +"geometry as a string of the form ``'200x200+10+10'``. :meth:`wm_geometry` is " +"an alias of :meth:`!geometry`." +msgstr "" + +#: ../../library/tkinter.rst:2558 +msgid "" +"Manage the window as a gridded window and define the relationship between " +"grid units and pixels. *baseWidth* and *baseHeight* are the numbers of grid " +"units for the window's internally requested size, and *widthInc* and " +"*heightInc* are the pixel sizes of a horizontal and vertical grid unit. " +"Empty strings turn off gridded management. With no arguments, return a tuple " +"of the four current values, or an empty string if the window is not " +"gridded. :meth:`wm_grid` is an alias of :meth:`!grid`." +msgstr "" + +#: ../../library/tkinter.rst:2573 +msgid "" +"Set or query the leader of a group of related windows. *pathName* gives the " +"path name of the group leader; the window manager may, for example, unmap " +"all windows in the group when the leader is iconified. An empty string " +"removes the window from any group. With no argument, return the path name of " +"the current group leader, or an empty string. :meth:`wm_group` is an alias " +"of :meth:`!group`." +msgstr "" + +#: ../../library/tkinter.rst:2587 +msgid "" +"Set or query the bitmap used by the window manager for the window's icon. " +"*bitmap* names a bitmap in one of the standard forms accepted by Tk; an " +"empty string cancels the current icon bitmap. With no argument, return the " +"name of the current icon bitmap, or an empty string. On Windows the " +"*default* argument names an icon (for example an ``.ico`` file) applied to " +"all top-level windows that have no icon of their own. :meth:`wm_iconbitmap` " +"is an alias of :meth:`!iconbitmap`." +msgstr "" + +#: ../../library/tkinter.rst:2601 +msgid "" +"Iconify the window. If the window has not yet been mapped for the first " +"time, arrange for it to appear in the iconified state when it is eventually " +"mapped. :meth:`wm_iconify` is an alias of :meth:`!iconify`." +msgstr "" + +#: ../../library/tkinter.rst:2611 +msgid "" +"Set or query the bitmap used as a mask for the icon (see :meth:" +"`iconbitmap`). Where the mask is zero no icon is displayed; where it is one, " +"the corresponding bits of the icon bitmap are shown. An empty string cancels " +"the current mask. With no argument, return the name of the current icon " +"mask, or an empty string. :meth:`wm_iconmask` is an alias of :meth:`!" +"iconmask`." +msgstr "" + +#: ../../library/tkinter.rst:2625 +msgid "" +"Set or query the name displayed by the window manager inside the window's " +"icon. With no argument, return the current icon name, or an empty string if " +"none has been set (in which case the window manager normally displays the " +"window's title). :meth:`wm_iconname` is an alias of :meth:`!iconname`." +msgstr "" + +#: ../../library/tkinter.rst:2637 +msgid "" +"Set the titlebar icon for the window from one or more :class:`PhotoImage` " +"objects given in *images*. Several images of different sizes (for example " +"16x16 and 32x32) may be supplied so that the window manager can choose an " +"appropriate one. The image data is taken as a snapshot at the time of the " +"call; later changes to the images are not reflected. If *default* is true, " +"the icon is also applied to all top-level windows created in the future. On " +"macOS only the first image is used. :meth:`wm_iconphoto` is an alias of :" +"meth:`!iconphoto`." +msgstr "" + +#: ../../library/tkinter.rst:2655 +msgid "" +"Set or query a hint to the window manager about where the window's icon " +"should be positioned. Empty strings cancel an existing hint. With no " +"arguments, return a tuple of the two current values, or an empty string if " +"no hint is in effect. :meth:`wm_iconposition` is an alias of :meth:`!" +"iconposition`." +msgstr "" + +#: ../../library/tkinter.rst:2667 +msgid "" +"Set or query the window used as the icon for the window. When the window is " +"iconified, *pathName* is mapped to serve as its icon and unmapped again when " +"it is de-iconified. An empty string cancels the association. With no " +"argument, return the path name of the current icon window, or an empty " +"string. Not all window managers support icon windows, and the concept is " +"meaningless on non-X11 platforms. :meth:`wm_iconwindow` is an alias of :meth:" +"`!iconwindow`." +msgstr "" + +#: ../../library/tkinter.rst:2682 +msgid "" +"Make *widget* a stand-alone top-level window, decorated by the window " +"manager with a title bar and so on. Only :class:`Frame`, :class:`LabelFrame` " +"and :class:`Toplevel` widgets may be used; passing any other widget type " +"raises an error. :meth:`wm_manage` is an alias of :meth:`!manage`." +msgstr "" + +#: ../../library/tkinter.rst:2695 +msgid "" +"Set or query the maximum permissible dimensions of the window, in pixels (or " +"grid units for a gridded window). The window manager restricts the window to " +"be no larger than *width* and *height*. With no arguments, return a tuple of " +"the current maximum width and height. The maximum size defaults to the size " +"of the screen. :meth:`wm_maxsize` is an alias of :meth:`!maxsize`." +msgstr "" + +#: ../../library/tkinter.rst:2709 +msgid "" +"Set or query the minimum permissible dimensions of the window, in pixels (or " +"grid units for a gridded window). The window manager restricts the window to " +"be no smaller than *width* and *height*. With no arguments, return a tuple " +"of the current minimum width and height. The minimum size defaults to one " +"pixel in each dimension. :meth:`wm_minsize` is an alias of :meth:`!minsize`." +msgstr "" + +#: ../../library/tkinter.rst:2723 +msgid "" +"Set or query the override-redirect flag for the window. When this flag is " +"set, the window is ignored by the window manager: it is not reparented into " +"a decorative frame and the user cannot manipulate it through the usual " +"window manager controls. With no argument, return a boolean indicating " +"whether the flag is set. The flag is reliably honored only when the window " +"is first mapped or remapped from the withdrawn state. :meth:" +"`wm_overrideredirect` is an alias of :meth:`!overrideredirect`." +msgstr "" + +#: ../../library/tkinter.rst:2737 +msgid "" +"Set or query the source of the window's current position. *who* is either " +"``'program'`` or ``'user'`` and indicates whether the position was requested " +"by the program or by the user; an empty string cancels the current source. " +"With no argument, return the current source, or an empty string if none has " +"been set. Tk automatically sets the source to ``'user'`` when :meth:" +"`geometry` is called, unless it has been set explicitly to ``'program'``. :" +"meth:`wm_positionfrom` is an alias of :meth:`!positionfrom`." +msgstr "" + +#: ../../library/tkinter.rst:2752 +msgid "" +"Register *func* as the handler for the window manager protocol *name*, an " +"atom such as ``'WM_DELETE_WINDOW'``, ``'WM_SAVE_YOURSELF'`` or " +"``'WM_TAKE_FOCUS'``; *func* is then called whenever the window manager sends " +"a message of that protocol. Tk installs a default ``WM_DELETE_WINDOW`` " +"handler that destroys the window, which this method can replace. If *func* " +"is an empty string, the handler is removed. With only *name*, return the " +"name of its registered handler command, or an empty string if none is set " +"(the default ``WM_DELETE_WINDOW`` handler is not reported); with no " +"arguments, return a tuple of the protocols that currently have handlers. :" +"meth:`wm_protocol` is an alias of :meth:`!protocol`." +msgstr "" + +#: ../../library/tkinter.rst:2770 +msgid "" +"Control whether the user may interactively resize the window. *width* and " +"*height* are boolean values that determine whether the window's width and " +"height may be changed. With no arguments, return a tuple of two ``0``/``1`` " +"values indicating whether each dimension is currently resizable. By default " +"a window is resizable in both dimensions. :meth:`wm_resizable` is an alias " +"of :meth:`!resizable`." +msgstr "" + +#: ../../library/tkinter.rst:2783 +msgid "" +"Set or query the source of the window's current size. *who* is either " +"``'program'`` or ``'user'`` and indicates whether the size was requested by " +"the program or by the user; an empty string cancels the current source. With " +"no argument, return the current source, or an empty string if none has been " +"set. :meth:`wm_sizefrom` is an alias of :meth:`!sizefrom`." +msgstr "" + +#: ../../library/tkinter.rst:2796 +msgid "" +"Set or query the state of the window. With no argument, return the current " +"state: one of ``'normal'``, ``'iconic'``, ``'withdrawn'``, ``'icon'`` or, on " +"Windows and macOS only, ``'zoomed'``. ``'iconic'`` refers to a window that " +"has been iconified, while ``'icon'`` refers to a window serving as the icon " +"for another window (see :meth:`iconwindow`); the ``'icon'`` state cannot be " +"set. :meth:`wm_state` is an alias of :meth:`!state`." +msgstr "" + +#: ../../library/tkinter.rst:2810 +msgid "" +"Set or query the title for the window, which the window manager should " +"display in the window's title bar. With no argument, return the current " +"title. The title defaults to the window's name. :meth:`wm_title` is an alias " +"of :meth:`!title`." +msgstr "" + +#: ../../library/tkinter.rst:2821 +msgid "" +"Mark the window as a transient window (such as a pull-down menu or dialog) " +"working on behalf of *master*, the path name of another top-level window. An " +"empty string clears the transient status. With no argument, return the path " +"name of the current master, or an empty string. A transient window mirrors " +"state changes in its master and may be decorated differently by the window " +"manager; it is an error to make a window a transient of itself. :meth:" +"`wm_transient` is an alias of :meth:`!transient`." +msgstr "" + +#: ../../library/tkinter.rst:2837 +msgid "" +"Withdraw the window from the screen, unmapping it and causing the window " +"manager to forget about it. If the window has never been mapped, it is " +"instead mapped in the withdrawn state. It is sometimes necessary to withdraw " +"a window and then re-map it (for example with :meth:`deiconify`) to make " +"some window managers notice changes to window attributes. :meth:" +"`wm_withdraw` is an alias of :meth:`!withdraw`." +msgstr "" + +#: ../../library/tkinter.rst:2849 +msgid "" +"Geometry manager that arranges widgets by packing them against the sides of " +"their container. The :class:`!Pack` mix-in is inherited by all widgets " +"(through :class:`Widget`) and provides the methods for managing a widget " +"with the *pack* geometry manager. See also :ref:`pack-the-packer`." +msgstr "" + +#: ../../library/tkinter.rst:2865 +msgid "" +"Pack the widget inside its container, positioning it relative to the " +"siblings already packed there. The supported options are:" +msgstr "" + +#: ../../library/tkinter.rst:2869 +#, fuzzy +msgid "*side*" +msgstr "side" + +#: ../../library/tkinter.rst:2870 +msgid "" +"Which side of the container to pack the widget against: ``'top'`` (the " +"default), ``'bottom'``, ``'left'`` or ``'right'``." +msgstr "" + +#: ../../library/tkinter.rst:2873 ../../library/tkinter.rst:3375 +#, fuzzy +msgid "*fill*" +msgstr "fill" + +#: ../../library/tkinter.rst:2874 +msgid "" +"Whether to stretch the widget to fill its parcel: ``'none'`` (the default), " +"``'x'``, ``'y'`` or ``'both'``." +msgstr "" + +#: ../../library/tkinter.rst:2877 +#, fuzzy +msgid "*expand*" +msgstr "expand" + +#: ../../library/tkinter.rst:2878 +msgid "" +"Whether the widget should expand to consume any extra space in its container " +"(a boolean, default false)." +msgstr "" + +#: ../../library/tkinter.rst:2881 ../../library/tkinter.rst:2980 +#: ../../library/tkinter.rst:3485 ../../library/tkinter.rst:3504 +#: ../../library/tkinter.rst:3519 ../../library/tkinter.rst:3532 +#, fuzzy +msgid "*anchor*" +msgstr "anchor" + +#: ../../library/tkinter.rst:2882 +msgid "" +"Where to position the widget in its parcel when the parcel is larger than " +"the widget: an anchor such as ``'n'`` or ``'sw'`` (default ``'center'``)." +msgstr "" + +#: ../../library/tkinter.rst:2886 ../../library/tkinter.rst:3073 +#, fuzzy +msgid "*ipadx*, *ipady*" +msgstr "ipadx 和 ipady" + +#: ../../library/tkinter.rst:2887 ../../library/tkinter.rst:3074 +msgid "" +"Internal padding added on the left and right (*ipadx*) or top and bottom " +"(*ipady*) of the widget, as a screen distance (default ``0``)." +msgstr "" + +#: ../../library/tkinter.rst:2890 ../../library/tkinter.rst:3077 +#, fuzzy +msgid "*padx*, *pady*" +msgstr "padx 和 pady" + +#: ../../library/tkinter.rst:2891 ../../library/tkinter.rst:3078 +msgid "" +"External padding left on the left and right (*padx*) or top and bottom " +"(*pady*) of the widget, as a screen distance or a pair of two distances for " +"the two sides (default ``0``)." +msgstr "" + +#: ../../library/tkinter.rst:2895 +msgid "*after*" +msgstr "" + +#: ../../library/tkinter.rst:2896 +msgid "" +"Pack the widget after the given widget in the packing order, using the same " +"container." +msgstr "" + +#: ../../library/tkinter.rst:2899 +msgid "*before*" +msgstr "" + +#: ../../library/tkinter.rst:2900 +msgid "" +"Pack the widget before the given widget in the packing order, using the same " +"container." +msgstr "" + +#: ../../library/tkinter.rst:2903 ../../library/tkinter.rst:3000 +#: ../../library/tkinter.rst:3082 +msgid "*in_*" +msgstr "" + +#: ../../library/tkinter.rst:2904 +msgid "" +"The container in which to pack the widget; it defaults to the parent widget." +msgstr "" + +#: ../../library/tkinter.rst:2907 +msgid "" +":meth:`pack`, :meth:`configure` and :meth:`config` are aliases of :meth:`!" +"pack_configure`." +msgstr "" + +#: ../../library/tkinter.rst:2915 +msgid "" +"Unmap the widget and remove it from the packing order, forgetting its " +"packing options. It can be packed again later with :meth:`pack_configure`. :" +"meth:`forget` is an alias of :meth:`!pack_forget`." +msgstr "" + +#: ../../library/tkinter.rst:2925 +msgid "" +"Return a dictionary of the widget's current packing options. :meth:`info` is " +"an alias of :meth:`!pack_info`." +msgstr "" + +#: ../../library/tkinter.rst:2935 +msgid "" +"Same as :meth:`Misc.pack_propagate`, treating this widget as a container: " +"enable or disable geometry propagation. :meth:`propagate` is an alias of :" +"meth:`!pack_propagate`." +msgstr "" + +#: ../../library/tkinter.rst:2944 +msgid "" +"Same as :meth:`Misc.pack_slaves`: return the list of widgets packed in this " +"widget. :meth:`slaves` is an alias of :meth:`!pack_slaves`." +msgstr "" + +#: ../../library/tkinter.rst:2951 +msgid "" +"Geometry manager that places widgets at explicit positions and sizes within " +"their container. The :class:`!Place` mix-in is inherited by all widgets " +"(through :class:`Widget`)." +msgstr "" + +#: ../../library/tkinter.rst:2965 +msgid "" +"Place the widget inside its container at an absolute or relative position. " +"The supported options are:" +msgstr "" + +#: ../../library/tkinter.rst:2969 +msgid "*x*, *y*" +msgstr "" + +#: ../../library/tkinter.rst:2970 +msgid "" +"The absolute horizontal and vertical position of the widget's anchor point, " +"as a screen distance (default ``0``)." +msgstr "" + +#: ../../library/tkinter.rst:2973 +msgid "*relx*, *rely*" +msgstr "" + +#: ../../library/tkinter.rst:2974 +msgid "" +"The horizontal and vertical position of the widget's anchor point as a " +"fraction of the container's width and height, where ``0.0`` is the left or " +"top edge and ``1.0`` is the right or bottom edge. If both the absolute and " +"the relative option are given, their values are summed." +msgstr "" + +#: ../../library/tkinter.rst:2981 +msgid "" +"Which point of the widget is placed at the given position: an anchor such as " +"``'n'`` or ``'se'`` (default ``'nw'``)." +msgstr "" + +#: ../../library/tkinter.rst:2984 ../../library/tkinter.rst:3535 +msgid "*width*, *height*" +msgstr "" + +#: ../../library/tkinter.rst:2985 +msgid "" +"The absolute width and height of the widget, as a screen distance. By " +"default the widget's requested size is used." +msgstr "" + +#: ../../library/tkinter.rst:2988 +msgid "*relwidth*, *relheight*" +msgstr "" + +#: ../../library/tkinter.rst:2989 +msgid "" +"The width and height of the widget as a fraction of the container's width " +"and height. If both the absolute and the relative option are given, their " +"values are summed." +msgstr "" + +#: ../../library/tkinter.rst:2994 +msgid "*bordermode*" +msgstr "" + +#: ../../library/tkinter.rst:2995 +msgid "" +"How the container's border affects placement: ``'inside'`` (the default) " +"measures the area inside the border, ``'outside'`` measures the area " +"including the border, and ``'ignore'`` uses the official X area." +msgstr "" + +#: ../../library/tkinter.rst:3001 +msgid "" +"The container relative to which the widget is placed; it must be the " +"widget's parent or a descendant of the parent, and defaults to the parent." +msgstr "" + +#: ../../library/tkinter.rst:3005 +msgid "" +":meth:`place`, :meth:`configure` and :meth:`config` are aliases of :meth:`!" +"place_configure`." +msgstr "" + +#: ../../library/tkinter.rst:3013 +msgid "" +"Unmap the widget and remove it from the placement, forgetting its place " +"options. :meth:`forget` is an alias of :meth:`!place_forget`." +msgstr "" + +#: ../../library/tkinter.rst:3022 +msgid "" +"Return a dictionary of the widget's current place options. :meth:`info` is " +"an alias of :meth:`!place_info`." +msgstr "" + +#: ../../library/tkinter.rst:3030 +msgid "" +"Same as :meth:`Misc.place_slaves`: return the list of widgets placed in this " +"widget. :meth:`slaves` is an alias of :meth:`!place_slaves`." +msgstr "" + +#: ../../library/tkinter.rst:3037 +msgid "" +"Geometry manager that arranges widgets in a two-dimensional grid of rows and " +"columns within their container. The :class:`!Grid` mix-in is inherited by " +"all widgets (through :class:`Widget`)." +msgstr "" + +#: ../../library/tkinter.rst:3051 +msgid "" +"Position the widget in a cell of its container's grid. The supported options " +"are:" +msgstr "" + +#: ../../library/tkinter.rst:3054 +msgid "*row*, *column*" +msgstr "" + +#: ../../library/tkinter.rst:3055 +msgid "" +"The row and column of the cell to place the widget in, counting from ``0``. " +"*column* defaults to the column after the previous widget placed in the " +"same :meth:`!grid_configure` call (or ``0``), and *row* defaults to the next " +"empty row." +msgstr "" + +#: ../../library/tkinter.rst:3061 +msgid "*rowspan*, *columnspan*" +msgstr "" + +#: ../../library/tkinter.rst:3062 +msgid "The number of rows and columns the widget should span (default ``1``)." +msgstr "" + +#: ../../library/tkinter.rst:3064 +msgid "*sticky*" +msgstr "" + +#: ../../library/tkinter.rst:3065 +msgid "" +"How to position or stretch the widget when its cell is larger than the " +"widget: a string containing zero or more of the characters ``'n'``, ``'s'``, " +"``'e'`` and ``'w'``, naming the cell sides the widget sticks to. Specifying " +"both ``'n'`` and ``'s'`` (or ``'e'`` and ``'w'``) stretches the widget to " +"fill the height (or width) of the cell. The default is ``''``, which centers " +"the widget at its requested size." +msgstr "" + +#: ../../library/tkinter.rst:3083 +msgid "" +"The container in whose grid to place the widget; it defaults to the parent " +"widget." +msgstr "" + +#: ../../library/tkinter.rst:3086 +msgid "" +":meth:`grid`, :meth:`configure` and :meth:`config` are aliases of :meth:`!" +"grid_configure`." +msgstr "" + +#: ../../library/tkinter.rst:3094 +msgid "" +"Unmap the widget and remove it from the grid, forgetting its grid options. :" +"meth:`forget` is an alias of :meth:`!grid_forget`." +msgstr "" + +#: ../../library/tkinter.rst:3100 +msgid "" +"Unmap the widget and remove it from the grid, but remember its grid options " +"so that it is restored to the same cell if it is gridded again." +msgstr "" + +#: ../../library/tkinter.rst:3108 +msgid "" +"Return a dictionary of the widget's current grid options. :meth:`info` is an " +"alias of :meth:`!grid_info`." +msgstr "" + +#: ../../library/tkinter.rst:3116 +msgid "" +"Same as :meth:`Misc.grid_bbox`. :meth:`bbox` is an alias of :meth:`!" +"grid_bbox`." +msgstr "" + +#: ../../library/tkinter.rst:3124 +msgid "" +"Same as :meth:`Misc.grid_columnconfigure`: query or set the options (such as " +"*weight*, *minsize*, *pad* and *uniform*) of a grid column. :meth:" +"`columnconfigure` is an alias of :meth:`!grid_columnconfigure`." +msgstr "" + +#: ../../library/tkinter.rst:3133 +msgid "" +"Same as :meth:`Misc.grid_rowconfigure`: query or set the options of a grid " +"row. :meth:`rowconfigure` is an alias of :meth:`!grid_rowconfigure`." +msgstr "" + +#: ../../library/tkinter.rst:3142 +msgid "" +"Same as :meth:`Misc.grid_location`: return the ``(column, row)`` of the cell " +"that covers the pixel at *x*, *y*. :meth:`location` is an alias of :meth:`!" +"grid_location`." +msgstr "" + +#: ../../library/tkinter.rst:3151 +msgid "" +"Same as :meth:`Misc.grid_size`: return a ``(columns, rows)`` tuple giving " +"the size of the grid. :meth:`size` is an alias of :meth:`!grid_size`." +msgstr "" + +#: ../../library/tkinter.rst:3162 +msgid "" +"Same as :meth:`Misc.grid_propagate`. :meth:`propagate` is an alias of :meth:" +"`!grid_propagate`." +msgstr "" + +#: ../../library/tkinter.rst:3170 +msgid "" +"Same as :meth:`Misc.grid_slaves`: return the widgets managed in the grid, " +"optionally restricted to a *row* and/or *column*. :meth:`slaves` is an alias " +"of :meth:`!grid_slaves`." +msgstr "" + +#: ../../library/tkinter.rst:3177 +msgid "" +"Mix-in providing the horizontal-scrolling interface shared by widgets such " +"as :class:`Entry`, :class:`Canvas`, :class:`Listbox`, :class:`Text` and :" +"class:`Spinbox`. A widget's :meth:`xview` method is registered as the " +"*command* of a horizontal :class:`Scrollbar`." +msgstr "" + +#: ../../library/tkinter.rst:3185 +msgid "" +"Query or change the horizontal position of the view. With no arguments, " +"return a tuple ``(first, last)`` of two fractions between 0 and 1 giving the " +"portion of the document that is currently visible. Otherwise the arguments " +"are passed to the Tk ``xview`` widget command and are usually generated by a " +"scrollbar; :meth:`xview_moveto` and :meth:`xview_scroll` provide a more " +"convenient interface." +msgstr "" + +#: ../../library/tkinter.rst:3195 +msgid "" +"Adjust the view so that *fraction* of the total width of the document is off-" +"screen to the left. *fraction* is a number between 0 and 1." +msgstr "" + +#: ../../library/tkinter.rst:3201 +msgid "" +"Shift the view left or right by *number* units. *what* is either ``'units'`` " +"or ``'pages'``; a negative *number* scrolls left and a positive one scrolls " +"right." +msgstr "" + +#: ../../library/tkinter.rst:3208 +msgid "" +"Mix-in providing the vertical-scrolling interface shared by widgets such as :" +"class:`Canvas`, :class:`Listbox` and :class:`Text`. A widget's :meth:`yview` " +"method is registered as the *command* of a vertical :class:`Scrollbar`." +msgstr "" + +#: ../../library/tkinter.rst:3215 +msgid "" +"Query or change the vertical position of the view. With no arguments, return " +"a tuple ``(first, last)`` of two fractions between 0 and 1 giving the " +"portion of the document that is currently visible. Otherwise the arguments " +"are passed to the Tk ``yview`` widget command, usually generated by a " +"scrollbar; :meth:`yview_moveto` and :meth:`yview_scroll` provide a more " +"convenient interface." +msgstr "" + +#: ../../library/tkinter.rst:3225 +msgid "" +"Adjust the view so that *fraction* of the total height of the document is " +"off-screen above the top. *fraction* is a number between 0 and 1." +msgstr "" + +#: ../../library/tkinter.rst:3231 +msgid "" +"Shift the view up or down by *number* units. *what* is either ``'units'`` or " +"``'pages'``; a negative *number* scrolls up and a positive one scrolls down." +msgstr "" + +#: ../../library/tkinter.rst:3238 +msgid "" +"Internal base class for all widgets. It inherits from :class:`Misc` and adds " +"the machinery that creates the underlying Tk widget; application code " +"normally uses :class:`Widget` or a concrete widget class rather than " +"instantiating :class:`!BaseWidget` directly." +msgstr "" + +#: ../../library/tkinter.rst:3246 +msgid "" +"Destroy this widget and all of its children, removing the corresponding Tk " +"widgets and deleting the associated Tcl commands." +msgstr "" + +#: ../../library/tkinter.rst:3252 +msgid "" +"Internal base class for the standard widgets. It combines :class:" +"`BaseWidget` with the geometry-manager mix-ins :class:`Pack`, :class:`Place` " +"and :class:`Grid`, so that every widget can be managed by any of the three " +"geometry managers. The concrete widget classes (:class:`Button`, :class:" +"`Label`, and so on) derive from :class:`!Widget`." +msgstr "" + +#: ../../library/tkinter.rst:3262 +msgid "" +"A :class:`!Toplevel` widget is a top-level window, similar to a :class:" +"`Frame` except that its X parent is the root window of a screen rather than " +"its logical parent. Its primary purpose is to serve as a container for " +"dialog boxes and other collections of widgets; its only visible features are " +"its background and an optional 3-D border. Notable options include *menu*, " +"which installs a :class:`Menu` as the window's menubar. Inherits from :class:" +"`BaseWidget` and :class:`Wm`, so a toplevel is managed by the window " +"manager. Refer to the Tk ``toplevel`` manual page for the full list of " +"options." +msgstr "" + +#: ../../library/tkinter.rst:3276 +msgid "Widget classes" +msgstr "" + +#: ../../library/tkinter.rst:3280 +msgid "" +"A :class:`!Button` widget displays a textual string, bitmap or image and " +"invokes a command when the user presses it (by clicking mouse button 1 over " +"the button or, when the button has focus, by pressing the space key). " +"Inherits from :class:`Widget`. In addition to the standard widget options, a " +"button accepts the options documented in the Tk ``button`` manual page, such " +"as *command* (the callback invoked when the button is pressed), " +"*textvariable*, *state* and *default*." +msgstr "" + +#: ../../library/tkinter.rst:3290 +msgid "" +"Invoke the command associated with the button, if there is one, and return " +"its result, or an empty string if no command is associated with the button. " +"This is ignored if the button's state is ``disabled``." +msgstr "" + +#: ../../library/tkinter.rst:3297 +msgid "" +"Flash the button by redisplaying it several times, alternating between the " +"active and normal colors. At the end of the flash the button is left in the " +"same normal or active state as when the method was called. This is ignored " +"if the button's state is ``disabled``." +msgstr "" + +#: ../../library/tkinter.rst:3306 +msgid "" +"A :class:`!Canvas` widget implements structured graphics. It displays any " +"number of *items*, such as arcs, lines, ovals, polygons, rectangles, text, " +"bitmaps, images and embedded windows, which may be drawn, moved, re-colored " +"and bound to events. Inherits from :class:`Widget`, :class:`XView` and :" +"class:`YView`, so the view can be scrolled horizontally and vertically with :" +"meth:`~XView.xview` and :meth:`~YView.yview`. Refer to the Tk ``canvas`` " +"manual page for the full list of widget and item options." +msgstr "" + +#: ../../library/tkinter.rst:3316 +msgid "" +"Each item has a unique integer *id*, assigned when it is created, and zero " +"or more string *tags*. A tag is an arbitrary string that does not have the " +"form of an integer; the same tag may be shared by many items, which makes " +"tags convenient for grouping items. The special tag ``'all'`` matches every " +"item in the canvas, and ``'current'`` matches the topmost item under the " +"mouse pointer. Most methods take a *tagOrId* argument that may be an integer " +"id naming a single item, or a tag naming zero or more items; as described in " +"the Tk ``canvas`` manual page, a tag may also be a logical expression of " +"tags combined with the operators ``&&``, ``||``, ``^``, ``!`` and " +"parentheses. When a method that operates on a single item is given a " +"*tagOrId* matching several items, it normally uses the lowest matching item " +"in the display list." +msgstr "" + +#: ../../library/tkinter.rst:3331 +msgid "" +"The items are kept in a *display list* that determines drawing order: items " +"later in the list are drawn on top of earlier ones. A newly created item is " +"placed at the top of the list; the order can be changed with :meth:" +"`tag_raise` and :meth:`tag_lower`." +msgstr "" + +#: ../../library/tkinter.rst:3346 +msgid "" +"Create a new item of the corresponding type and return its integer id. Each " +"method is called as ``create_TYPE(coord..., **options)``: the leading " +"positional arguments give the coordinates that define the item (as separate " +"numbers, as a single sequence of numbers, or as coordinate pairs), and the " +"keyword arguments set item-specific options. Coordinates and screen " +"distances may be given as numbers (interpreted as pixels) or as strings with " +"a unit suffix (``'m'``, ``'c'``, ``'i'`` or ``'p'`` for millimetres, " +"centimetres, inches or printer's points), but are always stored and returned " +"in pixels." +msgstr "" + +#: ../../library/tkinter.rst:3356 +msgid "" +"The item types are: ``arc`` (an arc-shaped region that is a section of an " +"oval, defined by two diagonally opposite corners ``x1, y1, x2, y2`` of the " +"enclosing rectangle); ``bitmap`` (a two-color bitmap positioned at a point " +"``x, y``); ``image`` (a Tk image positioned at a point ``x, y``); ``line`` " +"(a line or curve through the points ``x1, y1, ..., xn, yn``); ``oval`` (a " +"circle or ellipse inscribed in the rectangle ``x1, y1, x2, y2``); " +"``polygon`` (a closed polygon through the points ``x1, y1, ..., xn, yn``); " +"``rectangle`` (a rectangle with corners ``x1, y1, x2, y2``); ``text`` (a " +"string of text positioned at a point ``x, y``); and ``window`` (a child " +"widget embedded in the canvas at a point ``x, y``, specified with the " +"*window* option)." +msgstr "" + +#: ../../library/tkinter.rst:3368 +msgid "" +"Most item types accept a common set of *standard item options*, plus a few " +"options specific to each type. Option names are passed as keyword arguments, " +"without the leading hyphen." +msgstr "" + +#: ../../library/tkinter.rst:3373 +msgid "The standard item options are:" +msgstr "" + +#: ../../library/tkinter.rst:3376 +msgid "" +"The color used to fill the item's interior, or to draw a *line* item or the " +"characters of a *text* item. An empty string (the default for all types " +"except *line* and *text*) leaves the item unfilled." +msgstr "" + +#: ../../library/tkinter.rst:3381 +msgid "*outline*" +msgstr "" + +#: ../../library/tkinter.rst:3382 +msgid "" +"The color used to draw the item's outline. An empty string draws no outline." +msgstr "" + +#: ../../library/tkinter.rst:3385 ../../library/tkinter.rst:3489 +#, fuzzy +msgid "*width*" +msgstr "width" + +#: ../../library/tkinter.rst:3386 +msgid "" +"The width of the outline, defaulting to ``1.0``. Has no effect if *outline* " +"is empty." +msgstr "" + +#: ../../library/tkinter.rst:3389 +msgid "*dash*" +msgstr "" + +#: ../../library/tkinter.rst:3390 +msgid "" +"A dash pattern for the outline, given either as a sequence of segment " +"lengths in pixels or as a string of the characters ``'.'``, ``','``, " +"``'-'``, ``'_'`` and space. An empty pattern (the default) draws a solid " +"outline." +msgstr "" + +#: ../../library/tkinter.rst:3395 +msgid "*dashoffset*" +msgstr "" + +#: ../../library/tkinter.rst:3396 +msgid "" +"The starting offset in pixels into the *dash* pattern. Ignored if there is " +"no *dash* pattern." +msgstr "" + +#: ../../library/tkinter.rst:3399 +msgid "*stipple*" +msgstr "" + +#: ../../library/tkinter.rst:3400 +msgid "" +"A bitmap used as a stipple pattern when filling the item. Only well " +"supported on X11." +msgstr "" + +#: ../../library/tkinter.rst:3403 +msgid "*outlinestipple*" +msgstr "" + +#: ../../library/tkinter.rst:3404 +msgid "" +"A bitmap used as a stipple pattern when drawing the outline. Has no effect " +"if *outline* is empty." +msgstr "" + +#: ../../library/tkinter.rst:3407 +msgid "*offset*, *outlineoffset*" +msgstr "" + +#: ../../library/tkinter.rst:3408 +msgid "" +"The offset of the fill and outline stipple patterns, given as ``'x,y'`` or " +"as a side such as ``'n'``, ``'se'`` or ``'center'``. Stipple offsets are " +"only supported on X11." +msgstr "" + +#: ../../library/tkinter.rst:3412 ../../library/tkinter.rst:4330 +#, fuzzy +msgid "*state*" +msgstr "state" + +#: ../../library/tkinter.rst:3413 +msgid "" +"Overrides the canvas state for this item; one of ``'normal'``, " +"``'disabled'`` or ``'hidden'``." +msgstr "" + +#: ../../library/tkinter.rst:3416 +msgid "*tags*" +msgstr "" + +#: ../../library/tkinter.rst:3417 +msgid "" +"A single tag or a sequence of tags to associate with the item, replacing any " +"existing tags." +msgstr "" + +#: ../../library/tkinter.rst:3420 +msgid "" +"Many of these options have *active...* and *disabled...* variants (such as " +"*activefill*, *disabledfill*, *activewidth*, *disableddash*, " +"*activeoutline*, *disabledstipple*) that override the base option when the " +"item is the active item (under the mouse pointer) or is in the disabled " +"state." +msgstr "" + +#: ../../library/tkinter.rst:3426 +msgid "The following item types support additional options." +msgstr "" + +#: ../../library/tkinter.rst:3428 +msgid "For ``arc`` items:" +msgstr "" + +#: ../../library/tkinter.rst:3430 +msgid "*start*" +msgstr "" + +#: ../../library/tkinter.rst:3431 +msgid "" +"The start of the arc's angular range, in degrees measured counter-clockwise " +"from the 3-o'clock position." +msgstr "" + +#: ../../library/tkinter.rst:3434 +msgid "*extent*" +msgstr "" + +#: ../../library/tkinter.rst:3435 +msgid "" +"The size of the angular range, in degrees counter-clockwise from *start*." +msgstr "" + +#: ../../library/tkinter.rst:3438 +msgid "*style*" +msgstr "" + +#: ../../library/tkinter.rst:3439 +msgid "" +"How the arc is drawn: ``'pieslice'`` (the default), ``'chord'`` or ``'arc'``." +msgstr "" + +#: ../../library/tkinter.rst:3442 +msgid "For ``line`` items:" +msgstr "" + +#: ../../library/tkinter.rst:3444 +msgid "*arrow*" +msgstr "" + +#: ../../library/tkinter.rst:3445 +msgid "" +"Where to draw arrowheads: ``'none'`` (the default), ``'first'``, ``'last'`` " +"or ``'both'``." +msgstr "" + +#: ../../library/tkinter.rst:3448 +msgid "*arrowshape*" +msgstr "" + +#: ../../library/tkinter.rst:3449 +msgid "A sequence of three distances describing the shape of the arrowheads." +msgstr "" + +#: ../../library/tkinter.rst:3452 +msgid "*capstyle*" +msgstr "" + +#: ../../library/tkinter.rst:3453 +msgid "" +"How line ends are drawn: ``'butt'`` (the default), ``'projecting'`` or " +"``'round'``." +msgstr "" + +#: ../../library/tkinter.rst:3456 +msgid "*joinstyle*" +msgstr "" + +#: ../../library/tkinter.rst:3457 +msgid "" +"How line vertices are drawn: ``'round'`` (the default), ``'bevel'`` or " +"``'miter'``." +msgstr "" + +#: ../../library/tkinter.rst:3460 +msgid "*smooth*" +msgstr "" + +#: ../../library/tkinter.rst:3461 +msgid "" +"The smoothing method: a false value (the default) for no smoothing, or " +"``'true'``/``'bezier'`` or ``'raw'`` to draw the line as a curve." +msgstr "" + +#: ../../library/tkinter.rst:3464 +msgid "*splinesteps*" +msgstr "" + +#: ../../library/tkinter.rst:3465 +msgid "" +"The number of line segments approximating each spline when *smooth* is " +"enabled." +msgstr "" + +#: ../../library/tkinter.rst:3468 +msgid "For ``polygon`` items:" +msgstr "" + +#: ../../library/tkinter.rst:3470 +msgid "*joinstyle*, *smooth*, *splinesteps*" +msgstr "" + +#: ../../library/tkinter.rst:3471 +msgid "As for ``line`` items, applied to the polygon's outline." +msgstr "" + +#: ../../library/tkinter.rst:3473 +msgid "For ``text`` items:" +msgstr "" + +#: ../../library/tkinter.rst:3475 +msgid "*text*" +msgstr "" + +#: ../../library/tkinter.rst:3476 +msgid "The string to display; newline characters start new lines." +msgstr "" + +#: ../../library/tkinter.rst:3478 ../../library/tkinter.rst:4344 +#: ../../library/tkinter.rst:5207 +#, fuzzy +msgid "*font*" +msgstr "font" + +#: ../../library/tkinter.rst:3479 +msgid "The font used for the text." +msgstr "" + +#: ../../library/tkinter.rst:3481 ../../library/tkinter.rst:5247 +#, fuzzy +msgid "*justify*" +msgstr "justify" + +#: ../../library/tkinter.rst:3482 +#, fuzzy +msgid "" +"How lines are justified: ``'left'`` (the default), ``'right'`` or " +"``'center'``." +msgstr "合法值為:``'left'``、``'right'``、``'top'``、``'bottom'``。" + +#: ../../library/tkinter.rst:3486 +msgid "" +"How the text is positioned relative to its point, defaulting to ``'center'``." +msgstr "" + +#: ../../library/tkinter.rst:3490 +msgid "The maximum line length; if non-zero, lines are wrapped at spaces." +msgstr "" + +#: ../../library/tkinter.rst:3492 +msgid "*angle*" +msgstr "" + +#: ../../library/tkinter.rst:3493 +msgid "" +"How many degrees to rotate the text counter-clockwise about its positioning " +"point, from ``0.0`` to ``360.0`` (default ``0.0``)." +msgstr "" + +#: ../../library/tkinter.rst:3496 ../../library/tkinter.rst:4326 +#: ../../library/tkinter.rst:5232 +msgid "*underline*" +msgstr "" + +#: ../../library/tkinter.rst:3497 +msgid "The index of a character to underline, or ``-1`` for none." +msgstr "" + +#: ../../library/tkinter.rst:3499 +msgid "For ``bitmap`` items:" +msgstr "" + +#: ../../library/tkinter.rst:3501 ../../library/tkinter.rst:4341 +#, fuzzy +msgid "*bitmap*" +msgstr "bitmap" + +#: ../../library/tkinter.rst:3502 +msgid "The bitmap to display." +msgstr "" + +#: ../../library/tkinter.rst:3505 +msgid "How the bitmap is positioned relative to its point." +msgstr "" + +#: ../../library/tkinter.rst:3507 ../../library/tkinter.rst:4347 +msgid "*background*, *foreground*" +msgstr "" + +#: ../../library/tkinter.rst:3508 +msgid "" +"The colors used for the bitmap's ``0`` and ``1`` pixels; an empty " +"*background* makes the ``0`` pixels transparent. Both have *active...* and " +"*disabled...* variants, and *bitmap* has *activebitmap* and *disabledbitmap* " +"variants." +msgstr "" + +#: ../../library/tkinter.rst:3513 +msgid "For ``image`` items:" +msgstr "" + +#: ../../library/tkinter.rst:3515 ../../library/tkinter.rst:4333 +#, fuzzy +msgid "*image*" +msgstr "圖片" + +#: ../../library/tkinter.rst:3516 +msgid "The Tk image to display, previously created with the image protocols." +msgstr "" + +#: ../../library/tkinter.rst:3520 +msgid "How the image is positioned relative to its point." +msgstr "" + +#: ../../library/tkinter.rst:3522 +msgid "" +"Both options have *active...* and *disabled...* variants (*activeimage*, " +"*disabledimage*) used in the active and disabled states." +msgstr "" + +#: ../../library/tkinter.rst:3526 +msgid "For ``window`` items:" +msgstr "" + +#: ../../library/tkinter.rst:3528 +msgid "*window*" +msgstr "" + +#: ../../library/tkinter.rst:3529 +msgid "" +"The widget to embed; it must be a child of the canvas or of one of its " +"ancestors, and may not be a top-level window." +msgstr "" + +#: ../../library/tkinter.rst:3533 +msgid "How the window is positioned relative to its point." +msgstr "" + +#: ../../library/tkinter.rst:3536 +msgid "" +"The size to assign to the window; if zero (the default), the window is given " +"its requested size." +msgstr "" + +#: ../../library/tkinter.rst:3539 +msgid "" +"``oval`` and ``rectangle`` items have no type-specific options; they use " +"only the standard item options." +msgstr "" + +#: ../../library/tkinter.rst:3544 +msgid "" +"Tk 8.6 added the *angle* option and Tk 9.0 added the *underline* option for " +"``text`` items." +msgstr "" + +#: ../../library/tkinter.rst:3551 +msgid "" +"Query or modify the coordinates of an item. With only *tagOrId*, return a " +"list of the floating-point coordinates of the item given by *tagOrId* (the " +"first matching item if it matches several). Given new coordinates, replace " +"the coordinates of that item with them; like the ``create_*`` methods, the " +"coordinates may be given as separate numbers, as a single sequence, or as " +"coordinate pairs. The returned coordinates are always in pixels, regardless " +"of the units used to specify them; for rectangles, ovals and arcs they are " +"ordered left, top, right, bottom." +msgstr "" + +#: ../../library/tkinter.rst:3562 +msgid "" +"The arguments are now flattened: the coordinates may be given as separate " +"arguments, as a single sequence, or grouped in pairs, like the ``create_*`` " +"methods." +msgstr "" + +#: ../../library/tkinter.rst:3570 +msgid "" +"Move each of the items given by *tagOrId* in the canvas coordinate space by " +"adding *xAmount* to every x-coordinate and *yAmount* to every y-coordinate " +"of the item." +msgstr "" + +#: ../../library/tkinter.rst:3576 +msgid "" +"Move the items given by *tagOrId* so that the first coordinate pair (the " +"upper-left corner of the bounding box) of the lowest matching item is at " +"position (*x*, *y*). *x* or *y* may be an empty string, in which case the " +"corresponding coordinate is unchanged. All matching items keep their " +"positions relative to each other." +msgstr "" + +#: ../../library/tkinter.rst:3588 +msgid "" +"Rescale the coordinates of all items given by *tagOrId* in canvas coordinate " +"space. Each x-coordinate is adjusted so that its distance from *xOrigin* " +"changes by a factor of *xScale*, and each y-coordinate so that its distance " +"from *yOrigin* changes by a factor of *yScale* (a factor of ``1.0`` leaves " +"the coordinate unchanged)." +msgstr "" + +#: ../../library/tkinter.rst:3597 +msgid "Delete each of the items given by the *tagOrIds* arguments." +msgstr "" + +#: ../../library/tkinter.rst:3602 +msgid "" +"Delete from each of the items given by *tagOrId* the characters (for text " +"items) or coordinates (for line and polygon items) in the range from *first* " +"to *last* inclusive; *last* defaults to *first*. Items that do not support " +"indexing ignore this operation." +msgstr "" + +#: ../../library/tkinter.rst:3609 +msgid "" +"Insert *string* into each of the items given by *tagOrId* just before the " +"character or coordinate whose index is *beforeThis*. For line and polygon " +"items *string* must be a valid sequence of coordinates." +msgstr "" + +#: ../../library/tkinter.rst:3616 +msgid "" +"Return the current value of the configuration option *option* for the item " +"given by *tagOrId* (the lowest matching item if it matches several). This is " +"like :meth:`~Misc.cget` but applies to an individual item." +msgstr "" + +#: ../../library/tkinter.rst:3625 +msgid "" +"Query or modify the configuration options of the items given by *tagOrId*. " +"This mirrors :meth:`~Misc.configure`, except that it applies to individual " +"items rather than to the canvas as a whole. With no options, it returns a " +"dictionary describing the current options of the first matching item; " +"otherwise it sets the given options on every matching item. The legal " +"options are those accepted by the corresponding ``create_*`` method. :meth:" +"`itemconfig` is an alias of :meth:`!itemconfigure`." +msgstr "" + +#: ../../library/tkinter.rst:3638 +msgid "" +"Return the type of the item given by *tagOrId* (the first matching item if " +"it matches several), such as ``'rectangle'`` or ``'text'``, or ``None`` if " +"*tagOrId* does not match any item." +msgstr "" + +#: ../../library/tkinter.rst:3644 +msgid "" +"Return a tuple of the tags associated with the item given by *tagOrId* (the " +"first matching item in display-list order if it matches several). Return an " +"empty tuple if no item matches or the item has no tags." +msgstr "" + +#: ../../library/tkinter.rst:3651 +msgid "" +"Remove the tag *tagToDelete* (which defaults to *tagOrId*) from each of the " +"items given by *tagOrId*. Items that do not have that tag are unaffected." +msgstr "" + +#: ../../library/tkinter.rst:3657 +msgid "" +"Add the tag *newtag* to each item selected by the search specification " +"*searchSpec* (and any further *args*). *searchSpec* is one of ``'above'``, " +"``'all'``, ``'below'``, ``'closest'``, ``'enclosed'``, ``'overlapping'`` or " +"``'withtag'``; the ``addtag_*`` methods below are convenient wrappers that " +"supply each of these forms." +msgstr "" + +#: ../../library/tkinter.rst:3666 +msgid "" +"Add the tag *newtag* to the item just above (after) *tagOrId* in the display " +"list." +msgstr "" + +#: ../../library/tkinter.rst:3671 +msgid "Add the tag *newtag* to all items in the canvas." +msgstr "" + +#: ../../library/tkinter.rst:3675 +msgid "" +"Add the tag *newtag* to the item just below (before) *tagOrId* in the " +"display list." +msgstr "" + +#: ../../library/tkinter.rst:3680 +msgid "" +"Add the tag *newtag* to the item closest to the point (*x*, *y*). If *halo* " +"is given, any item within that distance of the point is treated as " +"overlapping it. If *start* is given (a tag or id), select the topmost " +"closest item that lies below *start* in the display list, which can be used " +"to step through all the closest items." +msgstr "" + +#: ../../library/tkinter.rst:3689 +msgid "" +"Add the tag *newtag* to every item completely enclosed within the rectangle " +"(*x1*, *y1*, *x2*, *y2*), where *x1* <= *x2* and *y1* <= *y2*." +msgstr "" + +#: ../../library/tkinter.rst:3694 +msgid "" +"Add the tag *newtag* to every item that overlaps or is enclosed within the " +"rectangle (*x1*, *y1*, *x2*, *y2*), where *x1* <= *x2* and *y1* <= *y2*." +msgstr "" + +#: ../../library/tkinter.rst:3700 +msgid "Add the tag *newtag* to every item given by *tagOrId*." +msgstr "" + +#: ../../library/tkinter.rst:3704 +msgid "" +"Return a tuple of the ids of all items selected by the search specification " +"*searchSpec* (and any further *args*), in stacking order with the lowest " +"item first. The search specification has any of the forms accepted by :meth:" +"`addtag`. The ``find_*`` methods below are more convenient wrappers around " +"it." +msgstr "" + +#: ../../library/tkinter.rst:3712 +msgid "" +"Return a tuple containing the id of the item just above *tagOrId* in the " +"display list." +msgstr "" + +#: ../../library/tkinter.rst:3717 +msgid "" +"Return a tuple of the ids of all items in the canvas, in stacking order." +msgstr "" + +#: ../../library/tkinter.rst:3721 +msgid "" +"Return a tuple containing the id of the item just below *tagOrId* in the " +"display list." +msgstr "" + +#: ../../library/tkinter.rst:3726 +msgid "" +"Return a tuple containing the id of the item closest to the point (*x*, " +"*y*). *halo* and *start* are interpreted as for :meth:`addtag_closest`." +msgstr "" + +#: ../../library/tkinter.rst:3732 +msgid "" +"Return a tuple of the ids of all items completely enclosed within the " +"rectangle (*x1*, *y1*, *x2*, *y2*)." +msgstr "" + +#: ../../library/tkinter.rst:3737 +msgid "" +"Return a tuple of the ids of all items that overlap or are enclosed within " +"the rectangle (*x1*, *y1*, *x2*, *y2*)." +msgstr "" + +#: ../../library/tkinter.rst:3742 +msgid "Return a tuple of the ids of all items given by *tagOrId*." +msgstr "" + +#: ../../library/tkinter.rst:3752 +msgid "" +"Move all items given by *tagOrId* to a new position in the display list just " +"above the item given by *aboveThis*, or to the top of the display list if " +"*aboveThis* is omitted. When several items are moved their relative order is " +"preserved. This has no effect on embedded window items, whose stacking order " +"is controlled by :meth:`Misc.tkraise` and :meth:`Misc.lower` instead. :meth:" +"`lift` and :meth:`tkraise` are aliases of :meth:`!tag_raise`." +msgstr "" + +#: ../../library/tkinter.rst:3765 +msgid "" +"Move all items given by *tagOrId* to a new position in the display list just " +"below the item given by *belowThis*, or to the bottom of the display list if " +"*belowThis* is omitted. When several items are moved their relative order is " +"preserved. This has no effect on embedded window items. :meth:`lower` is an " +"alias of :meth:`!tag_lower`." +msgstr "" + +#: ../../library/tkinter.rst:3774 +msgid "" +"Bind the callback *func* to the event *sequence* for all items given by " +"*tagOrId*, so that *func* is invoked whenever that event occurs for one of " +"the items. This is like :meth:`Widget.bind ` but operates on " +"canvas items rather than on whole widgets; only mouse, keyboard and virtual " +"events may be bound. Mouse events are directed to the current item and " +"keyboard events to the focus item (see :meth:`focus`). If *add* is true the " +"new binding is added to any existing bindings for the same sequence, rather " +"than replacing them. Return the identifier of the bound function, which can " +"be passed to :meth:`tag_unbind`." +msgstr "" + +#: ../../library/tkinter.rst:3789 +msgid "" +"Remove for all items given by *tagOrId* the binding for the event " +"*sequence*. If *funcid* is given, only that callback (as returned by :meth:" +"`tag_bind`) is unbound and deregistered." +msgstr "" + +#: ../../library/tkinter.rst:3794 ../../library/tkinter.rst:5353 +msgid "If *funcid* is given, only that callback is unbound." +msgstr "" + +#: ../../library/tkinter.rst:3800 +msgid "" +"Return a 4-tuple ``(x1, y1, x2, y2)`` giving an approximate bounding box, in " +"pixels, that encloses all the items given by *tagOrId* and any further " +"*tagOrIds*. The result may overestimate the true bounding box by a few " +"pixels. Return ``None`` if no item matches or the matching items have " +"nothing to display." +msgstr "" + +#: ../../library/tkinter.rst:3809 +msgid "" +"Given a window x-coordinate *screenx*, return the canvas x-coordinate " +"displayed at that location. If *gridspacing* is given, the result is rounded " +"to the nearest multiple of *gridspacing* units." +msgstr "" + +#: ../../library/tkinter.rst:3816 +msgid "" +"Given a window y-coordinate *screeny*, return the canvas y-coordinate " +"displayed at that location. If *gridspacing* is given, the result is rounded " +"to the nearest multiple of *gridspacing* units." +msgstr "" + +#: ../../library/tkinter.rst:3824 +msgid "" +"With *tagOrId*, set the keyboard focus for the canvas to the first item " +"given by *tagOrId* that supports the insertion cursor; the focus is left " +"unchanged if no such item exists. If *tagOrId* is an empty string, reset the " +"focus so that no item has it. With no argument, return the id of the item " +"that currently has the focus, or an empty string if none does. An item only " +"displays the insertion cursor when both it is the focus item and its canvas " +"has the input focus." +msgstr "" + +#: ../../library/tkinter.rst:3835 +msgid "" +"Set the insertion cursor of the items given by *tagOrId* to just before the " +"character given by *index*. Items that do not support an insertion cursor " +"are unaffected. The cursor is only displayed when the item has the focus, " +"but its position may be set at any time." +msgstr "" + +#: ../../library/tkinter.rst:3843 +msgid "" +"Return as an integer the numerical index within *tagOrId* corresponding to " +"*index*, which is a textual description of a position (for text items an " +"index into the characters, for line and polygon items an index into the " +"coordinates). If *tagOrId* matches several items, the first one that " +"supports indexing is used." +msgstr "" + +#: ../../library/tkinter.rst:3852 +msgid "" +"Adjust the end of the selection in *tagOrId* nearest to *index* so that it " +"is at *index*, and make the other end the anchor point for future :meth:" +"`select_to` calls. If the selection is not currently in *tagOrId*, this " +"behaves like :meth:`select_to`." +msgstr "" + +#: ../../library/tkinter.rst:3860 +msgid "Clear the selection if it is in this canvas; otherwise do nothing." +msgstr "" + +#: ../../library/tkinter.rst:3864 +msgid "" +"Set the selection anchor point to just before the character given by *index* " +"in the item given by *tagOrId*. This does not change the selection itself; " +"it sets the fixed end for future :meth:`select_to` calls." +msgstr "" + +#: ../../library/tkinter.rst:3871 +msgid "" +"Return the id of the item that holds the selection, or ``None`` if the " +"selection is not in this canvas. Unlike :meth:`find` and the ``find_*`` " +"methods, this returns the id as a string rather than an integer." +msgstr "" + +#: ../../library/tkinter.rst:3878 +msgid "" +"Set the selection to the characters of *tagOrId* between the selection " +"anchor point and *index*, inclusive of *index*. The anchor point is the one " +"set by the most recent :meth:`select_adjust` or :meth:`select_from` call." +msgstr "" + +#: ../../library/tkinter.rst:3885 ../../library/tkinter.rst:4272 +#: ../../library/tkinter.rst:5471 +msgid "" +"Record *x*, *y* and the current view, for use with later :meth:`scan_dragto` " +"calls. This is typically bound to a mouse button press in the widget." +msgstr "" + +#: ../../library/tkinter.rst:3891 +msgid "" +"Scroll the canvas by *gain* times the difference between *x*, *y* and the " +"coordinates passed to the last :meth:`scan_mark` call. This is typically " +"bound to mouse motion events in the widget, producing the effect of dragging " +"the canvas at high speed through its window." +msgstr "" + +#: ../../library/tkinter.rst:3898 +msgid "" +"Generate a PostScript (Encapsulated PostScript, version 3.0) representation " +"of part or all of the canvas. If the *file* or *channel* option is given, " +"the PostScript is written there and an empty string is returned; otherwise " +"it is returned as a string. By default only the area currently visible in " +"the window is generated, so it is usually necessary either to call :meth:" +"`~Misc.update` first or to use the *width* and *height* options. Supported " +"options include *colormap*, *colormode*, *file*, *fontmap*, *height*, " +"*pageanchor*, *pageheight*, *pagewidth*, *pagex*, *pagey*, *rotate*, " +"*width*, *x* and *y*." +msgstr "" + +#: ../../library/tkinter.rst:3913 +msgid "" +"A :class:`!Checkbutton` widget displays a textual string, bitmap or image " +"together with a square indicator, and toggles a boolean selection when " +"pressed. It has all the behavior of a simple button and, in addition, can be " +"selected: when selected the indicator is drawn with a check mark and the " +"associated variable is set to the ``onvalue``, and when deselected the " +"indicator is drawn empty and the variable is set to the ``offvalue``. " +"Inherits from :class:`Widget`. In addition to the standard widget options, a " +"checkbutton accepts the options documented in the Tk ``checkbutton`` manual " +"page, such as *variable*, *onvalue*, *offvalue* and *command*." +msgstr "" + +#: ../../library/tkinter.rst:3927 +msgid "" +"Do just what would happen if the user pressed the checkbutton with the " +"mouse: toggle the selection state of the button and invoke the associated " +"command, if there is one. Return the result of the command, or an empty " +"string if no command is associated with the checkbutton. This is ignored if " +"the checkbutton's state is ``disabled``." +msgstr "" + +#: ../../library/tkinter.rst:3936 +msgid "" +"Select the checkbutton and set the associated variable to its ``onvalue``." +msgstr "" + +#: ../../library/tkinter.rst:3941 +msgid "" +"Deselect the checkbutton and set the associated variable to its ``offvalue``." +msgstr "" + +#: ../../library/tkinter.rst:3946 +msgid "" +"Toggle the selection state of the button, redisplaying it and modifying its " +"associated variable to reflect the new state." +msgstr "" + +#: ../../library/tkinter.rst:3951 +msgid "" +"Flash the checkbutton by redisplaying it several times, alternating between " +"the active and normal colors. At the end of the flash the checkbutton is " +"left in the same normal or active state as when the method was called. This " +"is ignored if the checkbutton's state is ``disabled``." +msgstr "" + +#: ../../library/tkinter.rst:3960 +msgid "" +"An :class:`!Entry` widget displays a single line of text and lets the user " +"edit it. Inherits from :class:`Widget` and :class:`XView`; since entries can " +"hold strings too long to fit in the window, they support horizontal " +"scrolling through :meth:`~XView.xview`." +msgstr "" + +#: ../../library/tkinter.rst:3966 +msgid "" +"In addition to the standard widget options, an entry accepts the options " +"documented in the Tk ``entry`` manual page. Notable ones are *textvariable* " +"(the name of a variable kept in sync with the entry's contents), *show* (if " +"set, each character is displayed as the given character rather than its true " +"value, useful for password entry), *validate* and *validatecommand* (which " +"together let a callback accept or reject edits), and *state* (one of " +"``'normal'``, ``'disabled'`` or ``'readonly'``)." +msgstr "" + +#: ../../library/tkinter.rst:3975 +msgid "" +"Many of the methods below take an *index* argument that selects a character " +"in the entry's string. As described in the Tk ``entry`` manual page, *index* " +"may be a number (counting from 0), ``'insert'`` (the character just after " +"the insertion cursor), ``'end'`` (just after the last character), " +"``'anchor'`` (the selection anchor point), ``'sel.first'`` and ``'sel." +"last'`` (the ends of the selection), or ``@x`` (the character covering pixel " +"x-coordinate *x* in the window). Out-of-range indices are rounded to the " +"nearest legal value." +msgstr "" + +#: ../../library/tkinter.rst:3987 +msgid "" +"Delete the characters from index *first* up to but not including index " +"*last*. If *last* is omitted, only the single character at *first* is " +"deleted." +msgstr "" + +#: ../../library/tkinter.rst:3993 +msgid "Return the entry's current string." +msgstr "" + +#: ../../library/tkinter.rst:3997 +msgid "Insert *string* just before the character given by *index*." +msgstr "" + +#: ../../library/tkinter.rst:4001 ../../library/tkinter.rst:4891 +msgid "" +"Arrange for the insertion cursor to be displayed just before the character " +"given by *index*." +msgstr "" + +#: ../../library/tkinter.rst:4006 +msgid "Return the numerical index corresponding to *index*." +msgstr "" + +#: ../../library/tkinter.rst:4013 +msgid "" +"Locate the end of the selection nearest to the character given by *index*, " +"and adjust that end to be at *index* (including but not going beyond it); " +"the other end becomes the anchor point for future :meth:`selection_to` " +"calls. If there is no selection in the entry, a new one is created between " +"*index* and the most recent anchor point, inclusive. :meth:`select_adjust` " +"is an alias of :meth:`!selection_adjust`." +msgstr "" + +#: ../../library/tkinter.rst:4026 +msgid "" +"Clear the selection if it is currently in this widget. If the selection is " +"not in this widget the method has no effect. :meth:`select_clear` is an " +"alias of :meth:`!selection_clear`." +msgstr "" + +#: ../../library/tkinter.rst:4035 +msgid "" +"Set the selection anchor point to just before the character given by " +"*index*, without changing the selection. :meth:`select_from` is an alias of :" +"meth:`!selection_from`." +msgstr "" + +#: ../../library/tkinter.rst:4044 +msgid "" +"Return ``True`` if there are characters selected in the entry, ``False`` " +"otherwise. :meth:`select_present` is an alias of :meth:`!selection_present`." +msgstr "" + +#: ../../library/tkinter.rst:4053 +msgid "" +"Set the selection to include the characters starting with the one indexed by " +"*start* and ending with the one just before *end*. If *end* refers to the " +"same character as *start* or an earlier one, the selection is cleared. :meth:" +"`select_range` is an alias of :meth:`!selection_range`." +msgstr "" + +#: ../../library/tkinter.rst:4064 +msgid "" +"Set the selection between the anchor point and *index*: if *index* is before " +"the anchor point, the selection runs from *index* up to but not including " +"the anchor; if *index* is after it, from the anchor up to but not including " +"*index*; if they coincide, nothing happens. The anchor point is the one set " +"by the most recent :meth:`selection_from` or :meth:`selection_adjust` call. " +"If there is no selection in the entry, a new one is created using the most " +"recent anchor point. :meth:`select_to` is an alias of :meth:`!selection_to`." +msgstr "" + +#: ../../library/tkinter.rst:4076 +msgid "" +"Record *x* and the current view in the entry window, for use with later :" +"meth:`scan_dragto` calls. Typically associated with a mouse button press in " +"the widget." +msgstr "" + +#: ../../library/tkinter.rst:4082 +msgid "" +"Compute the difference between *x* and the *x* given to the last :meth:" +"`scan_mark` call, and adjust the view left or right by 10 times that " +"difference. Typically associated with mouse motion events, to produce the " +"effect of dragging the entry at high speed through the window." +msgstr "" + +#: ../../library/tkinter.rst:4091 +msgid "" +"A :class:`!Frame` widget is a simple container. Its primary purpose is to " +"act as a spacer or container for complex window layouts; its only features " +"are its background and an optional 3-D border to make the frame appear " +"raised or sunken. Inherits from :class:`Widget`. Refer to the Tk ``frame`` " +"manual page for the full list of options." +msgstr "" + +#: ../../library/tkinter.rst:4101 +msgid "" +"A :class:`!Label` widget displays a non-interactive textual string, bitmap " +"or image. The displayed text is set with the *text* option or linked to a " +"variable through *textvariable*, and an image can be shown using the *image* " +"option. Text must all be in a single font but may occupy multiple lines, and " +"one character may be underlined with the *underline* option. Inherits from :" +"class:`Widget`. Refer to the Tk ``label`` manual page for the full list of " +"options." +msgstr "" + +#: ../../library/tkinter.rst:4113 +msgid "" +"A :class:`!LabelFrame` widget is a container that has the features of a :" +"class:`Frame` plus the ability to display a label. The label text is set " +"with the *text* option and positioned with *labelanchor*, or an arbitrary " +"widget may be used as the label by giving it as the *labelwidget* option. " +"Inherits from :class:`Widget`. Refer to the Tk ``labelframe`` manual page " +"for the full list of options." +msgstr "" + +#: ../../library/tkinter.rst:4124 +msgid "" +"A :class:`!Listbox` widget displays a list of single-line text items, one " +"per line, of which the user can select one or more. The way the selection " +"behaves is governed by the *selectmode* option, which is one of ``browse`` " +"(the default; at most one item, which may be dragged with the mouse), " +"``single`` (at most one item), ``multiple`` (any number of items, toggled " +"individually), or ``extended`` (any number of items, including discontiguous " +"ranges, selected by clicking and dragging). Inherits from :class:`Widget`, :" +"class:`XView` and :class:`YView`, so the view can be scrolled horizontally " +"and vertically with :meth:`~XView.xview` and :meth:`~YView.yview`. Refer to " +"the Tk ``listbox`` manual page for the full list of options." +msgstr "" + +#: ../../library/tkinter.rst:4136 +msgid "" +"Many of the methods take an *index* argument identifying a particular item. " +"As described in the Tk ``listbox`` manual page, *index* may be a numeric " +"index (counting from 0 at the top), ``'active'`` (the item with the location " +"cursor, set with :meth:`activate`), ``'anchor'`` (the selection anchor, set " +"with :meth:`selection_anchor`), ``'end'`` (the last item, or for :meth:" +"`index` and :meth:`insert` the position just after it), or ``@x,y`` (the " +"item covering pixel coordinates *x*, *y* in the listbox window). Arguments " +"named *first* and *last* are indices of the same forms." +msgstr "" + +#: ../../library/tkinter.rst:4147 +msgid "" +"Insert the given *elements* as new items just before the item given by " +"*index*. If *index* is ``'end'``, the new items are appended to the end of " +"the list." +msgstr "" + +#: ../../library/tkinter.rst:4154 +msgid "" +"Delete the items in the range from *first* to *last* inclusive. If *last* is " +"omitted, it defaults to *first*, so that a single item is deleted." +msgstr "" + +#: ../../library/tkinter.rst:4160 +msgid "" +"If *last* is omitted, return the contents of the item given by *first*, or " +"an empty string if *first* refers to a non-existent item. If *last* is " +"given, return a tuple of all the items in the range from *first* to *last* " +"inclusive." +msgstr "" + +#: ../../library/tkinter.rst:4167 +msgid "Return the total number of items in the listbox." +msgstr "" + +#: ../../library/tkinter.rst:4171 +msgid "" +"Return the integer index value corresponding to *index*, or ``None`` if " +"*index* is out of range. If *index* is ``'end'``, the result is a count of " +"the number of items in the listbox (not the index of the last item)." +msgstr "" + +#: ../../library/tkinter.rst:4178 +msgid "" +"Return a tuple ``(x, y, width, height)`` describing the bounding box, in " +"pixels relative to the widget, of the text of the item given by *index*. " +"Return ``None`` if no part of that item is visible on the screen, or if " +"*index* refers to a non-existent item; if the item is only partly visible, " +"the result still gives the full area of the item, including the parts that " +"are not visible." +msgstr "" + +#: ../../library/tkinter.rst:4187 +msgid "" +"Given a y-coordinate within the listbox window, return the index of the " +"visible item nearest to that y-coordinate." +msgstr "" + +#: ../../library/tkinter.rst:4192 +msgid "" +"Adjust the view so that the item given by *index* is visible. If the item is " +"already visible the method has no effect; if it is near an edge of the " +"window the listbox scrolls just enough to bring it into view at that edge, " +"otherwise the listbox scrolls to center the item." +msgstr "" + +#: ../../library/tkinter.rst:4199 +msgid "" +"Set the active item to the one given by *index*. If *index* is outside the " +"range of items, the closest item is activated instead. The active item is " +"drawn as specified by the *activestyle* option when the widget has the input " +"focus, and its index may be retrieved with the ``'active'`` index." +msgstr "" + +#: ../../library/tkinter.rst:4208 +msgid "" +"Return a tuple containing the numerical indices of all of the items that are " +"currently selected, or an empty tuple if no items are selected." +msgstr "" + +#: ../../library/tkinter.rst:4216 +msgid "" +"Set the selection anchor to the item given by *index*. If *index* refers to " +"a non-existent item, the closest item is used. The selection anchor is the " +"end of the selection that is fixed while dragging out a selection with the " +"mouse, and may afterwards be referred to with the ``'anchor'`` index. :meth:" +"`select_anchor` is an alias of :meth:`!selection_anchor`." +msgstr "" + +#: ../../library/tkinter.rst:4228 +msgid "" +"Deselect any of the items in the range from *first* to *last* inclusive that " +"are selected. The selection state of items outside this range is not " +"changed. :meth:`select_clear` is an alias of :meth:`!selection_clear`." +msgstr "" + +#: ../../library/tkinter.rst:4238 +msgid "" +"Return ``True`` if the item given by *index* is currently selected, " +"``False`` otherwise. :meth:`select_includes` is an alias of :meth:`!" +"selection_includes`." +msgstr "" + +#: ../../library/tkinter.rst:4247 +msgid "" +"Select all of the items in the range from *first* to *last* inclusive, " +"without affecting the selection state of items outside that range. :meth:" +"`select_set` is an alias of :meth:`!selection_set`." +msgstr "" + +#: ../../library/tkinter.rst:4253 +msgid "" +"Return the current value of the configuration option *option* for the item " +"given by *index*." +msgstr "" + +#: ../../library/tkinter.rst:4261 +msgid "" +"Query or modify the configuration options of the item given by *index*. This " +"mirrors :meth:`~Misc.configure`, except that it applies to an individual " +"item rather than to the listbox as a whole. With no options, it returns a " +"dictionary describing the current options of the item; otherwise it sets the " +"given options. The supported item options are *background*, *foreground*, " +"*selectbackground* and *selectforeground*. :meth:`itemconfig` is an alias " +"of :meth:`!itemconfigure`." +msgstr "" + +#: ../../library/tkinter.rst:4278 +msgid "" +"Scroll the listbox by 10 times the difference between *x*, *y* and the " +"coordinates passed to the last :meth:`scan_mark` call. This is typically " +"bound to mouse motion events in the widget, producing the effect of dragging " +"the list at high speed through the window." +msgstr "" + +#: ../../library/tkinter.rst:4286 +msgid "" +"A :class:`!Menu` widget displays a column of entries, each of which may be a " +"command, a checkbutton, a radiobutton, a cascade (which posts an associated " +"submenu) or a separator. Menus are used as the menubar of a toplevel window, " +"as pulldown menus posted from a cascade entry or menubutton, and as popup " +"menus. Inherits from :class:`Widget`." +msgstr "" + +#: ../../library/tkinter.rst:4293 +msgid "" +"Many of the entry methods take an *index* argument that selects which entry " +"to operate on. As described in the Tk ``menu`` manual page, *index* may be a " +"numeric index (counting from 0 at the top), ``'active'`` (the currently " +"active entry), ``'end'`` or ``'last'`` (the bottommost entry), ``'none'`` " +"(no entry at all, written ``{}`` in Tcl), ``@y`` (the entry covering pixel y-" +"coordinate *y* in the menu window), or a pattern matched against the labels " +"of the entries from the top down." +msgstr "" + +#: ../../library/tkinter.rst:4304 +msgid "" +"Add a new entry to the bottom of the menu. *itemType* is one of " +"``'command'``, ``'cascade'``, ``'checkbutton'``, ``'radiobutton'`` or " +"``'separator'`` and determines the type of the new entry; the remaining " +"options configure it. The :meth:`!add_command`, :meth:`!add_cascade`, :meth:" +"`!add_checkbutton`, :meth:`!add_radiobutton` and :meth:`!add_separator` " +"convenience methods call this method with the corresponding *itemType*." +msgstr "" + +#: ../../library/tkinter.rst:4312 +msgid "" +"The entry is configured by the following options, although not every option " +"applies to every entry type (a separator accepts none of them):" +msgstr "" + +#: ../../library/tkinter.rst:4315 +msgid "*label*" +msgstr "" + +#: ../../library/tkinter.rst:4316 +msgid "The text to display in the entry." +msgstr "" + +#: ../../library/tkinter.rst:4318 +#, fuzzy +msgid "*command*" +msgstr "scrollcommand" + +#: ../../library/tkinter.rst:4319 +msgid "" +"The function to call when the entry is invoked (command, checkbutton and " +"radiobutton entries)." +msgstr "" + +#: ../../library/tkinter.rst:4322 +msgid "*accelerator*" +msgstr "" + +#: ../../library/tkinter.rst:4323 +msgid "" +"A string displayed at the right of the entry to advertise an accelerator " +"keystroke; it does not itself create the binding." +msgstr "" + +#: ../../library/tkinter.rst:4327 +msgid "" +"The index of a character in the label to underline for keyboard traversal." +msgstr "" + +#: ../../library/tkinter.rst:4331 +msgid "One of ``'normal'``, ``'active'`` or ``'disabled'``." +msgstr "" + +#: ../../library/tkinter.rst:4334 +msgid "An image to display instead of, or together with, the text label." +msgstr "" + +#: ../../library/tkinter.rst:4336 +msgid "*compound*" +msgstr "" + +#: ../../library/tkinter.rst:4337 +msgid "" +"Where to show the image relative to the text: ``'none'`` (the default), " +"``'text'``, ``'image'``, ``'top'``, ``'bottom'``, ``'left'`` or ``'right'``." +msgstr "" + +#: ../../library/tkinter.rst:4342 +msgid "A bitmap to display instead of the text label." +msgstr "" + +#: ../../library/tkinter.rst:4345 ../../library/tkinter.rst:5208 +msgid "The font to use for the text." +msgstr "" + +#: ../../library/tkinter.rst:4348 +msgid "" +"The entry's background and foreground colors in its normal state (ignored on " +"macOS)." +msgstr "" + +#: ../../library/tkinter.rst:4351 +msgid "*activebackground*, *activeforeground*" +msgstr "" + +#: ../../library/tkinter.rst:4352 +msgid "" +"The background and foreground colors used when the entry is active (ignored " +"on macOS)." +msgstr "" + +#: ../../library/tkinter.rst:4355 +msgid "*columnbreak*" +msgstr "" + +#: ../../library/tkinter.rst:4356 +msgid "" +"If true, the entry starts a new column instead of being placed below the " +"previous entry." +msgstr "" + +#: ../../library/tkinter.rst:4359 +msgid "*hidemargin*" +msgstr "" + +#: ../../library/tkinter.rst:4360 +msgid "" +"If true, the standard margin around the entry is omitted, which is useful " +"when a menu is used as a palette." +msgstr "" + +#: ../../library/tkinter.rst:4363 +msgid "*menu*" +msgstr "" + +#: ../../library/tkinter.rst:4364 +msgid "The submenu posted by a cascade entry; it must be a child of this menu." +msgstr "" + +#: ../../library/tkinter.rst:4367 +msgid "*variable*" +msgstr "" + +#: ../../library/tkinter.rst:4368 +msgid "The variable associated with a checkbutton or radiobutton entry." +msgstr "" + +#: ../../library/tkinter.rst:4370 +msgid "*onvalue*, *offvalue*" +msgstr "" + +#: ../../library/tkinter.rst:4371 +msgid "" +"The values stored in *variable* when a checkbutton entry is selected or " +"cleared." +msgstr "" + +#: ../../library/tkinter.rst:4374 +msgid "*value*" +msgstr "" + +#: ../../library/tkinter.rst:4375 +msgid "The value stored in *variable* when a radiobutton entry is selected." +msgstr "" + +#: ../../library/tkinter.rst:4377 +msgid "*indicatoron*" +msgstr "" + +#: ../../library/tkinter.rst:4378 +msgid "Whether to display the indicator of a checkbutton or radiobutton entry." +msgstr "" + +#: ../../library/tkinter.rst:4381 +msgid "*selectcolor*" +msgstr "" + +#: ../../library/tkinter.rst:4382 +msgid "" +"The color of the indicator of a checkbutton or radiobutton entry when it is " +"selected." +msgstr "" + +#: ../../library/tkinter.rst:4385 +msgid "*selectimage*" +msgstr "" + +#: ../../library/tkinter.rst:4386 +msgid "" +"The image displayed when a checkbutton or radiobutton entry is selected and " +"*image* is also given." +msgstr "" + +#: ../../library/tkinter.rst:4391 +msgid "" +"Add a new cascade entry to the bottom of the menu. A cascade entry has an " +"associated submenu, given by its *menu* option, which must be a child of " +"this menu; posting the entry posts the submenu next to it." +msgstr "" + +#: ../../library/tkinter.rst:4398 +msgid "" +"Add a new checkbutton entry to the bottom of the menu. When invoked, a " +"checkbutton entry toggles between its *onvalue* and *offvalue*, storing the " +"result in its associated *variable*, and displays an indicator showing " +"whether it is selected." +msgstr "" + +#: ../../library/tkinter.rst:4405 +msgid "" +"Add a new command entry to the bottom of the menu. A command entry behaves " +"much like a button: when it is invoked, the callback given by its *command* " +"option is called." +msgstr "" + +#: ../../library/tkinter.rst:4411 +msgid "" +"Add a new radiobutton entry to the bottom of the menu. Radiobutton entries " +"sharing the same *variable* form a group of which only one may be selected " +"at a time; selecting an entry stores its *value* in the variable." +msgstr "" + +#: ../../library/tkinter.rst:4418 +msgid "" +"Add a separator to the bottom of the menu. A separator is displayed as a " +"horizontal dividing line and cannot be activated or invoked." +msgstr "" + +#: ../../library/tkinter.rst:4424 +msgid "" +"Same as :meth:`add`, except that the new entry is inserted just before the " +"entry given by *index* instead of being appended to the end of the menu. " +"*itemType* is one of ``'command'``, ``'cascade'``, ``'checkbutton'``, " +"``'radiobutton'`` or ``'separator'``. The :meth:`!insert_command`, :meth:`!" +"insert_cascade`, :meth:`!insert_checkbutton`, :meth:`!insert_radiobutton` " +"and :meth:`!insert_separator` convenience methods call this method with the " +"corresponding *itemType*." +msgstr "" + +#: ../../library/tkinter.rst:4436 +msgid "" +"Insert a new cascade entry before the entry given by *index* (see :meth:" +"`add_cascade`)." +msgstr "" + +#: ../../library/tkinter.rst:4441 +msgid "" +"Insert a new checkbutton entry before the entry given by *index* (see :meth:" +"`add_checkbutton`)." +msgstr "" + +#: ../../library/tkinter.rst:4446 +msgid "" +"Insert a new command entry before the entry given by *index* (see :meth:" +"`add_command`)." +msgstr "" + +#: ../../library/tkinter.rst:4451 +msgid "" +"Insert a new radiobutton entry before the entry given by *index* (see :meth:" +"`add_radiobutton`)." +msgstr "" + +#: ../../library/tkinter.rst:4456 +msgid "" +"Insert a separator before the entry given by *index* (see :meth:" +"`add_separator`)." +msgstr "" + +#: ../../library/tkinter.rst:4461 +msgid "" +"Delete all of the menu entries between *index1* and *index2* inclusive. If " +"*index2* is omitted, it defaults to *index1*, so that a single entry is " +"deleted. Attempts to delete a tear-off entry are ignored; remove it by " +"changing the *tearoff* option instead." +msgstr "" + +#: ../../library/tkinter.rst:4469 +msgid "" +"Return the current value of the configuration option *option* for the entry " +"given by *index*." +msgstr "" + +#: ../../library/tkinter.rst:4477 +msgid "" +"Query or modify the configuration options of the entry given by *index*. " +"This mirrors :meth:`~Misc.configure`, except that it applies to an " +"individual entry rather than to the menu as a whole. With no options, it " +"returns a dictionary describing the current options of the entry; otherwise " +"it sets the given options. The supported options are those accepted by :meth:" +"`add` for the entry's type. :meth:`entryconfig` is an alias of :meth:`!" +"entryconfigure`." +msgstr "" + +#: ../../library/tkinter.rst:4488 +msgid "" +"Return the numerical index corresponding to *index*, or ``None`` if *index* " +"selects no entry." +msgstr "" + +#: ../../library/tkinter.rst:4493 +msgid "" +"Return the type of the entry given by *index*: one of ``'command'``, " +"``'cascade'``, ``'checkbutton'``, ``'radiobutton'``, ``'separator'`` or " +"``'tearoff'`` (for the tear-off entry)." +msgstr "" + +#: ../../library/tkinter.rst:4499 +msgid "" +"Make the entry given by *index* the active entry, redisplaying it with its " +"active colors, and deactivate any previously active entry. If *index* " +"selects no entry, or the selected entry is disabled, the menu ends up with " +"no active entry." +msgstr "" + +#: ../../library/tkinter.rst:4506 +msgid "" +"Invoke the action of the entry given by *index*, as if it had been clicked. " +"Nothing happens if the entry is disabled. If the entry has a *command* " +"associated with it, the result of that command is returned; otherwise the " +"result is an empty string." +msgstr "" + +#: ../../library/tkinter.rst:4514 +msgid "" +"Display the menu on the screen at the root-window coordinates *x* and *y*, " +"adjusting them if necessary so that the whole menu is visible. If the " +"*postcommand* option has been specified, it is evaluated before the menu is " +"posted." +msgstr "" + +#: ../../library/tkinter.rst:4521 +msgid "" +"Post the menu as a popup at the root-window coordinates *x* and *y*. If " +"*entry* is given, the menu is positioned so that this entry is displayed " +"under the pointer." +msgstr "" + +#: ../../library/tkinter.rst:4527 +msgid "" +"Unmap the menu so that it is no longer displayed, also unposting any posted " +"lower-level cascaded submenu. This has no effect on Windows and macOS, which " +"manage the unposting of menus themselves." +msgstr "" + +#: ../../library/tkinter.rst:4534 +msgid "" +"Return the x-coordinate, within the menu window, of the leftmost pixel of " +"the entry given by *index*." +msgstr "" + +#: ../../library/tkinter.rst:4541 +msgid "" +"Return the y-coordinate, within the menu window, of the topmost pixel of the " +"entry given by *index*." +msgstr "" + +#: ../../library/tkinter.rst:4547 +msgid "" +"A :class:`!Menubutton` widget displays a textual string, bitmap or image and " +"posts an associated :class:`Menu`, given by its *menu* option, when the user " +"presses it. Like a :class:`Label` it can show *text*, a *textvariable*, or " +"an *image*, and the *direction* option controls where the menu appears " +"relative to the button. Inherits from :class:`Widget`. Refer to the Tk " +"``menubutton`` manual page for the full list of options." +msgstr "" + +#: ../../library/tkinter.rst:4559 +msgid "" +"A :class:`!Message` widget displays a non-interactive textual string, given " +"by the *text* option or linked to a variable through *textvariable*. Unlike " +"a :class:`Label`, it breaks the string into multiple lines in order to " +"produce a given aspect ratio, choosing line breaks at word boundaries, and " +"it can justify the text left, centered or right. Inherits from :class:" +"`Widget`. Refer to the Tk ``message`` manual page for the full list of " +"options." +msgstr "" + +#: ../../library/tkinter.rst:4570 +msgid "" +"A helper subclass of :class:`Menubutton` that displays a pop-up menu of " +"mutually exclusive choices. *variable* is a :class:`Variable` kept in sync " +"with the selection, *value* is the initial choice, and *values* are the " +"remaining menu entries. The keyword argument *command* may be given a " +"callback that is invoked with the selected value, and the keyword argument " +"*name* sets the Tk widget name." +msgstr "" + +#: ../../library/tkinter.rst:4579 +msgid "Destroy the widget, also cleaning up the associated pop-up menu." +msgstr "" + +#: ../../library/tkinter.rst:4581 +msgid "Added support for the *name* keyword argument." +msgstr "" + +#: ../../library/tkinter.rst:4588 +msgid "" +"A :class:`!PanedWindow` is a geometry-manager widget that arranges any " +"number of child *panes* in a row (when *orient* is ``'horizontal'``) or a " +"column (when *orient* is ``'vertical'``). Each pane holds one widget, and " +"each pair of adjacent panes is separated by a movable *sash* that the user " +"can drag with the mouse to resize the widgets on either side of it. Inherits " +"from :class:`Widget`." +msgstr "" + +#: ../../library/tkinter.rst:4596 +msgid "" +"The *orient* option selects the layout direction, *sashwidth* sets the width " +"of each sash and *sashrelief* its relief. When *showhandle* is true a small " +"handle is drawn on each sash that the user can grab to drag it. Refer to the " +"Tk ``panedwindow`` manual page for the full list of options." +msgstr "" + +#: ../../library/tkinter.rst:4604 +msgid "" +"Add *child* to the panedwindow as a new pane, placed after any existing " +"panes. The keyword arguments specify per-pane management options for " +"*child*; they may be any of the options accepted by :meth:`paneconfigure`." +msgstr "" + +#: ../../library/tkinter.rst:4614 +msgid "" +"Remove the pane containing *child* from the panedwindow. All geometry " +"management options for *child* are forgotten. :meth:`forget` is an alias of :" +"meth:`!remove`." +msgstr "" + +#: ../../library/tkinter.rst:4620 +msgid "" +"Return a tuple of the widgets managed by the panedwindow, one per pane, in " +"order." +msgstr "" + +#: ../../library/tkinter.rst:4625 +msgid "" +"Return the current value of the management option *option* for the pane " +"containing *child*. *option* may be any value allowed by :meth:" +"`paneconfigure`." +msgstr "" + +#: ../../library/tkinter.rst:4634 +msgid "" +"Query or modify the management options of the pane containing the widget " +"*tagOrId*. With no options, it returns a dictionary describing all of the " +"available options for the pane; given a single option name as a string, it " +"returns a description of that one option; otherwise it sets the given " +"options. The supported options include *after* and *before* (insert the pane " +"after or before another managed window), *height* and *width* (the outer " +"dimensions of the window, including any border), *minsize* (the minimum size " +"in the paned dimension), *padx* and *pady* (extra space to leave on each " +"side of the window), *sticky* (position or stretch the window within an " +"oversized pane, using a string of the characters ``n``, ``s``, ``e`` and " +"``w``), *hide* (hide the pane while keeping it in the list of panes) and " +"*stretch* (how extra space is allocated to the pane: one of ``'always'``, " +"``'first'``, ``'last'``, ``'middle'`` or ``'never'``). :meth:`paneconfig` is " +"an alias of :meth:`!paneconfigure`." +msgstr "" + +#: ../../library/tkinter.rst:4652 +msgid "" +"Identify the panedwindow component underneath the point given by *x* and " +"*y*, in window coordinates. If the point is over a sash or a sash handle, " +"the result is a two-element tuple containing the index of the sash or handle " +"and a word indicating whether it is over a sash or a handle, such as ``(0, " +"'sash')`` or ``(2, 'handle')``. If the point is over any other part of the " +"panedwindow, the result is an empty string." +msgstr "" + +#: ../../library/tkinter.rst:4663 +msgid "" +"Query or change the position of the sashes in the panedwindow. This is a " +"thin wrapper around the Tk ``sash`` subcommand; the convenience methods :" +"meth:`sash_coord`, :meth:`sash_mark` and :meth:`sash_place` should normally " +"be used instead." +msgstr "" + +#: ../../library/tkinter.rst:4670 +msgid "" +"Return the current x and y coordinate pair for the sash given by *index*, " +"which must be an integer between 0 and one less than the number of panes in " +"the panedwindow. The coordinates returned are those of the top left corner " +"of the region containing the sash." +msgstr "" + +#: ../../library/tkinter.rst:4678 +msgid "" +"Record the current mouse position for the sash given by *index*, for use " +"together with later sash-drag operations to move the sash." +msgstr "" + +#: ../../library/tkinter.rst:4683 +msgid "Place the sash given by *index* at the coordinates *x* and *y*." +msgstr "" + +#: ../../library/tkinter.rst:4687 +msgid "" +"Query or change the position of the sash proxy, the \"ghost\" sash shown " +"while a sash is being dragged with non-opaque resizing. This is a thin " +"wrapper around the Tk ``proxy`` subcommand; the convenience methods :meth:" +"`proxy_coord`, :meth:`proxy_forget` and :meth:`proxy_place` should normally " +"be used instead." +msgstr "" + +#: ../../library/tkinter.rst:4695 +msgid "" +"Return a tuple containing the x and y coordinates of the most recent proxy " +"location." +msgstr "" + +#: ../../library/tkinter.rst:4700 +msgid "Remove the proxy from the display." +msgstr "" + +#: ../../library/tkinter.rst:4704 +msgid "Place the proxy at the coordinates *x* and *y*." +msgstr "" + +#: ../../library/tkinter.rst:4709 +msgid "" +"A :class:`!Radiobutton` widget displays a textual string, bitmap or image " +"together with a diamond or circular indicator, and selects one choice out of " +"several. It has all the behavior of a simple button and, in addition, can be " +"selected: typically several radiobuttons share a single *variable*, and " +"selecting one sets that variable to the radiobutton's *value*; each " +"radiobutton also monitors the variable and automatically selects or " +"deselects itself when the variable changes. Inherits from :class:`Widget`. " +"In addition to the standard widget options, a radiobutton accepts the " +"options documented in the Tk ``radiobutton`` manual page, such as " +"*variable*, *value* and *command*." +msgstr "" + +#: ../../library/tkinter.rst:4724 +msgid "" +"Do just what would happen if the user pressed the radiobutton with the " +"mouse: select the button and invoke the associated command, if there is one. " +"Return the result of the command, or an empty string if no command is " +"associated with the radiobutton. This is ignored if the radiobutton's state " +"is ``disabled``." +msgstr "" + +#: ../../library/tkinter.rst:4733 +msgid "" +"Select the radiobutton and set the associated variable to the value " +"corresponding to this widget." +msgstr "" + +#: ../../library/tkinter.rst:4738 +msgid "" +"Deselect the radiobutton and set the associated variable to an empty string. " +"If this radiobutton was not currently selected, this has no effect." +msgstr "" + +#: ../../library/tkinter.rst:4744 +msgid "" +"Flash the radiobutton by redisplaying it several times, alternating between " +"the active and normal colors. At the end of the flash the radiobutton is " +"left in the same normal or active state as when the method was called. This " +"is ignored if the radiobutton's state is ``disabled``." +msgstr "" + +#: ../../library/tkinter.rst:4753 +msgid "" +"A :class:`!Scale` widget lets the user select a numerical value by moving a " +"slider along a trough. It can be oriented vertically or horizontally and can " +"optionally display a label and the current value. Inherits from :class:" +"`Widget`." +msgstr "" + +#: ../../library/tkinter.rst:4759 +msgid "" +"In addition to the standard widget options, a scale accepts the options " +"documented in the Tk ``scale`` manual page, such as *from_*, *to*, " +"*resolution*, *orient*, *tickinterval*, *variable* and *command*. As " +"elsewhere in :mod:`!tkinter`, the leading ``-`` of the Tk option name is " +"dropped; *from* is spelled ``from_`` because :keyword:`from` is a Python " +"keyword." +msgstr "" + +#: ../../library/tkinter.rst:4768 +msgid "" +"Return the current value of the scale. The result is an integer if the " +"scale's *resolution* yields whole numbers, and a float otherwise." +msgstr "" + +#: ../../library/tkinter.rst:4774 +msgid "" +"Set the scale to *value*, moving the slider accordingly. This has no effect " +"if the scale is disabled." +msgstr "" + +#: ../../library/tkinter.rst:4779 +msgid "" +"Return a tuple ``(x, y)`` giving the pixel coordinates, relative to the " +"widget, of the point on the centerline of the trough that corresponds to " +"*value*. If *value* is omitted, the scale's current value is used." +msgstr "" + +#: ../../library/tkinter.rst:4786 +msgid "" +"Return a string describing the part of the scale at the pixel coordinates " +"*x*, *y*: ``'slider'``, ``'trough1'`` (the part of the trough above or to " +"the left of the slider), ``'trough2'`` (below or to the right of the " +"slider), or an empty string if the point is not over any of these elements." +msgstr "" + +#: ../../library/tkinter.rst:4795 +msgid "" +"A :class:`!Scrollbar` widget displays a slider and two arrows that let the " +"user scroll an associated widget, such as a :class:`Listbox`, :class:" +"`Text`, :class:`Canvas` or :class:`Entry`. It is connected to the scrolled " +"widget by setting that widget's *xscrollcommand* or *yscrollcommand* option " +"to the scrollbar's :meth:`set` method, and the scrollbar's *command* option " +"to the scrolled widget's :meth:`~XView.xview` or :meth:`~YView.yview` " +"method. Inherits from :class:`Widget`." +msgstr "" + +#: ../../library/tkinter.rst:4806 +msgid "" +"Return the current scrollbar settings as a tuple ``(first, last)`` of two " +"fractions between 0 and 1, describing the portion of the document that is " +"currently visible, as last passed to :meth:`set`." +msgstr "" + +#: ../../library/tkinter.rst:4812 +msgid "" +"Set the scrollbar. *first* and *last* are fractions between 0 and 1 giving " +"the positions of the start and end of the visible portion of the associated " +"document. This method is normally registered as the scrolled widget's " +"*xscrollcommand* or *yscrollcommand* and called by that widget." +msgstr "" + +#: ../../library/tkinter.rst:4820 +msgid "" +"Mark the element *index* (one of ``'arrow1'``, ``'slider'`` or ``'arrow2'``) " +"as active, displaying it according to the *activebackground* and " +"*activerelief* options. If *index* is omitted, return the name of the " +"currently active element, or ``None`` if no element is active." +msgstr "" + +#: ../../library/tkinter.rst:4826 +msgid "The *index* argument is now optional." +msgstr "" + +#: ../../library/tkinter.rst:4831 +msgid "" +"Return a float indicating the fractional change in the scrollbar setting " +"that corresponds to moving the slider by *deltax* pixels horizontally (for " +"horizontal scrollbars) or *deltay* pixels vertically (for vertical " +"scrollbars)." +msgstr "" + +#: ../../library/tkinter.rst:4838 +msgid "" +"Return a float between 0 and 1 indicating where the point at pixel " +"coordinates *x*, *y* lies in the trough: 0 corresponds to the top or left of " +"the trough and 1 to the bottom or right." +msgstr "" + +#: ../../library/tkinter.rst:4844 +msgid "" +"Return the name of the element under the pixel coordinates *x*, *y* (such as " +"``'arrow1'``), or an empty string if the point does not lie in any element " +"of the scrollbar." +msgstr "" + +#: ../../library/tkinter.rst:4851 +msgid "" +"A :class:`!Spinbox` widget is an :class:`Entry`-like widget with a pair of " +"up/down arrow buttons that let the user step through a range of values in " +"addition to editing the value directly. The set of values may be a numeric " +"range given by the *from_*, *to* and *increment* options, or an explicit " +"list of strings given by the *values* option (which takes precedence over " +"the range). Each time an arrow is invoked the *command* callback, if any, is " +"called; the *wrap* option controls whether stepping past either end of the " +"range wraps around to the other end; the *format* option specifies how " +"numeric values are formatted; and the *validate* option enables validation " +"of the entered text. Inherits from :class:`Widget` and :class:`XView`." +msgstr "" + +#: ../../library/tkinter.rst:4864 +msgid "" +"Many of the methods take an *index* argument identifying a character in the " +"spinbox's string. As described in the Tk ``spinbox`` manual page, *index* " +"may be a numeric index (counting from 0), ``'anchor'`` (the selection anchor " +"point), ``'end'`` (just after the last character), ``'insert'`` (the " +"character just after the insertion cursor), ``'sel.first'`` or ``'sel." +"last'`` (the ends of the selection), or ``@x`` (the character covering pixel " +"x-coordinate *x* in the window)." +msgstr "" + +#: ../../library/tkinter.rst:4875 +msgid "Return the spinbox's string." +msgstr "" + +#: ../../library/tkinter.rst:4879 +msgid "" +"Insert the characters of the string *s* just before the character given by " +"*index*." +msgstr "" + +#: ../../library/tkinter.rst:4884 +msgid "" +"Delete one or more characters of the spinbox. *first* is the index of the " +"first character to delete, and *last* is the index of the character just " +"after the last one to delete. If *last* is omitted, a single character at " +"*first* is deleted." +msgstr "" + +#: ../../library/tkinter.rst:4896 +msgid "Return the numerical index corresponding to *index*, as a string." +msgstr "" + +#: ../../library/tkinter.rst:4900 +msgid "" +"Return a tuple of four integers ``(x, y, width, height)`` describing the " +"bounding box of the character given by *index*. *x* and *y* are the pixel " +"coordinates of the upper-left corner of the character relative to the " +"widget, and *width* and *height* are its size in pixels. The bounding box " +"may refer to a region outside the visible area of the window." +msgstr "" + +#: ../../library/tkinter.rst:4910 +msgid "" +"Return the name of the window element at the pixel coordinates *x*, *y*: one " +"of ``'buttondown'``, ``'buttonup'``, ``'entry'`` or ``'none'``." +msgstr "" + +#: ../../library/tkinter.rst:4915 +msgid "" +"Invoke the spin button given by *element*, either ``'buttonup'`` or " +"``'buttondown'``, triggering the action associated with it." +msgstr "" + +#: ../../library/tkinter.rst:4920 +msgid "" +"A thin wrapper around the Tk ``scan`` widget subcommand, used to implement " +"fast dragging of the view: ``scan('mark', x)`` records *x* and the current " +"view, and ``scan('dragto', x)`` adjusts the view relative to that mark. The :" +"meth:`scan_mark` and :meth:`scan_dragto` methods wrap the two forms." +msgstr "" + +#: ../../library/tkinter.rst:4928 +msgid "" +"Record *x* and the current view in the spinbox window, for use with a later :" +"meth:`scan_dragto` call. This is typically associated with a mouse button " +"press in the widget." +msgstr "" + +#: ../../library/tkinter.rst:4934 +msgid "" +"Adjust the view by 10 times the difference between *x* and the *x* passed to " +"the last :meth:`scan_mark` call. This is typically associated with mouse " +"motion events, producing the effect of dragging the spinbox at high speed " +"through the window." +msgstr "" + +#: ../../library/tkinter.rst:4941 +msgid "" +"A thin wrapper around the Tk ``selection`` widget subcommand, used to adjust " +"the selection within the spinbox. It has several forms depending on the " +"first argument, such as ``selection('adjust', index)``, " +"``selection('clear')``, ``selection('element', ?elem?)``, " +"``selection('from', index)``, ``selection('present')``, ``selection('range', " +"start, end)`` and ``selection('to', index)``. The :meth:`selection_adjust`, :" +"meth:`selection_clear`, :meth:`selection_element`, :meth:`selection_from`, :" +"meth:`selection_present`, :meth:`selection_range` and :meth:`selection_to` " +"methods wrap these forms." +msgstr "" + +#: ../../library/tkinter.rst:4955 +msgid "" +"Locate the end of the selection nearest to the character given by *index* " +"and adjust that end of the selection to be at *index* (including but not " +"going beyond *index*). The other end becomes the anchor point for future :" +"meth:`selection_to` calls. If the selection is not currently in the spinbox, " +"a new selection is created to include the characters between *index* and the " +"most recent anchor point, inclusive." +msgstr "" + +#: ../../library/tkinter.rst:4966 +msgid "" +"Clear the selection if it is currently in this widget. If the selection is " +"not in this widget, the method has no effect." +msgstr "" + +#: ../../library/tkinter.rst:4971 +msgid "" +"Set or get the currently selected element. If *element* (one of " +"``'buttonup'``, ``'buttondown'`` or ``'none'``) is given, that spin button " +"is selected and displayed depressed; otherwise the name of the currently " +"selected element is returned." +msgstr "" + +#: ../../library/tkinter.rst:4978 +msgid "" +"Set the selection anchor point to just before the character given by " +"*index*, without changing the selection itself." +msgstr "" + +#: ../../library/tkinter.rst:4986 +msgid "" +"Return ``True`` if there are characters selected in the spinbox, ``False`` " +"otherwise." +msgstr "" + +#: ../../library/tkinter.rst:4994 +msgid "" +"Set the selection to include the characters starting with the one indexed by " +"*start* and ending with the one just before *end*. If *end* refers to the " +"same character as *start* or an earlier one, the selection is cleared." +msgstr "" + +#: ../../library/tkinter.rst:5004 +msgid "" +"Set the selection between *index* and the anchor point. If *index* is before " +"the anchor point, the selection runs from *index* up to but not including " +"the anchor point; if it is after, the selection runs from the anchor point " +"up to but not including *index*; if it is the same, nothing happens. The " +"anchor point is the one set by the most recent :meth:`selection_from` or :" +"meth:`selection_adjust` call. If the selection is not in this widget, a new " +"selection is created using the most recent anchor point." +msgstr "" + +#: ../../library/tkinter.rst:5020 +msgid "" +"A :class:`!Text` widget displays and edits multi-line text. Portions of the " +"text may be styled with **tags**, particular positions may be annotated with " +"floating **marks**, and arbitrary images and other widgets may be embedded " +"in the text. The widget also provides an unlimited undo/redo mechanism and " +"supports peer widgets that share the same underlying data. Inherits from :" +"class:`Widget`, :class:`XView` and :class:`YView`, so the view can be " +"scrolled horizontally and vertically with :meth:`~XView.xview` and :meth:" +"`~YView.yview`. Refer to the Tk ``text`` manual page for the full list of " +"options." +msgstr "" + +#: ../../library/tkinter.rst:5031 +msgid "" +"Most of the methods take one or more *index* arguments that identify a " +"position within the text. As described in the Tk ``text`` manual page, an " +"index is a string consisting of a base, optionally followed by one or more " +"modifiers. The base may be ``'line.char'`` (line *line*, character *char*, " +"where lines are counted from 1 and characters within a line from 0; ``'line." +"end'`` refers to the newline ending the line), ``'end'`` (the position just " +"after the last newline), the name of a mark, ``'tag.first'`` or ``'tag." +"last'`` (the first character tagged with *tag*, or the position just after " +"the last such character), the name of an embedded image or window, or ``@x," +"y`` (the character covering pixel coordinates *x*, *y* in the widget). A " +"modifier such as ``'+5 chars'``, ``'-3 lines'``, ``'linestart'``, " +"``'lineend'``, ``'wordstart'`` or ``'wordend'`` adjusts the index relative " +"to its base; several modifiers may be combined and are applied from left to " +"right, for example ``'insert wordstart - 1 c'``." +msgstr "" + +#: ../../library/tkinter.rst:5049 +msgid "" +"Insert the string *chars* just before the character at *index* (if *index* " +"is ``'end'``, just before the final newline). By default the new text " +"inherits any tags present on both sides of the insertion point. If *args* is " +"given, it consists of alternating *tagList*, *chars* values: the preceding " +"*chars* receives exactly the tags listed (a tag list may be a single tag " +"name or a sequence of names), overriding the surrounding tags." +msgstr "" + +#: ../../library/tkinter.rst:5060 +msgid "" +"Delete the range of characters from *index1* up to but not including " +"*index2*. If *index2* is omitted, the single character at *index1* is " +"deleted. The widget always keeps a newline as its last character, so a " +"deletion that would remove it is adjusted accordingly." +msgstr "" + +#: ../../library/tkinter.rst:5068 +msgid "" +"Replace the range of characters from *index1* up to but not including " +"*index2* with *chars*. This is equivalent to a :meth:`delete` followed by " +"an :meth:`insert` at *index1*; *args* is interpreted as for :meth:`insert`." +msgstr "" + +#: ../../library/tkinter.rst:5077 +msgid "" +"Return the text from *index1* up to but not including *index2* as a string. " +"If *index2* is omitted, return the single character at *index1*. Embedded " +"images and windows are omitted from the result." +msgstr "" + +#: ../../library/tkinter.rst:5084 +msgid "" +"Return the position corresponding to *index* in the canonical ``'line." +"char'`` form." +msgstr "" + +#: ../../library/tkinter.rst:5089 +msgid "" +"Compare the positions of *index1* and *index2* using the relational operator " +"*op*, which must be one of ``'<'``, ``'<='``, ``'=='``, ``'>='``, ``'>'`` or " +"``'!='``, and return the boolean result." +msgstr "" + +#: ../../library/tkinter.rst:5095 +msgid "" +"Count the number of items of the requested kinds between *index1* and " +"*index2*; the count is negative if *index1* is after *index2*. Each of " +"*options* names a kind of item to count: ``'chars'``, ``'displaychars'``, " +"``'displayindices'``, ``'displaylines'``, ``'indices'``, ``'lines'``, " +"``'xpixels'`` or ``'ypixels'`` (the default, used when no option is given, " +"is ``'indices'``). The pseudo-option ``'update'`` forces any out-of-date " +"layout information to be recalculated before the following options are " +"evaluated. When *return_ints* is true and a single counting option is given, " +"return a plain integer; otherwise return a tuple with one integer per " +"counting option (or ``None`` if the result is empty)." +msgstr "" + +#: ../../library/tkinter.rst:5109 +msgid "Added the *return_ints* parameter." +msgstr "" + +#: ../../library/tkinter.rst:5115 +msgid "" +"Adjust the view so that the character given by *index* is visible. If it is " +"already visible the method has no effect; if it is a short distance out of " +"view the widget scrolls just enough to bring it to the nearest edge, " +"otherwise it scrolls to center *index* in the window." +msgstr "" + +#: ../../library/tkinter.rst:5122 +msgid "" +"Return a tuple ``(x, y, width, height)`` giving the bounding box, in pixels, " +"of the visible part of the character at *index*, or ``None`` if that " +"character is not visible on the screen." +msgstr "" + +#: ../../library/tkinter.rst:5128 +msgid "" +"Return a tuple ``(x, y, width, height, baseline)`` describing the display " +"line that contains *index*: the first four values give the bounding box of " +"the line in pixels and *baseline* gives the offset of the baseline measured " +"down from the top of the area. Return ``None`` if that display line is not " +"visible on the screen." +msgstr "" + +#: ../../library/tkinter.rst:5136 +msgid "" +"Set the mark named *markName* to the position just before the character at " +"*index*, creating the mark if it does not already exist. A mark created this " +"way has right gravity by default." +msgstr "" + +#: ../../library/tkinter.rst:5142 +msgid "" +"Remove each of the marks named in *markNames*. The special ``insert`` and " +"``current`` marks may not be removed." +msgstr "" + +#: ../../library/tkinter.rst:5147 +msgid "Return a tuple of the names of all marks currently set in the widget." +msgstr "" + +#: ../../library/tkinter.rst:5151 +msgid "" +"If *direction* is omitted, return the gravity of mark *markName*, either " +"``'left'`` or ``'right'``. Otherwise set its gravity to *direction*. The " +"gravity determines on which side of the mark text inserted at the mark's " +"position appears: a mark with right gravity (the default) stays to the right " +"of such text." +msgstr "" + +#: ../../library/tkinter.rst:5160 +msgid "" +"Return the name of the first mark at or after *index*, or ``None`` if there " +"is none. When *index* is the name of a mark, the search starts just after " +"that mark." +msgstr "" + +#: ../../library/tkinter.rst:5167 +msgid "" +"Return the name of the last mark at or before *index*, or ``None`` if there " +"is none. When *index* is the name of a mark, the search starts just before " +"that mark." +msgstr "" + +#: ../../library/tkinter.rst:5174 +msgid "" +"Add the tag *tagName* to the range of characters from *index1* up to but not " +"including the next index in *args*. Further pairs of indices may follow in " +"*args* to tag additional ranges; a trailing single index tags just the " +"character at that index." +msgstr "" + +#: ../../library/tkinter.rst:5181 +msgid "" +"Remove the tag *tagName* from the characters from *index1* up to but not " +"including *index2* (or from the single character at *index1* if *index2* is " +"omitted). The tag itself continues to exist even if no characters carry it." +msgstr "" + +#: ../../library/tkinter.rst:5188 +msgid "" +"Delete each of the tags named in *tagNames*, removing them from all " +"characters and discarding their options and bindings." +msgstr "" + +#: ../../library/tkinter.rst:5196 +msgid "" +"Query or modify the configuration options of the tag *tagName*. This " +"mirrors :meth:`~Misc.configure`, except that it applies to a tag rather than " +"to the widget as a whole: with no options it returns a dictionary describing " +"the current options, otherwise it sets the given options. Defining a tag " +"this way also gives it a priority higher than any existing tag." +msgstr "" + +#: ../../library/tkinter.rst:5204 +msgid "" +"The supported tag options, all controlling the appearance of the tagged " +"text, are:" +msgstr "" + +#: ../../library/tkinter.rst:5210 +msgid "*foreground*" +msgstr "" + +#: ../../library/tkinter.rst:5211 +msgid "The color to use for the text." +msgstr "" + +#: ../../library/tkinter.rst:5213 +msgid "*background*" +msgstr "" + +#: ../../library/tkinter.rst:5214 +msgid "The color to use for the area behind the text." +msgstr "" + +#: ../../library/tkinter.rst:5216 +msgid "*fgstipple*, *bgstipple*" +msgstr "" + +#: ../../library/tkinter.rst:5217 +msgid "" +"Bitmaps used to stipple the foreground (text) and the background; only well " +"supported on X11." +msgstr "" + +#: ../../library/tkinter.rst:5220 +msgid "*borderwidth*" +msgstr "" + +#: ../../library/tkinter.rst:5221 +msgid "" +"The width of the border drawn around the text according to *relief* (default " +"``0``)." +msgstr "" + +#: ../../library/tkinter.rst:5224 +#, fuzzy +msgid "*relief*" +msgstr "relief" + +#: ../../library/tkinter.rst:5225 +msgid "" +"The 3-D appearance of the text's border: ``'flat'`` (the default), " +"``'raised'``, ``'sunken'``, ``'ridge'``, ``'groove'`` or ``'solid'``." +msgstr "" + +#: ../../library/tkinter.rst:5228 +msgid "*offset*" +msgstr "" + +#: ../../library/tkinter.rst:5229 +msgid "" +"How far the text is raised above (or, if negative, lowered below) the " +"baseline, for superscripts and subscripts." +msgstr "" + +#: ../../library/tkinter.rst:5233 +msgid "Whether to underline the text." +msgstr "" + +#: ../../library/tkinter.rst:5235 +msgid "*underlinefg*" +msgstr "" + +#: ../../library/tkinter.rst:5236 +msgid "The color of the underline; it defaults to the text color." +msgstr "" + +#: ../../library/tkinter.rst:5238 +msgid "*overstrike*" +msgstr "" + +#: ../../library/tkinter.rst:5239 +msgid "Whether to draw a line through the middle of the text." +msgstr "" + +#: ../../library/tkinter.rst:5241 +msgid "*overstrikefg*" +msgstr "" + +#: ../../library/tkinter.rst:5242 +msgid "The color of the overstrike line; it defaults to the text color." +msgstr "" + +#: ../../library/tkinter.rst:5244 +msgid "*elide*" +msgstr "" + +#: ../../library/tkinter.rst:5245 +msgid "Whether the text is elided (hidden)." +msgstr "" + +#: ../../library/tkinter.rst:5248 +msgid "" +"How to justify the first character of a display line: ``'left'`` (the " +"default), ``'right'`` or ``'center'``." +msgstr "" + +#: ../../library/tkinter.rst:5251 +#, fuzzy +msgid "*wrap*" +msgstr "wrap" + +#: ../../library/tkinter.rst:5252 +msgid "" +"How to wrap lines that are too long: ``'char'``, ``'word'`` or ``'none'``." +msgstr "" + +#: ../../library/tkinter.rst:5255 +msgid "*lmargin1*, *lmargin2*" +msgstr "" + +#: ../../library/tkinter.rst:5256 +msgid "" +"The indentation, in pixels, of the first display line of a logical line and " +"of the remaining display lines." +msgstr "" + +#: ../../library/tkinter.rst:5259 +msgid "*lmargincolor*" +msgstr "" + +#: ../../library/tkinter.rst:5260 +msgid "The color of the left margin area." +msgstr "" + +#: ../../library/tkinter.rst:5262 +msgid "*rmargin*" +msgstr "" + +#: ../../library/tkinter.rst:5263 +msgid "The right-hand margin, in pixels." +msgstr "" + +#: ../../library/tkinter.rst:5265 +msgid "*rmargincolor*" +msgstr "" + +#: ../../library/tkinter.rst:5266 +msgid "The color of the right margin area." +msgstr "" + +#: ../../library/tkinter.rst:5268 +msgid "*spacing1*, *spacing2*, *spacing3*" +msgstr "" + +#: ../../library/tkinter.rst:5269 +msgid "" +"Extra space, in pixels, above the first display line of a logical line, " +"between its display lines, and below its last display line." +msgstr "" + +#: ../../library/tkinter.rst:5272 +msgid "*tabs*" +msgstr "" + +#: ../../library/tkinter.rst:5273 +msgid "The set of tab stops, in the same form as the widget's *tabs* option." +msgstr "" + +#: ../../library/tkinter.rst:5275 +msgid "*tabstyle*" +msgstr "" + +#: ../../library/tkinter.rst:5276 +msgid "How tab stops are interpreted: ``'tabular'`` or ``'wordprocessor'``." +msgstr "" + +#: ../../library/tkinter.rst:5278 +msgid "*selectbackground*, *selectforeground*" +msgstr "" + +#: ../../library/tkinter.rst:5279 +msgid "" +"The background and foreground colors used for the text while it is selected." +msgstr "" + +#: ../../library/tkinter.rst:5284 +msgid "" +"Tk 8.6 added the *lmargincolor*, *overstrikefg*, *rmargincolor*, " +"*selectbackground*, *selectforeground* and *underlinefg* options." +msgstr "" + +#: ../../library/tkinter.rst:5287 +msgid ":meth:`tag_config` is an alias of :meth:`!tag_configure`." +msgstr "" + +#: ../../library/tkinter.rst:5291 +msgid "" +"Return the current value of the configuration option *option* for the tag " +"*tagName*." +msgstr "" + +#: ../../library/tkinter.rst:5296 +msgid "" +"If *index* is omitted, return a tuple of the names of all tags defined in " +"the widget; otherwise return only the names of the tags applied to the " +"character at *index*. The names are ordered from lowest to highest priority." +msgstr "" + +#: ../../library/tkinter.rst:5303 +msgid "" +"Return a tuple of indices describing all ranges of text tagged with " +"*tagName*. The result alternates start and end indices, so that elements " +"``2*i`` and ``2*i+1`` bound the *i*-th range." +msgstr "" + +#: ../../library/tkinter.rst:5310 +msgid "" +"Search forward from *index1* (up to *index2* if given) for the first range " +"of characters tagged with *tagName*, and return a two-element tuple of its " +"start and end indices, or an empty tuple if there is no such range." +msgstr "" + +#: ../../library/tkinter.rst:5317 +msgid "" +"Search backward from *index1* (down to *index2* if given) for the nearest " +"preceding range of characters tagged with *tagName*, and return a two-" +"element tuple of its start and end indices, or an empty tuple if there is no " +"such range." +msgstr "" + +#: ../../library/tkinter.rst:5324 +msgid "" +"Raise the priority of tag *tagName* so that it is just above the priority of " +"*aboveThis*, or to the highest priority of all tags if *aboveThis* is " +"omitted. When the display options of overlapping tags conflict, the higher-" +"priority tag wins." +msgstr "" + +#: ../../library/tkinter.rst:5332 +msgid "" +"Lower the priority of tag *tagName* so that it is just below the priority of " +"*belowThis*, or to the lowest priority of all tags if *belowThis* is omitted." +msgstr "" + +#: ../../library/tkinter.rst:5338 +msgid "" +"Bind the event *sequence* on characters tagged with *tagName* to the " +"callback *func*, so that *func* is invoked when that event occurs over such " +"a character. If *add* is true the binding is added alongside any existing " +"bindings for *sequence*, otherwise it replaces them. Works like :meth:`~Misc." +"bind` and returns the identifier of the new binding." +msgstr "" + +#: ../../library/tkinter.rst:5348 +msgid "" +"Remove the bindings of the event *sequence* on characters tagged with " +"*tagName*. If *funcid* is given, only that binding (as returned by :meth:" +"`tag_bind`) is removed and its callback is unregistered." +msgstr "" + +#: ../../library/tkinter.rst:5359 +msgid "" +"Embed an image at *index* and return the name assigned to this image " +"instance, which may then be used as an index or passed to the other " +"``image_*`` methods. The options, given in *cnf* and *kw*, include *image* " +"(the Tk image to display), *name* (a base name for the instance), *align*, " +"*padx* and *pady*." +msgstr "" + +#: ../../library/tkinter.rst:5368 +msgid "" +"Return the current value of the configuration option *option* for the " +"embedded image at *index*." +msgstr "" + +#: ../../library/tkinter.rst:5373 +msgid "" +"Query or modify the configuration options of the embedded image at *index*, " +"like :meth:`~Misc.configure` but applied to that image." +msgstr "" + +#: ../../library/tkinter.rst:5378 +msgid "Return a tuple of the names of all images embedded in the widget." +msgstr "" + +#: ../../library/tkinter.rst:5382 +msgid "" +"Embed a window (any widget) at *index*. The options, given in *cnf* and " +"*kw*, include *window* (the widget to embed), *create* (a callback that " +"creates the widget on demand), *align*, *stretch*, *padx* and *pady*. The " +"embedded widget must be a descendant of the text widget's parent." +msgstr "" + +#: ../../library/tkinter.rst:5390 +msgid "" +"Return the current value of the configuration option *option* for the " +"embedded window at *index*." +msgstr "" + +#: ../../library/tkinter.rst:5398 +msgid "" +"Query or modify the configuration options of the embedded window at *index*, " +"like :meth:`~Misc.configure` but applied to that window." +msgstr "" + +#: ../../library/tkinter.rst:5401 +msgid ":meth:`window_config` is an alias of :meth:`!window_configure`." +msgstr "" + +#: ../../library/tkinter.rst:5405 +msgid "Return a tuple of the names of all windows embedded in the widget." +msgstr "" + +#: ../../library/tkinter.rst:5409 +msgid "" +"Low-level wrapper around the Tk ``edit`` widget command that controls the " +"undo/redo mechanism and the modified flag; *args* is the ``edit`` subcommand " +"and its arguments. The :meth:`!edit_\\*` methods below are thin wrappers " +"around it and are usually more convenient." +msgstr "" + +#: ../../library/tkinter.rst:5417 +msgid "" +"If *arg* is omitted, return the current state of the modified flag as ``0`` " +"or ``1``; the flag is set automatically whenever the text is inserted or " +"deleted. Otherwise set the flag to the boolean *arg*." +msgstr "" + +#: ../../library/tkinter.rst:5424 +msgid "" +"Undo the most recent edit action, that is, all the inserts and deletes " +"recorded on the undo stack since the previous separator, and move it to the " +"redo stack. Raises :exc:`TclError` if the undo stack is empty. Has no effect " +"unless the *undo* option is true. Since Tk 9.0, returns a tuple of indices " +"delimiting the ranges of text that were changed." +msgstr "" + +#: ../../library/tkinter.rst:5434 +msgid "" +"Reapply the most recently undone edit action, provided no further edits have " +"been made since, and move it back to the undo stack. Raises :exc:`TclError` " +"if the redo stack is empty. Has no effect unless the *undo* option is true. " +"Since Tk 9.0, returns a tuple of indices delimiting the ranges of text that " +"were changed." +msgstr "" + +#: ../../library/tkinter.rst:5443 +msgid "Clear the undo and redo stacks." +msgstr "" + +#: ../../library/tkinter.rst:5447 +msgid "" +"Push a separator onto the undo stack, marking a boundary between edit " +"actions for undo and redo. Has no effect unless the *undo* option is true. " +"Separators are inserted automatically when the *autoseparators* option is " +"true." +msgstr "" + +#: ../../library/tkinter.rst:5455 +msgid "" +"Search for *pattern* starting at *index* and return the index of the first " +"character of the first match, or an empty string if there is no match. " +"Searching stops at *stopindex* if given; otherwise it wraps around the ends " +"of the text until the starting position is reached again. The following " +"boolean keyword flags control the search: *forwards* or *backwards* select " +"the direction (forward is the default); *exact* (the default) or *regexp* " +"select literal or regular-expression matching; *nocase* makes the match case-" +"insensitive; and *elide* causes hidden text to be searched as well. If " +"*count* is a :class:`Variable`, the number of index positions in the match " +"is stored in it." +msgstr "" + +#: ../../library/tkinter.rst:5477 +msgid "" +"Scroll the widget by 10 times the difference between *x*, *y* and the " +"coordinates passed to the last :meth:`scan_mark` call. This is typically " +"bound to mouse motion events, producing the effect of dragging the text at " +"high speed through the window." +msgstr "" + +#: ../../library/tkinter.rst:5484 +msgid "" +"If *boolean* is omitted, return whether internal consistency checks of the B-" +"tree data structure are enabled. Otherwise enable or disable them. The " +"setting is shared by all text widgets and may noticeably slow down widgets " +"holding large amounts of text." +msgstr "" + +#: ../../library/tkinter.rst:5492 +msgid "" +"Return the contents of the widget from *index1* up to but not including " +"*index2* (or just the segment at *index1* if *index2* is omitted), including " +"text and information about marks, tags, images and windows. The result is a " +"list of ``(key, value, index)`` triples, where *key* is one of ``'text'``, " +"``'mark'``, ``'tagon'``, ``'tagoff'``, ``'image'`` or ``'window'``. By " +"default all kinds are reported; passing any of the keyword arguments *all*, " +"*text*, *mark*, *tag*, *image* or *window* as true restricts the dump to the " +"selected kinds. If *command* is given, it is called once per triple with the " +"three values as arguments and nothing is returned." +msgstr "" + +#: ../../library/tkinter.rst:5506 +msgid "" +"Create a peer text widget with the path name *newPathName* that shares this " +"widget's underlying data (text, marks, tags, images and the undo stack). " +"Changes made through any peer are reflected in all of them. By default the " +"peer covers the same lines as this widget; standard text options, including " +"*startline* and *endline*, may be given to override this." +msgstr "" + +#: ../../library/tkinter.rst:5518 +msgid "" +"Return a tuple of the path names of this widget's peers, not including the " +"widget itself." +msgstr "" + +#: ../../library/tkinter.rst:5525 +msgid "" +"Adjust the view so that the location given by *what* is visible. This is an " +"obsolete equivalent of :meth:`see`, which should be used instead." +msgstr "" + +#: ../../library/tkinter.rst:5531 +msgid "Variable classes" +msgstr "" + +#: ../../library/tkinter.rst:5535 +msgid "" +"The base class for the Tk variable wrappers. A Tk variable is a value stored " +"in the Tcl interpreter that can be linked to widgets through their " +"*variable* or *textvariable* options (see :ref:`coupling-widget-variables`), " +"so that changes propagate both ways: updating the variable updates every " +"widget bound to it, and a user editing such a widget updates the variable." +msgstr "" + +#: ../../library/tkinter.rst:5542 +msgid "" +"*master* is the widget whose Tcl interpreter owns the variable; if omitted, " +"the default root window is used. *value* is the initial value; if omitted, a " +"type-specific default is used. *name* is the name of the variable in the Tcl " +"interpreter; if omitted, a unique name of the form ``'PY_VARnum'`` is " +"generated. If *name* matches an existing variable and *value* is omitted, " +"the existing value is retained." +msgstr "" + +#: ../../library/tkinter.rst:5550 +msgid "" +"In most cases you should use one of the typed subclasses below -- :class:" +"`StringVar`, :class:`IntVar`, :class:`DoubleVar` or :class:`BooleanVar` -- " +"rather than :class:`!Variable` directly." +msgstr "" + +#: ../../library/tkinter.rst:5554 +msgid "" +"Two variables now compare equal (``==``) only when they have the same name, " +"are of the same class, and belong to the same Tcl interpreter." +msgstr "" + +#: ../../library/tkinter.rst:5560 +msgid "" +"Return the current value of the variable. For the base class the value is " +"returned as a string; the typed subclasses convert it to the appropriate " +"Python type." +msgstr "" + +#: ../../library/tkinter.rst:5569 +msgid "Set the variable to *value*." +msgstr "" + +#: ../../library/tkinter.rst:5571 ../../library/tkinter.rst:5688 +msgid "The *initialize* spelling." +msgstr "" + +#: ../../library/tkinter.rst:5576 +msgid "" +"Register *callback* to be called when the variable is accessed according to " +"*mode*. *mode* is one of the strings ``'array'``, ``'read'``, ``'write'`` or " +"``'unset'``, or a list or tuple of such strings." +msgstr "" + +#: ../../library/tkinter.rst:5581 +msgid "" +"When triggered, *callback* is called with three arguments: the name of the " +"Tcl variable, an index (or an empty string if the variable is not an element " +"of an array), and the *mode* that triggered the call." +msgstr "" + +#: ../../library/tkinter.rst:5585 +msgid "" +"Return the internal name of the registered callback, which can be passed to :" +"meth:`trace_remove`." +msgstr "" + +#: ../../library/tkinter.rst:5592 +msgid "" +"Remove a trace callback from the variable. *mode* must match the *mode* that " +"was passed to :meth:`trace_add`, and *cbname* is the callback name returned " +"by :meth:`trace_add`." +msgstr "" + +#: ../../library/tkinter.rst:5600 +msgid "" +"Return a list of ``(modes, cbname)`` pairs describing all traces currently " +"set on the variable, where *modes* is a tuple of mode strings and *cbname* " +"is the internal callback name." +msgstr "" + +#: ../../library/tkinter.rst:5611 +msgid "" +"Register *callback* to be called when the variable is accessed according to " +"*mode*. *mode* is one of the strings ``'r'``, ``'w'`` or ``'u'``, for read, " +"write or unset. Return the internal name of the registered callback." +msgstr "" + +#: ../../library/tkinter.rst:5617 +msgid "" +"Use :meth:`trace_add` instead. This method wraps a Tcl feature that was " +"removed in Tcl 9.0." +msgstr "" + +#: ../../library/tkinter.rst:5623 +msgid "" +"Remove the trace callback named *cbname* registered for *mode* with :meth:" +"`trace_variable`." +msgstr "" + +#: ../../library/tkinter.rst:5626 +msgid "" +"Use :meth:`trace_remove` instead. This method wraps a Tcl feature that was " +"removed in Tcl 9.0." +msgstr "" + +#: ../../library/tkinter.rst:5632 +msgid "" +"Return a list of ``(mode, cbname)`` pairs for all traces set on the variable " +"with :meth:`trace_variable`." +msgstr "" + +#: ../../library/tkinter.rst:5635 +msgid "" +"Use :meth:`trace_info` instead. This method wraps a Tcl feature that was " +"removed in Tcl 9.0." +msgstr "" + +#: ../../library/tkinter.rst:5642 +msgid "" +"A :class:`Variable` subclass that holds a string. The default value is " +"``''``." +msgstr "" + +#: ../../library/tkinter.rst:5647 +msgid "Return the value of the variable as a :class:`str`." +msgstr "" + +#: ../../library/tkinter.rst:5652 +msgid "" +"A :class:`Variable` subclass that holds an integer. The default value is " +"``0``." +msgstr "" + +#: ../../library/tkinter.rst:5657 +msgid "Return the value of the variable as an :class:`int`." +msgstr "" + +#: ../../library/tkinter.rst:5662 +msgid "" +"A :class:`Variable` subclass that holds a float. The default value is " +"``0.0``." +msgstr "" + +#: ../../library/tkinter.rst:5667 +msgid "Return the value of the variable as a :class:`float`." +msgstr "" + +#: ../../library/tkinter.rst:5672 +msgid "" +"A :class:`Variable` subclass that holds a boolean. The default value is " +"``False``." +msgstr "" + +#: ../../library/tkinter.rst:5677 +msgid "" +"Return the value of the variable as a :class:`bool`. Raise a :exc:" +"`ValueError` if the value cannot be interpreted as a boolean." +msgstr "" + +#: ../../library/tkinter.rst:5686 +msgid "Set the variable to *value*, converting it to a boolean." +msgstr "" + +#: ../../library/tkinter.rst:5693 +#, fuzzy +msgid "Image classes" +msgstr "圖片" + +#: ../../library/tkinter.rst:5697 +msgid "" +"Base class for Tk images. *imgtype* is the Tk image type, one of ``'photo'`` " +"or ``'bitmap'``. An image is a named object that can be displayed by widgets " +"through their *image* option; deleting all references to the :class:`!Image` " +"object deletes the underlying Tk image. Usually you create a :class:" +"`PhotoImage` or :class:`BitmapImage` rather than an :class:`!Image` directly." +msgstr "" + +#: ../../library/tkinter.rst:5705 +msgid "" +"The image's configuration options are given by *cnf* and *kw* and may be " +"queried and changed later with the mapping protocol (using ``image[key]``) " +"or with the :meth:`configure` method." +msgstr "" + +#: ../../library/tkinter.rst:5714 +msgid "" +"Modify one or more configuration options of the image. The valid options " +"depend on the image type; see :class:`PhotoImage` and :class:`BitmapImage`. :" +"meth:`config` is an alias of :meth:`!configure`." +msgstr "" + +#: ../../library/tkinter.rst:5721 +msgid "Return the height of the image, in pixels." +msgstr "" + +#: ../../library/tkinter.rst:5725 +msgid "Return the width of the image, in pixels." +msgstr "" + +#: ../../library/tkinter.rst:5729 +msgid "" +"Return the type of the image, that is the value of *imgtype* with which it " +"was created (for example ``'photo'`` or ``'bitmap'``)." +msgstr "" + +#: ../../library/tkinter.rst:5735 +msgid "" +"A full-color image (the Tk ``photo`` image type), stored internally with a " +"varying degree of transparency per pixel. It can read and write GIF, PPM/PGM " +"and (in Tk 8.6 and later) PNG files, read SVG files (in Tk 9.0 and later), " +"and be drawn in widgets. Inherits from :class:`Image`." +msgstr "" + +#: ../../library/tkinter.rst:5741 +msgid "" +"The configuration options include *data* (the image contents as a string), " +"*file* (the name of a file to read the contents from), *format* (the name of " +"the file format handler), *width* and *height* (the size of the image, used " +"when building it up piece by piece), *gamma* and *palette*." +msgstr "" + +#: ../../library/tkinter.rst:5748 +msgid "" +"Blank the image; that is, set the entire image to have no data, so that it " +"is displayed as transparent and the background of whatever window it is " +"displayed in shows through." +msgstr "" + +#: ../../library/tkinter.rst:5754 +msgid "Return the current value of the configuration option *option*." +msgstr "" + +#: ../../library/tkinter.rst:5758 +msgid "Return a new :class:`PhotoImage` with a copy of this image." +msgstr "" + +#: ../../library/tkinter.rst:5760 +msgid "" +"*from_coords* specifies a rectangular sub-region of the source image to be " +"copied. It must be a tuple or a list of 1 to 4 integers ``(x1, y1, x2, " +"y2)``. ``(x1, y1)`` and ``(x2, y2)`` specify diagonally opposite corners of " +"the rectangle. If *x2* and *y2* are not specified, they default to the " +"bottom-right corner of the source image. The pixels copied include the left " +"and top edges of the rectangle but not the bottom or right edges. If " +"*from_coords* is not given, the whole source image is copied." +msgstr "" + +#: ../../library/tkinter.rst:5771 ../../library/tkinter.rst:5803 +msgid "" +"If *zoom* or *subsample* are specified, the image is transformed as in the :" +"meth:`zoom` or :meth:`subsample` methods. The value must be a single integer " +"or a pair of integers." +msgstr "" + +#: ../../library/tkinter.rst:5775 +msgid "Added the *from_coords*, *zoom* and *subsample* parameters." +msgstr "" + +#: ../../library/tkinter.rst:5783 +msgid "" +"Copy a region from *sourceImage* (which must be a :class:`PhotoImage`) into " +"this image, possibly with pixel zooming and/or subsampling. If no options " +"are specified, the whole of *sourceImage* is copied into this image, " +"starting at coordinates ``(0, 0)``." +msgstr "" + +#: ../../library/tkinter.rst:5788 ../../library/tkinter.rst:5900 +#: ../../library/tkinter.rst:5956 +msgid "" +"*from_coords* specifies a rectangular sub-region of the source image to be " +"copied, as in the :meth:`copy` method." +msgstr "" + +#: ../../library/tkinter.rst:5791 +msgid "" +"*to* specifies a rectangular sub-region of the destination image to be " +"affected. It must be a tuple or a list of 1 to 4 integers ``(x1, y1, x2, " +"y2)``. If *x2* and *y2* are not specified, they default to ``(x1, y1)`` plus " +"the size of the source region (after subsampling and zooming, if specified). " +"If *x2* and *y2* are specified, the source region is replicated if necessary " +"to fill the destination region in a tiled fashion." +msgstr "" + +#: ../../library/tkinter.rst:5799 +msgid "" +"If *shrink* is true, the size of the destination image is reduced, if " +"necessary, so that the region being copied into is at the bottom-right " +"corner of the image." +msgstr "" + +#: ../../library/tkinter.rst:5807 +msgid "" +"*compositingrule* specifies how transparent pixels in the source image are " +"combined with the destination image. With ``'overlay'`` (the default), the " +"old contents of the destination image remain visible, as if the source image " +"were printed on a piece of transparent film and placed over the top of the " +"destination. With ``'set'``, the old contents of the destination image are " +"discarded and the source image is used as-is." +msgstr "" + +#: ../../library/tkinter.rst:5821 +msgid "Return the image data." +msgstr "" + +#: ../../library/tkinter.rst:5823 +msgid "" +"*format* specifies the name of the image file format handler to use. If it " +"is not given, the data is returned as a tuple (one element per row) of " +"strings containing space-separated (one element per pixel/column) colors in " +"``#RRGGBB`` format." +msgstr "" + +#: ../../library/tkinter.rst:5828 +msgid "" +"*from_coords* specifies a rectangular region of the image to be returned. It " +"must be a tuple or a list of 1 to 4 integers ``(x1, y1, x2, y2)``. If only " +"*x1* and *y1* are specified, the region extends from ``(x1, y1)`` to the " +"bottom-right corner of the image. If all four coordinates are given, they " +"specify diagonally opposite corners of the region, including ``(x1, y1)`` " +"and excluding ``(x2, y2)``. If *from_coords* is not given, the whole image " +"is returned." +msgstr "" + +#: ../../library/tkinter.rst:5836 ../../library/tkinter.rst:5939 +msgid "" +"If *background* is specified, the data does not contain any transparency " +"information; in all transparent pixels the color is replaced by the " +"specified color." +msgstr "" + +#: ../../library/tkinter.rst:5840 ../../library/tkinter.rst:5943 +msgid "" +"If *grayscale* is true, the data does not contain color information; all " +"pixel data is transformed into grayscale." +msgstr "" + +#: ../../library/tkinter.rst:5848 +msgid "" +"Return the color of the pixel at coordinates (*x*, *y*) as an ``(r, g, b)`` " +"tuple of three integers between 0 and 255, representing the red, green and " +"blue components respectively." +msgstr "" + +#: ../../library/tkinter.rst:5854 +msgid "" +"Set pixels of the image to the colors given in *data*, which must be a " +"string or a nested sequence of horizontal rows of pixel colors (for example " +"``\"{red green} {blue yellow}\"``)." +msgstr "" + +#: ../../library/tkinter.rst:5858 +msgid "" +"*to* specifies the coordinates of the region of the image into which the " +"data are copied. It must be a tuple or a list of 2 or 4 integers ``(x1, " +"y1)`` or ``(x1, y1, x2, y2)`` giving the top-left corner, and optionally the " +"bottom-right corner, of the region. The default position is ``(0, 0)``." +msgstr "" + +#: ../../library/tkinter.rst:5868 +msgid "Read image data from the file named *filename* into the image." +msgstr "" + +#: ../../library/tkinter.rst:5870 +msgid "*format* specifies the format of the image data in the file." +msgstr "" + +#: ../../library/tkinter.rst:5872 +msgid "" +"*from_coords* specifies a rectangular sub-region of the image file data to " +"be copied to the destination image. It must be a tuple or a list of 1 to 4 " +"integers ``(x1, y1, x2, y2)``. If only *x1* and *y1* are specified, the " +"region extends from ``(x1, y1)`` to the bottom-right corner of the image in " +"the file. If all four coordinates are given, they specify diagonally " +"opposite corners of the region. If *from_coords* is not given, the whole of " +"the image in the file is read." +msgstr "" + +#: ../../library/tkinter.rst:5882 +msgid "" +"*to* specifies the coordinates of the top-left corner of the region of the " +"image into which the data are read. The default is ``(0, 0)``." +msgstr "" + +#: ../../library/tkinter.rst:5886 +msgid "" +"If *shrink* is true, the size of the image is reduced, if necessary, so that " +"the region into which the file data are read is at the bottom-right corner " +"of the image." +msgstr "" + +#: ../../library/tkinter.rst:5895 +msgid "" +"Return a new :class:`PhotoImage` based on this image but using only every " +"*x*-th pixel in the X direction and every *y*-th pixel in the Y direction. " +"If *y* is not given, it defaults to the same value as *x*." +msgstr "" + +#: ../../library/tkinter.rst:5903 ../../library/tkinter.rst:5959 +msgid "Added the *from_coords* parameter." +msgstr "" + +#: ../../library/tkinter.rst:5909 +msgid "" +"Return ``True`` if the pixel at coordinates (*x*, *y*) is fully transparent, " +"``False`` otherwise." +msgstr "" + +#: ../../library/tkinter.rst:5917 +msgid "" +"Make the pixel at coordinates (*x*, *y*) fully transparent if *boolean* is " +"true, fully opaque otherwise." +msgstr "" + +#: ../../library/tkinter.rst:5926 +msgid "Write image data from the image to the file named *filename*." +msgstr "" + +#: ../../library/tkinter.rst:5928 +msgid "" +"*format* specifies the name of the image file format handler to use. If it " +"is not given, the format is guessed from the file extension." +msgstr "" + +#: ../../library/tkinter.rst:5931 +msgid "" +"*from_coords* specifies a rectangular region of the image to be written. It " +"must be a tuple or a list of 1 to 4 integers ``(x1, y1, x2, y2)``. If only " +"*x1* and *y1* are specified, the region extends from ``(x1, y1)`` to the " +"bottom-right corner of the image. If all four coordinates are given, they " +"specify diagonally opposite corners of the region. If *from_coords* is not " +"given, the whole image is written." +msgstr "" + +#: ../../library/tkinter.rst:5946 +msgid "Added the *background* and *grayscale* parameters." +msgstr "" + +#: ../../library/tkinter.rst:5952 +msgid "" +"Return a new :class:`PhotoImage` with this image magnified by a factor of " +"*x* in the X direction and *y* in the Y direction. If *y* is not given, it " +"defaults to the same value as *x*." +msgstr "" + +#: ../../library/tkinter.rst:5966 +msgid "" +"A two-color image (the Tk ``bitmap`` image type) created from an X11 bitmap. " +"Each pixel displays a foreground color, a background color, or nothing " +"(producing a transparent effect). Inherits from :class:`Image`." +msgstr "" + +#: ../../library/tkinter.rst:5971 +msgid "" +"The configuration options are *data* or *file* (the source bitmap, given as " +"a string in X11 bitmap format or as the name of a file in that format), " +"*maskdata* or *maskfile* (the mask bitmap, in the same forms), and " +"*foreground* and *background* (the two colors). For pixels where the mask is " +"zero the image displays nothing; for other pixels it displays the foreground " +"color where the source is one and the background color where the source is " +"zero. If *background* is set to an empty string, the background pixels are " +"transparent." +msgstr "" + +#: ../../library/tkinter.rst:5981 +msgid "" +":class:`!BitmapImage` has no methods of its own beyond those inherited from :" +"class:`Image`." +msgstr "" + +#: ../../library/tkinter.rst:5986 +msgid "Other classes" +msgstr "" + +#: ../../library/tkinter.rst:5990 +msgid "" +"A container for the attributes of an event passed to a callback bound with :" +"meth:`Misc.bind`. An :class:`!Event` instance has the following attributes, " +"each corresponding to a field of the underlying Tk event; depending on the " +"event type, some attributes may be set to the string ``'??'`` to indicate " +"that they are not meaningful. See :ref:`bindings-and-events`." +msgstr "" + +#: ../../library/tkinter.rst:6000 +msgid "The serial number of the event." +msgstr "" + +#: ../../library/tkinter.rst:6004 +msgid "The mouse button that was pressed or released (for button events)." +msgstr "" + +#: ../../library/tkinter.rst:6008 +msgid "Whether the window has the focus (for ``Enter`` and ``Leave`` events)." +msgstr "" + +#: ../../library/tkinter.rst:6013 +msgid "" +"The new height and width of the window (for ``Configure`` and ``Expose`` " +"events)." +msgstr "" + +#: ../../library/tkinter.rst:6018 +msgid "The keycode of the key that was pressed or released." +msgstr "" + +#: ../../library/tkinter.rst:6022 +msgid "" +"The state of the event, as a number (for most events) or a string (for " +"``Visibility`` events)." +msgstr "" + +#: ../../library/tkinter.rst:6027 +msgid "The timestamp of the event, in milliseconds." +msgstr "" + +#: ../../library/tkinter.rst:6032 +msgid "The pointer position relative to the widget, in pixels." +msgstr "" + +#: ../../library/tkinter.rst:6037 +msgid "" +"The pointer position relative to the top-left corner of the screen, in " +"pixels." +msgstr "" + +#: ../../library/tkinter.rst:6042 +msgid "The character typed, as a string (for key events)." +msgstr "" + +#: ../../library/tkinter.rst:6046 +msgid "``True`` if the event was sent by another application." +msgstr "" + +#: ../../library/tkinter.rst:6050 +msgid "The symbolic name of the key that was pressed or released." +msgstr "" + +#: ../../library/tkinter.rst:6054 +msgid "The numeric value of :attr:`keysym`." +msgstr "" + +#: ../../library/tkinter.rst:6058 +msgid "The :class:`EventType` of the event." +msgstr "" + +#: ../../library/tkinter.rst:6062 +msgid "The widget on which the event occurred." +msgstr "" + +#: ../../library/tkinter.rst:6066 +msgid "The amount the mouse wheel was rotated (for ``MouseWheel`` events)." +msgstr "" + +#: ../../library/tkinter.rst:6071 +msgid "" +"An :class:`enum.StrEnum` enumerating the Tk event types, used as the value " +"of :attr:`Event.type`. Its members include, among others, ``KeyPress``, " +"``KeyRelease``, ``ButtonPress``, ``ButtonRelease``, ``Motion``, ``Enter``, " +"``Leave``, ``FocusIn``, ``FocusOut``, ``Configure``, ``Map``, ``Unmap``, " +"``Expose``, ``Destroy`` and ``MouseWheel``." +msgstr "" + +#: ../../library/tkinter.rst:6084 +msgid "" +"Internal helper that wraps a Python callback so that it can be invoked from " +"Tcl. *func* is the Python function, *subst* is an optional function that pre-" +"processes the Tcl arguments, and *widget* is the widget used for error " +"reporting. Instances are created automatically by :meth:`Misc.register`; " +"this class is not normally used directly." +msgstr "" + +#: ../../library/tkinter.rst:6094 +msgid "Module-level functions" +msgstr "" + +#: ../../library/tkinter.rst:6098 +msgid "" +"Inhibit the creation of an implicit default root window. Afterwards :mod:`!" +"tkinter` no longer creates a shared default root automatically, and " +"operations that rely on one --- such as constructing a widget without an " +"explicit *master* --- raise a :exc:`RuntimeError`. Call this early in larger " +"applications to make the root window explicit." +msgstr "" + +#: ../../library/tkinter.rst:6106 +msgid "" +"Run the Tk main event loop on the default root window until all windows are " +"destroyed. Equivalent to calling :meth:`Misc.mainloop` on the default root." +msgstr "" + +#: ../../library/tkinter.rst:6112 +msgid "" +"Convert the Tcl boolean string *s* (one of ``'1'``, ``'true'``, ``'yes'``, " +"``'on'`` and similar, or their false counterparts) to a Python :class:" +"`bool`. Raise :exc:`TclError` for an invalid value." +msgstr "" + +#: ../../library/tkinter.rst:6119 +msgid "" +"Convert *s* to a floating-point number. This is the built-in :class:`float`." +msgstr "" + +#: ../../library/tkinter.rst:6124 +msgid "Convert *s* to an integer. This is the built-in :class:`int`." +msgstr "" + +#: ../../library/tkinter.rst:6129 +msgid "" +"Return the names of all existing images in the default root's interpreter." +msgstr "" + +#: ../../library/tkinter.rst:6133 +msgid "" +"Return the available image types (such as ``'photo'`` and ``'bitmap'``) in " +"the default root's interpreter." +msgstr "" + +#: ../../library/tkinter.rst:6137 +msgid "Constants" +msgstr "" + +#: ../../library/tkinter.rst:6139 +msgid "" +"The following symbolic constants are available in both the :mod:`!tkinter` " +"and :mod:`!tkinter.constants` namespaces." +msgstr "" + +#: ../../library/tkinter.rst:6146 +msgid "Truthy values, all equal to the integer ``1``." +msgstr "" + +#: ../../library/tkinter.rst:6152 +msgid "Falsy values, all equal to the integer ``0``." +msgstr "" + +#: ../../library/tkinter.rst:6167 +msgid "" +"Compass directions (``'n'``, ``'s'``, ``'e'``, ``'w'`` and the diagonals and " +"edges) plus ``CENTER`` (``'center'``), used as values for the *anchor* and " +"*sticky* options and by methods such as :meth:`Misc.grid_anchor`." +msgstr "" + +#: ../../library/tkinter.rst:6176 +msgid "" +"Sides for the *side* option of the packer (see :meth:`Pack.pack_configure`)." +msgstr "" + +#: ../../library/tkinter.rst:6183 +#, fuzzy +msgid "" +"Values for the *fill* option of the packer: ``'x'``, ``'y'``, ``'both'`` or " +"``'none'``." +msgstr "合法值:``'x'``、``'y'``、``'both'``、``'none'``。" + +#: ../../library/tkinter.rst:6193 +msgid "Values for the *relief* option, which controls a widget's 3-D border." +msgstr "" + +#: ../../library/tkinter.rst:6198 +msgid "" +"Values for the *orient* option of widgets such as :class:`Scale`, :class:" +"`Scrollbar` and :class:`PanedWindow`." +msgstr "" + +#: ../../library/tkinter.rst:6204 +msgid "" +"Values for the *wrap* option of the :class:`Text` widget, selecting line " +"wrapping on character or word boundaries." +msgstr "" + +#: ../../library/tkinter.rst:6209 +msgid "The text-alignment value ``'baseline'``." +msgstr "" + +#: ../../library/tkinter.rst:6214 +msgid "" +"Values for the *bordermode* option of the placer (see :meth:`Place." +"place_configure`)." +msgstr "" + +#: ../../library/tkinter.rst:6225 +msgid "" +"Symbolic indices used by the :class:`Text`, :class:`Entry`, :class:`Listbox` " +"and :class:`Canvas` widgets, such as ``'insert'`` (the insertion cursor), " +"``'current'``, ``'end'``, ``'anchor'`` and the bounds of the selection " +"(``'sel.first'`` and ``'sel.last'``)." +msgstr "" + +#: ../../library/tkinter.rst:6232 +msgid "" +"The special tag ``'all'``, which matches every item of a :class:`Canvas` or " +"every character of a :class:`Text` (for example ``canvas.delete(ALL)``)." +msgstr "" + +#: ../../library/tkinter.rst:6240 +msgid "Values for the *state* option of various widgets and items." +msgstr "" + +#: ../../library/tkinter.rst:6248 +msgid "" +"Menu entry types, used as the *itemType* argument of :meth:`Menu.add` and :" +"meth:`Menu.insert`." +msgstr "" + +#: ../../library/tkinter.rst:6256 +msgid "Values for the *selectmode* option of the :class:`Listbox` widget." +msgstr "" + +#: ../../library/tkinter.rst:6262 +msgid "Values for the *style* option of :class:`Canvas` arc items." +msgstr "" + +#: ../../library/tkinter.rst:6270 +msgid "" +"Values for the *capstyle* (``'butt'``, ``'projecting'``, ``'round'``) and " +"*joinstyle* (``'round'``, ``'bevel'``, ``'miter'``) options of :class:" +"`Canvas` line items." +msgstr "" + +#: ../../library/tkinter.rst:6277 +msgid "" +"Values for the *arrow* option of :class:`Canvas` line items, indicating " +"which ends have arrowheads." +msgstr "" + +#: ../../library/tkinter.rst:6283 +msgid "" +"The first argument passed by a :class:`Scrollbar` to the :meth:`XView.xview` " +"or :meth:`YView.yview` method of the scrolled widget." +msgstr "" + +#: ../../library/tkinter.rst:6289 +msgid "" +"Values for the *what* argument of :meth:`XView.xview_scroll` and :meth:" +"`YView.yview_scroll`." +msgstr "" + +#: ../../library/tkinter.rst:6296 +msgid "Other option values: ``'underline'``, ``'numeric'`` and ``'dotbox'``." +msgstr "" + +#: ../../library/tkinter.rst:689 +msgid "packing (widgets)" +msgstr "packing(元件)" + +#: ../../library/tkinter.rst:806 +msgid "window manager (widgets)" +msgstr "視窗管理器(元件)" + +#: ../../library/tkinter.rst:852 +msgid "Tk Option Data Types" +msgstr "Tk 選項資料型別" + +#: ../../library/tkinter.rst:931 +msgid "bind (widgets)" +msgstr "bind(元件)" + +#: ../../library/tkinter.rst:931 msgid "events (widgets)" msgstr "事件(元件)" diff --git a/library/tkinter.scrolledtext.po b/library/tkinter.scrolledtext.po index a311bc6cd8..f7fbdf7d15 100644 --- a/library/tkinter.scrolledtext.po +++ b/library/tkinter.scrolledtext.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-20 00:18+0000\n" +"POT-Creation-Date: 2026-06-19 00:50+0000\n" "PO-Revision-Date: 2016-11-19 00:35+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -18,7 +18,8 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/tkinter.scrolledtext.rst:2 -msgid ":mod:`!tkinter.scrolledtext` --- Scrolled Text Widget" +#, fuzzy +msgid ":mod:`!tkinter.scrolledtext` --- Scrolled text widget" msgstr ":mod:`!tkinter.scrolledtext` --- 捲動文字小工具" #: ../../library/tkinter.scrolledtext.rst:9 @@ -35,23 +36,23 @@ msgstr "" #: ../../library/tkinter.scrolledtext.rst:18 msgid "" -"The text widget and scrollbar are packed together in a :class:`Frame`, and " -"the methods of the :class:`Grid` and :class:`Pack` geometry managers are " -"acquired from the :class:`Frame` object. This allows the :class:" -"`ScrolledText` widget to be used directly to achieve most normal geometry " -"management behavior." +"The text widget and scrollbar are packed together in a :class:`~tkinter." +"Frame`, and the methods of the :class:`~tkinter.Pack`, :class:`~tkinter." +"Grid` and :class:`~tkinter.Place` geometry managers are acquired from the :" +"class:`~tkinter.Frame` object. This allows the :class:`ScrolledText` widget " +"to be used directly to achieve most normal geometry management behavior." msgstr "" -#: ../../library/tkinter.scrolledtext.rst:23 +#: ../../library/tkinter.scrolledtext.rst:25 msgid "" "Should more specific control be necessary, the following attributes are " "available:" msgstr "" -#: ../../library/tkinter.scrolledtext.rst:31 +#: ../../library/tkinter.scrolledtext.rst:33 msgid "The frame which surrounds the text and scroll bar widgets." msgstr "" -#: ../../library/tkinter.scrolledtext.rst:36 +#: ../../library/tkinter.scrolledtext.rst:38 msgid "The scroll bar widget." msgstr "" diff --git a/library/tkinter.ttk.po b/library/tkinter.ttk.po index e04659572c..dfa2fefb0c 100644 --- a/library/tkinter.ttk.po +++ b/library/tkinter.ttk.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-07 00:19+0000\n" +"POT-Creation-Date: 2026-06-19 00:50+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,33 +40,33 @@ msgid "" "implementing its appearance." msgstr "" -#: ../../library/tkinter.ttk.rst:27 +#: ../../library/tkinter.ttk.rst:29 msgid "" "`Tk Widget Styling Support `_" msgstr "" -#: ../../library/tkinter.ttk.rst:28 +#: ../../library/tkinter.ttk.rst:30 msgid "A document introducing theming support for Tk" msgstr "" -#: ../../library/tkinter.ttk.rst:32 +#: ../../library/tkinter.ttk.rst:34 msgid "Using Ttk" msgstr "使用 Ttk" -#: ../../library/tkinter.ttk.rst:34 +#: ../../library/tkinter.ttk.rst:36 msgid "To start using Ttk, import its module::" msgstr "" -#: ../../library/tkinter.ttk.rst:36 +#: ../../library/tkinter.ttk.rst:38 msgid "from tkinter import ttk" msgstr "from tkinter import ttk" -#: ../../library/tkinter.ttk.rst:38 +#: ../../library/tkinter.ttk.rst:40 msgid "" "To override the basic Tk widgets, the import should follow the Tk import::" msgstr "" -#: ../../library/tkinter.ttk.rst:40 +#: ../../library/tkinter.ttk.rst:42 msgid "" "from tkinter import *\n" "from tkinter.ttk import *" @@ -74,7 +74,7 @@ msgstr "" "from tkinter import *\n" "from tkinter.ttk import *" -#: ../../library/tkinter.ttk.rst:43 +#: ../../library/tkinter.ttk.rst:45 msgid "" "That code causes several :mod:`!tkinter.ttk` widgets (:class:`Button`, :" "class:`Checkbutton`, :class:`Entry`, :class:`Frame`, :class:`Label`, :class:" @@ -83,33 +83,34 @@ msgid "" "replace the Tk widgets." msgstr "" -#: ../../library/tkinter.ttk.rst:49 +#: ../../library/tkinter.ttk.rst:51 msgid "" "This has the direct benefit of using the new widgets which gives a better " "look and feel across platforms; however, the replacement widgets are not " "completely compatible. The main difference is that widget options such as " "\"fg\", \"bg\" and others related to widget styling are no longer present in " -"Ttk widgets. Instead, use the :class:`ttk.Style` class for improved " +"Ttk widgets. Instead, use the :class:`ttk.Style