diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5adceaf466..74feaecdce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/setup-python@v6 with: - python-version: "3.14" + python-version: "3.13" - name: Install Dependencies run: sudo apt-get install gettext diff --git a/c-api/hash.po b/c-api/hash.po index 780b001cbb..cbd53b8163 100644 --- a/c-api/hash.po +++ b/c-api/hash.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2024-04-30 00:20+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -62,6 +62,10 @@ msgstr "用於複數虛數部分的乘數。" msgid "Hash function definition used by :c:func:`PyHash_GetFuncDef`." msgstr ":c:func:`PyHash_GetFuncDef` 所使用的雜湊函式定義。" +#: ../../c-api/hash.rst:56 +msgid "Hash function." +msgstr "雜湊函式。" + #: ../../c-api/hash.rst:60 msgid "Hash function name (UTF-8 encoded string)." msgstr "雜湊函式名稱(UTF-8 編碼字串)。" @@ -99,16 +103,15 @@ msgstr "此函式不會失敗:它不會回傳 ``-1``。" #: ../../c-api/hash.rst:95 msgid "" "Compute and return the hash value of a buffer of *len* bytes starting at " -"address *ptr*. The hash is guaranteed to match that " -"of :class:`bytes`, :class:`memoryview`, and other built-in objects that " -"implement the :ref:`buffer protocol `." +"address *ptr*. The hash is guaranteed to match that of :class:`bytes`, :" +"class:`memoryview`, and other built-in objects that implement the :ref:" +"`buffer protocol `." msgstr "" #: ../../c-api/hash.rst:100 msgid "" -"Use this function to implement hashing for immutable objects " -"whose :c:member:`~PyTypeObject.tp_richcompare` function compares to another " -"object's buffer." +"Use this function to implement hashing for immutable objects whose :c:member:" +"`~PyTypeObject.tp_richcompare` function compares to another object's buffer." msgstr "" #: ../../c-api/hash.rst:104 diff --git a/c-api/init.po b/c-api/init.po index 771928aae5..3b5b946f41 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2023-04-24 20:49+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -205,8 +205,10 @@ msgstr ":c:func:`PyMutex_Unlock`" msgid "" "Despite their apparent similarity to some of the functions listed above, the " "following functions **should not be called** before the interpreter has been " -"initialized: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`, :c:func:`Py_GetProgramName`, :c:func:`PyEval_InitThreads`, " -"and :c:func:`Py_RunMain`." +"initialized: :c:func:`Py_EncodeLocale`, :c:func:`Py_GetPath`, :c:func:" +"`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:func:" +"`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome`, :c:func:" +"`Py_GetProgramName`, :c:func:`PyEval_InitThreads`, and :c:func:`Py_RunMain`." msgstr "" #: ../../c-api/init.rst:90 @@ -216,30 +218,30 @@ msgstr "" #: ../../c-api/init.rst:92 msgid "" "Python has variables for the global configuration to control different " -"features and options. By default, these flags are controlled " -"by :ref:`command line options `." +"features and options. By default, these flags are controlled by :ref:" +"`command line options `." msgstr "" #: ../../c-api/init.rst:96 msgid "" "When a flag is set by an option, the value of the flag is the number of " -"times that the option was set. For example, ``-b`` " -"sets :c:data:`Py_BytesWarningFlag` to 1 and ``-bb`` " -"sets :c:data:`Py_BytesWarningFlag` to 2." +"times that the option was set. For example, ``-b`` sets :c:data:" +"`Py_BytesWarningFlag` to 1 and ``-bb`` sets :c:data:`Py_BytesWarningFlag` to " +"2." msgstr "" #: ../../c-api/init.rst:102 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.bytes_warning` should be used instead, " -"see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"bytes_warning` should be used instead, see :ref:`Python Initialization " +"Configuration `." msgstr "" #: ../../c-api/init.rst:106 msgid "" -"Issue a warning when comparing :class:`bytes` or :class:`bytearray` " -"with :class:`str` or :class:`bytes` with :class:`int`. Issue an error if " -"greater or equal to ``2``." +"Issue a warning when comparing :class:`bytes` or :class:`bytearray` with :" +"class:`str` or :class:`bytes` with :class:`int`. Issue an error if greater " +"or equal to ``2``." msgstr "" #: ../../c-api/init.rst:110 @@ -248,9 +250,9 @@ msgstr "由 :option:`-b` 選項設定。" #: ../../c-api/init.rst:116 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.parser_debug` should be used instead, " -"see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"parser_debug` should be used instead, see :ref:`Python Initialization " +"Configuration `." msgstr "" #: ../../c-api/init.rst:120 @@ -267,9 +269,9 @@ msgstr "由 :option:`-d` 選項與 :envvar:`PYTHONDEBUG` 環境變數設定。" #: ../../c-api/init.rst:130 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.write_bytecode` should be used instead, " -"see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"write_bytecode` should be used instead, see :ref:`Python Initialization " +"Configuration `." msgstr "" #: ../../c-api/init.rst:134 @@ -287,15 +289,15 @@ msgstr "" #: ../../c-api/init.rst:144 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.pathconfig_warnings` should be used instead, " -"see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"pathconfig_warnings` should be used instead, see :ref:`Python Initialization " +"Configuration `." msgstr "" #: ../../c-api/init.rst:148 msgid "" -"Suppress error messages when calculating the module search path " -"in :c:func:`Py_GetPath`." +"Suppress error messages when calculating the module search path in :c:func:" +"`Py_GetPath`." msgstr "" #: ../../c-api/init.rst:151 @@ -304,9 +306,8 @@ msgstr "" #: ../../c-api/init.rst:157 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.hash_seed` " -"and :c:member:`PyConfig.use_hash_seed` should be used instead, " +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"hash_seed` and :c:member:`PyConfig.use_hash_seed` should be used instead, " "see :ref:`Python Initialization Configuration `." msgstr "" @@ -325,15 +326,15 @@ msgstr "" #: ../../c-api/init.rst:172 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.use_environment` should be used instead, " -"see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"use_environment` should be used instead, see :ref:`Python Initialization " +"Configuration `." msgstr "" #: ../../c-api/init.rst:176 msgid "" -"Ignore all :envvar:`!PYTHON*` environment variables, " -"e.g. :envvar:`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." +"Ignore all :envvar:`!PYTHON*` environment variables, e.g. :envvar:" +"`PYTHONPATH` and :envvar:`PYTHONHOME`, that might be set." msgstr "" "忽略所有可能被設定的 :envvar:`!PYTHON*` 環境變數,例如 :envvar:`PYTHONPATH` " "與 :envvar:`PYTHONHOME`。" @@ -344,9 +345,9 @@ msgstr "由 :option:`-E` 與 :option:`-I` 選項設定。" #: ../../c-api/init.rst:185 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.inspect` should be used instead, " -"see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"inspect` should be used instead, see :ref:`Python Initialization " +"Configuration `." msgstr "" #: ../../c-api/init.rst:189 @@ -364,9 +365,9 @@ msgstr "由 :option:`-i` 選項與 :envvar:`PYTHONINSPECT` 環境變數設定。 #: ../../c-api/init.rst:200 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.interactive` should be used instead, " -"see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"interactive` should be used instead, see :ref:`Python Initialization " +"Configuration `." msgstr "" #: ../../c-api/init.rst:204 @@ -375,9 +376,9 @@ msgstr "由 :option:`-i` 選項設定。" #: ../../c-api/init.rst:210 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.isolated` should be used instead, " -"see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"isolated` should be used instead, see :ref:`Python Initialization " +"Configuration `." msgstr "" #: ../../c-api/init.rst:214 @@ -392,9 +393,9 @@ msgstr "由 :option:`-i` 選項設定。" #: ../../c-api/init.rst:225 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyPreConfig.legacy_windows_fs_encoding` should be used " -"instead, see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyPreConfig." +"legacy_windows_fs_encoding` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:229 @@ -422,15 +423,15 @@ msgstr "可用性" #: ../../c-api/init.rst:244 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.legacy_windows_stdio` should be used instead, " -"see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"legacy_windows_stdio` should be used instead, see :ref:`Python " +"Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:248 msgid "" -"If the flag is non-zero, use :class:`io.FileIO` instead of :class:`!" -"io._WindowsConsoleIO` for :mod:`sys` standard streams." +"If the flag is non-zero, use :class:`io.FileIO` instead of :class:`!io." +"_WindowsConsoleIO` for :mod:`sys` standard streams." msgstr "" #: ../../c-api/init.rst:251 @@ -445,17 +446,17 @@ msgstr "更多詳情請見 :pep:`528`。" #: ../../c-api/init.rst:262 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.site_import` should be used instead, " -"see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"site_import` should be used instead, see :ref:`Python Initialization " +"Configuration `." msgstr "" #: ../../c-api/init.rst:266 msgid "" "Disable the import of the module :mod:`site` and the site-dependent " "manipulations of :data:`sys.path` that it entails. Also disable these " -"manipulations if :mod:`site` is explicitly imported later " -"(call :func:`site.main` if you want them to be triggered)." +"manipulations if :mod:`site` is explicitly imported later (call :func:`site." +"main` if you want them to be triggered)." msgstr "" #: ../../c-api/init.rst:271 @@ -464,30 +465,30 @@ msgstr "由 :option:`-S` 選項設定。" #: ../../c-api/init.rst:277 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.user_site_directory` should be used instead, " -"see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"user_site_directory` should be used instead, see :ref:`Python Initialization " +"Configuration `." msgstr "" #: ../../c-api/init.rst:281 msgid "" -"Don't add the :data:`user site-packages directory ` " -"to :data:`sys.path`." +"Don't add the :data:`user site-packages directory ` to :data:" +"`sys.path`." msgstr "" #: ../../c-api/init.rst:284 msgid "" -"Set by the :option:`-s` and :option:`-I` options, and " -"the :envvar:`PYTHONNOUSERSITE` environment variable." +"Set by the :option:`-s` and :option:`-I` options, and the :envvar:" +"`PYTHONNOUSERSITE` environment variable." msgstr "" "由 :option:`-s` 選項、:option:`-I` 選項與 :envvar:`PYTHONNOUSERSITE` 環境變數" "設定。" #: ../../c-api/init.rst:291 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.optimization_level` should be used instead, " -"see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"optimization_level` should be used instead, see :ref:`Python Initialization " +"Configuration `." msgstr "" #: ../../c-api/init.rst:295 @@ -498,9 +499,9 @@ msgstr "由 :option:`-O` 選項與 :envvar:`PYTHONOPTIMIZE` 環境變數設定 #: ../../c-api/init.rst:302 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.quiet` should be used instead, see :ref:`Python " -"Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"quiet` should be used instead, see :ref:`Python Initialization Configuration " +"`." msgstr "" #: ../../c-api/init.rst:306 @@ -514,9 +515,9 @@ msgstr "由 :option:`-q` 選項設定。" #: ../../c-api/init.rst:316 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.buffered_stdio` should be used instead, " -"see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"buffered_stdio` should be used instead, see :ref:`Python Initialization " +"Configuration `." msgstr "" #: ../../c-api/init.rst:320 @@ -531,9 +532,9 @@ msgstr "由 :option:`-u` 選項與 :envvar:`PYTHONUNBUFFERED` 環境變數設定 #: ../../c-api/init.rst:329 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.verbose` should be used instead, " -"see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"verbose` should be used instead, see :ref:`Python Initialization " +"Configuration `." msgstr "" #: ../../c-api/init.rst:333 @@ -557,9 +558,8 @@ msgstr "" #: ../../c-api/init.rst:360 msgid "" "Initialize the Python interpreter. In an application embedding Python, " -"this should be called before using any other Python/C API functions; " -"see :ref:`Before Python Initialization ` for the few " -"exceptions." +"this should be called before using any other Python/C API functions; see :" +"ref:`Before Python Initialization ` for the few exceptions." msgstr "" #: ../../c-api/init.rst:364 @@ -622,19 +622,18 @@ msgstr "" #: ../../c-api/init.rst:417 msgid "" "Undo all initializations made by :c:func:`Py_Initialize` and subsequent use " -"of Python/C API functions, and destroy all sub-interpreters " -"(see :c:func:`Py_NewInterpreter` below) that were created and not yet " -"destroyed since the last call to :c:func:`Py_Initialize`. This is a no-op " -"when called for a second time (without calling :c:func:`Py_Initialize` again " -"first)." +"of Python/C API functions, and destroy all sub-interpreters (see :c:func:" +"`Py_NewInterpreter` below) that were created and not yet destroyed since the " +"last call to :c:func:`Py_Initialize`. This is a no-op when called for a " +"second time (without calling :c:func:`Py_Initialize` again first)." msgstr "" #: ../../c-api/init.rst:423 msgid "" "Since this is the reverse of :c:func:`Py_Initialize`, it should be called in " "the same thread with the same interpreter active. That means the main " -"thread and the main interpreter. This should never be called " -"while :c:func:`Py_RunMain` is running." +"thread and the main interpreter. This should never be called while :c:func:" +"`Py_RunMain` is running." msgstr "" #: ../../c-api/init.rst:428 @@ -685,11 +684,11 @@ msgstr "" #: ../../c-api/init.rst:462 msgid "" -"Raises an :ref:`auditing event ` " -"``cpython._PySys_ClearAuditHooks`` with no arguments." +"Raises an :ref:`auditing event ` ``cpython." +"_PySys_ClearAuditHooks`` with no arguments." msgstr "" -"引發一個不附帶引數的\\ :ref:`稽核事件 ` " -"``cpython._PySys_ClearAuditHooks``。" +"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." +"_PySys_ClearAuditHooks``。" #: ../../c-api/init.rst:469 msgid "" @@ -738,9 +737,9 @@ msgstr "" #: ../../c-api/init.rst:504 msgid "" -"In terms of the CPython runtime configuration APIs documented in " -"the :ref:`runtime configuration ` section (and without " -"accounting for error handling), ``Py_Main`` is approximately equivalent to::" +"In terms of the CPython runtime configuration APIs documented in the :ref:" +"`runtime configuration ` section (and without accounting for " +"error handling), ``Py_Main`` is approximately equivalent to::" msgstr "" #: ../../c-api/init.rst:508 @@ -757,14 +756,14 @@ msgstr "" #: ../../c-api/init.rst:516 msgid "" "In normal usage, an embedding application will call this function *instead* " -"of calling :c:func:`Py_Initialize`, :c:func:`Py_InitializeEx` " -"or :c:func:`Py_InitializeFromConfig` directly, and all settings will be " -"applied as described elsewhere in this documentation. If this function is " -"instead called *after* a preceding runtime initialization API call, then " -"exactly which environmental and command line configuration settings will be " -"updated is version dependent (as it depends on which settings correctly " -"support being modified after they have already been set once when the " -"runtime was first initialized)." +"of calling :c:func:`Py_Initialize`, :c:func:`Py_InitializeEx` or :c:func:" +"`Py_InitializeFromConfig` directly, and all settings will be applied as " +"described elsewhere in this documentation. If this function is instead " +"called *after* a preceding runtime initialization API call, then exactly " +"which environmental and command line configuration settings will be updated " +"is version dependent (as it depends on which settings correctly support " +"being modified after they have already been set once when the runtime was " +"first initialized)." msgstr "" #: ../../c-api/init.rst:529 @@ -773,11 +772,11 @@ msgstr "" #: ../../c-api/init.rst:531 msgid "" -"Executes the command (:c:member:`PyConfig.run_command`), the script " -"(:c:member:`PyConfig.run_filename`) or the module " -"(:c:member:`PyConfig.run_module`) specified on the command line or in the " -"configuration. If none of these values are set, runs the interactive Python " -"prompt (REPL) using the ``__main__`` module's global namespace." +"Executes the command (:c:member:`PyConfig.run_command`), the script (:c:" +"member:`PyConfig.run_filename`) or the module (:c:member:`PyConfig." +"run_module`) specified on the command line or in the configuration. If none " +"of these values are set, runs the interactive Python prompt (REPL) using the " +"``__main__`` module's global namespace." msgstr "" #: ../../c-api/init.rst:537 @@ -807,8 +806,8 @@ msgstr "" #: ../../c-api/init.rst:552 msgid "" "See :ref:`Python Configuration ` for an example of a " -"customized Python that always runs in isolated mode " -"using :c:func:`Py_RunMain`." +"customized Python that always runs in isolated mode using :c:func:" +"`Py_RunMain`." msgstr "" #: ../../c-api/init.rst:558 @@ -828,9 +827,9 @@ msgstr "" #: ../../c-api/init.rst:577 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.program_name` should be used instead, " -"see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"program_name` should be used instead, see :ref:`Python Initialization " +"Configuration `." msgstr "" #: ../../c-api/init.rst:581 @@ -850,8 +849,8 @@ msgstr "" #: ../../c-api/init.rst:592 ../../c-api/init.rst:840 ../../c-api/init.rst:876 #: ../../c-api/init.rst:902 msgid "" -"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get " -"a :c:expr:`wchar_t*` string." +"Use :c:func:`Py_DecodeLocale` to decode a bytes string to get a :c:expr:" +"`wchar_t*` string." msgstr "" #: ../../c-api/init.rst:600 @@ -875,8 +874,8 @@ msgstr "如果在 :c:func:`Py_Initialize` 之前呼叫,現在會回傳 ``NULL` #: ../../c-api/init.rst:610 ../../c-api/init.rst:705 msgid "" -"Use :c:func:`PyConfig_Get(\"executable\") ` " -"(:data:`sys.executable`) instead." +"Use :c:func:`PyConfig_Get(\"executable\") ` (:data:`sys." +"executable`) instead." msgstr "" #: ../../c-api/init.rst:617 @@ -895,10 +894,10 @@ msgstr "" #: ../../c-api/init.rst:633 msgid "" -"Use :c:func:`PyConfig_Get(\"base_prefix\") ` " -"(:data:`sys.base_prefix`) instead. Use :c:func:`PyConfig_Get(\"prefix\") " -"` (:data:`sys.prefix`) if :ref:`virtual environments ` need to be handled." +"Use :c:func:`PyConfig_Get(\"base_prefix\") ` (:data:`sys." +"base_prefix`) instead. Use :c:func:`PyConfig_Get(\"prefix\") ` " +"(:data:`sys.prefix`) if :ref:`virtual environments ` need to be " +"handled." msgstr "" #: ../../c-api/init.rst:642 @@ -908,11 +907,11 @@ msgid "" "with :c:member:`PyConfig.program_name` and some environment variables; for " "example, if the program name is ``'/usr/local/bin/python'``, the exec-prefix " "is ``'/usr/local'``. The returned string points into static storage; the " -"caller should not modify its value. This corresponds to " -"the :makevar:`exec_prefix` variable in the top-level :file:`Makefile` and " -"the ``--exec-prefix`` argument to the :program:`configure` script at build " -"time. The value is available to Python code as ``sys.base_exec_prefix``. " -"It is only useful on Unix." +"caller should not modify its value. This corresponds to the :makevar:" +"`exec_prefix` variable in the top-level :file:`Makefile` and the ``--exec-" +"prefix`` argument to the :program:`configure` script at build time. The " +"value is available to Python code as ``sys.base_exec_prefix``. It is only " +"useful on Unix." msgstr "" #: ../../c-api/init.rst:653 @@ -940,19 +939,18 @@ msgstr "" #: ../../c-api/init.rst:670 msgid "" -"System administrators will know how to configure the :program:`mount` " -"or :program:`automount` programs to share :file:`/usr/local` between " -"platforms while having :file:`/usr/local/plat` be a different filesystem for " -"each platform." +"System administrators will know how to configure the :program:`mount` or :" +"program:`automount` programs to share :file:`/usr/local` between platforms " +"while having :file:`/usr/local/plat` be a different filesystem for each " +"platform." msgstr "" #: ../../c-api/init.rst:681 msgid "" -"Use :c:func:`PyConfig_Get(\"base_exec_prefix\") ` " -"(:data:`sys.base_exec_prefix`) instead. " -"Use :c:func:`PyConfig_Get(\"exec_prefix\") ` " -"(:data:`sys.exec_prefix`) if :ref:`virtual environments ` need to " -"be handled." +"Use :c:func:`PyConfig_Get(\"base_exec_prefix\") ` (:data:`sys." +"base_exec_prefix`) instead. Use :c:func:`PyConfig_Get(\"exec_prefix\") " +"` (:data:`sys.exec_prefix`) if :ref:`virtual environments " +"` need to be handled." msgstr "" #: ../../c-api/init.rst:693 @@ -979,8 +977,8 @@ msgstr "" #: ../../c-api/init.rst:734 msgid "" -"Use :c:func:`PyConfig_Get(\"module_search_paths\") ` " -"(:data:`sys.path`) instead." +"Use :c:func:`PyConfig_Get(\"module_search_paths\") ` (:data:" +"`sys.path`) instead." msgstr "" #: ../../c-api/init.rst:740 @@ -998,8 +996,8 @@ msgid "" "The first word (up to the first space character) is the current Python " "version; the first characters are the major and minor version separated by a " "period. The returned string points into static storage; the caller should " -"not modify its value. The value is available to Python code " -"as :data:`sys.version`." +"not modify its value. The value is available to Python code as :data:`sys." +"version`." msgstr "" #: ../../c-api/init.rst:752 @@ -1062,10 +1060,10 @@ msgstr "\"#67, Aug 1 1997, 22:34:28\"" #: ../../c-api/init.rst:815 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.argv`, :c:member:`PyConfig.parse_argv` " -"and :c:member:`PyConfig.safe_path` should be used instead, see :ref:`Python " -"Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"argv`, :c:member:`PyConfig.parse_argv` and :c:member:`PyConfig.safe_path` " +"should be used instead, see :ref:`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:820 @@ -1089,8 +1087,8 @@ msgstr "" #: ../../c-api/init.rst:832 msgid "" "If the name of an existing script is passed in ``argv[0]``, the absolute " -"path of the directory where the script is located is prepended " -"to :data:`sys.path`." +"path of the directory where the script is located is prepended to :data:`sys." +"path`." msgstr "" #: ../../c-api/init.rst:835 @@ -1116,8 +1114,8 @@ msgstr "" #: ../../c-api/init.rst:852 msgid "" "On versions before 3.1.3, you can achieve the same effect by manually " -"popping the first :data:`sys.path` element after having " -"called :c:func:`PySys_SetArgv`, for example using::" +"popping the first :data:`sys.path` element after having called :c:func:" +"`PySys_SetArgv`, for example using::" msgstr "" #: ../../c-api/init.rst:856 @@ -1126,17 +1124,16 @@ msgstr "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" #: ../../c-api/init.rst:868 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.argv` and :c:member:`PyConfig.parse_argv` should " -"be used instead, see :ref:`Python Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"argv` and :c:member:`PyConfig.parse_argv` should be used instead, see :ref:" +"`Python Initialization Configuration `." msgstr "" #: ../../c-api/init.rst:872 msgid "" "This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to " -"``1`` unless the :program:`python` interpreter was started with " -"the :option:`-I`." +"``1`` unless the :program:`python` interpreter was started with the :option:" +"`-I`." msgstr "" #: ../../c-api/init.rst:882 @@ -1145,9 +1142,9 @@ msgstr "" #: ../../c-api/init.rst:889 msgid "" -"This API is kept for backward compatibility: " -"setting :c:member:`PyConfig.home` should be used instead, see :ref:`Python " -"Initialization Configuration `." +"This API is kept for backward compatibility: setting :c:member:`PyConfig." +"home` should be used instead, see :ref:`Python Initialization Configuration " +"`." msgstr "" #: ../../c-api/init.rst:893 @@ -1167,16 +1164,18 @@ msgstr "" #: ../../c-api/init.rst:910 msgid "" -"Return the default \"home\", that is, the value set " -"by :c:member:`PyConfig.home`, or the value of the :envvar:`PYTHONHOME` " -"environment variable if it is set." +"Return the default \"home\", that is, the value set by :c:member:`PyConfig." +"home`, or the value of the :envvar:`PYTHONHOME` environment variable if it " +"is set." msgstr "" #: ../../c-api/init.rst:920 msgid "" -"Use :c:func:`PyConfig_Get(\"home\") ` or " -"the :envvar:`PYTHONHOME` environment variable instead." -msgstr "改為使用 :c:func:`PyConfig_Get(\"home\") ` 或 :envvar:`PYTHONHOME` 環境變數。" +"Use :c:func:`PyConfig_Get(\"home\") ` or the :envvar:" +"`PYTHONHOME` environment variable instead." +msgstr "" +"改為使用 :c:func:`PyConfig_Get(\"home\") ` 或 :envvar:" +"`PYTHONHOME` 環境變數。" #: ../../c-api/init.rst:928 msgid "Thread State and the Global Interpreter Lock" @@ -1197,22 +1196,21 @@ msgstr "" #: ../../c-api/init.rst:946 msgid "" -"Therefore, the rule exists that only the thread that has acquired " -"the :term:`GIL` may operate on Python objects or call Python/C API " -"functions. In order to emulate concurrency of execution, the interpreter " -"regularly tries to switch threads (see :func:`sys.setswitchinterval`). The " -"lock is also released around potentially blocking I/O operations like " -"reading or writing a file, so that other Python threads can run in the " -"meantime." +"Therefore, the rule exists that only the thread that has acquired the :term:" +"`GIL` may operate on Python objects or call Python/C API functions. In order " +"to emulate concurrency of execution, the interpreter regularly tries to " +"switch threads (see :func:`sys.setswitchinterval`). The lock is also " +"released around potentially blocking I/O operations like reading or writing " +"a file, so that other Python threads can run in the meantime." msgstr "" #: ../../c-api/init.rst:956 msgid "" "The Python interpreter keeps some thread-specific bookkeeping information " -"inside a data structure called :c:type:`PyThreadState`, known as " -"a :term:`thread state`. Each OS thread has a thread-local pointer to " -"a :c:type:`PyThreadState`; a thread state referenced by this pointer is " -"considered to be :term:`attached `." +"inside a data structure called :c:type:`PyThreadState`, known as a :term:" +"`thread state`. Each OS thread has a thread-local pointer to a :c:type:" +"`PyThreadState`; a thread state referenced by this pointer is considered to " +"be :term:`attached `." msgstr "" #: ../../c-api/init.rst:961 @@ -1229,10 +1227,10 @@ msgstr "" #: ../../c-api/init.rst:968 msgid "" "In general, there will always be an :term:`attached thread state` when using " -"Python's C API. Only in some specific cases (such as in " -"a :c:macro:`Py_BEGIN_ALLOW_THREADS` block) will the thread not have an " -"attached thread state. If uncertain, check " -"if :c:func:`PyThreadState_GetUnchecked` returns ``NULL``." +"Python's C API. Only in some specific cases (such as in a :c:macro:" +"`Py_BEGIN_ALLOW_THREADS` block) will the thread not have an attached thread " +"state. If uncertain, check if :c:func:`PyThreadState_GetUnchecked` returns " +"``NULL``." msgstr "" #: ../../c-api/init.rst:974 @@ -1290,16 +1288,16 @@ msgstr "" #: ../../c-api/init.rst:1011 msgid "" "The :term:`attached thread state` holds the :term:`GIL` for the entire " -"interpreter. When detaching the :term:`attached thread state`, " -"the :term:`GIL` is released, allowing other threads to attach a thread state " -"to their own thread, thus getting the :term:`GIL` and can start executing. " -"The pointer to the prior :term:`attached thread state` is stored as a local " +"interpreter. When detaching the :term:`attached thread state`, the :term:" +"`GIL` is released, allowing other threads to attach a thread state to their " +"own thread, thus getting the :term:`GIL` and can start executing. The " +"pointer to the prior :term:`attached thread state` is stored as a local " "variable. Upon reaching :c:macro:`Py_END_ALLOW_THREADS`, the thread state " -"that was previously :term:`attached ` is passed " -"to :c:func:`PyEval_RestoreThread`. This function will block until another " -"releases its :term:`thread state `, thus allowing the " -"old :term:`thread state ` to get re-attached and the " -"C API can be called again." +"that was previously :term:`attached ` is passed to :c:" +"func:`PyEval_RestoreThread`. This function will block until another releases " +"its :term:`thread state `, thus allowing the old :" +"term:`thread state ` to get re-attached and the C API " +"can be called again." msgstr "" #: ../../c-api/init.rst:1021 @@ -1307,15 +1305,15 @@ msgid "" "For :term:`free-threaded ` builds, the :term:`GIL` is " "normally out of the question, but detaching the :term:`thread state " "` is still required for blocking I/O and long " -"operations. The difference is that threads don't have to wait for " -"the :term:`GIL` to be released to attach their thread state, allowing true " -"multi-core parallelism." +"operations. The difference is that threads don't have to wait for the :term:" +"`GIL` to be released to attach their thread state, allowing true multi-core " +"parallelism." msgstr "" #: ../../c-api/init.rst:1027 msgid "" -"Calling system I/O functions is the most common use case for detaching " -"the :term:`thread state `, but it can also be useful " +"Calling system I/O functions is the most common use case for detaching the :" +"term:`thread state `, but it can also be useful " "before calling long-running computations which don't need access to Python " "objects, such as compression or cryptographic functions operating over " "memory buffers. For example, the standard :mod:`zlib` and :mod:`hashlib` " @@ -1329,22 +1327,22 @@ msgstr "" #: ../../c-api/init.rst:1040 msgid "" -"When threads are created using the dedicated Python APIs (such as " -"the :mod:`threading` module), a thread state is automatically associated to " -"them and the code showed above is therefore correct. However, when threads " -"are created from C (for example by a third-party library with its own thread " -"management), they don't hold the :term:`GIL`, because they don't have " -"an :term:`attached thread state`." +"When threads are created using the dedicated Python APIs (such as the :mod:" +"`threading` module), a thread state is automatically associated to them and " +"the code showed above is therefore correct. However, when threads are " +"created from C (for example by a third-party library with its own thread " +"management), they don't hold the :term:`GIL`, because they don't have an :" +"term:`attached thread state`." msgstr "" #: ../../c-api/init.rst:1047 msgid "" "If you need to call Python code from these threads (often this will be part " "of a callback API provided by the aforementioned third-party library), you " -"must first register these threads with the interpreter by creating " -"an :term:`attached thread state` before you can start using the Python/C " -"API. When you are done, you should detach the :term:`thread state `, and finally free it." +"must first register these threads with the interpreter by creating an :term:" +"`attached thread state` before you can start using the Python/C API. When " +"you are done, you should detach the :term:`thread state `, and finally free it." msgstr "" #: ../../c-api/init.rst:1054 @@ -1371,13 +1369,13 @@ msgstr "" msgid "" "Note that the ``PyGILState_*`` functions assume there is only one global " "interpreter (created automatically by :c:func:`Py_Initialize`). Python " -"supports the creation of additional interpreters " -"(using :c:func:`Py_NewInterpreter`), but mixing multiple interpreters and " -"the ``PyGILState_*`` API is unsupported. This is " -"because :c:func:`PyGILState_Ensure` and similar functions default " -"to :term:`attaching ` a :term:`thread state` for the " -"main interpreter, meaning that the thread can't safely interact with the " -"calling subinterpreter." +"supports the creation of additional interpreters (using :c:func:" +"`Py_NewInterpreter`), but mixing multiple interpreters and the " +"``PyGILState_*`` API is unsupported. This is because :c:func:" +"`PyGILState_Ensure` and similar functions default to :term:`attaching " +"` a :term:`thread state` for the main interpreter, " +"meaning that the thread can't safely interact with the calling " +"subinterpreter." msgstr "" #: ../../c-api/init.rst:1078 @@ -1439,11 +1437,11 @@ msgid "" "of additional (non-Python) locks that need to be acquired before or reset " "after a fork. OS facilities such as :c:func:`!pthread_atfork` would need to " "be used to accomplish the same thing. Additionally, when extending or " -"embedding Python, calling :c:func:`fork` directly rather than " -"through :func:`os.fork` (and returning to or calling into Python) may result " -"in a deadlock by one of Python's internal locks being held by a thread that " -"is defunct after the fork. :c:func:`PyOS_AfterFork_Child` tries to reset the " -"necessary locks, but is not always able to." +"embedding Python, calling :c:func:`fork` directly rather than through :func:" +"`os.fork` (and returning to or calling into Python) may result in a deadlock " +"by one of Python's internal locks being held by a thread that is defunct " +"after the fork. :c:func:`PyOS_AfterFork_Child` tries to reset the necessary " +"locks, but is not always able to." msgstr "" #: ../../c-api/init.rst:1129 @@ -1466,18 +1464,18 @@ msgstr "" #: ../../c-api/init.rst:1145 msgid "" "In the late stage of :term:`interpreter shutdown`, after attempting to wait " -"for non-daemon threads to exit (though this can be interrupted " -"by :class:`KeyboardInterrupt`) and running the :mod:`atexit` functions, the " -"runtime is marked as *finalizing*: :c:func:`Py_IsFinalizing` " -"and :func:`sys.is_finalizing` return true. At this point, only the " -"*finalization thread* that initiated finalization (typically the main " -"thread) is allowed to acquire the :term:`GIL`." +"for non-daemon threads to exit (though this can be interrupted by :class:" +"`KeyboardInterrupt`) and running the :mod:`atexit` functions, the runtime is " +"marked as *finalizing*: :c:func:`Py_IsFinalizing` and :func:`sys." +"is_finalizing` return true. At this point, only the *finalization thread* " +"that initiated finalization (typically the main thread) is allowed to " +"acquire the :term:`GIL`." msgstr "" #: ../../c-api/init.rst:1153 msgid "" -"If any thread, other than the finalization thread, attempts to attach " -"a :term:`thread state` during finalization, either explicitly or implicitly, " +"If any thread, other than the finalization thread, attempts to attach a :" +"term:`thread state` during finalization, either explicitly or implicitly, " "the thread enters **a permanently blocked state** where it remains until the " "program exits. In most cases this is harmless, but this can result in " "deadlock if a later stage of finalization attempts to acquire a lock owned " @@ -1522,54 +1520,60 @@ msgid "" "which interpreter they belong." msgstr "" -#: ../../c-api/init.rst:1190 +#: ../../c-api/init.rst:1189 +msgid "" +":pep:`684` introduced the possibility of a :ref:`per-interpreter GIL `. See :c:func:`Py_NewInterpreterFromConfig`." +msgstr "" + +#: ../../c-api/init.rst:1196 msgid "" "This data structure represents the state of a single thread. The only " "public data member is:" msgstr "" -#: ../../c-api/init.rst:1195 +#: ../../c-api/init.rst:1201 msgid "This thread's interpreter state." msgstr "" -#: ../../c-api/init.rst:1206 +#: ../../c-api/init.rst:1212 msgid "Deprecated function which does nothing." msgstr "" -#: ../../c-api/init.rst:1208 +#: ../../c-api/init.rst:1214 msgid "" "In Python 3.6 and older, this function created the GIL if it didn't exist." msgstr "" -#: ../../c-api/init.rst:1210 +#: ../../c-api/init.rst:1216 msgid "The function now does nothing." msgstr "此函式現在不會做任何事情。" -#: ../../c-api/init.rst:1213 +#: ../../c-api/init.rst:1219 msgid "" "This function is now called by :c:func:`Py_Initialize()`, so you don't have " "to call it yourself anymore." msgstr "" -#: ../../c-api/init.rst:1217 +#: ../../c-api/init.rst:1223 msgid "" "This function cannot be called before :c:func:`Py_Initialize()` anymore." msgstr "" -#: ../../c-api/init.rst:1227 +#: ../../c-api/init.rst:1233 msgid "" "Detach the :term:`attached thread state` and return it. The thread will have " "no :term:`thread state` upon returning." msgstr "" -#: ../../c-api/init.rst:1233 +#: ../../c-api/init.rst:1239 msgid "" "Set the :term:`attached thread state` to *tstate*. The passed :term:`thread " "state` **should not** be :term:`attached `, otherwise " "deadlock ensues. *tstate* will be attached upon returning." msgstr "" -#: ../../c-api/init.rst:1238 ../../c-api/init.rst:1609 +#: ../../c-api/init.rst:1244 ../../c-api/init.rst:1615 msgid "" "Calling this function from a thread when the runtime is finalizing will hang " "the thread until the program exits, even if the thread was not created by " @@ -1577,14 +1581,14 @@ msgid "" "details." msgstr "" -#: ../../c-api/init.rst:1243 ../../c-api/init.rst:1314 -#: ../../c-api/init.rst:1619 +#: ../../c-api/init.rst:1249 ../../c-api/init.rst:1320 +#: ../../c-api/init.rst:1625 msgid "" "Hangs the current thread, rather than terminating it, if called while the " "interpreter is finalizing." msgstr "" -#: ../../c-api/init.rst:1249 +#: ../../c-api/init.rst:1255 msgid "" "Return the :term:`attached thread state`. If the thread has no attached " "thread state, (such as when inside of :c:macro:`Py_BEGIN_ALLOW_THREADS` " @@ -1592,78 +1596,78 @@ msgid "" "``NULL``)." msgstr "" -#: ../../c-api/init.rst:1254 +#: ../../c-api/init.rst:1260 msgid "See also :c:func:`PyThreadState_GetUnchecked`." msgstr "也請見 :c:func:`PyThreadState_GetUnchecked`。" -#: ../../c-api/init.rst:1258 +#: ../../c-api/init.rst:1264 msgid "" "Similar to :c:func:`PyThreadState_Get`, but don't kill the process with a " "fatal error if it is NULL. The caller is responsible to check if the result " "is NULL." msgstr "" -#: ../../c-api/init.rst:1262 +#: ../../c-api/init.rst:1268 msgid "" "In Python 3.5 to 3.12, the function was private and known as " "``_PyThreadState_UncheckedGet()``." msgstr "" -#: ../../c-api/init.rst:1269 +#: ../../c-api/init.rst:1275 msgid "" -"Set the :term:`attached thread state` to *tstate*, and return " -"the :term:`thread state` that was attached prior to calling." +"Set the :term:`attached thread state` to *tstate*, and return the :term:" +"`thread state` that was attached prior to calling." msgstr "" -#: ../../c-api/init.rst:1272 +#: ../../c-api/init.rst:1278 msgid "" "This function is safe to call without an :term:`attached thread state`; it " "will simply return ``NULL`` indicating that there was no prior thread state." msgstr "" -#: ../../c-api/init.rst:1279 +#: ../../c-api/init.rst:1285 msgid "" "Similar to :c:func:`PyGILState_Ensure`, this function will hang the thread " "if the runtime is finalizing." msgstr "" -#: ../../c-api/init.rst:1283 +#: ../../c-api/init.rst:1289 msgid "" "The following functions use thread-local storage, and are not compatible " "with sub-interpreters:" msgstr "" -#: ../../c-api/init.rst:1288 +#: ../../c-api/init.rst:1294 msgid "" "Ensure that the current thread is ready to call the Python C API regardless " "of the current state of Python, or of the :term:`attached thread state`. " "This may be called as many times as desired by a thread as long as each call " "is matched with a call to :c:func:`PyGILState_Release`. In general, other " -"thread-related APIs may be used between :c:func:`PyGILState_Ensure` " -"and :c:func:`PyGILState_Release` calls as long as the thread state is " -"restored to its previous state before the Release(). For example, normal " -"usage of the :c:macro:`Py_BEGIN_ALLOW_THREADS` " -"and :c:macro:`Py_END_ALLOW_THREADS` macros is acceptable." +"thread-related APIs may be used between :c:func:`PyGILState_Ensure` and :c:" +"func:`PyGILState_Release` calls as long as the thread state is restored to " +"its previous state before the Release(). For example, normal usage of the :" +"c:macro:`Py_BEGIN_ALLOW_THREADS` and :c:macro:`Py_END_ALLOW_THREADS` macros " +"is acceptable." msgstr "" -#: ../../c-api/init.rst:1298 +#: ../../c-api/init.rst:1304 msgid "" "The return value is an opaque \"handle\" to the :term:`attached thread " -"state` when :c:func:`PyGILState_Ensure` was called, and must be passed " -"to :c:func:`PyGILState_Release` to ensure Python is left in the same state. " -"Even though recursive calls are allowed, these handles *cannot* be shared - " -"each unique call to :c:func:`PyGILState_Ensure` must save the handle for its " -"call to :c:func:`PyGILState_Release`." +"state` when :c:func:`PyGILState_Ensure` was called, and must be passed to :c:" +"func:`PyGILState_Release` to ensure Python is left in the same state. Even " +"though recursive calls are allowed, these handles *cannot* be shared - each " +"unique call to :c:func:`PyGILState_Ensure` must save the handle for its call " +"to :c:func:`PyGILState_Release`." msgstr "" -#: ../../c-api/init.rst:1305 +#: ../../c-api/init.rst:1311 msgid "" "When the function returns, there will be an :term:`attached thread state` " "and the thread will be able to call arbitrary Python code. Failure is a " "fatal error." msgstr "" -#: ../../c-api/init.rst:1309 +#: ../../c-api/init.rst:1315 msgid "" "Calling this function when the runtime is finalizing is unsafe. Doing so " "will either hang the thread until the program ends, or fully crash the " @@ -1671,21 +1675,21 @@ msgid "" "finalization` for more details." msgstr "" -#: ../../c-api/init.rst:1320 +#: ../../c-api/init.rst:1326 msgid "" "Release any resources previously acquired. After this call, Python's state " -"will be the same as it was prior to the " -"corresponding :c:func:`PyGILState_Ensure` call (but generally this state " -"will be unknown to the caller, hence the use of the GILState API)." +"will be the same as it was prior to the corresponding :c:func:" +"`PyGILState_Ensure` call (but generally this state will be unknown to the " +"caller, hence the use of the GILState API)." msgstr "" -#: ../../c-api/init.rst:1325 +#: ../../c-api/init.rst:1331 msgid "" -"Every call to :c:func:`PyGILState_Ensure` must be matched by a call " -"to :c:func:`PyGILState_Release` on the same thread." +"Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:" +"func:`PyGILState_Release` on the same thread." msgstr "" -#: ../../c-api/init.rst:1330 +#: ../../c-api/init.rst:1336 msgid "" "Get the :term:`attached thread state` for this thread. May return ``NULL`` " "if no GILState API has been used on the current thread. Note that the main " @@ -1693,279 +1697,279 @@ msgid "" "been made on the main thread. This is mainly a helper/diagnostic function." msgstr "" -#: ../../c-api/init.rst:1336 +#: ../../c-api/init.rst:1342 msgid "" "This function does not account for :term:`thread states ` " -"created by something other than :c:func:`PyGILState_Ensure` (such " -"as :c:func:`PyThreadState_New`). Prefer :c:func:`PyThreadState_Get` " -"or :c:func:`PyThreadState_GetUnchecked` for most cases." +"created by something other than :c:func:`PyGILState_Ensure` (such as :c:func:" +"`PyThreadState_New`). Prefer :c:func:`PyThreadState_Get` or :c:func:" +"`PyThreadState_GetUnchecked` for most cases." msgstr "" -#: ../../c-api/init.rst:1345 +#: ../../c-api/init.rst:1351 msgid "" "Return ``1`` if the current thread is holding the :term:`GIL` and ``0`` " "otherwise. This function can be called from any thread at any time. Only if " -"it has had its :term:`thread state ` initialized " -"via :c:func:`PyGILState_Ensure` will it return ``1``. This is mainly a " -"helper/diagnostic function. It can be useful for example in callback " -"contexts or memory allocation functions when knowing that the :term:`GIL` is " -"locked can allow the caller to perform sensitive actions or otherwise behave " +"it has had its :term:`thread state ` initialized via :" +"c:func:`PyGILState_Ensure` will it return ``1``. This is mainly a helper/" +"diagnostic function. It can be useful for example in callback contexts or " +"memory allocation functions when knowing that the :term:`GIL` is locked can " +"allow the caller to perform sensitive actions or otherwise behave " "differently." msgstr "" -#: ../../c-api/init.rst:1355 +#: ../../c-api/init.rst:1361 msgid "" "If the current Python process has ever created a subinterpreter, this " -"function will *always* return ``1``. " -"Prefer :c:func:`PyThreadState_GetUnchecked` for most cases." +"function will *always* return ``1``. Prefer :c:func:" +"`PyThreadState_GetUnchecked` for most cases." msgstr "" -#: ../../c-api/init.rst:1362 +#: ../../c-api/init.rst:1368 msgid "" "The following macros are normally used without a trailing semicolon; look " "for example usage in the Python source distribution." msgstr "" -#: ../../c-api/init.rst:1368 +#: ../../c-api/init.rst:1374 msgid "" -"This macro expands to ``{ PyThreadState *_save; _save = " -"PyEval_SaveThread();``. Note that it contains an opening brace; it must be " -"matched with a following :c:macro:`Py_END_ALLOW_THREADS` macro. See above " -"for further discussion of this macro." +"This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();" +"``. Note that it contains an opening brace; it must be matched with a " +"following :c:macro:`Py_END_ALLOW_THREADS` macro. See above for further " +"discussion of this macro." msgstr "" -#: ../../c-api/init.rst:1376 +#: ../../c-api/init.rst:1382 msgid "" "This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it " -"contains a closing brace; it must be matched with an " -"earlier :c:macro:`Py_BEGIN_ALLOW_THREADS` macro. See above for further " -"discussion of this macro." +"contains a closing brace; it must be matched with an earlier :c:macro:" +"`Py_BEGIN_ALLOW_THREADS` macro. See above for further discussion of this " +"macro." msgstr "" -#: ../../c-api/init.rst:1384 +#: ../../c-api/init.rst:1390 msgid "" -"This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent " -"to :c:macro:`Py_END_ALLOW_THREADS` without the closing brace." +"This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :" +"c:macro:`Py_END_ALLOW_THREADS` without the closing brace." msgstr "" -#: ../../c-api/init.rst:1390 +#: ../../c-api/init.rst:1396 msgid "" -"This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent " -"to :c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " +"This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to :" +"c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " "declaration." msgstr "" -#: ../../c-api/init.rst:1396 +#: ../../c-api/init.rst:1402 msgid "Low-level API" msgstr "低階 API" -#: ../../c-api/init.rst:1398 +#: ../../c-api/init.rst:1404 msgid "" "All of the following functions must be called after :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/init.rst:1400 +#: ../../c-api/init.rst:1406 msgid "" -":c:func:`Py_Initialize()` now initializes the :term:`GIL` and sets " -"an :term:`attached thread state`." +":c:func:`Py_Initialize()` now initializes the :term:`GIL` and sets an :term:" +"`attached thread state`." msgstr "" -#: ../../c-api/init.rst:1407 +#: ../../c-api/init.rst:1413 msgid "" "Create a new interpreter state object. An :term:`attached thread state` is " "not needed, but may optionally exist if it is necessary to serialize calls " "to this function." msgstr "" -#: ../../c-api/init.rst:1411 +#: ../../c-api/init.rst:1417 msgid "" -"Raises an :ref:`auditing event ` " -"``cpython.PyInterpreterState_New`` with no arguments." +"Raises an :ref:`auditing event ` ``cpython." +"PyInterpreterState_New`` with no arguments." msgstr "" -"引發一個不附帶引數的\\ :ref:`稽核事件 ` " -"``cpython.PyInterpreterState_New``。" +"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." +"PyInterpreterState_New``。" -#: ../../c-api/init.rst:1416 +#: ../../c-api/init.rst:1422 msgid "" -"Reset all information in an interpreter state object. There must be " -"an :term:`attached thread state` for the interpreter." +"Reset all information in an interpreter state object. There must be an :" +"term:`attached thread state` for the interpreter." msgstr "" -#: ../../c-api/init.rst:1419 +#: ../../c-api/init.rst:1425 msgid "" -"Raises an :ref:`auditing event ` " -"``cpython.PyInterpreterState_Clear`` with no arguments." +"Raises an :ref:`auditing event ` ``cpython." +"PyInterpreterState_Clear`` with no arguments." msgstr "" -"引發一個不附帶引數的\\ :ref:`稽核事件 ` " -"``cpython.PyInterpreterState_Clear``。" +"引發一個不附帶引數的\\ :ref:`稽核事件 ` ``cpython." +"PyInterpreterState_Clear``。" -#: ../../c-api/init.rst:1424 +#: ../../c-api/init.rst:1430 msgid "" -"Destroy an interpreter state object. There **should not** be " -"an :term:`attached thread state` for the target interpreter. The interpreter " -"state must have been reset with a previous call " -"to :c:func:`PyInterpreterState_Clear`." +"Destroy an interpreter state object. There **should not** be an :term:" +"`attached thread state` for the target interpreter. The interpreter state " +"must have been reset with a previous call to :c:func:" +"`PyInterpreterState_Clear`." msgstr "" -#: ../../c-api/init.rst:1431 +#: ../../c-api/init.rst:1437 msgid "" "Create a new thread state object belonging to the given interpreter object. " "An :term:`attached thread state` is not needed." msgstr "" -#: ../../c-api/init.rst:1436 +#: ../../c-api/init.rst:1442 msgid "" -"Reset all information in a :term:`thread state` object. *tstate* must " -"be :term:`attached `" +"Reset all information in a :term:`thread state` object. *tstate* must be :" +"term:`attached `" msgstr "" -#: ../../c-api/init.rst:1439 +#: ../../c-api/init.rst:1445 msgid "" "This function now calls the :c:member:`PyThreadState.on_delete` callback. " "Previously, that happened in :c:func:`PyThreadState_Delete`." msgstr "" -#: ../../c-api/init.rst:1443 +#: ../../c-api/init.rst:1449 msgid "The :c:member:`PyThreadState.on_delete` callback was removed." msgstr ":c:member:`PyThreadState.on_delete` 回呼已被移除。" -#: ../../c-api/init.rst:1449 +#: ../../c-api/init.rst:1455 msgid "" -"Destroy a :term:`thread state` object. *tstate* should not " -"be :term:`attached ` to any thread. *tstate* must " -"have been reset with a previous call to :c:func:`PyThreadState_Clear`." +"Destroy a :term:`thread state` object. *tstate* should not be :term:" +"`attached ` to any thread. *tstate* must have been " +"reset with a previous call to :c:func:`PyThreadState_Clear`." msgstr "" -#: ../../c-api/init.rst:1457 +#: ../../c-api/init.rst:1463 msgid "" "Detach the :term:`attached thread state` (which must have been reset with a " "previous call to :c:func:`PyThreadState_Clear`) and then destroy it." msgstr "" -#: ../../c-api/init.rst:1460 +#: ../../c-api/init.rst:1466 msgid "" "No :term:`thread state` will be :term:`attached ` " "upon returning." msgstr "" -#: ../../c-api/init.rst:1465 +#: ../../c-api/init.rst:1471 msgid "Get the current frame of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1467 +#: ../../c-api/init.rst:1473 msgid "" "Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " "executing." msgstr "" -#: ../../c-api/init.rst:1470 +#: ../../c-api/init.rst:1476 msgid "See also :c:func:`PyEval_GetFrame`." msgstr "也請見 :c:func:`PyEval_GetFrame`。" -#: ../../c-api/init.rst:1472 ../../c-api/init.rst:1481 -#: ../../c-api/init.rst:1490 +#: ../../c-api/init.rst:1478 ../../c-api/init.rst:1487 +#: ../../c-api/init.rst:1496 msgid "" "*tstate* must not be ``NULL``, and must be :term:`attached `." msgstr "" -#: ../../c-api/init.rst:1479 +#: ../../c-api/init.rst:1485 msgid "" "Get the unique :term:`thread state` identifier of the Python thread state " "*tstate*." msgstr "" -#: ../../c-api/init.rst:1488 +#: ../../c-api/init.rst:1494 msgid "Get the interpreter of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1497 +#: ../../c-api/init.rst:1503 msgid "Suspend tracing and profiling in the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1499 +#: ../../c-api/init.rst:1505 msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." msgstr "" -#: ../../c-api/init.rst:1506 +#: ../../c-api/init.rst:1512 msgid "" "Resume tracing and profiling in the Python thread state *tstate* suspended " "by the :c:func:`PyThreadState_EnterTracing` function." msgstr "" -#: ../../c-api/init.rst:1509 +#: ../../c-api/init.rst:1515 msgid "" "See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." msgstr "" -#: ../../c-api/init.rst:1517 +#: ../../c-api/init.rst:1523 msgid "Get the current interpreter." msgstr "" -#: ../../c-api/init.rst:1519 +#: ../../c-api/init.rst:1525 msgid "" "Issue a fatal error if there no :term:`attached thread state`. It cannot " "return NULL." msgstr "" -#: ../../c-api/init.rst:1527 +#: ../../c-api/init.rst:1533 msgid "" "Return the interpreter's unique ID. If there was any error in doing so then " "``-1`` is returned and an error is set." msgstr "" -#: ../../c-api/init.rst:1530 ../../c-api/init.rst:2117 -#: ../../c-api/init.rst:2124 ../../c-api/init.rst:2143 -#: ../../c-api/init.rst:2150 +#: ../../c-api/init.rst:1536 ../../c-api/init.rst:2125 +#: ../../c-api/init.rst:2132 ../../c-api/init.rst:2151 +#: ../../c-api/init.rst:2158 msgid "The caller must have an :term:`attached thread state`." msgstr "呼叫者必須擁有一個 :term:`attached thread state`。" -#: ../../c-api/init.rst:1537 +#: ../../c-api/init.rst:1543 msgid "" "Return a dictionary in which interpreter-specific data may be stored. If " "this function returns ``NULL`` then no exception has been raised and the " "caller should assume no interpreter-specific dict is available." msgstr "" -#: ../../c-api/init.rst:1541 +#: ../../c-api/init.rst:1547 msgid "" "This is not a replacement for :c:func:`PyModule_GetState()`, which " "extensions should use to store interpreter-specific state information." msgstr "" -#: ../../c-api/init.rst:1549 +#: ../../c-api/init.rst:1555 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1551 +#: ../../c-api/init.rst:1557 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1554 +#: ../../c-api/init.rst:1560 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1557 +#: ../../c-api/init.rst:1563 msgid "" "The *frame* parameter changed from ``PyFrameObject*`` to " "``_PyInterpreterFrame*``." msgstr "" -#: ../../c-api/init.rst:1562 +#: ../../c-api/init.rst:1568 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1564 ../../c-api/init.rst:1572 +#: ../../c-api/init.rst:1570 ../../c-api/init.rst:1578 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1570 +#: ../../c-api/init.rst:1576 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1579 +#: ../../c-api/init.rst:1585 msgid "" "Return a dictionary in which extensions can store thread-specific state " "information. Each extension should use a unique key to use to store state " @@ -1975,7 +1979,7 @@ msgid "" "thread state is attached." msgstr "" -#: ../../c-api/init.rst:1589 +#: ../../c-api/init.rst:1595 msgid "" "Asynchronously raise an exception in a thread. The *id* argument is the " "thread id of the target thread; *exc* is the exception object to be raised. " @@ -1987,55 +1991,54 @@ msgid "" "is cleared. This raises no exceptions." msgstr "" -#: ../../c-api/init.rst:1597 +#: ../../c-api/init.rst:1603 msgid "" -"The type of the *id* parameter changed from :c:expr:`long` " -"to :c:expr:`unsigned long`." +"The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" +"`unsigned long`." msgstr "" -#: ../../c-api/init.rst:1603 +#: ../../c-api/init.rst:1609 msgid "" ":term:`Attach ` *tstate* to the current thread, which " "must not be ``NULL`` or already :term:`attached `." msgstr "" -#: ../../c-api/init.rst:1606 +#: ../../c-api/init.rst:1612 msgid "" "The calling thread must not already have an :term:`attached thread state`." msgstr "" -#: ../../c-api/init.rst:1614 +#: ../../c-api/init.rst:1620 msgid "" -"Updated to be consistent " -"with :c:func:`PyEval_RestoreThread`, :c:func:`Py_END_ALLOW_THREADS`, " -"and :c:func:`PyGILState_Ensure`, and terminate the current thread if called " -"while the interpreter is finalizing." +"Updated to be consistent with :c:func:`PyEval_RestoreThread`, :c:func:" +"`Py_END_ALLOW_THREADS`, and :c:func:`PyGILState_Ensure`, and terminate the " +"current thread if called while the interpreter is finalizing." msgstr "" -#: ../../c-api/init.rst:1623 +#: ../../c-api/init.rst:1629 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1629 +#: ../../c-api/init.rst:1635 msgid "" "Detach the :term:`attached thread state`. The *tstate* argument, which must " -"not be ``NULL``, is only used to check that it represents " -"the :term:`attached thread state` --- if it isn't, a fatal error is reported." +"not be ``NULL``, is only used to check that it represents the :term:" +"`attached thread state` --- if it isn't, a fatal error is reported." msgstr "" -#: ../../c-api/init.rst:1634 +#: ../../c-api/init.rst:1640 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." msgstr "" -#: ../../c-api/init.rst:1641 +#: ../../c-api/init.rst:1647 msgid "Sub-interpreter support" msgstr "" -#: ../../c-api/init.rst:1643 +#: ../../c-api/init.rst:1649 msgid "" "While in most uses, you will only embed a single Python interpreter, there " "are cases where you need to create several independent interpreters in the " @@ -2043,7 +2046,7 @@ msgid "" "to do that." msgstr "" -#: ../../c-api/init.rst:1648 +#: ../../c-api/init.rst:1654 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -2054,134 +2057,134 @@ msgid "" "returns a pointer to its state." msgstr "" -#: ../../c-api/init.rst:1655 +#: ../../c-api/init.rst:1661 msgid "" -"You can switch between sub-interpreters using " -"the :c:func:`PyThreadState_Swap` function. You can create and destroy them " -"using the following functions:" +"You can switch between sub-interpreters using the :c:func:" +"`PyThreadState_Swap` function. You can create and destroy them using the " +"following functions:" msgstr "" -#: ../../c-api/init.rst:1661 +#: ../../c-api/init.rst:1667 msgid "" "Structure containing most parameters to configure a sub-interpreter. Its " "values are used only in :c:func:`Py_NewInterpreterFromConfig` and never " "modified by the runtime." msgstr "" -#: ../../c-api/init.rst:1667 +#: ../../c-api/init.rst:1673 msgid "Structure fields:" msgstr "" -#: ../../c-api/init.rst:1671 +#: ../../c-api/init.rst:1677 msgid "" "If this is ``0`` then the sub-interpreter will use its own \"object\" " "allocator state. Otherwise it will use (share) the main interpreter's." msgstr "" -#: ../../c-api/init.rst:1675 +#: ../../c-api/init.rst:1681 msgid "" -"If this is ``0`` " -"then :c:member:`~PyInterpreterConfig.check_multi_interp_extensions` must be " -"``1`` (non-zero). If this is ``1`` then :c:member:`~PyInterpreterConfig.gil` " -"must not be :c:macro:`PyInterpreterConfig_OWN_GIL`." +"If this is ``0`` then :c:member:`~PyInterpreterConfig." +"check_multi_interp_extensions` must be ``1`` (non-zero). If this is ``1`` " +"then :c:member:`~PyInterpreterConfig.gil` must not be :c:macro:" +"`PyInterpreterConfig_OWN_GIL`." msgstr "" -#: ../../c-api/init.rst:1683 +#: ../../c-api/init.rst:1689 msgid "" "If this is ``0`` then the runtime will not support forking the process in " "any thread where the sub-interpreter is currently active. Otherwise fork is " "unrestricted." msgstr "" -#: ../../c-api/init.rst:1687 +#: ../../c-api/init.rst:1693 msgid "" "Note that the :mod:`subprocess` module still works when fork is disallowed." msgstr "" -#: ../../c-api/init.rst:1692 +#: ../../c-api/init.rst:1698 msgid "" "If this is ``0`` then the runtime will not support replacing the current " "process via exec (e.g. :func:`os.execv`) in any thread where the sub-" "interpreter is currently active. Otherwise exec is unrestricted." msgstr "" -#: ../../c-api/init.rst:1697 +#: ../../c-api/init.rst:1703 msgid "" "Note that the :mod:`subprocess` module still works when exec is disallowed." msgstr "" -#: ../../c-api/init.rst:1702 +#: ../../c-api/init.rst:1708 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " "create threads. Otherwise threads are allowed." msgstr "" -#: ../../c-api/init.rst:1708 +#: ../../c-api/init.rst:1714 msgid "" "If this is ``0`` then the sub-interpreter's :mod:`threading` module won't " -"create daemon threads. Otherwise daemon threads are allowed (as long " -"as :c:member:`~PyInterpreterConfig.allow_threads` is non-zero)." +"create daemon threads. Otherwise daemon threads are allowed (as long as :c:" +"member:`~PyInterpreterConfig.allow_threads` is non-zero)." msgstr "" -#: ../../c-api/init.rst:1715 +#: ../../c-api/init.rst:1721 msgid "" "If this is ``0`` then all extension modules may be imported, including " "legacy (single-phase init) modules, in any thread where the sub-interpreter " -"is currently active. Otherwise only multi-phase init extension modules " -"(see :pep:`489`) may be imported. (Also " -"see :c:macro:`Py_mod_multiple_interpreters`.)" +"is currently active. Otherwise only multi-phase init extension modules (see :" +"pep:`489`) may be imported. (Also see :c:macro:" +"`Py_mod_multiple_interpreters`.)" msgstr "" -#: ../../c-api/init.rst:1722 +#: ../../c-api/init.rst:1728 msgid "" -"This must be ``1`` (non-zero) " -"if :c:member:`~PyInterpreterConfig.use_main_obmalloc` is ``0``." +"This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." +"use_main_obmalloc` is ``0``." msgstr "" -#: ../../c-api/init.rst:1727 +#: ../../c-api/init.rst:1733 msgid "" "This determines the operation of the GIL for the sub-interpreter. It may be " "one of the following:" msgstr "" -#: ../../c-api/init.rst:1734 +#: ../../c-api/init.rst:1740 msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." msgstr "" -#: ../../c-api/init.rst:1738 +#: ../../c-api/init.rst:1744 msgid "Use (share) the main interpreter's GIL." msgstr "" -#: ../../c-api/init.rst:1742 +#: ../../c-api/init.rst:1748 msgid "Use the sub-interpreter's own GIL." msgstr "" -#: ../../c-api/init.rst:1744 +#: ../../c-api/init.rst:1750 msgid "" -"If this is :c:macro:`PyInterpreterConfig_OWN_GIL` " -"then :c:member:`PyInterpreterConfig.use_main_obmalloc` must be ``0``." +"If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" +"`PyInterpreterConfig.use_main_obmalloc` must be ``0``." msgstr "" -#: ../../c-api/init.rst:1758 +#: ../../c-api/init.rst:1764 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " "interpreter has separate, independent versions of all imported modules, " -"including the fundamental modules :mod:`builtins`, :mod:`__main__` " -"and :mod:`sys`. The table of loaded modules (``sys.modules``) and the " -"module search path (``sys.path``) are also separate. The new environment " -"has no ``sys.argv`` variable. It has new standard I/O stream file objects " -"``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` (however these refer to the " -"same underlying file descriptors)." +"including the fundamental modules :mod:`builtins`, :mod:`__main__` and :mod:" +"`sys`. The table of loaded modules (``sys.modules``) and the module search " +"path (``sys.path``) are also separate. The new environment has no ``sys." +"argv`` variable. It has new standard I/O stream file objects ``sys.stdin``, " +"``sys.stdout`` and ``sys.stderr`` (however these refer to the same " +"underlying file descriptors)." msgstr "" -#: ../../c-api/init.rst:1768 +#: ../../c-api/init.rst:1774 msgid "" "The given *config* controls the options with which the interpreter is " "initialized." msgstr "" -#: ../../c-api/init.rst:1771 +#: ../../c-api/init.rst:1777 msgid "" "Upon success, *tstate_p* will be set to the first :term:`thread state` " "created in the new sub-interpreter. This thread state is :term:`attached " @@ -2192,26 +2195,26 @@ msgid "" "not exist." msgstr "" -#: ../../c-api/init.rst:1780 +#: ../../c-api/init.rst:1786 msgid "" "Like all other Python/C API functions, an :term:`attached thread state` must " "be present before calling this function, but it might be detached upon " "returning. On success, the returned thread state will be :term:`attached " -"`. If the sub-interpreter is created with its " -"own :term:`GIL` then the :term:`attached thread state` of the calling " -"interpreter will be detached. When the function returns, the new " -"interpreter's :term:`thread state` will be :term:`attached ` to the current thread and the previous interpreter's :term:`attached " -"thread state` will remain detached." +"`. If the sub-interpreter is created with its own :" +"term:`GIL` then the :term:`attached thread state` of the calling interpreter " +"will be detached. When the function returns, the new interpreter's :term:" +"`thread state` will be :term:`attached ` to the " +"current thread and the previous interpreter's :term:`attached thread state` " +"will remain detached." msgstr "" -#: ../../c-api/init.rst:1791 +#: ../../c-api/init.rst:1797 msgid "" "Sub-interpreters are most effective when isolated from each other, with " "certain functionality restricted::" msgstr "" -#: ../../c-api/init.rst:1794 +#: ../../c-api/init.rst:1800 msgid "" "PyInterpreterConfig config = {\n" " .use_main_obmalloc = 0,\n" @@ -2243,59 +2246,58 @@ msgstr "" " Py_ExitStatusException(status);\n" "}" -#: ../../c-api/init.rst:1809 +#: ../../c-api/init.rst:1815 msgid "" "Note that the config is used only briefly and does not get modified. During " -"initialization the config's values are converted into " -"various :c:type:`PyInterpreterState` values. A read-only copy of the config " -"may be stored internally on the :c:type:`PyInterpreterState`." +"initialization the config's values are converted into various :c:type:" +"`PyInterpreterState` values. A read-only copy of the config may be stored " +"internally on the :c:type:`PyInterpreterState`." msgstr "" -#: ../../c-api/init.rst:1818 +#: ../../c-api/init.rst:1824 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1820 +#: ../../c-api/init.rst:1826 msgid "" -"For modules using multi-phase initialization, " -"e.g. :c:func:`PyModule_FromDefAndSpec`, a separate module object is created " -"and initialized for each interpreter. Only C-level static and global " -"variables are shared between these module objects." +"For modules using multi-phase initialization, e.g. :c:func:" +"`PyModule_FromDefAndSpec`, a separate module object is created and " +"initialized for each interpreter. Only C-level static and global variables " +"are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1826 +#: ../../c-api/init.rst:1832 msgid "" -"For modules using single-phase initialization, " -"e.g. :c:func:`PyModule_Create`, the first time a particular extension is " -"imported, it is initialized normally, and a (shallow) copy of its module's " -"dictionary is squirreled away. When the same extension is imported by " -"another (sub-)interpreter, a new module is initialized and filled with the " -"contents of this copy; the extension's ``init`` function is not called. " -"Objects in the module's dictionary thus end up shared across " -"(sub-)interpreters, which might cause unwanted behavior (see `Bugs and " -"caveats`_ below)." +"For modules using single-phase initialization, e.g. :c:func:" +"`PyModule_Create`, the first time a particular extension is imported, it is " +"initialized normally, and a (shallow) copy of its module's dictionary is " +"squirreled away. When the same extension is imported by another " +"(sub-)interpreter, a new module is initialized and filled with the contents " +"of this copy; the extension's ``init`` function is not called. Objects in " +"the module's dictionary thus end up shared across (sub-)interpreters, which " +"might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1837 +#: ../../c-api/init.rst:1843 msgid "" "Note that this is different from what happens when an extension is imported " -"after the interpreter has been completely re-initialized by " -"calling :c:func:`Py_FinalizeEx` and :c:func:`Py_Initialize`; in that case, " -"the extension's ``initmodule`` function *is* called again. As with multi-" -"phase initialization, this means that only C-level static and global " -"variables are shared between these modules." +"after the interpreter has been completely re-initialized by calling :c:func:" +"`Py_FinalizeEx` and :c:func:`Py_Initialize`; in that case, the extension's " +"``initmodule`` function *is* called again. As with multi-phase " +"initialization, this means that only C-level static and global variables are " +"shared between these modules." msgstr "" -#: ../../c-api/init.rst:1857 +#: ../../c-api/init.rst:1863 msgid "" -"Create a new sub-interpreter. This is essentially just a wrapper " -"around :c:func:`Py_NewInterpreterFromConfig` with a config that preserves " -"the existing behavior. The result is an unisolated sub-interpreter that " -"shares the main interpreter's GIL, allows fork/exec, allows daemon threads, " -"and allows single-phase init modules." +"Create a new sub-interpreter. This is essentially just a wrapper around :c:" +"func:`Py_NewInterpreterFromConfig` with a config that preserves the existing " +"behavior. The result is an unisolated sub-interpreter that shares the main " +"interpreter's GIL, allows fork/exec, allows daemon threads, and allows " +"single-phase init modules." msgstr "" -#: ../../c-api/init.rst:1869 +#: ../../c-api/init.rst:1875 msgid "" "Destroy the (sub-)interpreter represented by the given :term:`thread state`. " "The given thread state must be :term:`attached `. " @@ -2303,17 +2305,17 @@ msgid "" "thread states associated with this interpreter are destroyed." msgstr "" -#: ../../c-api/init.rst:1874 +#: ../../c-api/init.rst:1880 msgid "" ":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " "explicitly destroyed at that point." msgstr "" -#: ../../c-api/init.rst:1879 +#: ../../c-api/init.rst:1887 msgid "A Per-Interpreter GIL" msgstr "直譯器各別持有的 GIL" -#: ../../c-api/init.rst:1881 +#: ../../c-api/init.rst:1889 msgid "" "Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " "that is completely isolated from other interpreters, including having its " @@ -2322,10 +2324,10 @@ msgid "" "interpreters or blocking any others. Thus a single Python process can truly " "take advantage of multiple CPU cores when running Python code. The " "isolation also encourages a different approach to concurrency than that of " -"just using threads. (See :pep:`554`.)" +"just using threads. (See :pep:`554` and :pep:`684`.)" msgstr "" -#: ../../c-api/init.rst:1891 +#: ../../c-api/init.rst:1899 msgid "" "Using an isolated interpreter requires vigilance in preserving that " "isolation. That especially means not sharing any objects or mutable state " @@ -2339,7 +2341,7 @@ msgid "" "builtin objects." msgstr "" -#: ../../c-api/init.rst:1902 +#: ../../c-api/init.rst:1910 msgid "" "If you preserve isolation then you will have access to proper multi-core " "computing without the complications that come with free-threading. Failure " @@ -2347,7 +2349,7 @@ msgid "" "threading, including races and hard-to-debug crashes." msgstr "" -#: ../../c-api/init.rst:1907 +#: ../../c-api/init.rst:1915 msgid "" "Aside from that, one of the main challenges of using multiple isolated " "interpreters is how to communicate between them safely (not break isolation) " @@ -2357,11 +2359,11 @@ msgid "" "sharing) data between interpreters." msgstr "" -#: ../../c-api/init.rst:1918 +#: ../../c-api/init.rst:1926 msgid "Bugs and caveats" msgstr "" -#: ../../c-api/init.rst:1920 +#: ../../c-api/init.rst:1928 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -2374,7 +2376,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1930 +#: ../../c-api/init.rst:1938 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -2383,37 +2385,37 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1936 +#: ../../c-api/init.rst:1944 msgid "" "Also note that combining this functionality with ``PyGILState_*`` APIs is " "delicate, because these APIs assume a bijection between Python thread states " "and OS-level threads, an assumption broken by the presence of sub-" "interpreters. It is highly recommended that you don't switch sub-" -"interpreters between a pair of matching :c:func:`PyGILState_Ensure` " -"and :c:func:`PyGILState_Release` calls. Furthermore, extensions (such " -"as :mod:`ctypes`) using these APIs to allow calling of Python code from non-" -"Python created threads will probably be broken when using sub-interpreters." +"interpreters between a pair of matching :c:func:`PyGILState_Ensure` and :c:" +"func:`PyGILState_Release` calls. Furthermore, extensions (such as :mod:" +"`ctypes`) using these APIs to allow calling of Python code from non-Python " +"created threads will probably be broken when using sub-interpreters." msgstr "" -#: ../../c-api/init.rst:1947 +#: ../../c-api/init.rst:1955 msgid "Asynchronous Notifications" msgstr "" -#: ../../c-api/init.rst:1949 +#: ../../c-api/init.rst:1957 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " "and a void pointer argument." msgstr "" -#: ../../c-api/init.rst:1956 +#: ../../c-api/init.rst:1964 msgid "" "Schedule a function to be called from the main interpreter thread. On " "success, ``0`` is returned and *func* is queued for being called in the main " "thread. On failure, ``-1`` is returned without setting any exception." msgstr "" -#: ../../c-api/init.rst:1960 +#: ../../c-api/init.rst:1968 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2421,17 +2423,17 @@ msgid "" "these conditions met:" msgstr "" -#: ../../c-api/init.rst:1965 +#: ../../c-api/init.rst:1973 msgid "on a :term:`bytecode` boundary;" msgstr "" -#: ../../c-api/init.rst:1966 +#: ../../c-api/init.rst:1974 msgid "" "with the main thread holding an :term:`attached thread state` (*func* can " "therefore use the full C API)." msgstr "" -#: ../../c-api/init.rst:1969 +#: ../../c-api/init.rst:1977 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " @@ -2439,25 +2441,25 @@ msgid "" "if the :term:`thread state ` is detached." msgstr "" -#: ../../c-api/init.rst:1974 +#: ../../c-api/init.rst:1982 msgid "" "This function doesn't need an :term:`attached thread state`. However, to " -"call this function in a subinterpreter, the caller must have " -"an :term:`attached thread state`. Otherwise, the function *func* can be " -"scheduled to be called from the wrong interpreter." +"call this function in a subinterpreter, the caller must have an :term:" +"`attached thread state`. Otherwise, the function *func* can be scheduled to " +"be called from the wrong interpreter." msgstr "" -#: ../../c-api/init.rst:1979 +#: ../../c-api/init.rst:1987 msgid "" "This is a low-level function, only useful for very special cases. There is " "no guarantee that *func* will be called as quick as possible. If the main " "thread is busy executing a system call, *func* won't be called before the " "system call returns. This function is generally **not** suitable for " -"calling Python code from arbitrary C threads. Instead, use " -"the :ref:`PyGILState API`." +"calling Python code from arbitrary C threads. Instead, use the :ref:" +"`PyGILState API`." msgstr "" -#: ../../c-api/init.rst:1988 +#: ../../c-api/init.rst:1996 msgid "" "If this function is called in a subinterpreter, the function *func* is now " "scheduled to be called from the subinterpreter, rather than being called " @@ -2465,18 +2467,18 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1997 +#: ../../c-api/init.rst:2005 msgid "Profiling and Tracing" msgstr "" -#: ../../c-api/init.rst:2002 +#: ../../c-api/init.rst:2010 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " "debugging, and coverage analysis tools." msgstr "" -#: ../../c-api/init.rst:2006 +#: ../../c-api/init.rst:2014 msgid "" "This C interface allows the profiling or tracing code to avoid the overhead " "of calling through Python-level callable objects, making a direct C function " @@ -2486,76 +2488,78 @@ msgid "" "reported to the Python-level trace functions in previous versions." msgstr "" -#: ../../c-api/init.rst:2016 +#: ../../c-api/init.rst:2024 msgid "" "The type of the trace function registered using :c:func:`PyEval_SetProfile` " "and :c:func:`PyEval_SetTrace`. The first parameter is the object passed to " "the registration function as *obj*, *frame* is the frame object to which the " -"event pertains, *what* is one of the " -"constants :c:data:`PyTrace_CALL`, :c:data:`PyTrace_EXCEPTION`, :c:data:`PyTrace_LINE`, :c:data:`PyTrace_RETURN`, :c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION`, :c:data:`PyTrace_C_RETURN`, " -"or :c:data:`PyTrace_OPCODE`, and *arg* depends on the value of *what*:" +"event pertains, *what* is one of the constants :c:data:`PyTrace_CALL`, :c:" +"data:`PyTrace_EXCEPTION`, :c:data:`PyTrace_LINE`, :c:data:`PyTrace_RETURN`, :" +"c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION`, :c:data:" +"`PyTrace_C_RETURN`, or :c:data:`PyTrace_OPCODE`, and *arg* depends on the " +"value of *what*:" msgstr "" -#: ../../c-api/init.rst:2025 +#: ../../c-api/init.rst:2033 msgid "Value of *what*" msgstr "*what* 的值" -#: ../../c-api/init.rst:2025 +#: ../../c-api/init.rst:2033 msgid "Meaning of *arg*" msgstr "*arg* 的含義" -#: ../../c-api/init.rst:2027 +#: ../../c-api/init.rst:2035 msgid ":c:data:`PyTrace_CALL`" msgstr ":c:data:`PyTrace_CALL`" -#: ../../c-api/init.rst:2027 ../../c-api/init.rst:2032 -#: ../../c-api/init.rst:2043 +#: ../../c-api/init.rst:2035 ../../c-api/init.rst:2040 +#: ../../c-api/init.rst:2051 msgid "Always :c:data:`Py_None`." msgstr "" -#: ../../c-api/init.rst:2029 +#: ../../c-api/init.rst:2037 msgid ":c:data:`PyTrace_EXCEPTION`" msgstr ":c:data:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:2029 +#: ../../c-api/init.rst:2037 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr "" -#: ../../c-api/init.rst:2032 +#: ../../c-api/init.rst:2040 msgid ":c:data:`PyTrace_LINE`" msgstr ":c:data:`PyTrace_LINE`" -#: ../../c-api/init.rst:2034 +#: ../../c-api/init.rst:2042 msgid ":c:data:`PyTrace_RETURN`" msgstr ":c:data:`PyTrace_RETURN`" -#: ../../c-api/init.rst:2034 +#: ../../c-api/init.rst:2042 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" -#: ../../c-api/init.rst:2037 +#: ../../c-api/init.rst:2045 msgid ":c:data:`PyTrace_C_CALL`" msgstr ":c:data:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:2037 ../../c-api/init.rst:2039 -#: ../../c-api/init.rst:2041 +#: ../../c-api/init.rst:2045 ../../c-api/init.rst:2047 +#: ../../c-api/init.rst:2049 msgid "Function object being called." msgstr "被呼叫的函式物件。" -#: ../../c-api/init.rst:2039 +#: ../../c-api/init.rst:2047 msgid ":c:data:`PyTrace_C_EXCEPTION`" msgstr ":c:data:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:2041 +#: ../../c-api/init.rst:2049 msgid ":c:data:`PyTrace_C_RETURN`" msgstr ":c:data:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:2043 +#: ../../c-api/init.rst:2051 msgid ":c:data:`PyTrace_OPCODE`" msgstr ":c:data:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:2048 +#: ../../c-api/init.rst:2056 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "a new call to a function or method is being reported, or a new entry into a " @@ -2564,7 +2568,7 @@ msgid "" "the corresponding frame." msgstr "" -#: ../../c-api/init.rst:2057 +#: ../../c-api/init.rst:2065 msgid "" "The value of the *what* parameter to a :c:type:`Py_tracefunc` function when " "an exception has been raised. The callback function is called with this " @@ -2576,129 +2580,128 @@ msgid "" "profiler." msgstr "" -#: ../../c-api/init.rst:2068 +#: ../../c-api/init.rst:2076 msgid "" "The value passed as the *what* parameter to a :c:type:`Py_tracefunc` " "function (but not a profiling function) when a line-number event is being " -"reported. It may be disabled for a frame by " -"setting :attr:`~frame.f_trace_lines` to *0* on that frame." +"reported. It may be disabled for a frame by setting :attr:`~frame." +"f_trace_lines` to *0* on that frame." msgstr "" -#: ../../c-api/init.rst:2076 +#: ../../c-api/init.rst:2084 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." msgstr "" -#: ../../c-api/init.rst:2082 +#: ../../c-api/init.rst:2090 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." msgstr "" -#: ../../c-api/init.rst:2088 +#: ../../c-api/init.rst:2096 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." msgstr "" -#: ../../c-api/init.rst:2094 +#: ../../c-api/init.rst:2102 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." msgstr "" -#: ../../c-api/init.rst:2100 +#: ../../c-api/init.rst:2108 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions (but " "not profiling functions) when a new opcode is about to be executed. This " -"event is not emitted by default: it must be explicitly requested by " -"setting :attr:`~frame.f_trace_opcodes` to *1* on the frame." +"event is not emitted by default: it must be explicitly requested by setting :" +"attr:`~frame.f_trace_opcodes` to *1* on the frame." msgstr "" -#: ../../c-api/init.rst:2108 +#: ../../c-api/init.rst:2116 msgid "" "Set the profiler function to *func*. The *obj* parameter is passed to the " "function as its first parameter, and may be any Python object, or ``NULL``. " "If the profile function needs to maintain state, using a different value for " "*obj* for each thread provides a convenient and thread-safe place to store " -"it. The profile function is called for all monitored events " -"except :c:data:`PyTrace_LINE` :c:data:`PyTrace_OPCODE` " -"and :c:data:`PyTrace_EXCEPTION`." +"it. The profile function is called for all monitored events except :c:data:" +"`PyTrace_LINE` :c:data:`PyTrace_OPCODE` and :c:data:`PyTrace_EXCEPTION`." msgstr "" -#: ../../c-api/init.rst:2115 +#: ../../c-api/init.rst:2123 msgid "See also the :func:`sys.setprofile` function." msgstr "另請參閱 :func:`sys.setprofile` 函式。" -#: ../../c-api/init.rst:2121 +#: ../../c-api/init.rst:2129 msgid "" "Like :c:func:`PyEval_SetProfile` but sets the profile function in all " "running threads belonging to the current interpreter instead of the setting " "it only on the current thread." msgstr "" -#: ../../c-api/init.rst:2126 +#: ../../c-api/init.rst:2134 msgid "" "As :c:func:`PyEval_SetProfile`, this function ignores any exceptions raised " "while setting the profile functions in all threads." msgstr "" -#: ../../c-api/init.rst:2134 +#: ../../c-api/init.rst:2142 msgid "" -"Set the tracing function to *func*. This is similar " -"to :c:func:`PyEval_SetProfile`, except the tracing function does receive " -"line-number events and per-opcode events, but does not receive any event " -"related to C function objects being called. Any trace function registered " -"using :c:func:`PyEval_SetTrace` will not " -"receive :c:data:`PyTrace_C_CALL`, :c:data:`PyTrace_C_EXCEPTION` " -"or :c:data:`PyTrace_C_RETURN` as a value for the *what* parameter." +"Set the tracing function to *func*. This is similar to :c:func:" +"`PyEval_SetProfile`, except the tracing function does receive line-number " +"events and per-opcode events, but does not receive any event related to C " +"function objects being called. Any trace function registered using :c:func:" +"`PyEval_SetTrace` will not receive :c:data:`PyTrace_C_CALL`, :c:data:" +"`PyTrace_C_EXCEPTION` or :c:data:`PyTrace_C_RETURN` as a value for the " +"*what* parameter." msgstr "" -#: ../../c-api/init.rst:2141 +#: ../../c-api/init.rst:2149 msgid "See also the :func:`sys.settrace` function." msgstr "也請見 :func:`sys.settrace` 函式。" -#: ../../c-api/init.rst:2147 +#: ../../c-api/init.rst:2155 msgid "" "Like :c:func:`PyEval_SetTrace` but sets the tracing function in all running " "threads belonging to the current interpreter instead of the setting it only " "on the current thread." msgstr "" -#: ../../c-api/init.rst:2152 +#: ../../c-api/init.rst:2160 msgid "" "As :c:func:`PyEval_SetTrace`, this function ignores any exceptions raised " "while setting the trace functions in all threads." msgstr "" -#: ../../c-api/init.rst:2158 +#: ../../c-api/init.rst:2166 msgid "Reference tracing" msgstr "" -#: ../../c-api/init.rst:2164 +#: ../../c-api/init.rst:2172 msgid "" -"The type of the trace function registered " -"using :c:func:`PyRefTracer_SetTracer`. The first parameter is a Python " -"object that has been just created (when **event** is set " -"to :c:data:`PyRefTracer_CREATE`) or about to be destroyed (when **event** is " -"set to :c:data:`PyRefTracer_DESTROY`). The **data** argument is the opaque " -"pointer that was provided when :c:func:`PyRefTracer_SetTracer` was called." +"The type of the trace function registered using :c:func:" +"`PyRefTracer_SetTracer`. The first parameter is a Python object that has " +"been just created (when **event** is set to :c:data:`PyRefTracer_CREATE`) or " +"about to be destroyed (when **event** is set to :c:data:" +"`PyRefTracer_DESTROY`). The **data** argument is the opaque pointer that was " +"provided when :c:func:`PyRefTracer_SetTracer` was called." msgstr "" -#: ../../c-api/init.rst:2174 +#: ../../c-api/init.rst:2182 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been created." msgstr "" -#: ../../c-api/init.rst:2179 +#: ../../c-api/init.rst:2187 msgid "" "The value for the *event* parameter to :c:type:`PyRefTracer` functions when " "a Python object has been destroyed." msgstr "" -#: ../../c-api/init.rst:2184 +#: ../../c-api/init.rst:2192 msgid "" "Register a reference tracer function. The function will be called when a new " "Python has been created or when an object is going to be destroyed. If " @@ -2707,7 +2710,7 @@ msgid "" "return ``-1`` on error." msgstr "" -#: ../../c-api/init.rst:2190 +#: ../../c-api/init.rst:2198 msgid "" "Not that tracer functions **must not** create Python objects inside or " "otherwise the call will be re-entrant. The tracer also **must not** clear " @@ -2715,12 +2718,12 @@ msgid "" "active every time the tracer function is called." msgstr "" -#: ../../c-api/init.rst:2195 ../../c-api/init.rst:2206 +#: ../../c-api/init.rst:2203 ../../c-api/init.rst:2214 msgid "" "There must be an :term:`attached thread state` when calling this function." msgstr "" -#: ../../c-api/init.rst:2201 +#: ../../c-api/init.rst:2209 msgid "" "Get the registered reference tracer function and the value of the opaque " "data pointer that was registered when :c:func:`PyRefTracer_SetTracer` was " @@ -2728,48 +2731,48 @@ msgid "" "set the **data** pointer to NULL." msgstr "" -#: ../../c-api/init.rst:2213 +#: ../../c-api/init.rst:2221 msgid "Advanced Debugger Support" msgstr "" -#: ../../c-api/init.rst:2218 +#: ../../c-api/init.rst:2226 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "" -#: ../../c-api/init.rst:2223 +#: ../../c-api/init.rst:2231 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" -#: ../../c-api/init.rst:2228 +#: ../../c-api/init.rst:2236 msgid "Return the main interpreter state object." msgstr "" -#: ../../c-api/init.rst:2233 +#: ../../c-api/init.rst:2241 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." msgstr "" -#: ../../c-api/init.rst:2239 +#: ../../c-api/init.rst:2247 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." msgstr "" -#: ../../c-api/init.rst:2245 +#: ../../c-api/init.rst:2253 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." msgstr "" -#: ../../c-api/init.rst:2252 +#: ../../c-api/init.rst:2260 msgid "Thread Local Storage Support" msgstr "" -#: ../../c-api/init.rst:2256 +#: ../../c-api/init.rst:2264 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " @@ -2779,42 +2782,42 @@ msgid "" "thread." msgstr "" -#: ../../c-api/init.rst:2263 +#: ../../c-api/init.rst:2271 msgid "" "A :term:`thread state` does *not* need to be :term:`attached ` when calling these functions; they suppl their own locking." msgstr "" -#: ../../c-api/init.rst:2266 +#: ../../c-api/init.rst:2274 msgid "" "Note that :file:`Python.h` does not include the declaration of the TLS APIs, " "you need to include :file:`pythread.h` to use thread-local storage." msgstr "" -#: ../../c-api/init.rst:2270 +#: ../../c-api/init.rst:2278 msgid "" -"None of these API functions handle memory management on behalf of " -"the :c:expr:`void*` values. You need to allocate and deallocate them " -"yourself. If the :c:expr:`void*` values happen to be :c:expr:`PyObject*`, " -"these functions don't do refcount operations on them either." +"None of these API functions handle memory management on behalf of the :c:" +"expr:`void*` values. You need to allocate and deallocate them yourself. If " +"the :c:expr:`void*` values happen to be :c:expr:`PyObject*`, these functions " +"don't do refcount operations on them either." msgstr "" -#: ../../c-api/init.rst:2278 +#: ../../c-api/init.rst:2286 msgid "Thread Specific Storage (TSS) API" msgstr "" -#: ../../c-api/init.rst:2280 +#: ../../c-api/init.rst:2288 msgid "" "TSS API is introduced to supersede the use of the existing TLS API within " "the CPython interpreter. This API uses a new type :c:type:`Py_tss_t` " "instead of :c:expr:`int` to represent thread keys." msgstr "" -#: ../../c-api/init.rst:2286 +#: ../../c-api/init.rst:2294 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" -#: ../../c-api/init.rst:2291 +#: ../../c-api/init.rst:2299 msgid "" "This data structure represents the state of a thread key, the definition of " "which may depend on the underlying TLS implementation, and it has an " @@ -2822,67 +2825,66 @@ msgid "" "public members in this structure." msgstr "" -#: ../../c-api/init.rst:2296 +#: ../../c-api/init.rst:2304 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." msgstr "" -#: ../../c-api/init.rst:2302 +#: ../../c-api/init.rst:2310 msgid "" "This macro expands to the initializer for :c:type:`Py_tss_t` variables. Note " "that this macro won't be defined with :ref:`Py_LIMITED_API `." msgstr "" -#: ../../c-api/init.rst:2307 +#: ../../c-api/init.rst:2315 msgid "Dynamic Allocation" msgstr "" -#: ../../c-api/init.rst:2309 +#: ../../c-api/init.rst:2317 msgid "" "Dynamic allocation of the :c:type:`Py_tss_t`, required in extension modules " "built with :ref:`Py_LIMITED_API `, where static allocation of this " "type is not possible due to its implementation being opaque at build time." msgstr "" -#: ../../c-api/init.rst:2316 +#: ../../c-api/init.rst:2324 msgid "" -"Return a value which is the same state as a value initialized " -"with :c:macro:`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic " -"allocation failure." +"Return a value which is the same state as a value initialized with :c:macro:" +"`Py_tss_NEEDS_INIT`, or ``NULL`` in the case of dynamic allocation failure." msgstr "" -#: ../../c-api/init.rst:2323 +#: ../../c-api/init.rst:2331 msgid "" "Free the given *key* allocated by :c:func:`PyThread_tss_alloc`, after first " "calling :c:func:`PyThread_tss_delete` to ensure any associated thread locals " "have been unassigned. This is a no-op if the *key* argument is ``NULL``." msgstr "" -#: ../../c-api/init.rst:2329 +#: ../../c-api/init.rst:2337 msgid "" "A freed key becomes a dangling pointer. You should reset the key to ``NULL``." msgstr "" -#: ../../c-api/init.rst:2334 +#: ../../c-api/init.rst:2342 msgid "Methods" msgstr "方法" -#: ../../c-api/init.rst:2336 +#: ../../c-api/init.rst:2344 msgid "" "The parameter *key* of these functions must not be ``NULL``. Moreover, the " "behaviors of :c:func:`PyThread_tss_set` and :c:func:`PyThread_tss_get` are " -"undefined if the given :c:type:`Py_tss_t` has not been initialized " -"by :c:func:`PyThread_tss_create`." +"undefined if the given :c:type:`Py_tss_t` has not been initialized by :c:" +"func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2344 +#: ../../c-api/init.rst:2352 msgid "" "Return a non-zero value if the given :c:type:`Py_tss_t` has been initialized " "by :c:func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2350 +#: ../../c-api/init.rst:2358 msgid "" "Return a zero value on successful initialization of a TSS key. The behavior " "is undefined if the value pointed to by the *key* argument is not " @@ -2891,40 +2893,40 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2359 +#: ../../c-api/init.rst:2367 msgid "" "Destroy a TSS key to forget the values associated with the key across all " "threads, and change the key's initialization state to uninitialized. A " -"destroyed key is able to be initialized again " -"by :c:func:`PyThread_tss_create`. This function can be called repeatedly on " -"the same key -- calling it on an already destroyed key is a no-op." +"destroyed key is able to be initialized again by :c:func:" +"`PyThread_tss_create`. This function can be called repeatedly on the same " +"key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2368 +#: ../../c-api/init.rst:2376 msgid "" "Return a zero value to indicate successfully associating a :c:expr:`void*` " "value with a TSS key in the current thread. Each thread has a distinct " "mapping of the key to a :c:expr:`void*` value." msgstr "" -#: ../../c-api/init.rst:2375 +#: ../../c-api/init.rst:2383 msgid "" "Return the :c:expr:`void*` value associated with a TSS key in the current " "thread. This returns ``NULL`` if no value is associated with the key in the " "current thread." msgstr "" -#: ../../c-api/init.rst:2383 +#: ../../c-api/init.rst:2391 msgid "Thread Local Storage (TLS) API" msgstr "執行緒局部儲存 (Thread Local Storage, TLS) API:" -#: ../../c-api/init.rst:2385 +#: ../../c-api/init.rst:2393 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2390 +#: ../../c-api/init.rst:2398 msgid "" "This version of the API does not support platforms where the native TLS key " "is defined in a way that cannot be safely cast to ``int``. On such " @@ -2933,45 +2935,45 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2395 +#: ../../c-api/init.rst:2403 msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." msgstr "" -#: ../../c-api/init.rst:2406 +#: ../../c-api/init.rst:2414 msgid "Synchronization Primitives" msgstr "" -#: ../../c-api/init.rst:2408 +#: ../../c-api/init.rst:2416 msgid "The C-API provides a basic mutual exclusion lock." msgstr "" -#: ../../c-api/init.rst:2412 +#: ../../c-api/init.rst:2420 msgid "" "A mutual exclusion lock. The :c:type:`!PyMutex` should be initialized to " "zero to represent the unlocked state. For example::" msgstr "" -#: ../../c-api/init.rst:2415 +#: ../../c-api/init.rst:2423 msgid "PyMutex mutex = {0};" msgstr "PyMutex mutex = {0};" -#: ../../c-api/init.rst:2417 +#: ../../c-api/init.rst:2425 msgid "" "Instances of :c:type:`!PyMutex` should not be copied or moved. Both the " "contents and address of a :c:type:`!PyMutex` are meaningful, and it must " "remain at a fixed, writable location in memory." msgstr "" -#: ../../c-api/init.rst:2423 +#: ../../c-api/init.rst:2431 msgid "" "A :c:type:`!PyMutex` currently occupies one byte, but the size should be " "considered unstable. The size may change in future Python releases without " "a deprecation period." msgstr "" -#: ../../c-api/init.rst:2431 +#: ../../c-api/init.rst:2439 msgid "" "Lock mutex *m*. If another thread has already locked it, the calling thread " "will block until the mutex is unlocked. While blocked, the thread will " @@ -2979,28 +2981,28 @@ msgid "" "exists." msgstr "" -#: ../../c-api/init.rst:2439 +#: ../../c-api/init.rst:2447 msgid "" "Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " "issue a fatal error." msgstr "" -#: ../../c-api/init.rst:2446 +#: ../../c-api/init.rst:2454 msgid "Returns non-zero if the mutex *m* is currently locked, zero otherwise." msgstr "" -#: ../../c-api/init.rst:2450 +#: ../../c-api/init.rst:2458 msgid "" "This function is intended for use in assertions and debugging only and " "should not be used to make concurrency control decisions, as the lock state " "may change immediately after the check." msgstr "" -#: ../../c-api/init.rst:2459 +#: ../../c-api/init.rst:2467 msgid "Python Critical Section API" msgstr "" -#: ../../c-api/init.rst:2461 +#: ../../c-api/init.rst:2469 msgid "" "The critical section API provides a deadlock avoidance layer on top of per-" "object locks for :term:`free-threaded ` CPython. They are " @@ -3008,17 +3010,16 @@ msgid "" "no-ops in versions of Python with the global interpreter lock." msgstr "" -#: ../../c-api/init.rst:2466 +#: ../../c-api/init.rst:2474 msgid "" "Critical sections are intended to be used for custom types implemented in C-" -"API extensions. They should generally not be used with built-in types " -"like :class:`list` and :class:`dict` because their public C-APIs already use " -"critical sections internally, with the notable exception " -"of :c:func:`PyDict_Next`, which requires critical section to be acquired " -"externally." +"API extensions. They should generally not be used with built-in types like :" +"class:`list` and :class:`dict` because their public C-APIs already use " +"critical sections internally, with the notable exception of :c:func:" +"`PyDict_Next`, which requires critical section to be acquired externally." msgstr "" -#: ../../c-api/init.rst:2473 +#: ../../c-api/init.rst:2481 msgid "" "Critical sections avoid deadlocks by implicitly suspending active critical " "sections, hence, they do not provide exclusive access such as provided by " @@ -3029,7 +3030,7 @@ msgid "" "threads can acquire the per-object lock for the same object." msgstr "" -#: ../../c-api/init.rst:2481 +#: ../../c-api/init.rst:2489 msgid "" "Variants that accept :c:type:`PyMutex` pointers rather than Python objects " "are also available. Use these variants to start a critical section in a " @@ -3038,7 +3039,7 @@ msgid "" "needs to call into the C API in a manner that might lead to deadlocks." msgstr "" -#: ../../c-api/init.rst:2487 +#: ../../c-api/init.rst:2495 msgid "" "The functions and structs used by the macros are exposed for cases where C " "macros are not available. They should only be used as in the given macro " @@ -3046,20 +3047,20 @@ msgid "" "future Python versions." msgstr "" -#: ../../c-api/init.rst:2494 +#: ../../c-api/init.rst:2502 msgid "" -"Operations that need to lock two objects at once must " -"use :c:macro:`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical " -"sections to lock more than one object at once, because the inner critical " -"section may suspend the outer critical sections. This API does not provide " -"a way to lock more than two objects at once." +"Operations that need to lock two objects at once must use :c:macro:" +"`Py_BEGIN_CRITICAL_SECTION2`. You *cannot* use nested critical sections to " +"lock more than one object at once, because the inner critical section may " +"suspend the outer critical sections. This API does not provide a way to " +"lock more than two objects at once." msgstr "" -#: ../../c-api/init.rst:2500 +#: ../../c-api/init.rst:2508 msgid "Example usage::" msgstr "範例用法: ::" -#: ../../c-api/init.rst:2502 +#: ../../c-api/init.rst:2510 msgid "" "static PyObject *\n" "set_field(MyObject *self, PyObject *value)\n" @@ -3079,29 +3080,29 @@ msgstr "" " Py_RETURN_NONE;\n" "}" -#: ../../c-api/init.rst:2511 +#: ../../c-api/init.rst:2519 msgid "" "In the above example, :c:macro:`Py_SETREF` calls :c:macro:`Py_DECREF`, which " "can call arbitrary code through an object's deallocation function. The " "critical section API avoids potential deadlocks due to reentrancy and lock " "ordering by allowing the runtime to temporarily suspend the critical section " -"if the code triggered by the finalizer blocks and " -"calls :c:func:`PyEval_SaveThread`." +"if the code triggered by the finalizer blocks and calls :c:func:" +"`PyEval_SaveThread`." msgstr "" -#: ../../c-api/init.rst:2519 +#: ../../c-api/init.rst:2527 msgid "" "Acquires the per-object lock for the object *op* and begins a critical " "section." msgstr "" -#: ../../c-api/init.rst:2522 ../../c-api/init.rst:2536 -#: ../../c-api/init.rst:2553 ../../c-api/init.rst:2568 -#: ../../c-api/init.rst:2582 ../../c-api/init.rst:2599 +#: ../../c-api/init.rst:2530 ../../c-api/init.rst:2544 +#: ../../c-api/init.rst:2561 ../../c-api/init.rst:2576 +#: ../../c-api/init.rst:2590 ../../c-api/init.rst:2607 msgid "In the free-threaded build, this macro expands to::" msgstr "" -#: ../../c-api/init.rst:2524 +#: ../../c-api/init.rst:2532 msgid "" "{\n" " PyCriticalSection _py_cs;\n" @@ -3111,15 +3112,15 @@ msgstr "" " PyCriticalSection _py_cs;\n" " PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" -#: ../../c-api/init.rst:2528 ../../c-api/init.rst:2574 +#: ../../c-api/init.rst:2536 ../../c-api/init.rst:2582 msgid "In the default build, this macro expands to ``{``." msgstr "" -#: ../../c-api/init.rst:2534 +#: ../../c-api/init.rst:2542 msgid "Locks the mutex *m* and begins a critical section." msgstr "" -#: ../../c-api/init.rst:2538 +#: ../../c-api/init.rst:2546 msgid "" "{\n" " PyCriticalSection _py_cs;\n" @@ -3129,21 +3130,21 @@ msgstr "" " PyCriticalSection _py_cs;\n" " PyCriticalSection_BeginMutex(&_py_cs, m)" -#: ../../c-api/init.rst:2542 +#: ../../c-api/init.rst:2550 msgid "" "Note that unlike :c:macro:`Py_BEGIN_CRITICAL_SECTION`, there is no cast for " "the argument of the macro - it must be a :c:type:`PyMutex` pointer." msgstr "" -#: ../../c-api/init.rst:2545 ../../c-api/init.rst:2591 +#: ../../c-api/init.rst:2553 ../../c-api/init.rst:2599 msgid "On the default build, this macro expands to ``{``." msgstr "" -#: ../../c-api/init.rst:2551 +#: ../../c-api/init.rst:2559 msgid "Ends the critical section and releases the per-object lock." msgstr "" -#: ../../c-api/init.rst:2555 +#: ../../c-api/init.rst:2563 msgid "" " PyCriticalSection_End(&_py_cs);\n" "}" @@ -3151,18 +3152,18 @@ msgstr "" " PyCriticalSection_End(&_py_cs);\n" "}" -#: ../../c-api/init.rst:2558 ../../c-api/init.rst:2604 +#: ../../c-api/init.rst:2566 ../../c-api/init.rst:2612 msgid "In the default build, this macro expands to ``}``." msgstr "" -#: ../../c-api/init.rst:2564 +#: ../../c-api/init.rst:2572 msgid "" "Acquires the per-objects locks for the objects *a* and *b* and begins a " "critical section. The locks are acquired in a consistent order (lowest " "address first) to avoid lock ordering deadlocks." msgstr "" -#: ../../c-api/init.rst:2570 +#: ../../c-api/init.rst:2578 msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" @@ -3172,11 +3173,11 @@ msgstr "" " PyCriticalSection2 _py_cs2;\n" " PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" -#: ../../c-api/init.rst:2580 +#: ../../c-api/init.rst:2588 msgid "Locks the mutexes *m1* and *m2* and begins a critical section." msgstr "" -#: ../../c-api/init.rst:2584 +#: ../../c-api/init.rst:2592 msgid "" "{\n" " PyCriticalSection2 _py_cs2;\n" @@ -3186,17 +3187,17 @@ msgstr "" " PyCriticalSection2 _py_cs2;\n" " PyCriticalSection2_BeginMutex(&_py_cs2, m1, m2)" -#: ../../c-api/init.rst:2588 +#: ../../c-api/init.rst:2596 msgid "" "Note that unlike :c:macro:`Py_BEGIN_CRITICAL_SECTION2`, there is no cast for " "the arguments of the macro - they must be :c:type:`PyMutex` pointers." msgstr "" -#: ../../c-api/init.rst:2597 +#: ../../c-api/init.rst:2605 msgid "Ends the critical section and releases the per-object locks." msgstr "" -#: ../../c-api/init.rst:2601 +#: ../../c-api/init.rst:2609 msgid "" " PyCriticalSection2_End(&_py_cs2);\n" "}" @@ -3216,20 +3217,20 @@ msgstr "modules(sys 模組中)" msgid "path (in module sys)" msgstr "path(sys 模組中)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:712 ../../c-api/init.rst:1222 -#: ../../c-api/init.rst:1750 ../../c-api/init.rst:1849 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:712 ../../c-api/init.rst:1228 +#: ../../c-api/init.rst:1756 ../../c-api/init.rst:1855 msgid "module" msgstr "模組" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1750 ../../c-api/init.rst:1849 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1756 ../../c-api/init.rst:1855 msgid "builtins" msgstr "builtins(內建)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1750 ../../c-api/init.rst:1849 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1756 ../../c-api/init.rst:1855 msgid "__main__" msgstr "__main__" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1750 ../../c-api/init.rst:1849 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1756 ../../c-api/init.rst:1855 msgid "sys" msgstr "sys" @@ -3241,7 +3242,7 @@ msgstr "search(搜尋)" msgid "path" msgstr "path(路徑)" -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1814 ../../c-api/init.rst:1867 +#: ../../c-api/init.rst:350 ../../c-api/init.rst:1820 ../../c-api/init.rst:1873 msgid "Py_FinalizeEx (C function)" msgstr "Py_FinalizeEx(C 函式)" @@ -3317,43 +3318,43 @@ msgstr "PyEval_RestoreThread(C 函式)" msgid "PyEval_SaveThread (C function)" msgstr "PyEval_SaveThread(C 函式)" -#: ../../c-api/init.rst:1200 +#: ../../c-api/init.rst:1206 msgid "PyEval_AcquireThread()" msgstr "PyEval_AcquireThread()" -#: ../../c-api/init.rst:1200 +#: ../../c-api/init.rst:1206 msgid "PyEval_ReleaseThread()" msgstr "PyEval_ReleaseThread()" -#: ../../c-api/init.rst:1200 +#: ../../c-api/init.rst:1206 msgid "PyEval_SaveThread()" msgstr "PyEval_SaveThread()" -#: ../../c-api/init.rst:1200 +#: ../../c-api/init.rst:1206 msgid "PyEval_RestoreThread()" msgstr "PyEval_RestoreThread()" -#: ../../c-api/init.rst:1222 +#: ../../c-api/init.rst:1228 msgid "_thread" msgstr "_thread" -#: ../../c-api/init.rst:1750 ../../c-api/init.rst:1849 +#: ../../c-api/init.rst:1756 ../../c-api/init.rst:1855 msgid "stdout (in module sys)" msgstr "stdout(sys 模組中)" -#: ../../c-api/init.rst:1750 ../../c-api/init.rst:1849 +#: ../../c-api/init.rst:1756 ../../c-api/init.rst:1855 msgid "stderr (in module sys)" msgstr "stderr(sys 模組中)" -#: ../../c-api/init.rst:1750 ../../c-api/init.rst:1849 +#: ../../c-api/init.rst:1756 ../../c-api/init.rst:1855 msgid "stdin (in module sys)" msgstr "stdin(sys 模組中)" -#: ../../c-api/init.rst:1814 +#: ../../c-api/init.rst:1820 msgid "Py_Initialize (C function)" msgstr "Py_Initialize(C 函式)" -#: ../../c-api/init.rst:1844 +#: ../../c-api/init.rst:1850 msgid "close (in module os)" msgstr "close(os 模組中)" diff --git a/c-api/long.po b/c-api/long.po index e428371f79..17bf9290c6 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: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+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-" @@ -46,8 +46,8 @@ msgstr "" #: ../../c-api/long.rst:29 msgid "" -"Return true if its argument is a :c:type:`PyLongObject` or a subtype " -"of :c:type:`PyLongObject`. This function always succeeds." +"Return true if its argument is a :c:type:`PyLongObject` or a subtype of :c:" +"type:`PyLongObject`. This function always succeeds." msgstr "" #: ../../c-api/long.rst:35 @@ -61,63 +61,63 @@ msgid "" "Return a new :c:type:`PyLongObject` object from *v*, or ``NULL`` on failure." msgstr "" -#: ../../c-api/long.rst:43 +#: ../../c-api/long.rst:45 msgid "" -"The current implementation keeps an array of integer objects for all " -"integers between ``-5`` and ``256``. When you create an int in that range " -"you actually just get back a reference to the existing object." +"CPython keeps an array of integer objects for all integers between ``-5`` " +"and ``256``. When you create an int in that range you actually just get " +"back a reference to the existing object." msgstr "" -#: ../../c-api/long.rst:50 +#: ../../c-api/long.rst:52 msgid "" "Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long`, " "or ``NULL`` on failure." msgstr "" -#: ../../c-api/long.rst:56 +#: ../../c-api/long.rst:58 msgid "" "Return a new :c:type:`PyLongObject` object from a C :c:type:`Py_ssize_t`, or " "``NULL`` on failure." msgstr "" -#: ../../c-api/long.rst:62 +#: ../../c-api/long.rst:64 msgid "" "Return a new :c:type:`PyLongObject` object from a C :c:type:`size_t`, or " "``NULL`` on failure." msgstr "" -#: ../../c-api/long.rst:68 +#: ../../c-api/long.rst:70 msgid "" "Return a new :c:type:`PyLongObject` object from a C :c:expr:`long long`, or " "``NULL`` on failure." msgstr "" -#: ../../c-api/long.rst:75 +#: ../../c-api/long.rst:77 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." msgstr "" -#: ../../c-api/long.rst:84 +#: ../../c-api/long.rst:86 msgid "" "Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long " "long`, or ``NULL`` on failure." msgstr "" -#: ../../c-api/long.rst:91 +#: ../../c-api/long.rst:93 msgid "" -"Return a new :c:type:`PyLongObject` object from an unsigned " -"C :c:expr:`uint32_t` or :c:expr:`uint64_t`, or ``NULL`` with an exception " -"set on failure." +"Return a new :c:type:`PyLongObject` object from an unsigned C :c:expr:" +"`uint32_t` or :c:expr:`uint64_t`, or ``NULL`` with an exception set on " +"failure." msgstr "" -#: ../../c-api/long.rst:100 +#: ../../c-api/long.rst:102 msgid "" "Return a new :c:type:`PyLongObject` object from the integer part of *v*, or " "``NULL`` on failure." msgstr "" -#: ../../c-api/long.rst:106 +#: ../../c-api/long.rst:108 msgid "" "Return a new :c:type:`PyLongObject` based on the string value in *str*, " "which is interpreted according to the radix in *base*, or ``NULL`` on " @@ -132,32 +132,32 @@ msgid "" "whitespace, :exc:`ValueError` will be raised." msgstr "" -#: ../../c-api/long.rst:117 +#: ../../c-api/long.rst:119 msgid "" ":c:func:`PyLong_AsNativeBytes()` and :c:func:`PyLong_FromNativeBytes()` " "functions can be used to convert a :c:type:`PyLongObject` to/from an array " "of bytes in base ``256``." msgstr "" -#: ../../c-api/long.rst:124 +#: ../../c-api/long.rst:126 msgid "" "Convert a sequence of Unicode digits in the string *u* to a Python integer " "value." msgstr "" -#: ../../c-api/long.rst:132 +#: ../../c-api/long.rst:134 msgid "" "Create a Python integer from the pointer *p*. The pointer value can be " "retrieved from the resulting value using :c:func:`PyLong_AsVoidPtr`." msgstr "" -#: ../../c-api/long.rst:138 +#: ../../c-api/long.rst:140 msgid "" "Create a Python integer from the value contained in the first *n_bytes* of " "*buffer*, interpreted as a two's-complement signed number." msgstr "" -#: ../../c-api/long.rst:141 +#: ../../c-api/long.rst:143 msgid "" "*flags* are as for :c:func:`PyLong_AsNativeBytes`. Passing ``-1`` will " "select the native endian that CPython was compiled with and assume that the " @@ -166,295 +166,291 @@ msgid "" "calling :c:func:`PyLong_FromUnsignedNativeBytes`. Other flags are ignored." msgstr "" -#: ../../c-api/long.rst:152 +#: ../../c-api/long.rst:154 msgid "" "Create a Python integer from the value contained in the first *n_bytes* of " "*buffer*, interpreted as an unsigned number." msgstr "" -#: ../../c-api/long.rst:155 +#: ../../c-api/long.rst:157 msgid "" "*flags* are as for :c:func:`PyLong_AsNativeBytes`. Passing ``-1`` will " "select the native endian that CPython was compiled with and assume that the " "most-significant bit is not a sign bit. Flags other than endian are ignored." msgstr "" -#: ../../c-api/long.rst:168 ../../c-api/long.rst:204 +#: ../../c-api/long.rst:170 ../../c-api/long.rst:206 msgid "" "Return a C :c:expr:`long` representation of *obj*. If *obj* is not an " "instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` " "method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:172 +#: ../../c-api/long.rst:174 msgid "" -"Raise :exc:`OverflowError` if the value of *obj* is out of range for " -"a :c:expr:`long`." +"Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" +"expr:`long`." msgstr "" -#: ../../c-api/long.rst:175 ../../c-api/long.rst:213 ../../c-api/long.rst:234 -#: ../../c-api/long.rst:254 ../../c-api/long.rst:277 +#: ../../c-api/long.rst:177 ../../c-api/long.rst:215 ../../c-api/long.rst:236 +#: ../../c-api/long.rst:256 ../../c-api/long.rst:279 msgid "Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/long.rst:177 ../../c-api/long.rst:215 ../../c-api/long.rst:236 -#: ../../c-api/long.rst:258 ../../c-api/long.rst:342 ../../c-api/long.rst:362 +#: ../../c-api/long.rst:179 ../../c-api/long.rst:217 ../../c-api/long.rst:238 +#: ../../c-api/long.rst:260 ../../c-api/long.rst:344 ../../c-api/long.rst:364 msgid "Use :meth:`~object.__index__` if available." msgstr "" -#: ../../c-api/long.rst:180 ../../c-api/long.rst:218 ../../c-api/long.rst:239 -#: ../../c-api/long.rst:261 ../../c-api/long.rst:345 ../../c-api/long.rst:365 +#: ../../c-api/long.rst:182 ../../c-api/long.rst:220 ../../c-api/long.rst:241 +#: ../../c-api/long.rst:263 ../../c-api/long.rst:347 ../../c-api/long.rst:367 msgid "This function will no longer use :meth:`~object.__int__`." msgstr "" -#: ../../c-api/long.rst:187 +#: ../../c-api/long.rst:189 msgid "" "A :term:`soft deprecated` alias. Exactly equivalent to the preferred " "``PyLong_AsLong``. In particular, it can fail with :exc:`OverflowError` or " "another exception." msgstr "" -#: ../../c-api/long.rst:191 +#: ../../c-api/long.rst:193 msgid "The function is soft deprecated." msgstr "" -#: ../../c-api/long.rst:196 +#: ../../c-api/long.rst:198 msgid "" -"Similar to :c:func:`PyLong_AsLong`, but store the result in a " -"C :c:expr:`int` instead of a C :c:expr:`long`." +"Similar to :c:func:`PyLong_AsLong`, but store the result in a C :c:expr:" +"`int` instead of a C :c:expr:`long`." msgstr "" -#: ../../c-api/long.rst:208 +#: ../../c-api/long.rst:210 msgid "" -"If the value of *obj* is greater than :c:macro:`LONG_MAX` or less " -"than :c:macro:`LONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, " -"respectively, and return ``-1``; otherwise, set *\\*overflow* to ``0``. If " -"any other exception occurs set *\\*overflow* to ``0`` and return ``-1`` as " -"usual." +"If the value of *obj* is greater than :c:macro:`LONG_MAX` or less than :c:" +"macro:`LONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and " +"return ``-1``; otherwise, set *\\*overflow* to ``0``. If any other " +"exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" -#: ../../c-api/long.rst:227 ../../c-api/long.rst:245 +#: ../../c-api/long.rst:229 ../../c-api/long.rst:247 msgid "" "Return a C :c:expr:`long long` representation of *obj*. If *obj* is not an " "instance of :c:type:`PyLongObject`, first call its :meth:`~object.__index__` " "method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:231 +#: ../../c-api/long.rst:233 msgid "" -"Raise :exc:`OverflowError` if the value of *obj* is out of range for " -"a :c:expr:`long long`." +"Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" +"expr:`long long`." msgstr "" -#: ../../c-api/long.rst:249 +#: ../../c-api/long.rst:251 msgid "" -"If the value of *obj* is greater than :c:macro:`LLONG_MAX` or less " -"than :c:macro:`LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, " -"respectively, and return ``-1``; otherwise, set *\\*overflow* to ``0``. If " -"any other exception occurs set *\\*overflow* to ``0`` and return ``-1`` as " -"usual." +"If the value of *obj* is greater than :c:macro:`LLONG_MAX` or less than :c:" +"macro:`LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and " +"return ``-1``; otherwise, set *\\*overflow* to ``0``. If any other " +"exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" -#: ../../c-api/long.rst:271 +#: ../../c-api/long.rst:273 msgid "" "Return a C :c:type:`Py_ssize_t` representation of *pylong*. *pylong* must " "be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:274 +#: ../../c-api/long.rst:276 msgid "" -"Raise :exc:`OverflowError` if the value of *pylong* is out of range for " -"a :c:type:`Py_ssize_t`." +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" +"type:`Py_ssize_t`." msgstr "" -#: ../../c-api/long.rst:286 +#: ../../c-api/long.rst:288 msgid "" "Return a C :c:expr:`unsigned long` representation of *pylong*. *pylong* " "must be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:289 +#: ../../c-api/long.rst:291 msgid "" -"Raise :exc:`OverflowError` if the value of *pylong* is out of range for " -"a :c:expr:`unsigned long`." +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" +"expr:`unsigned long`." msgstr "" -#: ../../c-api/long.rst:292 +#: ../../c-api/long.rst:294 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:302 +#: ../../c-api/long.rst:304 msgid "" "Return a C :c:type:`size_t` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:305 +#: ../../c-api/long.rst:307 msgid "" -"Raise :exc:`OverflowError` if the value of *pylong* is out of range for " -"a :c:type:`size_t`." +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" +"type:`size_t`." msgstr "" -#: ../../c-api/long.rst:308 +#: ../../c-api/long.rst:310 msgid "" "Returns ``(size_t)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:317 +#: ../../c-api/long.rst:319 msgid "" "Return a C :c:expr:`unsigned long long` representation of *pylong*. " "*pylong* must be an instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:320 +#: ../../c-api/long.rst:322 msgid "" -"Raise :exc:`OverflowError` if the value of *pylong* is out of range for " -"an :c:expr:`unsigned long long`." +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for an :" +"c:expr:`unsigned long long`." msgstr "" -#: ../../c-api/long.rst:323 +#: ../../c-api/long.rst:325 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:326 +#: ../../c-api/long.rst:328 msgid "" "A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`." msgstr "" -#: ../../c-api/long.rst:332 +#: ../../c-api/long.rst:334 msgid "" "Return a C :c:expr:`unsigned long` representation of *obj*. If *obj* is not " -"an instance of :c:type:`PyLongObject`, first call " -"its :meth:`~object.__index__` method (if present) to convert it to " -"a :c:type:`PyLongObject`." +"an instance of :c:type:`PyLongObject`, first call its :meth:`~object." +"__index__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:336 +#: ../../c-api/long.rst:338 msgid "" "If the value of *obj* is out of range for an :c:expr:`unsigned long`, return " "the reduction of that value modulo ``ULONG_MAX + 1``." msgstr "" -#: ../../c-api/long.rst:339 +#: ../../c-api/long.rst:341 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." msgstr "" -#: ../../c-api/long.rst:351 +#: ../../c-api/long.rst:353 msgid "" "Return a C :c:expr:`unsigned long long` representation of *obj*. If *obj* " -"is not an instance of :c:type:`PyLongObject`, first call " -"its :meth:`~object.__index__` method (if present) to convert it to " -"a :c:type:`PyLongObject`." +"is not an instance of :c:type:`PyLongObject`, first call its :meth:`~object." +"__index__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:356 +#: ../../c-api/long.rst:358 msgid "" "If the value of *obj* is out of range for an :c:expr:`unsigned long long`, " "return the reduction of that value modulo ``ULLONG_MAX + 1``." msgstr "" -#: ../../c-api/long.rst:359 +#: ../../c-api/long.rst:361 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` " "to disambiguate." msgstr "" -#: ../../c-api/long.rst:372 +#: ../../c-api/long.rst:374 msgid "" "Set *\\*value* to a signed C :c:expr:`int32_t` or :c:expr:`int64_t` " "representation of *obj*." msgstr "" -#: ../../c-api/long.rst:375 ../../c-api/long.rst:396 +#: ../../c-api/long.rst:377 ../../c-api/long.rst:397 +msgid "" +"If *obj* is not an instance of :c:type:`PyLongObject`, first call its :meth:" +"`~object.__index__` method (if present) to convert it to a :c:type:" +"`PyLongObject`." +msgstr "" + +#: ../../c-api/long.rst:381 ../../c-api/long.rst:402 msgid "If the *obj* value is out of range, raise an :exc:`OverflowError`." msgstr "" -#: ../../c-api/long.rst:377 ../../c-api/long.rst:398 +#: ../../c-api/long.rst:383 ../../c-api/long.rst:404 msgid "" "Set *\\*value* and return ``0`` on success. Set an exception and return " "``-1`` on error." msgstr "" -#: ../../c-api/long.rst:380 ../../c-api/long.rst:401 +#: ../../c-api/long.rst:386 ../../c-api/long.rst:407 msgid "*value* must not be ``NULL``." msgstr "" -#: ../../c-api/long.rst:388 +#: ../../c-api/long.rst:394 msgid "" "Set *\\*value* to an unsigned C :c:expr:`uint32_t` or :c:expr:`uint64_t` " "representation of *obj*." msgstr "" -#: ../../c-api/long.rst:391 -msgid "" -"If *obj* is not an instance of :c:type:`PyLongObject`, first call " -"its :meth:`~object.__index__` method (if present) to convert it to " -"a :c:type:`PyLongObject`." -msgstr "" - -#: ../../c-api/long.rst:395 +#: ../../c-api/long.rst:401 msgid "If *obj* is negative, raise a :exc:`ValueError`." msgstr "" -#: ../../c-api/long.rst:408 +#: ../../c-api/long.rst:414 msgid "" "Return a C :c:expr:`double` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." msgstr "" -#: ../../c-api/long.rst:411 +#: ../../c-api/long.rst:417 msgid "" -"Raise :exc:`OverflowError` if the value of *pylong* is out of range for " -"a :c:expr:`double`." +"Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" +"expr:`double`." msgstr "" -#: ../../c-api/long.rst:414 +#: ../../c-api/long.rst:420 msgid "" "Returns ``-1.0`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/long.rst:419 +#: ../../c-api/long.rst:425 msgid "" "Convert a Python integer *pylong* to a C :c:expr:`void` pointer. If *pylong* " "cannot be converted, an :exc:`OverflowError` will be raised. This is only " -"assured to produce a usable :c:expr:`void` pointer for values created " -"with :c:func:`PyLong_FromVoidPtr`." +"assured to produce a usable :c:expr:`void` pointer for values created with :" +"c:func:`PyLong_FromVoidPtr`." msgstr "" -#: ../../c-api/long.rst:424 +#: ../../c-api/long.rst:430 msgid "" "Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" -#: ../../c-api/long.rst:429 +#: ../../c-api/long.rst:435 msgid "" "Copy the Python integer value *pylong* to a native *buffer* of size " "*n_bytes*. The *flags* can be set to ``-1`` to behave similarly to a C cast, " "or to values documented below to control the behavior." msgstr "" -#: ../../c-api/long.rst:433 +#: ../../c-api/long.rst:439 msgid "" "Returns ``-1`` with an exception raised on error. This may happen if " "*pylong* cannot be interpreted as an integer, or if *pylong* was negative " "and the ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` flag was set." msgstr "" -#: ../../c-api/long.rst:437 +#: ../../c-api/long.rst:443 msgid "" "Otherwise, returns the number of bytes required to store the value. If this " "is equal to or less than *n_bytes*, the entire value was copied. All " "*n_bytes* of the buffer are written: large buffers are padded with zeroes." msgstr "" -#: ../../c-api/long.rst:442 +#: ../../c-api/long.rst:448 msgid "" "If the returned value is greater than *n_bytes*, the value was truncated: as " "many of the lowest bits of the value as could fit are written, and the " @@ -462,25 +458,25 @@ msgid "" "downcast." msgstr "" -#: ../../c-api/long.rst:449 +#: ../../c-api/long.rst:455 msgid "" "Overflow is not considered an error. If the returned value is larger than " "*n_bytes*, most significant bits were discarded." msgstr "" -#: ../../c-api/long.rst:452 +#: ../../c-api/long.rst:458 msgid "``0`` will never be returned." msgstr "``0`` 將永不被回傳。" -#: ../../c-api/long.rst:454 +#: ../../c-api/long.rst:460 msgid "Values are always copied as two's-complement." msgstr "" -#: ../../c-api/long.rst:456 +#: ../../c-api/long.rst:462 msgid "Usage example::" msgstr "使用範例: ::" -#: ../../c-api/long.rst:458 +#: ../../c-api/long.rst:464 msgid "" "int32_t value;\n" "Py_ssize_t bytes = PyLong_AsNativeBytes(pylong, &value, sizeof(value), -1);\n" @@ -497,26 +493,26 @@ msgid "" "}" msgstr "" -#: ../../c-api/long.rst:472 +#: ../../c-api/long.rst:478 msgid "" "Passing zero to *n_bytes* will return the size of a buffer that would be " "large enough to hold the value. This may be larger than technically " "necessary, but not unreasonably so. If *n_bytes=0*, *buffer* may be ``NULL``." msgstr "" -#: ../../c-api/long.rst:479 +#: ../../c-api/long.rst:485 msgid "" "Passing *n_bytes=0* to this function is not an accurate way to determine the " "bit length of the value." msgstr "" -#: ../../c-api/long.rst:482 +#: ../../c-api/long.rst:488 msgid "" "To get at the entire Python value of an unknown size, the function can be " "called twice: first to determine the buffer size, then to fill it::" msgstr "" -#: ../../c-api/long.rst:485 +#: ../../c-api/long.rst:491 msgid "" "// Ask how much space we need.\n" "Py_ssize_t expected = PyLong_AsNativeBytes(pylong, NULL, 0, -1);\n" @@ -547,69 +543,69 @@ msgid "" "free(bignum);" msgstr "" -#: ../../c-api/long.rst:513 +#: ../../c-api/long.rst:519 msgid "" "*flags* is either ``-1`` (``Py_ASNATIVEBYTES_DEFAULTS``) to select defaults " "that behave most like a C cast, or a combination of the other flags in the " "table below. Note that ``-1`` cannot be combined with other flags." msgstr "" -#: ../../c-api/long.rst:518 +#: ../../c-api/long.rst:524 msgid "" "Currently, ``-1`` corresponds to ``Py_ASNATIVEBYTES_NATIVE_ENDIAN | " "Py_ASNATIVEBYTES_UNSIGNED_BUFFER``." msgstr "" -#: ../../c-api/long.rst:524 +#: ../../c-api/long.rst:530 msgid "Flag" msgstr "旗標" -#: ../../c-api/long.rst:524 +#: ../../c-api/long.rst:530 msgid "Value" msgstr "數值" -#: ../../c-api/long.rst:526 +#: ../../c-api/long.rst:532 msgid "``-1``" msgstr "``-1``" -#: ../../c-api/long.rst:527 +#: ../../c-api/long.rst:533 msgid "``0``" msgstr "``0``" -#: ../../c-api/long.rst:528 +#: ../../c-api/long.rst:534 msgid "``1``" msgstr "``1``" -#: ../../c-api/long.rst:529 +#: ../../c-api/long.rst:535 msgid "``3``" msgstr "``3``" -#: ../../c-api/long.rst:530 +#: ../../c-api/long.rst:536 msgid "``4``" msgstr "``4``" -#: ../../c-api/long.rst:531 +#: ../../c-api/long.rst:537 msgid "``8``" msgstr "``8``" -#: ../../c-api/long.rst:532 +#: ../../c-api/long.rst:538 msgid "``16``" msgstr "``16``" -#: ../../c-api/long.rst:535 +#: ../../c-api/long.rst:541 msgid "" "Specifying ``Py_ASNATIVEBYTES_NATIVE_ENDIAN`` will override any other endian " "flags. Passing ``2`` is reserved." msgstr "" -#: ../../c-api/long.rst:538 +#: ../../c-api/long.rst:544 msgid "" "By default, sufficient buffer will be requested to include a sign bit. For " "example, when converting 128 with *n_bytes=1*, the function will return 2 " "(or more) in order to store a zero sign bit." msgstr "" -#: ../../c-api/long.rst:542 +#: ../../c-api/long.rst:548 msgid "" "If ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` is specified, a zero sign bit will " "be omitted from size calculations. This allows, for example, 128 to fit in a " @@ -619,7 +615,7 @@ msgid "" "requested." msgstr "" -#: ../../c-api/long.rst:549 +#: ../../c-api/long.rst:555 msgid "" "Specifying ``Py_ASNATIVEBYTES_REJECT_NEGATIVE`` causes an exception to be " "set if *pylong* is negative. Without this flag, negative values will be " @@ -627,17 +623,17 @@ msgid "" "of whether ``Py_ASNATIVEBYTES_UNSIGNED_BUFFER`` was specified." msgstr "" -#: ../../c-api/long.rst:554 +#: ../../c-api/long.rst:560 msgid "" "If ``Py_ASNATIVEBYTES_ALLOW_INDEX`` is specified and a non-integer value is " "passed, its :meth:`~object.__index__` method will be called first. This may " "result in Python code executing and other threads being allowed to run, " "which could cause changes to other objects or values in use. When *flags* is " -"``-1``, this option is not set, and non-integer values will " -"raise :exc:`TypeError`." +"``-1``, this option is not set, and non-integer values will raise :exc:" +"`TypeError`." msgstr "" -#: ../../c-api/long.rst:563 +#: ../../c-api/long.rst:569 msgid "" "With the default *flags* (``-1``, or *UNSIGNED_BUFFER* without " "*REJECT_NEGATIVE*), multiple Python integers can map to a single value " @@ -645,166 +641,165 @@ msgid "" "buffer and set all its bits. This matches typical C cast behavior." msgstr "" -#: ../../c-api/long.rst:574 +#: ../../c-api/long.rst:580 msgid "Get the sign of the integer object *obj*." msgstr "" -#: ../../c-api/long.rst:576 +#: ../../c-api/long.rst:582 msgid "" "On success, set *\\*sign* to the integer sign (0, -1 or +1 for zero, " "negative or positive integer, respectively) and return 0." msgstr "" -#: ../../c-api/long.rst:579 +#: ../../c-api/long.rst:585 msgid "" "On failure, return -1 with an exception set. This function always succeeds " "if *obj* is a :c:type:`PyLongObject` or its subtype." msgstr "" -#: ../../c-api/long.rst:587 +#: ../../c-api/long.rst:593 msgid "Check if the integer object *obj* is positive (``obj > 0``)." msgstr "" -#: ../../c-api/long.rst:589 +#: ../../c-api/long.rst:595 msgid "" "If *obj* is an instance of :c:type:`PyLongObject` or its subtype, return " "``1`` when it's positive and ``0`` otherwise. Else set an exception and " "return ``-1``." msgstr "" -#: ../../c-api/long.rst:598 +#: ../../c-api/long.rst:604 msgid "Check if the integer object *obj* is negative (``obj < 0``)." msgstr "" -#: ../../c-api/long.rst:600 +#: ../../c-api/long.rst:606 msgid "" "If *obj* is an instance of :c:type:`PyLongObject` or its subtype, return " "``1`` when it's negative and ``0`` otherwise. Else set an exception and " "return ``-1``." msgstr "" -#: ../../c-api/long.rst:609 +#: ../../c-api/long.rst:615 msgid "Check if the integer object *obj* is zero." msgstr "" -#: ../../c-api/long.rst:611 +#: ../../c-api/long.rst:617 msgid "" "If *obj* is an instance of :c:type:`PyLongObject` or its subtype, return " "``1`` when it's zero and ``0`` otherwise. Else set an exception and return " "``-1``." msgstr "" -#: ../../c-api/long.rst:620 +#: ../../c-api/long.rst:626 msgid "" "On success, return a read only :term:`named tuple`, that holds information " "about Python's internal representation of integers. See :data:`sys.int_info` " "for description of individual fields." msgstr "" -#: ../../c-api/long.rst:624 +#: ../../c-api/long.rst:630 msgid "On failure, return ``NULL`` with an exception set." msgstr "在失敗時,會回傳 ``NULL`` 並設定例外。" -#: ../../c-api/long.rst:631 +#: ../../c-api/long.rst:637 msgid "Return 1 if *op* is compact, 0 otherwise." msgstr "" -#: ../../c-api/long.rst:633 +#: ../../c-api/long.rst:639 msgid "" "This function makes it possible for performance-critical code to implement a " -"“fast path” for small integers. For compact values " -"use :c:func:`PyUnstable_Long_CompactValue`; for others fall back to " -"a :c:func:`PyLong_As* ` function " -"or :c:func:`PyLong_AsNativeBytes`." +"“fast path” for small integers. For compact values use :c:func:" +"`PyUnstable_Long_CompactValue`; for others fall back to a :c:func:" +"`PyLong_As* ` function or :c:func:`PyLong_AsNativeBytes`." msgstr "" -#: ../../c-api/long.rst:639 +#: ../../c-api/long.rst:645 msgid "The speedup is expected to be negligible for most users." msgstr "" -#: ../../c-api/long.rst:641 +#: ../../c-api/long.rst:647 msgid "" "Exactly what values are considered compact is an implementation detail and " "is subject to change." msgstr "" -#: ../../c-api/long.rst:649 +#: ../../c-api/long.rst:655 msgid "" "If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`, " "return its value." msgstr "" -#: ../../c-api/long.rst:652 +#: ../../c-api/long.rst:658 msgid "Otherwise, the return value is undefined." msgstr "" -#: ../../c-api/long.rst:658 +#: ../../c-api/long.rst:664 msgid "Export API" msgstr "" -#: ../../c-api/long.rst:664 +#: ../../c-api/long.rst:670 msgid "" "Layout of an array of \"digits\" (\"limbs\" in the GMP terminology), used to " "represent absolute value for arbitrary precision integers." msgstr "" -#: ../../c-api/long.rst:667 +#: ../../c-api/long.rst:673 msgid "" -"Use :c:func:`PyLong_GetNativeLayout` to get the native layout of " -"Python :class:`int` objects, used internally for integers with \"big " -"enough\" absolute value." +"Use :c:func:`PyLong_GetNativeLayout` to get the native layout of Python :" +"class:`int` objects, used internally for integers with \"big enough\" " +"absolute value." msgstr "" -#: ../../c-api/long.rst:671 +#: ../../c-api/long.rst:677 msgid "" "See also :data:`sys.int_info` which exposes similar information in Python." msgstr "" -#: ../../c-api/long.rst:675 +#: ../../c-api/long.rst:681 msgid "" "Bits per digit. For example, a 15 bit digit means that bits 0-14 contain " "meaningful information." msgstr "" -#: ../../c-api/long.rst:680 +#: ../../c-api/long.rst:686 msgid "" "Digit size in bytes. For example, a 15 bit digit will require at least 2 " "bytes." msgstr "" -#: ../../c-api/long.rst:685 +#: ../../c-api/long.rst:691 msgid "Digits order:" msgstr "" -#: ../../c-api/long.rst:687 +#: ../../c-api/long.rst:693 msgid "``1`` for most significant digit first" msgstr "" -#: ../../c-api/long.rst:688 +#: ../../c-api/long.rst:694 msgid "``-1`` for least significant digit first" msgstr "" -#: ../../c-api/long.rst:692 +#: ../../c-api/long.rst:698 msgid "Digit endianness:" msgstr "" -#: ../../c-api/long.rst:694 +#: ../../c-api/long.rst:700 msgid "``1`` for most significant byte first (big endian)" msgstr "" -#: ../../c-api/long.rst:695 +#: ../../c-api/long.rst:701 msgid "``-1`` for least significant byte first (little endian)" msgstr "" -#: ../../c-api/long.rst:700 +#: ../../c-api/long.rst:706 msgid "Get the native layout of Python :class:`int` objects." msgstr "" -#: ../../c-api/long.rst:702 +#: ../../c-api/long.rst:708 msgid "See the :c:struct:`PyLongLayout` structure." msgstr "" -#: ../../c-api/long.rst:704 +#: ../../c-api/long.rst:710 msgid "" "The function must not be called before Python initialization nor after " "Python finalization. The returned layout is valid until Python is finalized. " @@ -812,175 +807,175 @@ msgid "" "it can be cached." msgstr "" -#: ../../c-api/long.rst:712 +#: ../../c-api/long.rst:718 msgid "Export of a Python :class:`int` object." msgstr "" -#: ../../c-api/long.rst:714 +#: ../../c-api/long.rst:720 msgid "There are two cases:" msgstr "" -#: ../../c-api/long.rst:716 +#: ../../c-api/long.rst:722 msgid "" "If :c:member:`digits` is ``NULL``, only use the :c:member:`value` member." msgstr "" -#: ../../c-api/long.rst:717 +#: ../../c-api/long.rst:723 msgid "" -"If :c:member:`digits` is not ``NULL``, " -"use :c:member:`negative`, :c:member:`ndigits` and :c:member:`digits` members." +"If :c:member:`digits` is not ``NULL``, use :c:member:`negative`, :c:member:" +"`ndigits` and :c:member:`digits` members." msgstr "" -#: ../../c-api/long.rst:722 +#: ../../c-api/long.rst:728 msgid "" -"The native integer value of the exported :class:`int` object. Only valid " -"if :c:member:`digits` is ``NULL``." +"The native integer value of the exported :class:`int` object. Only valid if :" +"c:member:`digits` is ``NULL``." msgstr "" -#: ../../c-api/long.rst:727 +#: ../../c-api/long.rst:733 msgid "" -"``1`` if the number is negative, ``0`` otherwise. Only valid " -"if :c:member:`digits` is not ``NULL``." +"``1`` if the number is negative, ``0`` otherwise. Only valid if :c:member:" +"`digits` is not ``NULL``." msgstr "" -#: ../../c-api/long.rst:732 +#: ../../c-api/long.rst:738 msgid "" -"Number of digits in :c:member:`digits` array. Only valid " -"if :c:member:`digits` is not ``NULL``." +"Number of digits in :c:member:`digits` array. Only valid if :c:member:" +"`digits` is not ``NULL``." msgstr "" -#: ../../c-api/long.rst:737 +#: ../../c-api/long.rst:743 msgid "Read-only array of unsigned digits. Can be ``NULL``." msgstr "" -#: ../../c-api/long.rst:742 +#: ../../c-api/long.rst:748 msgid "Export a Python :class:`int` object." msgstr "" -#: ../../c-api/long.rst:744 +#: ../../c-api/long.rst:750 msgid "" "*export_long* must point to a :c:struct:`PyLongExport` structure allocated " "by the caller. It must not be ``NULL``." msgstr "" -#: ../../c-api/long.rst:747 +#: ../../c-api/long.rst:753 msgid "" "On success, fill in *\\*export_long* and return ``0``. On error, set an " "exception and return ``-1``." msgstr "" -#: ../../c-api/long.rst:750 +#: ../../c-api/long.rst:756 msgid "" ":c:func:`PyLong_FreeExport` must be called when the export is no longer " "needed." msgstr "" -#: ../../c-api/long.rst:754 +#: ../../c-api/long.rst:760 msgid "" "This function always succeeds if *obj* is a Python :class:`int` object or a " "subclass." msgstr "" -#: ../../c-api/long.rst:760 +#: ../../c-api/long.rst:766 msgid "Release the export *export_long* created by :c:func:`PyLong_Export`." msgstr "" -#: ../../c-api/long.rst:763 +#: ../../c-api/long.rst:769 msgid "" "Calling :c:func:`PyLong_FreeExport` is optional if *export_long->digits* is " "``NULL``." msgstr "" -#: ../../c-api/long.rst:768 +#: ../../c-api/long.rst:774 msgid "PyLongWriter API" msgstr "" -#: ../../c-api/long.rst:770 +#: ../../c-api/long.rst:776 msgid "The :c:type:`PyLongWriter` API can be used to import an integer." msgstr "" -#: ../../c-api/long.rst:776 +#: ../../c-api/long.rst:782 msgid "A Python :class:`int` writer instance." msgstr "" -#: ../../c-api/long.rst:778 +#: ../../c-api/long.rst:784 msgid "" -"The instance must be destroyed by :c:func:`PyLongWriter_Finish` " -"or :c:func:`PyLongWriter_Discard`." +"The instance must be destroyed by :c:func:`PyLongWriter_Finish` or :c:func:" +"`PyLongWriter_Discard`." msgstr "" -#: ../../c-api/long.rst:784 +#: ../../c-api/long.rst:790 msgid "Create a :c:type:`PyLongWriter`." msgstr "" -#: ../../c-api/long.rst:786 +#: ../../c-api/long.rst:792 msgid "" "On success, allocate *\\*digits* and return a writer. On error, set an " "exception and return ``NULL``." msgstr "" -#: ../../c-api/long.rst:789 +#: ../../c-api/long.rst:795 msgid "*negative* is ``1`` if the number is negative, or ``0`` otherwise." msgstr "" -#: ../../c-api/long.rst:791 +#: ../../c-api/long.rst:797 msgid "" "*ndigits* is the number of digits in the *digits* array. It must be greater " "than 0." msgstr "" -#: ../../c-api/long.rst:794 +#: ../../c-api/long.rst:800 msgid "*digits* must not be NULL." msgstr "" -#: ../../c-api/long.rst:796 +#: ../../c-api/long.rst:802 msgid "" "After a successful call to this function, the caller should fill in the " "array of digits *digits* and then call :c:func:`PyLongWriter_Finish` to get " -"a Python :class:`int`. The layout of *digits* is described " -"by :c:func:`PyLong_GetNativeLayout`." +"a Python :class:`int`. The layout of *digits* is described by :c:func:" +"`PyLong_GetNativeLayout`." msgstr "" -#: ../../c-api/long.rst:801 +#: ../../c-api/long.rst:807 msgid "" "Digits must be in the range [``0``; ``(1 << bits_per_digit) - 1``] (where " "the :c:struct:`~PyLongLayout.bits_per_digit` is the number of bits per " "digit). Any unused most significant digits must be set to ``0``." msgstr "" -#: ../../c-api/long.rst:806 +#: ../../c-api/long.rst:812 msgid "" "Alternately, call :c:func:`PyLongWriter_Discard` to destroy the writer " "instance without creating an :class:`~int` object." msgstr "" -#: ../../c-api/long.rst:812 +#: ../../c-api/long.rst:818 msgid "" "Finish a :c:type:`PyLongWriter` created by :c:func:`PyLongWriter_Create`." msgstr "" -#: ../../c-api/long.rst:814 +#: ../../c-api/long.rst:820 msgid "" "On success, return a Python :class:`int` object. On error, set an exception " "and return ``NULL``." msgstr "" -#: ../../c-api/long.rst:817 +#: ../../c-api/long.rst:823 msgid "" "The function takes care of normalizing the digits and converts the object to " "a compact integer if needed." msgstr "" -#: ../../c-api/long.rst:820 ../../c-api/long.rst:829 +#: ../../c-api/long.rst:826 ../../c-api/long.rst:835 msgid "The writer instance and the *digits* array are invalid after the call." msgstr "" -#: ../../c-api/long.rst:825 +#: ../../c-api/long.rst:831 msgid "" "Discard a :c:type:`PyLongWriter` created by :c:func:`PyLongWriter_Create`." msgstr "" -#: ../../c-api/long.rst:827 +#: ../../c-api/long.rst:833 msgid "If *writer* is ``NULL``, no operation is performed." msgstr "" @@ -996,23 +991,23 @@ msgstr "long integer(長整數)" msgid "integer" msgstr "integer(整數)" -#: ../../c-api/long.rst:164 +#: ../../c-api/long.rst:166 msgid "LONG_MAX (C macro)" msgstr "LONG_MAX(C 巨集)" -#: ../../c-api/long.rst:164 ../../c-api/long.rst:224 ../../c-api/long.rst:267 -#: ../../c-api/long.rst:282 ../../c-api/long.rst:298 ../../c-api/long.rst:314 +#: ../../c-api/long.rst:166 ../../c-api/long.rst:226 ../../c-api/long.rst:269 +#: ../../c-api/long.rst:284 ../../c-api/long.rst:300 ../../c-api/long.rst:316 msgid "OverflowError (built-in exception)" msgstr "OverflowError(內建例外)" -#: ../../c-api/long.rst:267 +#: ../../c-api/long.rst:269 msgid "PY_SSIZE_T_MAX (C macro)" msgstr "PY_SSIZE_T_MAX(C 巨集)" -#: ../../c-api/long.rst:282 +#: ../../c-api/long.rst:284 msgid "ULONG_MAX (C macro)" msgstr "ULONG_MAX(C 巨集)" -#: ../../c-api/long.rst:298 +#: ../../c-api/long.rst:300 msgid "SIZE_MAX (C macro)" msgstr "SIZE_MAX(C 巨集)" diff --git a/deprecations/c-api-pending-removal-in-3.18.po b/deprecations/c-api-pending-removal-in-3.18.po index f4c5782835..458022f9a8 100644 --- a/deprecations/c-api-pending-removal-in-3.18.po +++ b/deprecations/c-api-pending-removal-in-3.18.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-18 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -21,50 +21,52 @@ msgid "Pending removal in Python 3.18" msgstr "Python 3.18 中待移除的項目" #: ../../deprecations/c-api-pending-removal-in-3.18.rst:4 -msgid "Deprecated private functions (:gh:`128863`):" -msgstr "被棄用的私有函式 (:gh:`128863`):" +msgid "" +"The following private functions are deprecated and planned for removal in " +"Python 3.18:" +msgstr "以下私有函式已被棄用,並計劃在 Python 3.18 中移除:" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:6 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:7 msgid ":c:func:`!_PyBytes_Join`: use :c:func:`PyBytes_Join`." msgstr ":c:func:`!_PyBytes_Join`:請改用 :c:func:`PyBytes_Join`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:7 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:8 msgid "" -":c:func:`!_PyDict_GetItemStringWithError`: " -"use :c:func:`PyDict_GetItemStringRef`." +":c:func:`!_PyDict_GetItemStringWithError`: use :c:func:" +"`PyDict_GetItemStringRef`." msgstr "" -":c:func:`!_PyDict_GetItemStringWithError`:請改" -"用 :c:func:`PyDict_GetItemStringRef`。" +":c:func:`!_PyDict_GetItemStringWithError`:請改用 :c:func:" +"`PyDict_GetItemStringRef`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:8 -msgid ":c:func:`!_PyDict_Pop()`: :c:func:`PyDict_Pop`." +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:9 +msgid ":c:func:`!_PyDict_Pop()`: use :c:func:`PyDict_Pop`." msgstr ":c:func:`!_PyDict_Pop()`:請改用 :c:func:`PyDict_Pop`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:9 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:10 msgid ":c:func:`!_PyLong_Sign()`: use :c:func:`PyLong_GetSign`." msgstr ":c:func:`!_PyLong_Sign()`:請改用 :c:func:`PyLong_GetSign`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:10 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:11 msgid "" -":c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`: " -"use :c:func:`PyLongWriter_Create`." +":c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`: use :c:func:" +"`PyLongWriter_Create`." msgstr "" -":c:func:`!_PyLong_FromDigits` 和 :c:func:`!_PyLong_New`:請改" -"用 :c:func:`PyLongWriter_Create`。" +":c:func:`!_PyLong_FromDigits` 和 :c:func:`!_PyLong_New`:請改用 :c:func:" +"`PyLongWriter_Create`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:12 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:13 msgid "" -":c:func:`!_PyThreadState_UncheckedGet`: " -"use :c:func:`PyThreadState_GetUnchecked`." +":c:func:`!_PyThreadState_UncheckedGet`: use :c:func:" +"`PyThreadState_GetUnchecked`." msgstr "" -":c:func:`!_PyThreadState_UncheckedGet`:請改" -"用 :c:func:`PyThreadState_GetUnchecked`。" +":c:func:`!_PyThreadState_UncheckedGet`:請改用 :c:func:" +"`PyThreadState_GetUnchecked`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:13 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:14 msgid ":c:func:`!_PyUnicode_AsString`: use :c:func:`PyUnicode_AsUTF8`." msgstr ":c:func:`!_PyUnicode_AsString`:請改用 :c:func:`PyUnicode_AsUTF8`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:14 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:15 msgid "" ":c:func:`!_PyUnicodeWriter_Init`: replace ``_PyUnicodeWriter_Init(&writer)`` " "with :c:func:`writer = PyUnicodeWriter_Create(0) `." @@ -72,105 +74,99 @@ msgstr "" ":c:func:`!_PyUnicodeWriter_Init`:將 ``_PyUnicodeWriter_Init(&writer)`` 替換" "為 :c:func:`writer = PyUnicodeWriter_Create(0) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:17 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:18 msgid "" ":c:func:`!_PyUnicodeWriter_Finish`: replace " -"``_PyUnicodeWriter_Finish(&writer)`` " -"with :c:func:`PyUnicodeWriter_Finish(writer) `." +"``_PyUnicodeWriter_Finish(&writer)`` with :c:func:" +"`PyUnicodeWriter_Finish(writer) `." msgstr "" ":c:func:`!_PyUnicodeWriter_Finish`:將 ``_PyUnicodeWriter_Finish(&writer)`` " "替換為 :c:func:`PyUnicodeWriter_Finish(writer) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:20 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:21 msgid "" ":c:func:`!_PyUnicodeWriter_Dealloc`: replace " -"``_PyUnicodeWriter_Dealloc(&writer)`` " -"with :c:func:`PyUnicodeWriter_Discard(writer) `." +"``_PyUnicodeWriter_Dealloc(&writer)`` with :c:func:" +"`PyUnicodeWriter_Discard(writer) `." msgstr "" ":c:func:`!_PyUnicodeWriter_Dealloc`:將 " -"``_PyUnicodeWriter_Dealloc(&writer)`` 替換" -"為 :c:func:`PyUnicodeWriter_Discard(writer) `。" +"``_PyUnicodeWriter_Dealloc(&writer)`` 替換為 :c:func:" +"`PyUnicodeWriter_Discard(writer) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:23 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:24 msgid "" ":c:func:`!_PyUnicodeWriter_WriteChar`: replace " -"``_PyUnicodeWriter_WriteChar(&writer, ch)`` " -"with :c:func:`PyUnicodeWriter_WriteChar(writer, ch) " -"`." +"``_PyUnicodeWriter_WriteChar(&writer, ch)`` with :c:func:" +"`PyUnicodeWriter_WriteChar(writer, ch) `." msgstr "" ":c:func:`!_PyUnicodeWriter_WriteChar`:將 " -"``_PyUnicodeWriter_WriteChar(&writer, ch)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteChar(writer, ch) " -"`。" +"``_PyUnicodeWriter_WriteChar(&writer, ch)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteChar(writer, ch) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:26 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:27 msgid "" ":c:func:`!_PyUnicodeWriter_WriteStr`: replace " -"``_PyUnicodeWriter_WriteStr(&writer, str)`` " -"with :c:func:`PyUnicodeWriter_WriteStr(writer, str) " -"`." +"``_PyUnicodeWriter_WriteStr(&writer, str)`` with :c:func:" +"`PyUnicodeWriter_WriteStr(writer, str) `." msgstr "" ":c:func:`!_PyUnicodeWriter_WriteStr`:將 " -"``_PyUnicodeWriter_WriteStr(&writer, str)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteStr(writer, str) " -"`。" +"``_PyUnicodeWriter_WriteStr(&writer, str)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteStr(writer, str) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:29 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:30 msgid "" ":c:func:`!_PyUnicodeWriter_WriteSubstring`: replace " -"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` " -"with :c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " +"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` with :c:func:" +"`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " "`." msgstr "" ":c:func:`!_PyUnicodeWriter_WriteSubstring`:將 " -"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " +"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " "`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:32 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:33 msgid "" ":c:func:`!_PyUnicodeWriter_WriteASCIIString`: replace " -"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` " -"with :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " -"`." +"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` with :c:func:" +"`PyUnicodeWriter_WriteASCII(writer, str) `." msgstr "" ":c:func:`!_PyUnicodeWriter_WriteASCIIString`:將 " -"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " -"`。" +"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteASCII(writer, str) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:35 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:36 msgid "" ":c:func:`!_PyUnicodeWriter_WriteLatin1String`: replace " -"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` " -"with :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " -"`." +"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` with :c:func:" +"`PyUnicodeWriter_WriteUTF8(writer, str) `." msgstr "" ":c:func:`!_PyUnicodeWriter_WriteLatin1String`:將 " -"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " -"`。" +"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteUTF8(writer, str) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:38 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:39 msgid ":c:func:`!_PyUnicodeWriter_Prepare`: (no replacement)." msgstr ":c:func:`!_PyUnicodeWriter_Prepare`:(無替代方案)。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:39 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:40 msgid ":c:func:`!_PyUnicodeWriter_PrepareKind`: (no replacement)." msgstr ":c:func:`!_PyUnicodeWriter_PrepareKind`:(無替代方案)。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:40 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:41 msgid ":c:func:`!_Py_HashPointer`: use :c:func:`Py_HashPointer`." msgstr ":c:func:`!_Py_HashPointer`:請改用 :c:func:`Py_HashPointer`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:41 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:42 msgid ":c:func:`!_Py_fopen_obj`: use :c:func:`Py_fopen`." msgstr ":c:func:`!_Py_fopen_obj`:請改用 :c:func:`Py_fopen`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:43 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:44 msgid "" "The `pythoncapi-compat project `__ can be used to get these new public functions on Python 3.13 and older." +">`__ can be used to get these new public functions on Python 3.13 and older. " +"(Contributed by Victor Stinner in :gh:`128863`.)" msgstr "" -"可以使用 `pythoncapi-compat 專案 `__\\ 來為 Python 3.13 及更早版本取得這些新的公開函式。" +"可以使用 `pythoncapi-compat project `__ 來取得這些於 Python 3.13 及更早版本的新公開函式。(由 " +"Victor Stinner 在 :gh:`128863` 貢獻)" diff --git a/deprecations/index.po b/deprecations/index.po index a8107540c4..06b7a16536 100644 --- a/deprecations/index.po +++ b/deprecations/index.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-18 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,10 +31,10 @@ msgstr "引入系統 (import system):" #: ../../deprecations/pending-removal-in-3.15.rst:6 msgid "" -"Setting :attr:`~module.__cached__` on a module while failing to " -"set :attr:`__spec__.cached ` is " -"deprecated. In Python 3.15, :attr:`!__cached__` will cease to be set or take " -"into consideration by the import system or standard library. (:gh:`97879`)" +"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" +"`__spec__.cached ` is deprecated. In " +"Python 3.15, :attr:`!__cached__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" msgstr "" "在模組上設定 :attr:`~module.__cached__` 而沒有設定 :attr:`__spec__.cached " "` 的做法已被棄用。在 Python 3.15 中," @@ -42,11 +42,10 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:11 msgid "" -"Setting :attr:`~module.__package__` on a module while failing to " -"set :attr:`__spec__.parent ` is " -"deprecated. In Python 3.15, :attr:`!__package__` will cease to be set or " -"take into consideration by the import system or standard library. " -"(:gh:`97879`)" +"Setting :attr:`~module.__package__` on a module while failing to set :attr:" +"`__spec__.parent ` is deprecated. In " +"Python 3.15, :attr:`!__package__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" msgstr "" "在模組上設定 :attr:`~module.__package__` 而沒有設定 :attr:`__spec__.parent " "` 的做法已被棄用。在 Python 3.15 中," @@ -102,17 +101,15 @@ 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`.)" +"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` 貢" -"獻。)" +"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`:" @@ -120,11 +117,11 @@ msgstr ":mod:`pathlib`:" #: ../../deprecations/pending-removal-in-3.15.rst:48 msgid "" -":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. " -"Use :func:`os.path.isreserved` to detect reserved paths on Windows." +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" +"func:`os.path.isreserved` to detect reserved paths on Windows." msgstr "" -":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請" -"用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" +":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請用 :func:`os.path." +"isreserved` 來偵測 Windows 上的保留路徑。" #: ../../deprecations/pending-removal-in-3.15.rst:52 msgid ":mod:`platform`:" @@ -179,9 +176,9 @@ msgid "" "in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" ":class:`types.CodeType`:自 3.10 起,存取 :attr:`~codeobject.co_lnotab` 已" -"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發" -"出 :exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev " -"於 :gh:`101866` 貢獻。)" +"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發出 :" +"exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev 於 :gh:" +"`101866` 貢獻。)" #: ../../deprecations/pending-removal-in-3.15.rst:80 #: ../../deprecations/pending-removal-in-3.17.rst:4 @@ -190,10 +187,10 @@ msgstr ":mod:`typing`:" #: ../../deprecations/pending-removal-in-3.15.rst:82 msgid "" -"The undocumented keyword argument syntax for " -"creating :class:`~typing.NamedTuple` classes (for example, ``Point = " -"NamedTuple(\"Point\", x=int, y=int)``) has been deprecated since Python " -"3.13. Use the class-based syntax or the functional syntax instead." +"The undocumented keyword argument syntax for creating :class:`~typing." +"NamedTuple` classes (for example, ``Point = NamedTuple(\"Point\", x=int, " +"y=int)``) has been deprecated since Python 3.13. Use the class-based syntax " +"or the functional syntax instead." msgstr "" "用於建立 :class:`~typing.NamedTuple` 類別的未以文件記錄之關鍵字引數語法 " "(``Point = NamedTuple(\"Point\", x=int, y=int)``) 已自 Python 3.13 棄用。請改" @@ -228,14 +225,13 @@ msgstr ":mod:`wave`:" #: ../../deprecations/pending-removal-in-3.15.rst:102 msgid "" -"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, " -"and :meth:`~wave.Wave_read.getmarkers` methods of " -"the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes have been " -"deprecated since Python 3.13." +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." +"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" +"`~wave.Wave_write` classes have been deprecated since Python 3.13." msgstr "" -"已棄用 :class:`~wave.Wave_read` 和 :class:`~wave.Wave_write` 類別" -"的 :meth:`~wave.Wave_read.getmark`、:meth:`!setmark` " -"和 :meth:`~wave.Wave_read.getmarkers` 方法自 Python 3.13 被棄用。" +"已棄用 :class:`~wave.Wave_read` 和 :class:`~wave.Wave_write` 類別的 :meth:" +"`~wave.Wave_read.getmark`、:meth:`!setmark` 和 :meth:`~wave.Wave_read." +"getmarkers` 方法自 Python 3.13 被棄用。" #: ../../deprecations/pending-removal-in-3.15.rst:107 msgid ":mod:`zipimport`:" @@ -247,9 +243,9 @@ msgid "" "3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead. (Contributed " "by Jiahao Li in :gh:`125746`.)" msgstr "" -":meth:`~zipimport.zipimporter.load_module` 自 Python 3.10 被棄用。請改" -"用 :meth:`~zipimport.zipimporter.exec_module`。(由 Jiahao Li " -"於 :gh:`125746` 貢獻。)" +":meth:`~zipimport.zipimporter.load_module` 自 Python 3.10 被棄用。請改用 :" +"meth:`~zipimport.zipimporter.exec_module`。(由 Jiahao Li 於 :gh:`125746` 貢" +"獻。)" #: ../../deprecations/pending-removal-in-3.16.rst:2 msgid "Pending removal in Python 3.16" @@ -257,10 +253,10 @@ msgstr "Python 3.16 中待移除的項目" #: ../../deprecations/pending-removal-in-3.16.rst:6 msgid "" -"Setting :attr:`~module.__loader__` on a module while failing to " -"set :attr:`__spec__.loader ` is " -"deprecated. In Python 3.16, :attr:`!__loader__` will cease to be set or " -"taken into consideration by the import system or the standard library." +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.16, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." msgstr "" "在模組上設定 :attr:`~module.__loader__` 而沒有設定 :attr:`__spec__.loader " "` 的做法將於 Python 3.16 被棄用。在 " @@ -291,8 +287,8 @@ msgid "" "by Jiahao Li and Kumar Aditya in :gh:`122875`.)" msgstr "" ":func:`!asyncio.iscoroutinefunction` 已被棄用並將在 Python 3.16 中移除;請改" -"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya " -"於 :gh:`122875` 貢獻。)" +"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya 於 :" +"gh:`122875` 貢獻。)" #: ../../deprecations/pending-removal-in-3.16.rst:26 msgid "" @@ -386,8 +382,8 @@ msgid "" "*function* or *sequence* as keyword arguments has been deprecated since " "Python 3.14." msgstr "" -"自 Python 3.14 起,使用 *function* 或 *sequence* 關鍵字引數呼" -"叫 :func:`functools.reduce` 的 Python 實作已被棄用。" +"自 Python 3.14 起,使用 *function* 或 *sequence* 關鍵字引數呼叫 :func:" +"`functools.reduce` 的 Python 實作已被棄用。" #: ../../deprecations/pending-removal-in-3.16.rst:64 msgid ":mod:`logging`:" @@ -408,10 +404,10 @@ msgstr ":mod:`mimetypes`:" #: ../../deprecations/pending-removal-in-3.16.rst:72 msgid "" -"Valid extensions start with a '.' or are empty " -"for :meth:`mimetypes.MimeTypes.add_type`. Undotted extensions are deprecated " -"and will raise a :exc:`ValueError` in Python 3.16. (Contributed by Hugo van " -"Kemenade in :gh:`75223`.)" +"Valid extensions start with a '.' or are empty for :meth:`mimetypes." +"MimeTypes.add_type`. Undotted extensions are deprecated and will raise a :" +"exc:`ValueError` in Python 3.16. (Contributed by Hugo van Kemenade in :gh:" +"`75223`.)" msgstr "" "有效的副檔名以 '.' 開頭或對 :meth:`mimetypes.MimeTypes.add_type` 為空字串。未" "加點的副檔名已被棄用,並將在 Python 3.16 中引發 :exc:`ValueError`。(由 Hugo " @@ -494,18 +490,48 @@ msgstr "" "除。使用者應該改用文件中記錄的內省輔助函式,例如 :func:`typing.get_origin` " "和 :func:`typing.get_args`,或者依賴私有實作細節。" +#: ../../deprecations/pending-removal-in-3.17.rst:11 +msgid "" +":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " +"removal in Python 3.17. Prefer :class:`~collections.abc.Sequence` or :class:" +"`~collections.abc.Buffer`. For use in type annotations, prefer a union, like " +"``bytes | bytearray``, or :class:`collections.abc.Buffer`. (Contributed by " +"Shantanu Jain in :gh:`91896`.)" +msgstr "" +"自 Python 3.9 起已被棄用的 :class:`typing.ByteString`,計劃在 Python " +"3.17 中移除。建議改用 :class:`~collections.abc.Sequence` 或 :class:`~" +"collections.abc.Buffer`。在型別註釋中建議改用聯集,例如 ``bytes | " +"bytearray`` 或 :class:`collections.abc.Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" + +#: ../../deprecations/pending-removal-in-3.17.rst:17 +msgid ":mod:`collections.abc`:" +msgstr ":mod:`collections.abc`:" + +#: ../../deprecations/pending-removal-in-3.17.rst:19 +msgid "" +":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17. " +"Prefer :class:`~collections.abc.Sequence` or :class:`~collections.abc." +"Buffer`. For use in type annotations, prefer a union, like ``bytes | " +"bytearray``, or :class:`collections.abc.Buffer`. (Contributed by Shantanu " +"Jain in :gh:`91896`.)" +msgstr "" +":class:`collections.abc.ByteString` 計劃在 Python 3.17 中移除。建議改用 " +":class:`~collections.abc.Sequence` 或 :class:`~collections.abc.Buffer`。在" +"型別註釋中建議改用聯集,例如 ``bytes | bytearray`` 或 :class:`collections.abc." +"Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" + #: ../../deprecations/pending-removal-in-3.19.rst:2 msgid "Pending removal in Python 3.19" msgstr "Python 3.19 中待移除的項目" #: ../../deprecations/pending-removal-in-3.19.rst:6 msgid "" -"Implicitly switching to the MSVC-compatible struct layout by " -"setting :attr:`~ctypes.Structure._pack_` but " -"not :attr:`~ctypes.Structure._layout_` on non-Windows platforms." +"Implicitly switching to the MSVC-compatible struct layout by setting :attr:" +"`~ctypes.Structure._pack_` but not :attr:`~ctypes.Structure._layout_` on non-" +"Windows platforms." msgstr "" -"在非 Windows 平台上,透過設定 :attr:`~ctypes.Structure._pack_` 而沒有設" -"定 :attr:`~ctypes.Structure._layout_` 來隱式地切換到與 MSVC 相容的結構佈局。" +"在非 Windows 平台上,透過設定 :attr:`~ctypes.Structure._pack_` 而沒有設定 :" +"attr:`~ctypes.Structure._layout_` 來隱式地切換到與 MSVC 相容的結構佈局。" #: ../../deprecations/c-api-pending-removal-in-future.rst:2 #: ../../deprecations/pending-removal-in-future.rst:2 @@ -529,11 +555,11 @@ msgstr "巢狀引數群組和巢狀互斥群組已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:11 msgid "" -"Passing the undocumented keyword argument *prefix_chars* " -"to :meth:`~argparse.ArgumentParser.add_argument_group` is now deprecated." +"Passing the undocumented keyword argument *prefix_chars* to :meth:`~argparse." +"ArgumentParser.add_argument_group` is now deprecated." msgstr "" -"將未以文件記錄的關鍵字引數 *prefix_chars* 傳遞" -"給 :meth:`~argparse.ArgumentParser.add_argument_group` 的做法現在已被棄用。" +"將未以文件記錄的關鍵字引數 *prefix_chars* 傳遞給 :meth:`~argparse." +"ArgumentParser.add_argument_group` 的做法現在已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:14 msgid "The :class:`argparse.FileType` type converter is deprecated." @@ -558,17 +584,17 @@ msgid "" "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " "ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " "``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised " -"if the numeric literal is immediately followed by one of " -"keywords :keyword:`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :keyword:`is` " -"and :keyword:`or`. In a future release it will be changed to a syntax " -"error. (:gh:`87999`)" +"if the numeric literal is immediately followed by one of keywords :keyword:" +"`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :" +"keyword:`is` and :keyword:`or`. In a future release it will be changed to a " +"syntax error. (:gh:`87999`)" msgstr "" "目前 Python 接受數值字面值後面立即接關鍵字,例如 ``0in x``、``1or x``、``0if " "1else 2``。它讓表達式模糊且容易混淆,如 ``[0x1for x in y]``\\ (可以解釋為 " -"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即" -"接 :keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:`in`、:keyword:`is` " -"和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版本中,它將被更改為語" -"法錯誤。(:gh:`87999`)" +"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即接 :" +"keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:" +"`in`、:keyword:`is` 和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版" +"本中,它將被更改為語法錯誤。(:gh:`87999`)" #: ../../deprecations/pending-removal-in-future.rst:30 msgid "" @@ -581,18 +607,18 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:33 msgid "" -"Support for ``__float__()`` method returning a strict subclass " -"of :class:`float`: these methods will be required to return an instance " -"of :class:`float`." +"Support for ``__float__()`` method returning a strict subclass of :class:" +"`float`: these methods will be required to return an instance of :class:" +"`float`." msgstr "" "回傳 :class:`float` 嚴格子類別 ``__float__()`` 方法的支援:這些方法將需要回" "傳 :class:`float` 的實例。" #: ../../deprecations/pending-removal-in-future.rst:36 msgid "" -"Support for ``__complex__()`` method returning a strict subclass " -"of :class:`complex`: these methods will be required to return an instance " -"of :class:`complex`." +"Support for ``__complex__()`` method returning a strict subclass of :class:" +"`complex`: these methods will be required to return an instance of :class:" +"`complex`." msgstr "" "回傳 :class:`complex` 嚴格子類別 ``__complex__()`` 方法的支援:這些方法將需要" "回傳 :class:`complex` 的實例。" @@ -603,10 +629,10 @@ msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。" #: ../../deprecations/pending-removal-in-future.rst:40 msgid "" -"Passing a complex number as the *real* or *imag* argument in " -"the :func:`complex` constructor is now deprecated; it should only be passed " -"as a single positional argument. (Contributed by Serhiy Storchaka " -"in :gh:`109218`.)" +"Passing a complex number as the *real* or *imag* argument in the :func:" +"`complex` constructor is now deprecated; it should only be passed as a " +"single positional argument. (Contributed by Serhiy Storchaka in :gh:" +"`109218`.)" msgstr "" "在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;" "它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)" @@ -614,9 +640,8 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:45 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " -"are deprecated and replaced by :data:`calendar.JANUARY` " -"and :data:`calendar.FEBRUARY`. (Contributed by Prince Roshan " -"in :gh:`103636`.)" +"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." +"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" ":mod:`calendar`:``calendar.January`` 和 ``calendar.February`` 常數已被棄用並" "被 :data:`calendar.JANUARY` 和 :data:`calendar.FEBRUARY` 取代。 (由 Prince " @@ -624,8 +649,8 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:50 msgid "" -":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. " -"(:gh:`133038`)" +":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. (:gh:" +"`133038`)" msgstr "" ":mod:`codecs`:請改用 :func:`open` 而非 :func:`codecs.open`。(:gh:`133038`)" @@ -642,19 +667,19 @@ msgstr ":mod:`datetime`:" #: ../../deprecations/pending-removal-in-future.rst:57 msgid "" -":meth:`~datetime.datetime.utcnow`: use " -"``datetime.datetime.now(tz=datetime.UTC)``." +":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." +"UTC)``." msgstr "" -":meth:`~datetime.datetime.utcnow`:請改用 " -"``datetime.datetime.now(tz=datetime.UTC)``。" +":meth:`~datetime.datetime.utcnow`:請改用 ``datetime.datetime." +"now(tz=datetime.UTC)``。" #: ../../deprecations/pending-removal-in-future.rst:59 msgid "" -":meth:`~datetime.datetime.utcfromtimestamp`: use " -"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``." +":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." +"fromtimestamp(timestamp, tz=datetime.UTC)``." msgstr "" -":meth:`~datetime.datetime.utcfromtimestamp`:請改用 " -"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``。" +":meth:`~datetime.datetime.utcfromtimestamp`:請改用 ``datetime.datetime." +"fromtimestamp(timestamp, tz=datetime.UTC)``。" #: ../../deprecations/pending-removal-in-future.rst:62 msgid ":mod:`gettext`: Plural value must be an integer." @@ -685,8 +710,8 @@ msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." msgstr "" -":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改" -"用 :meth:`~logging.warning`。" +":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:" +"`~logging.warning`。" #: ../../deprecations/pending-removal-in-future.rst:77 msgid "" @@ -743,11 +768,11 @@ msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:100 msgid "" -":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` " -"and :meth:`!selected_npn_protocol` are deprecated: use ALPN instead." +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" +"`!selected_npn_protocol` are deprecated: use ALPN instead." msgstr "" -":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` " -"和 :meth:`!selected_npn_protocol` 已被棄用:請改用 ALPN。" +":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:" +"`!selected_npn_protocol` 已被棄用:請改用 ALPN。" #: ../../deprecations/pending-removal-in-future.rst:103 msgid "``ssl.OP_NO_SSL*`` options" @@ -795,11 +820,11 @@ msgstr ":mod:`threading` 方法:" #: ../../deprecations/pending-removal-in-future.rst:116 msgid "" -":meth:`!threading.Condition.notifyAll`: " -"use :meth:`~threading.Condition.notify_all`." +":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." +"notify_all`." msgstr "" -":meth:`!threading.Condition.notifyAll`:請" -"用 :meth:`~threading.Condition.notify_all`。" +":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." +"notify_all`。" #: ../../deprecations/pending-removal-in-future.rst:117 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." @@ -807,19 +832,19 @@ msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set` #: ../../deprecations/pending-removal-in-future.rst:118 msgid "" -":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: " -"use :attr:`threading.Thread.daemon` attribute." +":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" +"attr:`threading.Thread.daemon` attribute." msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" #: ../../deprecations/pending-removal-in-future.rst:120 msgid "" -":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: " -"use :attr:`threading.Thread.name` attribute." +":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" +"attr:`threading.Thread.name` attribute." msgstr "" -":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請" -"用 :attr:`threading.Thread.name` 屬性。" +":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" +"attr:`threading.Thread.name` 屬性。" #: ../../deprecations/pending-removal-in-future.rst:122 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." @@ -912,22 +937,22 @@ msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分 #: ../../deprecations/pending-removal-in-future.rst:152 msgid "" -":mod:`xml.etree.ElementTree`: Testing the truth value of " -"an :class:`~xml.etree.ElementTree.Element` is deprecated. In a future " -"release it will always return ``True``. Prefer explicit ``len(elem)`` or " -"``elem is not None`` tests instead." +":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." +"etree.ElementTree.Element` is deprecated. In a future release it will always " +"return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests " +"instead." msgstr "" -":mod:`xml.etree.ElementTree`:已棄用" -"對 :class:`~xml.etree.ElementTree.Element` 的真值測試。在未來版本中,它將始終" -"回傳 ``True``。請改用明確的 ``len(elem)`` 或 ``elem is not None`` 測試。" +":mod:`xml.etree.ElementTree`:已棄用對 :class:`~xml.etree.ElementTree." +"Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " +"``len(elem)`` 或 ``elem is not None`` 測試。" #: ../../deprecations/pending-removal-in-future.rst:157 msgid "" -":func:`sys._clear_type_cache` is deprecated: " -"use :func:`sys._clear_internal_caches` instead." +":func:`sys._clear_type_cache` is deprecated: use :func:`sys." +"_clear_internal_caches` instead." msgstr "" -":func:`sys._clear_type_cache` 已被棄用:請改" -"用 :func:`sys._clear_internal_caches`。" +":func:`sys._clear_type_cache` 已被棄用:請改用 :func:`sys." +"_clear_internal_caches`。" #: ../../deprecations/index.rst:15 msgid "C API deprecations" @@ -935,31 +960,31 @@ msgstr "C API 的棄用項目" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:4 msgid "" -"The :c:func:`PyImport_ImportModuleNoBlock`: " -"Use :c:func:`PyImport_ImportModule` instead." +"The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:" +"`PyImport_ImportModule` instead." msgstr "" -":c:func:`PyImport_ImportModuleNoBlock`:請改" -"用 :c:func:`PyImport_ImportModule`。" +":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:" +"`PyImport_ImportModule`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:6 msgid "" -":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: " -"Use :c:func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project " -"`__ can be used to " -"get :c:func:`PyWeakref_GetRef` on Python 3.12 and older." +":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" +"func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project `__ can be used to get :c:func:" +"`PyWeakref_GetRef` on Python 3.12 and older." msgstr "" -":c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT`:請改" -"用 :c:func:`PyWeakref_GetRef`。可以使用 `pythoncapi-compat 專案 `__\\ 來為 Python 3.12 和更早版本取" -"得 :c:func:`PyWeakref_GetRef`。" +":c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT`:請改用 :c:" +"func:`PyWeakref_GetRef`。可以使用 `pythoncapi-compat 專案 `__\\ 來為 Python 3.12 和更早版本取得 :c:func:" +"`PyWeakref_GetRef`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:10 msgid "" -":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: " -"Use :c:type:`wchar_t` instead." +":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:" +"type:`wchar_t` instead." msgstr "" -":c:type:`Py_UNICODE` 型別與 :c:macro:`!Py_UNICODE_WIDE` 巨集:請改" -"用 :c:type:`wchar_t`。" +":c:type:`Py_UNICODE` 型別與 :c:macro:`!Py_UNICODE_WIDE` 巨集:請改用 :c:type:" +"`wchar_t`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:12 msgid "" @@ -974,8 +999,8 @@ msgid "" "than :class:`str`, such as :class:`bytes`." msgstr "" ":c:func:`!PyUnicode_AsDecodedUnicode`:請改用 :c:func:`PyCodec_Decode`;請注" -"意某些編解碼器(例如 \"base64\")可能會回傳非 :class:`str` 的型別,例" -"如 :class:`bytes`。" +"意某些編解碼器(例如 \"base64\")可能會回傳非 :class:`str` 的型別,例如 :" +"class:`bytes`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 msgid "" @@ -990,8 +1015,8 @@ msgid "" "than :class:`bytes`, such as :class:`str`." msgstr "" ":c:func:`!PyUnicode_AsEncodedUnicode`:請改用 :c:func:`PyCodec_Encode`;請注" -"意某些編解碼器(例如 \"base64\")可能會回傳非 :class:`bytes` 的型別,例" -"如 :class:`str`。" +"意某些編解碼器(例如 \"base64\")可能會回傳非 :class:`bytes` 的型別,例如 :" +"class:`str`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:22 msgid "Python initialization functions, deprecated in Python 3.13:" @@ -1008,37 +1033,35 @@ msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:27 msgid "" ":c:func:`Py_GetPrefix`: Use :c:func:`PyConfig_Get(\"base_prefix\") " -"` (:data:`sys.base_prefix`) instead. " -"Use :c:func:`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) " -"if :ref:`virtual environments ` need to be handled." +"` (:data:`sys.base_prefix`) instead. Use :c:func:" +"`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) if :ref:" +"`virtual environments ` need to be handled." msgstr "" ":c:func:`Py_GetPrefix`:請改用 :c:func:`PyConfig_Get(\"base_prefix\") " "` (:data:`sys.base_prefix`)。如果需要處理\\ :ref:`虛擬環境 " -"`,請改用 :c:func:`PyConfig_Get(\"prefix\") ` " -"(:data:`sys.prefix`)。" +"`,請改用 :c:func:`PyConfig_Get(\"prefix\") ` (:data:" +"`sys.prefix`)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:32 msgid "" ":c:func:`Py_GetExecPrefix`: Use :c:func:`PyConfig_Get(\"base_exec_prefix\") " -"` (:data:`sys.base_exec_prefix`) instead. " -"Use :c:func:`PyConfig_Get(\"exec_prefix\") ` " -"(:data:`sys.exec_prefix`) if :ref:`virtual environments ` need to " -"be handled." +"` (:data:`sys.base_exec_prefix`) instead. Use :c:func:" +"`PyConfig_Get(\"exec_prefix\") ` (:data:`sys.exec_prefix`) if :" +"ref:`virtual environments ` need to be handled." msgstr "" -":c:func:`Py_GetExecPrefix`:請改" -"用 :c:func:`PyConfig_Get(\"base_exec_prefix\") ` " -"(:data:`sys.base_exec_prefix`)。如果需要處理\\ :ref:`虛擬環境 `,請" -"改用 :c:func:`PyConfig_Get(\"exec_prefix\") ` " -"(:data:`sys.exec_prefix`)。" +":c:func:`Py_GetExecPrefix`:請改用 :c:func:" +"`PyConfig_Get(\"base_exec_prefix\") ` (:data:`sys." +"base_exec_prefix`)。如果需要處理\\ :ref:`虛擬環境 `,請改用 :c:" +"func:`PyConfig_Get(\"exec_prefix\") ` (:data:`sys." +"exec_prefix`)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:38 msgid "" ":c:func:`Py_GetProgramFullPath`: Use :c:func:`PyConfig_Get(\"executable\") " "` (:data:`sys.executable`) instead." msgstr "" -":c:func:`Py_GetProgramFullPath`:請改" -"用 :c:func:`PyConfig_Get(\"executable\") ` " -"(:data:`sys.executable`)。" +":c:func:`Py_GetProgramFullPath`:請改用 :c:func:" +"`PyConfig_Get(\"executable\") ` (:data:`sys.executable`)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:41 msgid "" @@ -1093,13 +1116,13 @@ msgid "" ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" "warnings.filters` instead." msgstr "" -":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` " -"和 :data:`!warnings.filters`。" +":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` 和 :" +"data:`!warnings.filters`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:65 msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used " -"with :c:type:`PyConfig` instead." +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` instead." msgstr "" "應改用帶有 :c:type:`PyConfig` 的 :c:func:`Py_InitializeFromConfig` API。" @@ -1109,108 +1132,108 @@ msgstr "全域配置變數:" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:70 msgid "" -":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` " -"or :c:func:`PyConfig_Get(\"parser_debug\") ` instead." +":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` or :c:func:" +"`PyConfig_Get(\"parser_debug\") ` instead." msgstr "" -":c:var:`Py_DebugFlag`:請改用 :c:member:`PyConfig.parser_debug` " -"或 :c:func:`PyConfig_Get(\"parser_debug\") `。" +":c:var:`Py_DebugFlag`:請改用 :c:member:`PyConfig.parser_debug` 或 :c:func:" +"`PyConfig_Get(\"parser_debug\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:73 msgid "" -":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` " -"or :c:func:`PyConfig_Get(\"verbose\") ` instead." +":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` or :c:func:" +"`PyConfig_Get(\"verbose\") ` instead." msgstr "" -":c:var:`Py_VerboseFlag`:請改用 :c:member:`PyConfig.verbose` " -"或 :c:func:`PyConfig_Get(\"verbose\") `。" +":c:var:`Py_VerboseFlag`:請改用 :c:member:`PyConfig.verbose` 或 :c:func:" +"`PyConfig_Get(\"verbose\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:76 msgid "" -":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` " -"or :c:func:`PyConfig_Get(\"quiet\") ` instead." +":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` or :c:func:" +"`PyConfig_Get(\"quiet\") ` instead." msgstr "" -":c:var:`Py_QuietFlag`:請改用 :c:member:`PyConfig.quiet` " -"或 :c:func:`PyConfig_Get(\"quiet\") `。" +":c:var:`Py_QuietFlag`:請改用 :c:member:`PyConfig.quiet` 或 :c:func:" +"`PyConfig_Get(\"quiet\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:79 msgid "" -":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` " -"or :c:func:`PyConfig_Get(\"interactive\") ` instead." +":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` or :c:func:" +"`PyConfig_Get(\"interactive\") ` instead." msgstr "" -":c:var:`Py_InteractiveFlag`:請改用 :c:member:`PyConfig.interactive` " -"或 :c:func:`PyConfig_Get(\"interactive\") `。" +":c:var:`Py_InteractiveFlag`:請改用 :c:member:`PyConfig.interactive` 或 :c:" +"func:`PyConfig_Get(\"interactive\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:82 msgid "" -":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` " -"or :c:func:`PyConfig_Get(\"inspect\") ` instead." +":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` or :c:func:" +"`PyConfig_Get(\"inspect\") ` instead." msgstr "" -":c:var:`Py_InspectFlag`:請改用 :c:member:`PyConfig.inspect` " -"或 :c:func:`PyConfig_Get(\"inspect\") `。" +":c:var:`Py_InspectFlag`:請改用 :c:member:`PyConfig.inspect` 或 :c:func:" +"`PyConfig_Get(\"inspect\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:85 msgid "" -":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` " -"or :c:func:`PyConfig_Get(\"optimization_level\") ` instead." +":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` or :c:" +"func:`PyConfig_Get(\"optimization_level\") ` instead." msgstr "" -":c:var:`Py_OptimizeFlag`:請改用 :c:member:`PyConfig.optimization_level` " -"或 :c:func:`PyConfig_Get(\"optimization_level\") `。" +":c:var:`Py_OptimizeFlag`:請改用 :c:member:`PyConfig.optimization_level` 或 :" +"c:func:`PyConfig_Get(\"optimization_level\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:88 msgid "" -":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` " -"or :c:func:`PyConfig_Get(\"site_import\") ` instead." +":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` or :c:func:" +"`PyConfig_Get(\"site_import\") ` instead." msgstr "" -":c:var:`Py_NoSiteFlag`:請改用 :c:member:`PyConfig.site_import` " -"或 :c:func:`PyConfig_Get(\"site_import\") `。" +":c:var:`Py_NoSiteFlag`:請改用 :c:member:`PyConfig.site_import` 或 :c:func:" +"`PyConfig_Get(\"site_import\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:91 msgid "" -":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` " -"or :c:func:`PyConfig_Get(\"bytes_warning\") ` instead." +":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` or :c:" +"func:`PyConfig_Get(\"bytes_warning\") ` instead." msgstr "" -":c:var:`Py_BytesWarningFlag`:請改用 :c:member:`PyConfig.bytes_warning` " -"或 :c:func:`PyConfig_Get(\"bytes_warning\") `。" +":c:var:`Py_BytesWarningFlag`:請改用 :c:member:`PyConfig.bytes_warning` 或 :" +"c:func:`PyConfig_Get(\"bytes_warning\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:94 msgid "" -":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` " -"or :c:func:`PyConfig_Get(\"pathconfig_warnings\") ` instead." +":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` or :c:" +"func:`PyConfig_Get(\"pathconfig_warnings\") ` instead." msgstr "" -":c:var:`Py_FrozenFlag`:請改用 :c:member:`PyConfig.pathconfig_warnings` " -"或 :c:func:`PyConfig_Get(\"pathconfig_warnings\") `。" +":c:var:`Py_FrozenFlag`:請改用 :c:member:`PyConfig.pathconfig_warnings` 或 :" +"c:func:`PyConfig_Get(\"pathconfig_warnings\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:97 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " "or :c:func:`PyConfig_Get(\"use_environment\") ` instead." msgstr "" -":c:var:`Py_IgnoreEnvironmentFlag`:請改" -"用 :c:member:`PyConfig.use_environment` " -"或 :c:func:`PyConfig_Get(\"use_environment\") `。" +":c:var:`Py_IgnoreEnvironmentFlag`:請改用 :c:member:`PyConfig." +"use_environment` 或 :c:func:`PyConfig_Get(\"use_environment\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:100 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " "or :c:func:`PyConfig_Get(\"write_bytecode\") ` instead." msgstr "" -":c:var:`Py_DontWriteBytecodeFlag`:請改" -"用 :c:member:`PyConfig.write_bytecode` " -"或 :c:func:`PyConfig_Get(\"write_bytecode\") `。" +":c:var:`Py_DontWriteBytecodeFlag`:請改用 :c:member:`PyConfig." +"write_bytecode` 或 :c:func:`PyConfig_Get(\"write_bytecode\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:103 msgid "" -":c:var:`Py_NoUserSiteDirectory`: " -"Use :c:member:`PyConfig.user_site_directory` " -"or :c:func:`PyConfig_Get(\"user_site_directory\") ` instead." +":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig." +"user_site_directory` or :c:func:`PyConfig_Get(\"user_site_directory\") " +"` instead." msgstr "" -":c:var:`Py_NoUserSiteDirectory`:請改" -"用 :c:member:`PyConfig.user_site_directory` " -"或 :c:func:`PyConfig_Get(\"user_site_directory\") `。" +":c:var:`Py_NoUserSiteDirectory`:請改用 :c:member:`PyConfig." +"user_site_directory` 或 :c:func:`PyConfig_Get(\"user_site_directory\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:106 msgid "" -":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` " -"or :c:func:`PyConfig_Get(\"buffered_stdio\") ` instead." +":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` or :" +"c:func:`PyConfig_Get(\"buffered_stdio\") ` instead." msgstr "" ":c:var:`Py_UnbufferedStdioFlag`:請改用 :c:member:`PyConfig.buffered_stdio` " "或 :c:func:`PyConfig_Get(\"buffered_stdio\") `。" @@ -1227,70 +1250,69 @@ msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:113 msgid "" -":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` " -"or :c:func:`PyConfig_Get(\"isolated\") ` instead." +":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` or :c:func:" +"`PyConfig_Get(\"isolated\") ` instead." msgstr "" -":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated` " -"或 :c:func:`PyConfig_Get(\"isolated\") `。" +":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated` 或 :c:func:" +"`PyConfig_Get(\"isolated\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:116 msgid "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: " -"Use :c:member:`PyPreConfig.legacy_windows_fs_encoding` " -"or :c:func:`PyConfig_Get(\"legacy_windows_fs_encoding\") ` " -"instead." +":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig." +"legacy_windows_fs_encoding` or :c:func:" +"`PyConfig_Get(\"legacy_windows_fs_encoding\") ` instead." msgstr "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改" -"用 :c:member:`PyPreConfig.legacy_windows_fs_encoding` " -"或 :c:func:`PyConfig_Get(\"legacy_windows_fs_encoding\") `。" +":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改用 :c:member:`PyPreConfig." +"legacy_windows_fs_encoding` 或 :c:func:" +"`PyConfig_Get(\"legacy_windows_fs_encoding\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:119 msgid "" -":c:var:`Py_LegacyWindowsStdioFlag`: " -"Use :c:member:`PyConfig.legacy_windows_stdio` " -"or :c:func:`PyConfig_Get(\"legacy_windows_stdio\") ` instead." +":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig." +"legacy_windows_stdio` or :c:func:`PyConfig_Get(\"legacy_windows_stdio\") " +"` instead." msgstr "" -":c:var:`Py_LegacyWindowsStdioFlag`:請改" -"用 :c:member:`PyConfig.legacy_windows_stdio` " -"或 :c:func:`PyConfig_Get(\"legacy_windows_stdio\") `。" +":c:var:`Py_LegacyWindowsStdioFlag`:請改用 :c:member:`PyConfig." +"legacy_windows_stdio` 或 :c:func:`PyConfig_Get(\"legacy_windows_stdio\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:122 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`, :c:var:`!" -"Py_HasFileSystemDefaultEncoding`: " -"Use :c:member:`PyConfig.filesystem_encoding` " -"or :c:func:`PyConfig_Get(\"filesystem_encoding\") ` instead." +"Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig." +"filesystem_encoding` or :c:func:`PyConfig_Get(\"filesystem_encoding\") " +"` instead." msgstr "" ":c:var:`!Py_FileSystemDefaultEncoding`、:c:var:`!" -"Py_HasFileSystemDefaultEncoding`:請改" -"用 :c:member:`PyConfig.filesystem_encoding` " -"或 :c:func:`PyConfig_Get(\"filesystem_encoding\") `。" +"Py_HasFileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." +"filesystem_encoding` 或 :c:func:`PyConfig_Get(\"filesystem_encoding\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:125 msgid "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: " -"Use :c:member:`PyConfig.filesystem_errors` " -"or :c:func:`PyConfig_Get(\"filesystem_errors\") ` instead." +":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig." +"filesystem_errors` or :c:func:`PyConfig_Get(\"filesystem_errors\") " +"` instead." msgstr "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改" -"用 :c:member:`PyConfig.filesystem_errors` " -"或 :c:func:`PyConfig_Get(\"filesystem_errors\") `。" +":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改用 :c:member:`PyConfig." +"filesystem_errors` 或 :c:func:`PyConfig_Get(\"filesystem_errors\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:128 msgid "" -":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` " -"or :c:func:`PyConfig_Get(\"utf8_mode\") ` instead. " -"(see :c:func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` or :c:func:" +"`PyConfig_Get(\"utf8_mode\") ` instead. (see :c:func:" +"`Py_PreInitialize`)" msgstr "" -":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode` " -"或 :c:func:`PyConfig_Get(\"utf8_mode\") `。(請參" -"閱 :c:func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode` 或 :c:func:" +"`PyConfig_Get(\"utf8_mode\") `。(請參閱 :c:func:" +"`Py_PreInitialize`)" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:133 msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used " -"with :c:type:`PyConfig` to set these options. Or :c:func:`PyConfig_Get` can " -"be used to get these options at runtime." +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` to set these options. Or :c:func:`PyConfig_Get` can be used to " +"get these options at runtime." msgstr "" "應改用帶有 :c:type:`PyConfig` 的 :c:func:`Py_InitializeFromConfig` API 來設定" "這些選項。或者也可以使用 :c:func:`PyConfig_Get` 在執行時取得這些選項。" @@ -1300,50 +1322,52 @@ msgid "Pending removal in Python 3.18" msgstr "Python 3.18 中待移除的項目" #: ../../deprecations/c-api-pending-removal-in-3.18.rst:4 -msgid "Deprecated private functions (:gh:`128863`):" -msgstr "被棄用的私有函式 (:gh:`128863`):" +msgid "" +"The following private functions are deprecated and planned for removal in " +"Python 3.18:" +msgstr "以下私有函式已被棄用,並計劃在 Python 3.18 中移除:" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:6 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:7 msgid ":c:func:`!_PyBytes_Join`: use :c:func:`PyBytes_Join`." msgstr ":c:func:`!_PyBytes_Join`:請改用 :c:func:`PyBytes_Join`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:7 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:8 msgid "" -":c:func:`!_PyDict_GetItemStringWithError`: " -"use :c:func:`PyDict_GetItemStringRef`." +":c:func:`!_PyDict_GetItemStringWithError`: use :c:func:" +"`PyDict_GetItemStringRef`." msgstr "" -":c:func:`!_PyDict_GetItemStringWithError`:請改" -"用 :c:func:`PyDict_GetItemStringRef`。" +":c:func:`!_PyDict_GetItemStringWithError`:請改用 :c:func:" +"`PyDict_GetItemStringRef`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:8 -msgid ":c:func:`!_PyDict_Pop()`: :c:func:`PyDict_Pop`." +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:9 +msgid ":c:func:`!_PyDict_Pop()`: use :c:func:`PyDict_Pop`." msgstr ":c:func:`!_PyDict_Pop()`:請改用 :c:func:`PyDict_Pop`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:9 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:10 msgid ":c:func:`!_PyLong_Sign()`: use :c:func:`PyLong_GetSign`." msgstr ":c:func:`!_PyLong_Sign()`:請改用 :c:func:`PyLong_GetSign`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:10 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:11 msgid "" -":c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`: " -"use :c:func:`PyLongWriter_Create`." +":c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`: use :c:func:" +"`PyLongWriter_Create`." msgstr "" -":c:func:`!_PyLong_FromDigits` 和 :c:func:`!_PyLong_New`:請改" -"用 :c:func:`PyLongWriter_Create`。" +":c:func:`!_PyLong_FromDigits` 和 :c:func:`!_PyLong_New`:請改用 :c:func:" +"`PyLongWriter_Create`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:12 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:13 msgid "" -":c:func:`!_PyThreadState_UncheckedGet`: " -"use :c:func:`PyThreadState_GetUnchecked`." +":c:func:`!_PyThreadState_UncheckedGet`: use :c:func:" +"`PyThreadState_GetUnchecked`." msgstr "" -":c:func:`!_PyThreadState_UncheckedGet`:請改" -"用 :c:func:`PyThreadState_GetUnchecked`。" +":c:func:`!_PyThreadState_UncheckedGet`:請改用 :c:func:" +"`PyThreadState_GetUnchecked`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:13 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:14 msgid ":c:func:`!_PyUnicode_AsString`: use :c:func:`PyUnicode_AsUTF8`." msgstr ":c:func:`!_PyUnicode_AsString`:請改用 :c:func:`PyUnicode_AsUTF8`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:14 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:15 msgid "" ":c:func:`!_PyUnicodeWriter_Init`: replace ``_PyUnicodeWriter_Init(&writer)`` " "with :c:func:`writer = PyUnicodeWriter_Create(0) `." @@ -1351,108 +1375,102 @@ msgstr "" ":c:func:`!_PyUnicodeWriter_Init`:將 ``_PyUnicodeWriter_Init(&writer)`` 替換" "為 :c:func:`writer = PyUnicodeWriter_Create(0) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:17 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:18 msgid "" ":c:func:`!_PyUnicodeWriter_Finish`: replace " -"``_PyUnicodeWriter_Finish(&writer)`` " -"with :c:func:`PyUnicodeWriter_Finish(writer) `." +"``_PyUnicodeWriter_Finish(&writer)`` with :c:func:" +"`PyUnicodeWriter_Finish(writer) `." msgstr "" ":c:func:`!_PyUnicodeWriter_Finish`:將 ``_PyUnicodeWriter_Finish(&writer)`` " "替換為 :c:func:`PyUnicodeWriter_Finish(writer) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:20 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:21 msgid "" ":c:func:`!_PyUnicodeWriter_Dealloc`: replace " -"``_PyUnicodeWriter_Dealloc(&writer)`` " -"with :c:func:`PyUnicodeWriter_Discard(writer) `." +"``_PyUnicodeWriter_Dealloc(&writer)`` with :c:func:" +"`PyUnicodeWriter_Discard(writer) `." msgstr "" ":c:func:`!_PyUnicodeWriter_Dealloc`:將 " -"``_PyUnicodeWriter_Dealloc(&writer)`` 替換" -"為 :c:func:`PyUnicodeWriter_Discard(writer) `。" +"``_PyUnicodeWriter_Dealloc(&writer)`` 替換為 :c:func:" +"`PyUnicodeWriter_Discard(writer) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:23 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:24 msgid "" ":c:func:`!_PyUnicodeWriter_WriteChar`: replace " -"``_PyUnicodeWriter_WriteChar(&writer, ch)`` " -"with :c:func:`PyUnicodeWriter_WriteChar(writer, ch) " -"`." +"``_PyUnicodeWriter_WriteChar(&writer, ch)`` with :c:func:" +"`PyUnicodeWriter_WriteChar(writer, ch) `." msgstr "" ":c:func:`!_PyUnicodeWriter_WriteChar`:將 " -"``_PyUnicodeWriter_WriteChar(&writer, ch)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteChar(writer, ch) " -"`。" +"``_PyUnicodeWriter_WriteChar(&writer, ch)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteChar(writer, ch) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:26 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:27 msgid "" ":c:func:`!_PyUnicodeWriter_WriteStr`: replace " -"``_PyUnicodeWriter_WriteStr(&writer, str)`` " -"with :c:func:`PyUnicodeWriter_WriteStr(writer, str) " -"`." +"``_PyUnicodeWriter_WriteStr(&writer, str)`` with :c:func:" +"`PyUnicodeWriter_WriteStr(writer, str) `." msgstr "" ":c:func:`!_PyUnicodeWriter_WriteStr`:將 " -"``_PyUnicodeWriter_WriteStr(&writer, str)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteStr(writer, str) " -"`。" +"``_PyUnicodeWriter_WriteStr(&writer, str)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteStr(writer, str) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:29 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:30 msgid "" ":c:func:`!_PyUnicodeWriter_WriteSubstring`: replace " -"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` " -"with :c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " +"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` with :c:func:" +"`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " "`." msgstr "" ":c:func:`!_PyUnicodeWriter_WriteSubstring`:將 " -"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " +"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " "`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:32 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:33 msgid "" ":c:func:`!_PyUnicodeWriter_WriteASCIIString`: replace " -"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` " -"with :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " -"`." +"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` with :c:func:" +"`PyUnicodeWriter_WriteASCII(writer, str) `." msgstr "" ":c:func:`!_PyUnicodeWriter_WriteASCIIString`:將 " -"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " -"`。" +"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteASCII(writer, str) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:35 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:36 msgid "" ":c:func:`!_PyUnicodeWriter_WriteLatin1String`: replace " -"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` " -"with :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " -"`." +"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` with :c:func:" +"`PyUnicodeWriter_WriteUTF8(writer, str) `." msgstr "" ":c:func:`!_PyUnicodeWriter_WriteLatin1String`:將 " -"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " -"`。" +"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteUTF8(writer, str) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:38 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:39 msgid ":c:func:`!_PyUnicodeWriter_Prepare`: (no replacement)." msgstr ":c:func:`!_PyUnicodeWriter_Prepare`:(無替代方案)。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:39 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:40 msgid ":c:func:`!_PyUnicodeWriter_PrepareKind`: (no replacement)." msgstr ":c:func:`!_PyUnicodeWriter_PrepareKind`:(無替代方案)。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:40 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:41 msgid ":c:func:`!_Py_HashPointer`: use :c:func:`Py_HashPointer`." msgstr ":c:func:`!_Py_HashPointer`:請改用 :c:func:`Py_HashPointer`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:41 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:42 msgid ":c:func:`!_Py_fopen_obj`: use :c:func:`Py_fopen`." msgstr ":c:func:`!_Py_fopen_obj`:請改用 :c:func:`Py_fopen`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:43 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:44 msgid "" "The `pythoncapi-compat project `__ can be used to get these new public functions on Python 3.13 and older." +">`__ can be used to get these new public functions on Python 3.13 and older. " +"(Contributed by Victor Stinner in :gh:`128863`.)" msgstr "" "可以使用 `pythoncapi-compat project `__ 來取得這些於 Python 3.13 及更早版本的新公開函式。" +"compat/>`__ 來取得這些於 Python 3.13 及更早版本的新公開函式。(由 " +"Victor Stinner 在 :gh:`128863` 貢獻)" #: ../../deprecations/c-api-pending-removal-in-future.rst:4 msgid "" @@ -1473,8 +1491,8 @@ msgid "" ":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " "instead." msgstr "" -":c:func:`PyErr_NormalizeException`:請改" -"用 :c:func:`PyErr_GetRaisedException`。" +":c:func:`PyErr_NormalizeException`:請改用 :c:func:" +"`PyErr_GetRaisedException`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:13 msgid "" @@ -1494,11 +1512,11 @@ msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:19 msgid "" -":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` " -"and :c:func:`PySlice_AdjustIndices` instead." +":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:" +"`PySlice_AdjustIndices` instead." msgstr "" -":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` " -"和 :c:func:`PySlice_AdjustIndices`。" +":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:" +"`PySlice_AdjustIndices`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:21 msgid ":c:func:`PyUnicode_READY`: Unneeded since Python 3.12" @@ -1520,8 +1538,8 @@ msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead." msgstr "" -":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼" -"叫 :c:func:`PyObject_Hash`。" +":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼叫 :c:func:" +"`PyObject_Hash`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:29 msgid "Thread Local Storage (TLS) API:" diff --git a/deprecations/pending-removal-in-3.14.po b/deprecations/pending-removal-in-3.14.po index 12e8980e52..add170a79b 100644 --- a/deprecations/pending-removal-in-3.14.po +++ b/deprecations/pending-removal-in-3.14.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-18 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -60,8 +60,8 @@ msgstr ":class:`!ast.Ellipsis`" #: ../../deprecations/pending-removal-in-3.14.rst:19 msgid "" -"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka " -"in :gh:`90953`.)" +"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" +"`90953`.)" msgstr "" "請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)" @@ -72,28 +72,26 @@ msgstr ":mod:`asyncio`:" #: ../../deprecations/pending-removal-in-3.14.rst:24 msgid "" "The child watcher classes :class:`!asyncio.MultiLoopChildWatcher`, :class:`!" -"asyncio.FastChildWatcher`, :class:`!asyncio.AbstractChildWatcher` " -"and :class:`!asyncio.SafeChildWatcher` are deprecated and will be removed in " -"Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +"asyncio.FastChildWatcher`, :class:`!asyncio.AbstractChildWatcher` and :class:" +"`!asyncio.SafeChildWatcher` are deprecated and will be removed in Python " +"3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -"已棄用並將在 Python 3.14 中移除的 child watcher 類別::class:`!" -"asyncio.MultiLoopChildWatcher`、:class:`!asyncio.FastChildWatcher`、:class:`!" -"asyncio.AbstractChildWatcher` 和 :class:`!asyncio.SafeChildWatcher`。 (由 " -"Kumar Aditya 於 :gh:`94597` 貢獻。)" +"已棄用並將在 Python 3.14 中移除的 child watcher 類別::class:`!asyncio." +"MultiLoopChildWatcher`、:class:`!asyncio.FastChildWatcher`、:class:`!asyncio." +"AbstractChildWatcher` 和 :class:`!asyncio.SafeChildWatcher`。 (由 Kumar " +"Aditya 於 :gh:`94597` 貢獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:30 msgid "" -":func:`!asyncio.set_child_watcher`, :func:`!" -"asyncio.get_child_watcher`, :meth:`!" -"asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`!" +":func:`!asyncio.set_child_watcher`, :func:`!asyncio.get_child_watcher`, :" +"meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`!" "asyncio.AbstractEventLoopPolicy.get_child_watcher` are deprecated and will " "be removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -":func:`!asyncio.set_child_watcher`、:func:`!" -"asyncio.get_child_watcher`、:meth:`!" -"asyncio.AbstractEventLoopPolicy.set_child_watcher` 和 :meth:`!" -"asyncio.AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python " -"3.14 中移除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" +":func:`!asyncio.set_child_watcher`、:func:`!asyncio.get_child_watcher`、:" +"meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher` 和 :meth:`!asyncio." +"AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python 3.14 中移" +"除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:36 msgid "" @@ -108,60 +106,45 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.14.rst:41 msgid "" -":mod:`collections.abc`: Deprecated :class:`!collections.abc.ByteString`. " -"Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " -"typing, prefer a union, like ``bytes | bytearray``, " -"or :class:`collections.abc.Buffer`. (Contributed by Shantanu Jain " -"in :gh:`91896`.)" -msgstr "" -":mod:`collections.abc`:已棄用 :class:`!collections.abc.ByteString`。請改" -"用 :class:`!Sequence` 或 :class:`~collections.abc.Buffer`。在 typing 中使用" -"時,請改用聯集,如 ``bytes | bytearray``," -"或 :class:`collections.abc.Buffer`。(由 Shantanu Jain 於 :gh:`91896` 貢" -"獻。)" - -#: ../../deprecations/pending-removal-in-3.14.rst:47 -msgid "" -":mod:`email`: Deprecated the *isdst* parameter " -"in :func:`email.utils.localtime`. (Contributed by Alan Williams " -"in :gh:`72346`.)" +":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." +"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" ":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:50 +#: ../../deprecations/pending-removal-in-3.14.rst:44 msgid ":mod:`importlib.abc` deprecated classes:" msgstr ":mod:`importlib.abc` 的已棄用類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:52 +#: ../../deprecations/pending-removal-in-3.14.rst:46 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../deprecations/pending-removal-in-3.14.rst:53 +#: ../../deprecations/pending-removal-in-3.14.rst:47 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:54 +#: ../../deprecations/pending-removal-in-3.14.rst:48 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:56 +#: ../../deprecations/pending-removal-in-3.14.rst:50 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:58 +#: ../../deprecations/pending-removal-in-3.14.rst:52 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:53 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:55 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" -#: ../../deprecations/pending-removal-in-3.14.rst:63 +#: ../../deprecations/pending-removal-in-3.14.rst:57 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -172,86 +155,94 @@ msgstr "" "deepcopy 和 pickle 操作支援。將在 3.14 中移除以大幅減少程式碼量和維護負擔。 " "(由 Raymond Hettinger 於 :gh:`101588` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:69 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " "currently the default (:gh:`84559`). Adding a runtime warning about this was " "deemed too disruptive as the majority of code is not expected to care. Use " -"the :func:`~multiprocessing.get_context` " -"or :func:`~multiprocessing.set_start_method` APIs to explicitly specify when " -"your code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." +"the :func:`~multiprocessing.get_context` or :func:`~multiprocessing." +"set_start_method` APIs to explicitly specify when your code *requires* " +"``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" ":mod:`multiprocessing`:預設的啟動方法將在 Linux、BSD 和其他非 macOS POSIX 平" "台上更改為更安全的 方法,目前 ``'fork'`` 是預設值 (:gh:`84559`)。對此增加一" -"個 runtime 警告被認為太過擾人,因為 大多數程式碼不會在意。請使" -"用 :func:`~multiprocessing.get_context` " -"或 :func:`~multiprocessing.set_start_method` API 來明確指定你的程式碼何時\\ *" -"需要* ``'fork'``。請參閱 :ref:`multiprocessing-start-methods`。" +"個 runtime 警告被認為太過擾人,因為 大多數程式碼不會在意。請使用 :func:" +"`~multiprocessing.get_context` 或 :func:`~multiprocessing.set_start_method` " +"API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" +"`multiprocessing-start-methods`。" -#: ../../deprecations/pending-removal-in-3.14.rst:77 +#: ../../deprecations/pending-removal-in-3.14.rst:71 msgid "" -":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` " -"and :meth:`~pathlib.PurePath.relative_to`: passing additional arguments is " -"deprecated." +":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." +"PurePath.relative_to`: passing additional arguments is deprecated." msgstr "" -":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` " -"和 :meth:`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" +":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" +"`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" -#: ../../deprecations/pending-removal-in-3.14.rst:81 +#: ../../deprecations/pending-removal-in-3.14.rst:75 msgid "" ":mod:`pkgutil`: :func:`!pkgutil.find_loader` and :func:`!pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" ":mod:`pkgutil`::func:`!pkgutil.find_loader` 和 :func:`!pkgutil.get_loader` " -"現在會引發 :exc:`DeprecationWarning`;請改" -"用 :func:`importlib.util.find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢" -"獻。)" +"現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." +"find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:86 +#: ../../deprecations/pending-removal-in-3.14.rst:80 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.14.rst:88 +#: ../../deprecations/pending-removal-in-3.14.rst:82 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "``master_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:89 +#: ../../deprecations/pending-removal-in-3.14.rst:83 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "``slave_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:91 +#: ../../deprecations/pending-removal-in-3.14.rst:85 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" -#: ../../deprecations/pending-removal-in-3.14.rst:93 +#: ../../deprecations/pending-removal-in-3.14.rst:87 msgid ":data:`!version` and :data:`!version_info`." msgstr ":data:`!version` 和 :data:`!version_info`。" -#: ../../deprecations/pending-removal-in-3.14.rst:95 +#: ../../deprecations/pending-removal-in-3.14.rst:89 msgid "" -":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` " -"if :ref:`named placeholders ` are used and " -"*parameters* is a sequence instead of a :class:`dict`." +":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" +"ref:`named placeholders ` are used and *parameters* is " +"a sequence instead of a :class:`dict`." msgstr "" ":meth:`~sqlite3.Cursor.execute` 和 :meth:`~sqlite3.Cursor.executemany`,如果" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" "而不是 :class:`dict`。" -#: ../../deprecations/pending-removal-in-3.14.rst:99 -msgid "" -":mod:`typing`: :class:`!typing.ByteString`, deprecated since Python 3.9, now " -"causes a :exc:`DeprecationWarning` to be emitted when it is used." -msgstr "" -":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`!typing.ByteString` 現在在" -"使用時會發出 :exc:`DeprecationWarning`。" - -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " -"intended to be a public API. (Contributed by Gregory P. Smith " -"in :gh:`88168`.)" +"intended to be a public API. (Contributed by Gregory P. Smith in :gh:" +"`88168`.)" msgstr "" ":mod:`urllib`::class:`!urllib.parse.Quoter` 已被棄用:它並非預期的公開 API。" "(由 Gregory P. Smith 於 :gh:`88168` 貢獻。)" + +#~ msgid "" +#~ ":mod:`collections.abc`: Deprecated :class:`!collections.abc.ByteString`. " +#~ "Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " +#~ "typing, prefer a union, like ``bytes | bytearray``, or :class:" +#~ "`collections.abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" +#~ msgstr "" +#~ ":mod:`collections.abc`:已棄用 :class:`!collections.abc.ByteString`。請改" +#~ "用 :class:`!Sequence` 或 :class:`~collections.abc.Buffer`。在 typing 中使" +#~ "用時,請改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc." +#~ "Buffer`。(由 Shantanu Jain 於 :gh:`91896` 貢獻。)" + +#~ msgid "" +#~ ":mod:`typing`: :class:`!typing.ByteString`, deprecated since Python 3.9, " +#~ "now causes a :exc:`DeprecationWarning` to be emitted when it is used." +#~ msgstr "" +#~ ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`!typing.ByteString` 現在" +#~ "在使用時會發出 :exc:`DeprecationWarning`。" diff --git a/deprecations/pending-removal-in-3.17.po b/deprecations/pending-removal-in-3.17.po index cbf597dea4..49abbd6744 100644 --- a/deprecations/pending-removal-in-3.17.po +++ b/deprecations/pending-removal-in-3.17.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-18 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -37,3 +37,33 @@ msgstr "" "作的。這個類別不再被需要,但為了向後相容性而保留,並計劃將在 Python 3.17 中移" "除。使用者應該改用文件中記錄的內省輔助函式,例如 :func:`typing.get_origin` " "和 :func:`typing.get_args`,或者依賴私有實作細節。" + +#: ../../deprecations/pending-removal-in-3.17.rst:11 +msgid "" +":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " +"removal in Python 3.17. Prefer :class:`~collections.abc.Sequence` or :class:" +"`~collections.abc.Buffer`. For use in type annotations, prefer a union, like " +"``bytes | bytearray``, or :class:`collections.abc.Buffer`. (Contributed by " +"Shantanu Jain in :gh:`91896`.)" +msgstr "" +"自 Python 3.9 起已被棄用的 :class:`typing.ByteString`,計劃在 Python " +"3.17 中移除。建議改用 :class:`~collections.abc.Sequence` 或 :class:`~" +"collections.abc.Buffer`。在型別註釋中建議改用聯集,例如 ``bytes | " +"bytearray`` 或 :class:`collections.abc.Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" + +#: ../../deprecations/pending-removal-in-3.17.rst:17 +msgid ":mod:`collections.abc`:" +msgstr ":mod:`collections.abc`:" + +#: ../../deprecations/pending-removal-in-3.17.rst:19 +msgid "" +":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17. " +"Prefer :class:`~collections.abc.Sequence` or :class:`~collections.abc." +"Buffer`. For use in type annotations, prefer a union, like ``bytes | " +"bytearray``, or :class:`collections.abc.Buffer`. (Contributed by Shantanu " +"Jain in :gh:`91896`.)" +msgstr "" +":class:`collections.abc.ByteString` 計劃在 Python 3.17 中移除。建議改用 " +":class:`~collections.abc.Sequence` 或 :class:`~collections.abc.Buffer`。在" +"型別註釋中建議改用聯集,例如 ``bytes | bytearray`` 或 :class:`collections.abc." +"Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" diff --git a/extending/extending.po b/extending/extending.po index 597ae13de8..452fcb6374 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2025-02-17 14:34+0000\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -101,9 +101,9 @@ msgstr "" #: ../../extending/extending.rst:53 msgid "" "Begin by creating a file :file:`spammodule.c`. (Historically, if a module " -"is called ``spam``, the C file containing its implementation is " -"called :file:`spammodule.c`; if the module name is very long, like " -"``spammify``, the module name can be just :file:`spammify.c`.)" +"is called ``spam``, the C file containing its implementation is called :file:" +"`spammodule.c`; if the module name is very long, like ``spammify``, the " +"module name can be just :file:`spammify.c`.)" msgstr "" "首先建立一個檔案 :file:`spammodule.c`。(從過去歷史來看,如果一個模組叫做 " "``spam``,包含其實作的 C 檔案就會叫做 :file:`spammodule.c`;如果模組名稱很" @@ -153,11 +153,11 @@ msgstr "" msgid "" "All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` " "or ``PY``, except those defined in standard header files. For convenience, " -"and since they are used extensively by the Python interpreter, " -"``\"Python.h\"`` includes a few standard header files: ````, " -"````, ````, and ````. If the latter header " -"file does not exist on your system, it declares the " -"functions :c:func:`malloc`, :c:func:`free` and :c:func:`realloc` directly." +"and since they are used extensively by the Python interpreter, ``\"Python." +"h\"`` includes a few standard header files: ````, ````, " +"````, and ````. If the latter header file does not exist " +"on your system, it declares the functions :c:func:`malloc`, :c:func:`free` " +"and :c:func:`realloc` directly." msgstr "" #: ../../extending/extending.rst:85 @@ -166,9 +166,9 @@ msgid "" "called when the Python expression ``spam.system(string)`` is evaluated " "(we'll see shortly how it ends up being called)::" msgstr "" -"接下來我們要加入到模組檔案的是 C 函式,當 Python 運算式 " -"``spam.system(string)`` 要被求值 (evaluated) 時就會被呼叫(我們很快就會看到它" -"最後是如何被呼叫的): ::" +"接下來我們要加入到模組檔案的是 C 函式,當 Python 運算式 ``spam." +"system(string)`` 要被求值 (evaluated) 時就會被呼叫(我們很快就會看到它最後是" +"如何被呼叫的): ::" #: ../../extending/extending.rst:89 msgid "" @@ -227,9 +227,9 @@ msgid "" msgstr "" "*args* 引數會是一個指向包含引數的 Python 元組物件的指標。元組中的每一項都對應" "於呼叫的引數串列中的一個引數。引數是 Python 物件 --- 為了在我們的 C 函式中對" -"它們做任何事情,我們必須先將它們轉換成 C 值。Python API 中" -"的 :c:func:`PyArg_ParseTuple` 函式能夠檢查引數型別並將他們轉換為 C 值。它使用" -"模板字串來決定所需的引數型別以及儲存轉換值的 C 變數型別。稍後會再詳細說明。" +"它們做任何事情,我們必須先將它們轉換成 C 值。Python API 中的 :c:func:" +"`PyArg_ParseTuple` 函式能夠檢查引數型別並將他們轉換為 C 值。它使用模板字串來" +"決定所需的引數型別以及儲存轉換值的 C 變數型別。稍後會再詳細說明。" #: ../../extending/extending.rst:118 msgid "" @@ -240,10 +240,10 @@ msgid "" "the calling function can return ``NULL`` immediately (as we saw in the " "example)." msgstr "" -"如果所有的引數都有正確的型別,且其元件已儲存在傳入位址的變數中," -"則 :c:func:`PyArg_ParseTuple` 會回傳 true(非零)。如果傳入的是無效引數串列則" -"回傳 false(零)。在後者情況下,它也會產生適當的例外,因此呼叫函式可以立即回" -"傳 ``NULL``\\ (就像我們在範例中所看到的)。" +"如果所有的引數都有正確的型別,且其元件已儲存在傳入位址的變數中,則 :c:func:" +"`PyArg_ParseTuple` 會回傳 true(非零)。如果傳入的是無效引數串列則回傳 false" +"(零)。在後者情況下,它也會產生適當的例外,因此呼叫函式可以立即回傳 " +"``NULL``\\ (就像我們在範例中所看到的)。" #: ../../extending/extending.rst:128 msgid "Intermezzo: Errors and Exceptions" @@ -289,28 +289,27 @@ msgstr "" msgid "" "Another useful function is :c:func:`PyErr_SetFromErrno`, which only takes an " "exception argument and constructs the associated value by inspection of the " -"global variable :c:data:`errno`. The most general function " -"is :c:func:`PyErr_SetObject`, which takes two object arguments, the " -"exception and its associated value. You don't need to :c:func:`Py_INCREF` " -"the objects passed to any of these functions." +"global variable :c:data:`errno`. The most general function is :c:func:" +"`PyErr_SetObject`, which takes two object arguments, the exception and its " +"associated value. You don't need to :c:func:`Py_INCREF` the objects passed " +"to any of these functions." msgstr "" "另一個有用的函式是 :c:func:`PyErr_SetFromErrno`,它只接受一個例外引數,並透過" -"檢查全域變數 :c:data:`errno` 來建立關聯值。最一般的函式" -"是 :c:func:`PyErr_SetObject`,它接受兩個物件引數,即例外和它的關聯值。你不需" -"要對傳給任何這些函式的物件呼叫 :c:func:`Py_INCREF`。" +"檢查全域變數 :c:data:`errno` 來建立關聯值。最一般的函式是 :c:func:" +"`PyErr_SetObject`,它接受兩個物件引數,即例外和它的關聯值。你不需要對傳給任何" +"這些函式的物件呼叫 :c:func:`Py_INCREF`。" #: ../../extending/extending.rst:154 msgid "" -"You can test non-destructively whether an exception has been set " -"with :c:func:`PyErr_Occurred`. This returns the current exception object, " -"or ``NULL`` if no exception has occurred. You normally don't need to " -"call :c:func:`PyErr_Occurred` to see whether an error occurred in a function " -"call, since you should be able to tell from the return value." +"You can test non-destructively whether an exception has been set with :c:" +"func:`PyErr_Occurred`. This returns the current exception object, or " +"``NULL`` if no exception has occurred. You normally don't need to call :c:" +"func:`PyErr_Occurred` to see whether an error occurred in a function call, " +"since you should be able to tell from the return value." msgstr "" "你可以使用 :c:func:`PyErr_Occurred` 來不具破壞性地測試例外是否已被設定。這會" -"回傳目前的例外物件,如果沒有例外發生則回傳 ``NULL``。你通常不需要呼" -"叫 :c:func:`PyErr_Occurred` 來查看函式呼叫是否發生錯誤,因為你應可從回傳值就" -"得知。" +"回傳目前的例外物件,如果沒有例外發生則回傳 ``NULL``。你通常不需要呼叫 :c:" +"func:`PyErr_Occurred` 來查看函式呼叫是否發生錯誤,因為你應可從回傳值就得知。" #: ../../extending/extending.rst:160 msgid "" @@ -359,17 +358,16 @@ msgstr "" #: ../../extending/extending.rst:182 msgid "" "Every failing :c:func:`malloc` call must be turned into an exception --- the " -"direct caller of :c:func:`malloc` (or :c:func:`realloc`) must " -"call :c:func:`PyErr_NoMemory` and return a failure indicator itself. All " -"the object-creating functions (for example, :c:func:`PyLong_FromLong`) " -"already do this, so this note is only relevant to those who " -"call :c:func:`malloc` directly." -msgstr "" -"每個失敗的 :c:func:`malloc` 呼叫都必須被轉換成一個例外 " -"--- :c:func:`malloc`\\ (或 :c:func:`realloc`)的直接呼叫者必須呼" -"叫 :c:func:`PyErr_NoMemory` 並回傳一個失敗指示器。所有建立物件的函式(例" -"如 :c:func:`PyLong_FromLong`)都已經這麼做了,所以這個注意事項只和那些直接呼" -"叫 :c:func:`malloc` 的函式有關。" +"direct caller of :c:func:`malloc` (or :c:func:`realloc`) must call :c:func:" +"`PyErr_NoMemory` and return a failure indicator itself. All the object-" +"creating functions (for example, :c:func:`PyLong_FromLong`) already do this, " +"so this note is only relevant to those who call :c:func:`malloc` directly." +msgstr "" +"每個失敗的 :c:func:`malloc` 呼叫都必須被轉換成一個例外 --- :c:func:" +"`malloc`\\ (或 :c:func:`realloc`)的直接呼叫者必須呼叫 :c:func:" +"`PyErr_NoMemory` 並回傳一個失敗指示器。所有建立物件的函式(例如 :c:func:" +"`PyLong_FromLong`)都已經這麼做了,所以這個注意事項只和那些直接呼叫 :c:func:" +"`malloc` 的函式有關。" #: ../../extending/extending.rst:188 msgid "" @@ -384,12 +382,12 @@ msgstr "" #: ../../extending/extending.rst:192 msgid "" -"Finally, be careful to clean up garbage (by making :c:func:`Py_XDECREF` " -"or :c:func:`Py_DECREF` calls for objects you have already created) when you " +"Finally, be careful to clean up garbage (by making :c:func:`Py_XDECREF` or :" +"c:func:`Py_DECREF` calls for objects you have already created) when you " "return an error indicator!" msgstr "" -"最後,在回傳錯誤指示器時要注意垃圾清理(透過對你已經建立的物件呼" -"叫 :c:func:`Py_XDECREF` 或 :c:func:`Py_DECREF`)!" +"最後,在回傳錯誤指示器時要注意垃圾清理(透過對你已經建立的物件呼叫 :c:func:" +"`Py_XDECREF` 或 :c:func:`Py_DECREF`)!" #: ../../extending/extending.rst:196 msgid "" @@ -397,20 +395,19 @@ msgid "" "predeclared C objects corresponding to all built-in Python exceptions, such " "as :c:data:`PyExc_ZeroDivisionError`, which you can use directly. Of course, " "you should choose exceptions wisely --- don't use :c:data:`PyExc_TypeError` " -"to mean that a file couldn't be opened (that should probably " -"be :c:data:`PyExc_OSError`). If something's wrong with the argument list, " -"the :c:func:`PyArg_ParseTuple` function usually " -"raises :c:data:`PyExc_TypeError`. If you have an argument whose value must " -"be in a particular range or must satisfy other " -"conditions, :c:data:`PyExc_ValueError` is appropriate." +"to mean that a file couldn't be opened (that should probably be :c:data:" +"`PyExc_OSError`). If something's wrong with the argument list, the :c:func:" +"`PyArg_ParseTuple` function usually raises :c:data:`PyExc_TypeError`. If " +"you have an argument whose value must be in a particular range or must " +"satisfy other conditions, :c:data:`PyExc_ValueError` is appropriate." msgstr "" "你完全可以自行選擇要產生的例外。有一些預先宣告的 C 物件會對應到所有內建的 " "Python 例外,例如 :c:data:`PyExc_ZeroDivisionError`,你可以直接使用它們。當" "然,你應該明智地選擇例外,像是不要使用 :c:data:`PyExc_TypeError` 來表示檔案無" -"法打開(應該是 :c:data:`PyExc_OSError`)。如果引數串列有問" -"題,:c:func:`PyArg_ParseTuple` 函式通常會引發 :c:data:`PyExc_TypeError`。如果" -"你有一個引數的值必須在一個特定的範圍內或必須滿足其他條件,則可以使" -"用 :c:data:`PyExc_ValueError`。" +"法打開(應該是 :c:data:`PyExc_OSError`)。如果引數串列有問題,:c:func:" +"`PyArg_ParseTuple` 函式通常會引發 :c:data:`PyExc_TypeError`。如果你有一個引數" +"的值必須在一個特定的範圍內或必須滿足其他條件,則可以使用 :c:data:" +"`PyExc_ValueError`。" #: ../../extending/extending.rst:206 msgid "" @@ -427,8 +424,8 @@ msgstr "static PyObject *SpamError = NULL;" #: ../../extending/extending.rst:212 msgid "" -"and initialize it by calling :c:func:`PyErr_NewException` in the " -"module's :c:data:`Py_mod_exec` function (:c:func:`!spam_module_exec`)::" +"and initialize it by calling :c:func:`PyErr_NewException` in the module's :c:" +"data:`Py_mod_exec` function (:c:func:`!spam_module_exec`)::" msgstr "" #: ../../extending/extending.rst:215 @@ -437,9 +434,9 @@ msgstr "" #: ../../extending/extending.rst:217 msgid "" -"Since :c:data:`!SpamError` is a global variable, it will be overwitten every " -"time the module is reinitialized, when the :c:data:`Py_mod_exec` function is " -"called." +"Since :c:data:`!SpamError` is a global variable, it will be overwritten " +"every time the module is reinitialized, when the :c:data:`Py_mod_exec` " +"function is called." msgstr "" #: ../../extending/extending.rst:220 @@ -609,8 +606,8 @@ msgid "" "The next statement is a call to the Unix function :c:func:`system`, passing " "it the string we just got from :c:func:`PyArg_ParseTuple`::" msgstr "" -"接下來的陳述式會呼叫 Unix 函式 :c:func:`system`,並將剛才" -"從 :c:func:`PyArg_ParseTuple` 得到的字串傳給它:" +"接下來的陳述式會呼叫 Unix 函式 :c:func:`system`,並將剛才從 :c:func:" +"`PyArg_ParseTuple` 得到的字串傳給它:" #: ../../extending/extending.rst:321 msgid "sts = system(command);" @@ -619,8 +616,8 @@ msgstr "sts = system(command);" #: ../../extending/extending.rst:323 msgid "" "Our :func:`!spam.system` function must return the value of :c:data:`!sts` as " -"a Python object. This is done using the " -"function :c:func:`PyLong_FromLong`. ::" +"a Python object. This is done using the function :c:func:" +"`PyLong_FromLong`. ::" msgstr "" "我們的 :func:`!spam.system` 函式必須以 Python 物件的形式來回傳 :c:data:`!" "sts` 的值。這是透過 :c:func:`PyLong_FromLong` 函式來達成。 ::" @@ -641,12 +638,12 @@ msgstr "" msgid "" "If you have a C function that returns no useful argument (a function " "returning :c:expr:`void`), the corresponding Python function must return " -"``None``. You need this idiom to do so (which is implemented by " -"the :c:macro:`Py_RETURN_NONE` macro)::" +"``None``. You need this idiom to do so (which is implemented by the :c:" +"macro:`Py_RETURN_NONE` macro)::" msgstr "" "如果你有一個不回傳任何有用引數的 C 函式(一個回傳 :c:expr:`void` 的函式),對" -"應的 Python 函式必須回傳 ``None``。你需要以下這個慣例來達成" -"(由 :c:macro:`Py_RETURN_NONE` 巨集實作): ::" +"應的 Python 函式必須回傳 ``None``。你需要以下這個慣例來達成(由 :c:macro:" +"`Py_RETURN_NONE` 巨集實作): ::" #: ../../extending/extending.rst:336 msgid "" @@ -711,9 +708,8 @@ msgstr "" #: ../../extending/extending.rst:365 msgid "" "When using only ``METH_VARARGS``, the function should expect the Python-" -"level parameters to be passed in as a tuple acceptable for parsing " -"via :c:func:`PyArg_ParseTuple`; more information on this function is " -"provided below." +"level parameters to be passed in as a tuple acceptable for parsing via :c:" +"func:`PyArg_ParseTuple`; more information on this function is provided below." msgstr "" "當只使用 ``METH_VARARGS`` 時,函式應預期 Python 層級的參數是以元組形式傳入且" "能夠接受以 :c:func:`PyArg_ParseTuple` 進行剖析;有關此函式的更多資訊將在下面" @@ -749,9 +745,9 @@ msgstr "" #: ../../extending/extending.rst:383 msgid "" "This structure, in turn, must be passed to the interpreter in the module's " -"initialization function. The initialization function must be " -"named :c:func:`!PyInit_name`, where *name* is the name of the module, and " -"should be the only non-\\ ``static`` item defined in the module file::" +"initialization function. The initialization function must be named :c:func:" +"`!PyInit_name`, where *name* is the name of the module, and should be the " +"only non-\\ ``static`` item defined in the module file::" msgstr "" "反過來說,這個結構必須在模組的初始化函式中被傳給直譯器。初始化函式必須被命名" "為 :c:func:`!PyInit_name`,其中 *name* 是模組的名稱,且應該是模組檔案中唯一定" @@ -782,24 +778,23 @@ msgstr "" #: ../../extending/extending.rst:398 msgid "" -":c:func:`!PyInit_spam` is called when each interpreter imports its " -"module :mod:`!spam` for the first time. (See below for comments about " -"embedding Python.) A pointer to the module definition must be returned " -"via :c:func:`PyModuleDef_Init`, so that the import machinery can create the " -"module and store it in ``sys.modules``." +":c:func:`!PyInit_spam` is called when each interpreter imports its module :" +"mod:`!spam` for the first time. (See below for comments about embedding " +"Python.) A pointer to the module definition must be returned via :c:func:" +"`PyModuleDef_Init`, so that the import machinery can create the module and " +"store it in ``sys.modules``." msgstr "" #: ../../extending/extending.rst:403 msgid "" "When embedding Python, the :c:func:`!PyInit_spam` function is not called " "automatically unless there's an entry in the :c:data:`!PyImport_Inittab` " -"table. To add the module to the initialization table, " -"use :c:func:`PyImport_AppendInittab`, optionally followed by an import of " -"the module::" +"table. To add the module to the initialization table, use :c:func:" +"`PyImport_AppendInittab`, optionally followed by an import of the module::" msgstr "" "嵌入 Python 時,除非在 :c:data:`!PyImport_Inittab` 表中有相關條目,否則不會自" -"動呼叫 :c:func:`!PyInit_spam` 函式。要將模組加入初始化表,請使" -"用 :c:func:`PyImport_AppendInittab` 並在隨後選擇性地將該模組引入: ::" +"動呼叫 :c:func:`!PyInit_spam` 函式。要將模組加入初始化表,請使用 :c:func:" +"`PyImport_AppendInittab` 並在隨後選擇性地將該模組引入: ::" #: ../../extending/extending.rst:408 msgid "" @@ -909,10 +904,10 @@ msgid "" "experience unintended side-effects on re-initialisation, for example when " "removing entries from ``sys.modules`` or importing compiled modules into " "multiple interpreters within a process (or following a :c:func:`fork` " -"without an intervening :c:func:`exec`). If module state is not yet " -"fully :ref:`isolated `, authors should consider " -"marking the module as having no support for subinterpreters " -"(via :c:macro:`Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED`)." +"without an intervening :c:func:`exec`). If module state is not yet fully :" +"ref:`isolated `, authors should consider marking " +"the module as having no support for subinterpreters (via :c:macro:" +"`Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED`)." msgstr "" #: ../../extending/extending.rst:467 @@ -921,8 +916,8 @@ msgid "" "distribution as :file:`Modules/xxlimited.c`. This file may be used as a " "template or simply read as an example." msgstr "" -"Python 原始碼發行版本中包含了一個更實質的範例模組 :file:`Modules/" -"xxlimited.c`。這個檔案可以當作模板使用,也可以簡單地當作範例來閱讀。" +"Python 原始碼發行版本中包含了一個更實質的範例模組 :file:`Modules/xxlimited." +"c`。這個檔案可以當作模板使用,也可以簡單地當作範例來閱讀。" #: ../../extending/extending.rst:475 msgid "Compilation and Linkage" @@ -933,10 +928,9 @@ msgid "" "There are two more things to do before you can use your new extension: " "compiling and linking it with the Python system. If you use dynamic " "loading, the details may depend on the style of dynamic loading your system " -"uses; see the chapters about building extension modules " -"(chapter :ref:`building`) and additional information that pertains only to " -"building on Windows (chapter :ref:`building-on-windows`) for more " -"information about this." +"uses; see the chapters about building extension modules (chapter :ref:" +"`building`) and additional information that pertains only to building on " +"Windows (chapter :ref:`building-on-windows`) for more information about this." msgstr "" #: ../../extending/extending.rst:484 @@ -1035,10 +1029,10 @@ msgstr "" #: ../../extending/extending.rst:558 msgid "" -"This function must be registered with the interpreter using " -"the :c:macro:`METH_VARARGS` flag; this is described in " -"section :ref:`methodtable`. The :c:func:`PyArg_ParseTuple` function and its " -"arguments are documented in section :ref:`parsetuple`." +"This function must be registered with the interpreter using the :c:macro:" +"`METH_VARARGS` flag; this is described in section :ref:`methodtable`. The :" +"c:func:`PyArg_ParseTuple` function and its arguments are documented in " +"section :ref:`parsetuple`." msgstr "" #: ../../extending/extending.rst:563 @@ -1051,15 +1045,14 @@ msgstr "" #: ../../extending/extending.rst:570 msgid "" -"Later, when it is time to call the function, you call the C " -"function :c:func:`PyObject_CallObject`. This function has two arguments, " -"both pointers to arbitrary Python objects: the Python function, and the " -"argument list. The argument list must always be a tuple object, whose " -"length is the number of arguments. To call the Python function with no " -"arguments, pass in ``NULL``, or an empty tuple; to call it with one " -"argument, pass a singleton tuple. :c:func:`Py_BuildValue` returns a tuple " -"when its format string consists of zero or more format codes between " -"parentheses. For example::" +"Later, when it is time to call the function, you call the C function :c:func:" +"`PyObject_CallObject`. This function has two arguments, both pointers to " +"arbitrary Python objects: the Python function, and the argument list. The " +"argument list must always be a tuple object, whose length is the number of " +"arguments. To call the Python function with no arguments, pass in ``NULL``, " +"or an empty tuple; to call it with one argument, pass a singleton tuple. :c:" +"func:`Py_BuildValue` returns a tuple when its format string consists of zero " +"or more format codes between parentheses. For example::" msgstr "" #: ../../extending/extending.rst:579 @@ -1081,9 +1074,8 @@ msgid "" ":c:func:`PyObject_CallObject` returns a Python object pointer: this is the " "return value of the Python function. :c:func:`PyObject_CallObject` is " "\"reference-count-neutral\" with respect to its arguments. In the example a " -"new tuple was created to serve as the argument list, which " -"is :c:func:`Py_DECREF`\\ -ed immediately after " -"the :c:func:`PyObject_CallObject` call." +"new tuple was created to serve as the argument list, which is :c:func:" +"`Py_DECREF`\\ -ed immediately after the :c:func:`PyObject_CallObject` call." msgstr "" #: ../../extending/extending.rst:597 @@ -1149,10 +1141,9 @@ msgstr "" #: ../../extending/extending.rst:639 msgid "" -"You may also call a function with keyword arguments by " -"using :c:func:`PyObject_Call`, which supports arguments and keyword " -"arguments. As in the above example, we use :c:func:`Py_BuildValue` to " -"construct the dictionary. ::" +"You may also call a function with keyword arguments by using :c:func:" +"`PyObject_Call`, which supports arguments and keyword arguments. As in the " +"above example, we use :c:func:`Py_BuildValue` to construct the dictionary. ::" msgstr "" #: ../../extending/extending.rst:643 @@ -1305,21 +1296,21 @@ msgstr "" #: ../../extending/extending.rst:758 msgid "" -"The *arg* and *format* parameters are identical to those of " -"the :c:func:`PyArg_ParseTuple` function. The *kwdict* parameter is the " -"dictionary of keywords received as the third parameter from the Python " -"runtime. The *kwlist* parameter is a ``NULL``-terminated list of strings " -"which identify the parameters; the names are matched with the type " -"information from *format* from left to right. On " -"success, :c:func:`PyArg_ParseTupleAndKeywords` returns true, otherwise it " -"returns false and raises an appropriate exception." +"The *arg* and *format* parameters are identical to those of the :c:func:" +"`PyArg_ParseTuple` function. The *kwdict* parameter is the dictionary of " +"keywords received as the third parameter from the Python runtime. The " +"*kwlist* parameter is a ``NULL``-terminated list of strings which identify " +"the parameters; the names are matched with the type information from " +"*format* from left to right. On success, :c:func:" +"`PyArg_ParseTupleAndKeywords` returns true, otherwise it returns false and " +"raises an appropriate exception." msgstr "" #: ../../extending/extending.rst:768 msgid "" "Nested tuples cannot be parsed when using keyword arguments! Keyword " -"parameters passed in which are not present in the *kwlist* will " -"cause :exc:`TypeError` to be raised." +"parameters passed in which are not present in the *kwlist* will cause :exc:" +"`TypeError` to be raised." msgstr "" #: ../../extending/extending.rst:774 @@ -1397,10 +1388,10 @@ msgstr "PyObject *Py_BuildValue(const char *format, ...);" #: ../../extending/extending.rst:835 msgid "" -"It recognizes a set of format units similar to the ones recognized " -"by :c:func:`PyArg_ParseTuple`, but the arguments (which are input to the " -"function, not output) must not be pointers, just values. It returns a new " -"Python object, suitable for returning from a C function called from Python." +"It recognizes a set of format units similar to the ones recognized by :c:" +"func:`PyArg_ParseTuple`, but the arguments (which are input to the function, " +"not output) must not be pointers, just values. It returns a new Python " +"object, suitable for returning from a C function called from Python." msgstr "" #: ../../extending/extending.rst:840 @@ -1474,16 +1465,16 @@ msgstr "" #: ../../extending/extending.rst:882 msgid "" "Every block of memory allocated with :c:func:`malloc` should eventually be " -"returned to the pool of available memory by exactly one call " -"to :c:func:`free`. It is important to call :c:func:`free` at the right " -"time. If a block's address is forgotten but :c:func:`free` is not called " -"for it, the memory it occupies cannot be reused until the program " -"terminates. This is called a :dfn:`memory leak`. On the other hand, if a " -"program calls :c:func:`free` for a block and then continues to use the " -"block, it creates a conflict with reuse of the block through " -"another :c:func:`malloc` call. This is called :dfn:`using freed memory`. It " -"has the same bad consequences as referencing uninitialized data --- core " -"dumps, wrong results, mysterious crashes." +"returned to the pool of available memory by exactly one call to :c:func:" +"`free`. It is important to call :c:func:`free` at the right time. If a " +"block's address is forgotten but :c:func:`free` is not called for it, the " +"memory it occupies cannot be reused until the program terminates. This is " +"called a :dfn:`memory leak`. On the other hand, if a program calls :c:func:" +"`free` for a block and then continues to use the block, it creates a " +"conflict with reuse of the block through another :c:func:`malloc` call. " +"This is called :dfn:`using freed memory`. It has the same bad consequences " +"as referencing uninitialized data --- core dumps, wrong results, mysterious " +"crashes." msgstr "" #: ../../extending/extending.rst:893 @@ -1547,9 +1538,9 @@ msgstr "" #: ../../extending/extending.rst:937 msgid "" "The cycle detector is able to detect garbage cycles and can reclaim them. " -"The :mod:`gc` module exposes a way to run the detector " -"(the :func:`~gc.collect` function), as well as configuration interfaces and " -"the ability to disable the detector at runtime." +"The :mod:`gc` module exposes a way to run the detector (the :func:`~gc." +"collect` function), as well as configuration interfaces and the ability to " +"disable the detector at runtime." msgstr "" #: ../../extending/extending.rst:946 @@ -1559,12 +1550,12 @@ msgstr "Python 中的參照計數" #: ../../extending/extending.rst:948 msgid "" "There are two macros, ``Py_INCREF(x)`` and ``Py_DECREF(x)``, which handle " -"the incrementing and decrementing of the reference " -"count. :c:func:`Py_DECREF` also frees the object when the count reaches " -"zero. For flexibility, it doesn't call :c:func:`free` directly --- rather, " -"it makes a call through a function pointer in the object's :dfn:`type " -"object`. For this purpose (and others), every object also contains a " -"pointer to its type object." +"the incrementing and decrementing of the reference count. :c:func:" +"`Py_DECREF` also frees the object when the count reaches zero. For " +"flexibility, it doesn't call :c:func:`free` directly --- rather, it makes a " +"call through a function pointer in the object's :dfn:`type object`. For " +"this purpose (and others), every object also contains a pointer to its type " +"object." msgstr "" #: ../../extending/extending.rst:955 @@ -1602,11 +1593,11 @@ msgstr "" #: ../../extending/extending.rst:978 msgid "" -"A borrowed reference can be changed into an owned reference by " -"calling :c:func:`Py_INCREF`. This does not affect the status of the owner " -"from which the reference was borrowed --- it creates a new owned reference, " -"and gives full owner responsibilities (the new owner must dispose of the " -"reference properly, as well as the previous owner)." +"A borrowed reference can be changed into an owned reference by calling :c:" +"func:`Py_INCREF`. This does not affect the status of the owner from which " +"the reference was borrowed --- it creates a new owned reference, and gives " +"full owner responsibilities (the new owner must dispose of the reference " +"properly, as well as the previous owner)." msgstr "" #: ../../extending/extending.rst:988 @@ -1626,20 +1617,20 @@ msgid "" "the reference. In particular, all functions whose function it is to create " "a new object, such as :c:func:`PyLong_FromLong` and :c:func:`Py_BuildValue`, " "pass ownership to the receiver. Even if the object is not actually new, you " -"still receive ownership of a new reference to that object. For " -"instance, :c:func:`PyLong_FromLong` maintains a cache of popular values and " -"can return a reference to a cached item." +"still receive ownership of a new reference to that object. For instance, :c:" +"func:`PyLong_FromLong` maintains a cache of popular values and can return a " +"reference to a cached item." msgstr "" #: ../../extending/extending.rst:1002 msgid "" "Many functions that extract objects from other objects also transfer " -"ownership with the reference, for " -"instance :c:func:`PyObject_GetAttrString`. The picture is less clear, here, " -"however, since a few common routines are " -"exceptions: :c:func:`PyTuple_GetItem`, :c:func:`PyList_GetItem`, :c:func:`PyDict_GetItem`, " -"and :c:func:`PyDict_GetItemString` all return references that you borrow " -"from the tuple, list or dictionary." +"ownership with the reference, for instance :c:func:" +"`PyObject_GetAttrString`. The picture is less clear, here, however, since a " +"few common routines are exceptions: :c:func:`PyTuple_GetItem`, :c:func:" +"`PyList_GetItem`, :c:func:`PyDict_GetItem`, and :c:func:" +"`PyDict_GetItemString` all return references that you borrow from the tuple, " +"list or dictionary." msgstr "" #: ../../extending/extending.rst:1009 @@ -1654,11 +1645,10 @@ msgid "" "When you pass an object reference into another function, in general, the " "function borrows the reference from you --- if it needs to store it, it will " "use :c:func:`Py_INCREF` to become an independent owner. There are exactly " -"two important exceptions to this rule: :c:func:`PyTuple_SetItem` " -"and :c:func:`PyList_SetItem`. These functions take over ownership of the " -"item passed to them --- even if they fail! (Note " -"that :c:func:`PyDict_SetItem` and friends don't take over ownership --- they " -"are \"normal.\")" +"two important exceptions to this rule: :c:func:`PyTuple_SetItem` and :c:func:" +"`PyList_SetItem`. These functions take over ownership of the item passed to " +"them --- even if they fail! (Note that :c:func:`PyDict_SetItem` and friends " +"don't take over ownership --- they are \"normal.\")" msgstr "" #: ../../extending/extending.rst:1021 @@ -1732,12 +1722,12 @@ msgid "" "defined a :meth:`!__del__` method. If this class instance has a reference " "count of 1, disposing of it will call its :meth:`!__del__` method. " "Internally, :c:func:`PyList_SetItem` calls :c:func:`Py_DECREF` on the " -"replaced item, which invokes replaced item's " -"corresponding :c:member:`~PyTypeObject.tp_dealloc` function. During " -"deallocation, :c:member:`~PyTypeObject.tp_dealloc` " -"calls :c:member:`~PyTypeObject.tp_finalize`, which is mapped to the :meth:`!" -"__del__` method for class instances (see :pep:`442`). This entire sequence " -"happens synchronously within the :c:func:`PyList_SetItem` call." +"replaced item, which invokes replaced item's corresponding :c:member:" +"`~PyTypeObject.tp_dealloc` function. During deallocation, :c:member:" +"`~PyTypeObject.tp_dealloc` calls :c:member:`~PyTypeObject.tp_finalize`, " +"which is mapped to the :meth:`!__del__` method for class instances (see :pep:" +"`442`). This entire sequence happens synchronously within the :c:func:" +"`PyList_SetItem` call." msgstr "" #: ../../extending/extending.rst:1071 @@ -1794,12 +1784,11 @@ msgid "" "threads. Normally, multiple threads in the Python interpreter can't get in " "each other's way, because there is a :term:`global lock ` protecting Python's entire object space. However, it is possible to " -"temporarily release this lock using the " -"macro :c:macro:`Py_BEGIN_ALLOW_THREADS`, and to re-acquire it " -"using :c:macro:`Py_END_ALLOW_THREADS`. This is common around blocking I/O " -"calls, to let other threads use the processor while waiting for the I/O to " -"complete. Obviously, the following function has the same problem as the " -"previous one::" +"temporarily release this lock using the macro :c:macro:" +"`Py_BEGIN_ALLOW_THREADS`, and to re-acquire it using :c:macro:" +"`Py_END_ALLOW_THREADS`. This is common around blocking I/O calls, to let " +"other threads use the processor while waiting for the I/O to complete. " +"Obviously, the following function has the same problem as the previous one::" msgstr "" #: ../../extending/extending.rst:1107 @@ -1841,8 +1830,8 @@ msgstr "" #: ../../extending/extending.rst:1135 msgid "" "The macros :c:func:`Py_INCREF` and :c:func:`Py_DECREF` do not check for " -"``NULL`` pointers --- however, their variants :c:func:`Py_XINCREF` " -"and :c:func:`Py_XDECREF` do." +"``NULL`` pointers --- however, their variants :c:func:`Py_XINCREF` and :c:" +"func:`Py_XDECREF` do." msgstr "" #: ../../extending/extending.rst:1139 @@ -2070,9 +2059,9 @@ msgstr "" #: ../../extending/extending.rst:1286 msgid "" "The ``#define`` is used to tell the header file that it is being included in " -"the exporting module, not a client module. Finally, the " -"module's :c:data:`mod_exec ` function must take care of " -"initializing the C API pointer array::" +"the exporting module, not a client module. Finally, the module's :c:data:" +"`mod_exec ` function must take care of initializing the C API " +"pointer array::" msgstr "" #: ../../extending/extending.rst:1290 @@ -2164,10 +2153,9 @@ msgstr "" #: ../../extending/extending.rst:1363 msgid "" -"All that a client module must do in order to have access to the " -"function :c:func:`!PySpam_System` is to call the function (or rather " -"macro) :c:func:`!import_spam` in its :c:data:`mod_exec ` " -"function::" +"All that a client module must do in order to have access to the function :c:" +"func:`!PySpam_System` is to call the function (or rather macro) :c:func:`!" +"import_spam` in its :c:data:`mod_exec ` function::" msgstr "" #: ../../extending/extending.rst:1367 @@ -2206,8 +2194,8 @@ msgstr "註腳" #: ../../extending/extending.rst:1390 msgid "" -"An interface for this function already exists in the standard " -"module :mod:`os` --- it was chosen as a simple and straightforward example." +"An interface for this function already exists in the standard module :mod:" +"`os` --- it was chosen as a simple and straightforward example." msgstr "" #: ../../extending/extending.rst:1393 diff --git a/glossary.po b/glossary.po index 72d8b77df6..9bb349a099 100644 --- a/glossary.po +++ b/glossary.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -54,56 +54,56 @@ msgstr "" "號、花括號或三引號)內部,或是在指定一個裝飾器 (decorator) 之後,要輸入程式碼" "時,:term:`互動式 ` shell 顯示的預設 Python 提示字元。" -#: ../../glossary.rst:24 -msgid "The :const:`Ellipsis` built-in constant." -msgstr "內建常數 :const:`Ellipsis`。" +#: ../../glossary.rst:26 +msgid "" +"The three dots form of the :ref:`Ellipsis ` object." +msgstr "" -#: ../../glossary.rst:25 +#: ../../glossary.rst:27 msgid "abstract base class" msgstr "abstract base class(抽象基底類別)" -#: ../../glossary.rst:27 +#: ../../glossary.rst:29 msgid "" "Abstract base classes complement :term:`duck-typing` by providing a way to " "define interfaces when other techniques like :func:`hasattr` would be clumsy " "or subtly wrong (for example with :ref:`magic methods `). " "ABCs introduce virtual subclasses, which are classes that don't inherit from " -"a class but are still recognized by :func:`isinstance` " -"and :func:`issubclass`; see the :mod:`abc` module documentation. Python " -"comes with many built-in ABCs for data structures (in " -"the :mod:`collections.abc` module), numbers (in the :mod:`numbers` module), " -"streams (in the :mod:`io` module), import finders and loaders (in " -"the :mod:`importlib.abc` module). You can create your own ABCs with " -"the :mod:`abc` module." +"a class but are still recognized by :func:`isinstance` and :func:" +"`issubclass`; see the :mod:`abc` module documentation. Python comes with " +"many built-in ABCs for data structures (in the :mod:`collections.abc` " +"module), numbers (in the :mod:`numbers` module), streams (in the :mod:`io` " +"module), import finders and loaders (in the :mod:`importlib.abc` module). " +"You can create your own ABCs with the :mod:`abc` module." msgstr "" "抽象基底類別(又稱為 ABC)提供了一種定義介面的方法,作為 :term:`duck-" "typing`\\ (鴨子型別)的補充。其他類似的技術,像是 :func:`hasattr`,則顯得笨" "拙或是帶有細微的錯誤(例如使用\\ :ref:`魔術方法 (magic method) `\\ )。ABC 採用虛擬的 subclass(子類別),它們並不繼承自另一個 class" -"(類別),但仍可被 :func:`isinstance` 及 :func:`issubclass` 辨識;請參" -"閱 :mod:`abc` 模組的說明文件。Python 有許多內建的 ABC,用於資料結構" -"(在 :mod:`collections.abc` 模組)、數字(在 :mod:`numbers` 模組)、串流" -"(在 :mod:`io` 模組)及 import 尋檢器和載入器(在 :mod:`importlib.abc` 模" -"組)。你可以使用 :mod:`abc` 模組建立自己的 ABC。" +"(類別),但仍可被 :func:`isinstance` 及 :func:`issubclass` 辨識;請參閱 :" +"mod:`abc` 模組的說明文件。Python 有許多內建的 ABC,用於資料結構(在 :mod:" +"`collections.abc` 模組)、數字(在 :mod:`numbers` 模組)、串流(在 :mod:`io` " +"模組)及 import 尋檢器和載入器(在 :mod:`importlib.abc` 模組)。你可以使用 :" +"mod:`abc` 模組建立自己的 ABC。" -#: ../../glossary.rst:38 +#: ../../glossary.rst:40 msgid "annotate function" msgstr "annotate function(註釋函式)" -#: ../../glossary.rst:40 +#: ../../glossary.rst:42 msgid "" "A function that can be called to retrieve the :term:`annotations " -"` of an object. This function is accessible as " -"the :attr:`~object.__annotate__` attribute of functions, classes, and " -"modules. Annotate functions are a subset of :term:`evaluate functions " -"`." +"` of an object. This function is accessible as the :attr:" +"`~object.__annotate__` attribute of functions, classes, and modules. " +"Annotate functions are a subset of :term:`evaluate functions `." msgstr "" -#: ../../glossary.rst:44 +#: ../../glossary.rst:46 msgid "annotation" msgstr "annotation(註釋)" -#: ../../glossary.rst:46 +#: ../../glossary.rst:48 msgid "" "A label associated with a variable, a class attribute or a function " "parameter or return value, used by convention as a :term:`type hint`." @@ -111,32 +111,31 @@ msgstr "" "一個與變數、class 屬性、函式的參數或回傳值相關聯的標籤。照慣例,它被用來作" "為 :term:`type hint`\\ (型別提示)。" -#: ../../glossary.rst:50 +#: ../../glossary.rst:52 msgid "" "Annotations of local variables cannot be accessed at runtime, but " "annotations of global variables, class attributes, and functions can be " "retrieved by calling :func:`annotationlib.get_annotations` on modules, " "classes, and functions, respectively." msgstr "" -"在 runtime 的區域變數註釋無法被存取,但全域變數、類別屬性和函式" -"的註釋,分別能夠以對模組、類別和函式呼叫 :func:`annotationlib.get_annotations` 來取得。" +"在 runtime 的區域變數註釋無法被存取,但全域變數、類別屬性和函式的註釋,分別能" +"夠以對模組、類別和函式呼叫 :func:`annotationlib.get_annotations` 來取得。" -#: ../../glossary.rst:55 +#: ../../glossary.rst:57 msgid "" -"See :term:`variable annotation`, :term:`function " -"annotation`, :pep:`484`, :pep:`526`, and :pep:`649`, which describe this " -"functionality. Also see :ref:`annotations-howto` for best practices on " -"working with annotations." +"See :term:`variable annotation`, :term:`function annotation`, :pep:`484`, :" +"pep:`526`, and :pep:`649`, which describe this functionality. Also see :ref:" +"`annotations-howto` for best practices on working with annotations." msgstr "" -"請參閱 :term:`variable annotation`、:term:`function annotation`、:pep:`484`" -"、:pep:`526` 和 :pep:`649`,這些章節皆有此功能的說明。關於註釋的最佳實踐方法也請參" -"閱 :ref:`annotations-howto`。" +"請參閱 :term:`variable annotation`、:term:`function annotation`、:pep:" +"`484`、:pep:`526` 和 :pep:`649`,這些章節皆有此功能的說明。關於註釋的最佳實踐" +"方法也請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:59 +#: ../../glossary.rst:61 msgid "argument" msgstr "argument(引數)" -#: ../../glossary.rst:61 +#: ../../glossary.rst:63 msgid "" "A value passed to a :term:`function` (or :term:`method`) when calling the " "function. There are two kinds of argument:" @@ -144,7 +143,7 @@ msgstr "" "呼叫函式時被傳遞給 :term:`function`\\ (或 :term:`method`\\ )的值。引數有兩" "種:" -#: ../../glossary.rst:64 +#: ../../glossary.rst:66 msgid "" ":dfn:`keyword argument`: an argument preceded by an identifier (e.g. " "``name=``) in a function call or passed as a value in a dictionary preceded " @@ -156,7 +155,7 @@ msgstr "" "遞的引數。例如,``3`` 和 ``5`` 都是以下 :func:`complex` 呼叫中的關鍵字引" "數: ::" -#: ../../glossary.rst:69 +#: ../../glossary.rst:71 msgid "" "complex(real=3, imag=5)\n" "complex(**{'real': 3, 'imag': 5})" @@ -164,7 +163,7 @@ msgstr "" "complex(real=3, imag=5)\n" "complex(**{'real': 3, 'imag': 5})" -#: ../../glossary.rst:72 +#: ../../glossary.rst:74 msgid "" ":dfn:`positional argument`: an argument that is not a keyword argument. " "Positional arguments can appear at the beginning of an argument list and/or " @@ -175,7 +174,7 @@ msgstr "" "引數列表的起始處出現,和(或)作為 ``*`` 之後的 :term:`iterable`\\ (可疊代物" "件)中的元素被傳遞。例如,``3`` 和 ``5`` 都是以下呼叫中的位置引數: ::" -#: ../../glossary.rst:78 +#: ../../glossary.rst:80 msgid "" "complex(3, 5)\n" "complex(*(3, 5))" @@ -183,7 +182,7 @@ msgstr "" "complex(3, 5)\n" "complex(*(3, 5))" -#: ../../glossary.rst:81 +#: ../../glossary.rst:83 msgid "" "Arguments are assigned to the named local variables in a function body. See " "the :ref:`calls` section for the rules governing this assignment. " @@ -194,7 +193,7 @@ msgstr "" "\\ :ref:`calls`\\ 章節。在語法上,任何運算式都可以被用來表示一個引數;其評估" "值會被指定給區域變數。" -#: ../../glossary.rst:86 +#: ../../glossary.rst:88 msgid "" "See also the :term:`parameter` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -203,25 +202,25 @@ msgstr "" "另請參閱術語表的 :term:`parameter`\\ (參數)條目、常見問題中的\\ :ref:`引數" "和參數之間的差異 `,以及 :pep:`362`。" -#: ../../glossary.rst:89 +#: ../../glossary.rst:91 msgid "asynchronous context manager" msgstr "asynchronous context manager(非同步情境管理器)" -#: ../../glossary.rst:91 +#: ../../glossary.rst:93 msgid "" "An object which controls the environment seen in an :keyword:`async with` " -"statement by defining :meth:`~object.__aenter__` " -"and :meth:`~object.__aexit__` methods. Introduced by :pep:`492`." +"statement by defining :meth:`~object.__aenter__` and :meth:`~object." +"__aexit__` methods. Introduced by :pep:`492`." msgstr "" -"一個可以控制 :keyword:`async with` 陳述式中所見環境的物件,而它是透過定" -"義 :meth:`~object.__aenter__` 和 :meth:`~object.__aexit__` method(方法)來控" -"制的。由 :pep:`492` 引入。" +"一個可以控制 :keyword:`async with` 陳述式中所見環境的物件,而它是透過定義 :" +"meth:`~object.__aenter__` 和 :meth:`~object.__aexit__` method(方法)來控制" +"的。由 :pep:`492` 引入。" -#: ../../glossary.rst:94 +#: ../../glossary.rst:96 msgid "asynchronous generator" msgstr "asynchronous generator(非同步產生器)" -#: ../../glossary.rst:96 +#: ../../glossary.rst:98 msgid "" "A function which returns an :term:`asynchronous generator iterator`. It " "looks like a coroutine function defined with :keyword:`async def` except " @@ -230,10 +229,10 @@ msgid "" msgstr "" "一個會回傳 :term:`asynchronous generator iterator`\\ (非同步產生器疊代器)的" "函式。它看起來像一個以 :keyword:`async def` 定義的協程函式 (coroutine " -"function),但不同的是它包含了 :keyword:`yield` 運算式,能生成一系列可用" -"於 :keyword:`async for` 迴圈的值。" +"function),但不同的是它包含了 :keyword:`yield` 運算式,能生成一系列可用於 :" +"keyword:`async for` 迴圈的值。" -#: ../../glossary.rst:101 +#: ../../glossary.rst:103 msgid "" "Usually refers to an asynchronous generator function, but may refer to an " "*asynchronous generator iterator* in some contexts. In cases where the " @@ -243,7 +242,7 @@ msgstr "" "同步產生器疊代器 (asynchronous generator iterator)*。萬一想表達的意思不夠清" "楚,那就使用完整的術語,以避免歧義。" -#: ../../glossary.rst:105 +#: ../../glossary.rst:107 msgid "" "An asynchronous generator function may contain :keyword:`await` expressions " "as well as :keyword:`async for`, and :keyword:`async with` statements." @@ -251,28 +250,28 @@ msgstr "" "一個非同步產生器函式可能包含 :keyword:`await` 運算式,以及 :keyword:`async " "for` 和 :keyword:`async with` 陳述式。" -#: ../../glossary.rst:108 +#: ../../glossary.rst:110 msgid "asynchronous generator iterator" msgstr "asynchronous generator iterator(非同步產生器疊代器)" -#: ../../glossary.rst:110 +#: ../../glossary.rst:112 msgid "An object created by an :term:`asynchronous generator` function." msgstr "" "一個由 :term:`asynchronous generator`\\ (非同步產生器)函式所建立的物件。" -#: ../../glossary.rst:112 +#: ../../glossary.rst:114 msgid "" -"This is an :term:`asynchronous iterator` which when called using " -"the :meth:`~object.__anext__` method returns an awaitable object which will " -"execute the body of the asynchronous generator function until the " -"next :keyword:`yield` expression." +"This is an :term:`asynchronous iterator` which when called using the :meth:" +"`~object.__anext__` method returns an awaitable object which will execute " +"the body of the asynchronous generator function until the next :keyword:" +"`yield` expression." msgstr "" -"這是一個 :term:`asynchronous iterator`\\ (非同步疊代器),當它" -"以 :meth:`~object.__anext__` method 被呼叫時,會回傳一個可等待物件 " -"(awaitable object),該物件將執行非同步產生器的函式主體,直到遇到下一" -"個 :keyword:`yield` 運算式。" +"這是一個 :term:`asynchronous iterator`\\ (非同步疊代器),當它以 :meth:" +"`~object.__anext__` method 被呼叫時,會回傳一個可等待物件 (awaitable " +"object),該物件將執行非同步產生器的函式主體,直到遇到下一個 :keyword:`yield` " +"運算式。" -#: ../../glossary.rst:117 +#: ../../glossary.rst:119 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "execution state (including local variables and pending try-statements). " @@ -281,58 +280,57 @@ msgid "" "off. See :pep:`492` and :pep:`525`." msgstr "" "每個 :keyword:`yield` 會暫停處理程序,並記住執行狀態(包括區域變數及擱置中的 " -"try 陳述式)。當\\ *非同步產生器疊代器*\\ 以另一個" -"被 :meth:`~object.__anext__` 回傳的可等待物件有效地回復時,它會從停止的地方繼" -"續執行。請參閱 :pep:`492` 和 :pep:`525`。" +"try 陳述式)。當\\ *非同步產生器疊代器*\\ 以另一個被 :meth:`~object." +"__anext__` 回傳的可等待物件有效地回復時,它會從停止的地方繼續執行。請參閱 :" +"pep:`492` 和 :pep:`525`。" -#: ../../glossary.rst:122 +#: ../../glossary.rst:124 msgid "asynchronous iterable" msgstr "asynchronous iterable(非同步可疊代物件)" -#: ../../glossary.rst:124 +#: ../../glossary.rst:126 msgid "" "An object, that can be used in an :keyword:`async for` statement. Must " "return an :term:`asynchronous iterator` from its :meth:`~object.__aiter__` " "method. Introduced by :pep:`492`." msgstr "" -"一個物件,它可以在 :keyword:`async for` 陳述式中被使用。必須從它" -"的 :meth:`~object.__aiter__` method 回傳一個 :term:`asynchronous iterator`\\ " -"(非同步疊代器)。由 :pep:`492` 引入。" +"一個物件,它可以在 :keyword:`async for` 陳述式中被使用。必須從它的 :meth:" +"`~object.__aiter__` method 回傳一個 :term:`asynchronous iterator`\\ (非同步" +"疊代器)。由 :pep:`492` 引入。" -#: ../../glossary.rst:127 +#: ../../glossary.rst:129 msgid "asynchronous iterator" msgstr "asynchronous iterator(非同步疊代器)" -#: ../../glossary.rst:129 +#: ../../glossary.rst:131 msgid "" -"An object that implements the :meth:`~object.__aiter__` " -"and :meth:`~object.__anext__` methods. :meth:`~object.__anext__` must " -"return an :term:`awaitable` object. :keyword:`async for` resolves the " -"awaitables returned by an asynchronous iterator's :meth:`~object.__anext__` " -"method until it raises a :exc:`StopAsyncIteration` exception. Introduced " -"by :pep:`492`." +"An object that implements the :meth:`~object.__aiter__` and :meth:`~object." +"__anext__` methods. :meth:`~object.__anext__` must return an :term:" +"`awaitable` object. :keyword:`async for` resolves the awaitables returned by " +"an asynchronous iterator's :meth:`~object.__anext__` method until it raises " +"a :exc:`StopAsyncIteration` exception. Introduced by :pep:`492`." msgstr "" "一個實作 :meth:`~object.__aiter__` 和 :meth:`~object.__anext__` method 的物" "件。:meth:`~object.__anext__` 必須回傳一個 :term:`awaitable`\\ (可等待物" "件)。:keyword:`async for` 會解析非同步疊代器的 :meth:`~object.__anext__` " -"method 所回傳的可等待物件,直到它引發 :exc:`StopAsyncIteration` 例外。" -"由 :pep:`492` 引入。" +"method 所回傳的可等待物件,直到它引發 :exc:`StopAsyncIteration` 例外。由 :" +"pep:`492` 引入。" -#: ../../glossary.rst:134 +#: ../../glossary.rst:136 msgid "attached thread state" msgstr "" -#: ../../glossary.rst:137 +#: ../../glossary.rst:139 msgid "A :term:`thread state` that is active for the current OS thread." msgstr "" -#: ../../glossary.rst:139 +#: ../../glossary.rst:141 msgid "" "When a :term:`thread state` is attached, the OS thread has access to the " "full Python C API and can safely invoke the bytecode interpreter." msgstr "" -#: ../../glossary.rst:143 +#: ../../glossary.rst:145 msgid "" "Unless a function explicitly notes otherwise, attempting to call the C API " "without an attached thread state will result in a fatal error or undefined " @@ -341,7 +339,7 @@ msgid "" "blocking C calls and by the bytecode interpreter in between calls." msgstr "" -#: ../../glossary.rst:150 +#: ../../glossary.rst:152 msgid "" "On most builds of Python, having an attached thread state implies that the " "caller holds the :term:`GIL` for the current interpreter, so only one OS " @@ -351,11 +349,11 @@ msgid "" "interpreter." msgstr "" -#: ../../glossary.rst:156 +#: ../../glossary.rst:158 msgid "attribute" msgstr "attribute(屬性)" -#: ../../glossary.rst:158 +#: ../../glossary.rst:160 msgid "" "A value associated with an object which is usually referenced by name using " "dotted expressions. For example, if an object *o* has an attribute *a* it " @@ -364,75 +362,75 @@ msgstr "" "一個與某物件相關聯的值,該值大多能透過使用點分隔運算式 (dotted expression) 的" "名稱被參照。例如,如果物件 *o* 有一個屬性 *a*,則該屬性能以 *o.a* 被參照。" -#: ../../glossary.rst:163 +#: ../../glossary.rst:165 msgid "" "It is possible to give an object an attribute whose name is not an " -"identifier as defined by :ref:`identifiers`, for example " -"using :func:`setattr`, if the object allows it. Such an attribute will not " -"be accessible using a dotted expression, and would instead need to be " -"retrieved with :func:`getattr`." +"identifier as defined by :ref:`identifiers`, for example using :func:" +"`setattr`, if the object allows it. Such an attribute will not be accessible " +"using a dotted expression, and would instead need to be retrieved with :func:" +"`getattr`." msgstr "" "如果一個物件允許,給予該物件一個名稱不是由\\ :ref:`identifiers`\\ 所定義之識" "別符 (identifier) 的屬性是有可能的,例如使用 :func:`setattr`。像這樣的屬性將" "無法使用點分隔運算式來存取,而是需要使用 :func:`getattr` 來取得它。" -#: ../../glossary.rst:168 +#: ../../glossary.rst:170 msgid "awaitable" msgstr "awaitable(可等待物件)" -#: ../../glossary.rst:170 +#: ../../glossary.rst:172 msgid "" -"An object that can be used in an :keyword:`await` expression. Can be " -"a :term:`coroutine` or an object with an :meth:`~object.__await__` method. " -"See also :pep:`492`." +"An object that can be used in an :keyword:`await` expression. Can be a :" +"term:`coroutine` or an object with an :meth:`~object.__await__` method. See " +"also :pep:`492`." msgstr "" -"一個可以在 :keyword:`await` 運算式中被使用的物件。它可以是一" -"個 :term:`coroutine`\\ (協程),或是一個有 :meth:`~object.__await__` method " -"的物件。另請參閱 :pep:`492`。" +"一個可以在 :keyword:`await` 運算式中被使用的物件。它可以是一個 :term:" +"`coroutine`\\ (協程),或是一個有 :meth:`~object.__await__` method 的物件。" +"另請參閱 :pep:`492`。" -#: ../../glossary.rst:173 +#: ../../glossary.rst:175 msgid "BDFL" msgstr "BDFL" -#: ../../glossary.rst:175 +#: ../../glossary.rst:177 msgid "" -"Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator." +"Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator." msgstr "" "Benevolent Dictator For Life(終身仁慈獨裁者),又名 `Guido van Rossum " "`_,Python 的創造者。" -#: ../../glossary.rst:177 +#: ../../glossary.rst:179 msgid "binary file" msgstr "binary file(二進位檔案)" -#: ../../glossary.rst:179 +#: ../../glossary.rst:181 msgid "" "A :term:`file object` able to read and write :term:`bytes-like objects " "`. Examples of binary files are files opened in binary " -"mode (``'rb'``, ``'wb'`` or ``'rb+'``), :data:`sys.stdin.buffer " -"`, :data:`sys.stdout.buffer `, and instances " -"of :class:`io.BytesIO` and :class:`gzip.GzipFile`." +"mode (``'rb'``, ``'wb'`` or ``'rb+'``), :data:`sys.stdin.buffer `, :data:`sys.stdout.buffer `, and instances of :class:`io." +"BytesIO` and :class:`gzip.GzipFile`." msgstr "" "一個能夠讀取和寫入 :term:`bytes-like objects `\\ (類位元" "組串物件)的 :term:`file object`\\ (檔案物件)。二進位檔案的例子有:以二進位" "模式(``'rb'``、``'wb'`` 或 ``'rb+'``)開啟的檔案、:data:`sys.stdin.buffer " -"`、:data:`sys.stdout.buffer `,以" -"及 :class:`io.BytesIO` 和 :class:`gzip.GzipFile` 實例。" +"`、:data:`sys.stdout.buffer `,以及 :class:`io." +"BytesIO` 和 :class:`gzip.GzipFile` 實例。" -#: ../../glossary.rst:186 +#: ../../glossary.rst:188 msgid "" -"See also :term:`text file` for a file object able to read and " -"write :class:`str` objects." +"See also :term:`text file` for a file object able to read and write :class:" +"`str` objects." msgstr "" -"另請參閱 :term:`text file`\\ (文字檔案),它是一個能夠讀取和寫" -"入 :class:`str` 物件的檔案物件。" +"另請參閱 :term:`text file`\\ (文字檔案),它是一個能夠讀取和寫入 :class:" +"`str` 物件的檔案物件。" -#: ../../glossary.rst:188 +#: ../../glossary.rst:190 msgid "borrowed reference" msgstr "borrowed reference(借用參照)" -#: ../../glossary.rst:190 +#: ../../glossary.rst:192 msgid "" "In Python's C API, a borrowed reference is a reference to an object, where " "the code using the object does not own the reference. It becomes a dangling " @@ -444,12 +442,12 @@ msgstr "" "如,一次垃圾回收 (garbage collection) 可以移除對物件的最後一個 :term:`strong " "reference`\\ (強參照),而將該物件銷毀。" -#: ../../glossary.rst:196 +#: ../../glossary.rst:198 msgid "" "Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is recommended " "to convert it to a :term:`strong reference` in-place, except when the object " -"cannot be destroyed before the last usage of the borrowed reference. " -"The :c:func:`Py_NewRef` function can be used to create a new :term:`strong " +"cannot be destroyed before the last usage of the borrowed reference. The :c:" +"func:`Py_NewRef` function can be used to create a new :term:`strong " "reference`." msgstr "" "對 :term:`borrowed reference` 呼叫 :c:func:`Py_INCREF` 以將它原地 (in-place) " @@ -457,31 +455,31 @@ msgstr "" "借用參照之前被銷毀。:c:func:`Py_NewRef` 函式可用於建立一個新的 :term:`strong " "reference`。" -#: ../../glossary.rst:201 +#: ../../glossary.rst:203 msgid "bytes-like object" msgstr "bytes-like object(類位元組串物件)" -#: ../../glossary.rst:203 +#: ../../glossary.rst:205 msgid "" -"An object that supports the :ref:`bufferobjects` and can export a " -"C-:term:`contiguous` buffer. This includes " -"all :class:`bytes`, :class:`bytearray`, and :class:`array.array` objects, as " -"well as many common :class:`memoryview` objects. Bytes-like objects can be " -"used for various operations that work with binary data; these include " -"compression, saving to a binary file, and sending over a socket." +"An object that supports the :ref:`bufferobjects` and can export a C-:term:" +"`contiguous` buffer. This includes all :class:`bytes`, :class:`bytearray`, " +"and :class:`array.array` objects, as well as many common :class:`memoryview` " +"objects. Bytes-like objects can be used for various operations that work " +"with binary data; these include compression, saving to a binary file, and " +"sending over a socket." msgstr "" "一個支援\\ :ref:`bufferobjects`\\ 且能夠匯出 C-:term:`contiguous` 緩衝區的物" "件。這包括所有的 :class:`bytes`、:class:`bytearray` 和 :class:`array.array` " "物件,以及許多常見的 :class:`memoryview` 物件。類位元組串物件可用於處理二進位" "資料的各種運算;這些運算包括壓縮、儲存至二進位檔案和透過 socket(插座)發送。" -#: ../../glossary.rst:210 +#: ../../glossary.rst:212 msgid "" "Some operations need the binary data to be mutable. The documentation often " "refers to these as \"read-write bytes-like objects\". Example mutable " -"buffer objects include :class:`bytearray` and a :class:`memoryview` of " -"a :class:`bytearray`. Other operations require the binary data to be stored " -"in immutable objects (\"read-only bytes-like objects\"); examples of these " +"buffer objects include :class:`bytearray` and a :class:`memoryview` of a :" +"class:`bytearray`. Other operations require the binary data to be stored in " +"immutable objects (\"read-only bytes-like objects\"); examples of these " "include :class:`bytes` and a :class:`memoryview` of a :class:`bytes` object." msgstr "" "有些運算需要二進位資料是可變的。說明文件通常會將這些物件稱為「可讀寫的類位元" @@ -490,11 +488,11 @@ msgstr "" "的類位元組串物件」)中;這些物件包括 :class:`bytes`,以及 :class:`bytes` 物件" "的 :class:`memoryview`。" -#: ../../glossary.rst:218 +#: ../../glossary.rst:220 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../glossary.rst:220 +#: ../../glossary.rst:222 msgid "" "Python source code is compiled into bytecode, the internal representation of " "a Python program in the CPython interpreter. The bytecode is also cached in " @@ -513,54 +511,54 @@ msgstr "" "上是無法在不同的 Python 虛擬機器之間運作的,也不能在不同版本的 Python 之間保" "持穩定。" -#: ../../glossary.rst:230 +#: ../../glossary.rst:232 msgid "" -"A list of bytecode instructions can be found in the documentation " -"for :ref:`the dis module `." +"A list of bytecode instructions can be found in the documentation for :ref:" +"`the dis module `." msgstr "" "位元組碼的指令列表可以在 :ref:`dis 模組 `\\ 的說明文件中找到。" -#: ../../glossary.rst:232 +#: ../../glossary.rst:234 msgid "callable" msgstr "callable(可呼叫物件)" -#: ../../glossary.rst:234 +#: ../../glossary.rst:236 msgid "" "A callable is an object that can be called, possibly with a set of arguments " "(see :term:`argument`), with the following syntax::" msgstr "" -"一個 callable 是可以被呼叫的物件,呼叫時可能以下列形式帶有一組引數(請" -"見 :term:`argument`): ::" +"一個 callable 是可以被呼叫的物件,呼叫時可能以下列形式帶有一組引數(請見 :" +"term:`argument`): ::" -#: ../../glossary.rst:237 +#: ../../glossary.rst:239 msgid "callable(argument1, argument2, argumentN)" msgstr "callable(argument1, argument2, argumentN)" -#: ../../glossary.rst:239 +#: ../../glossary.rst:241 msgid "" "A :term:`function`, and by extension a :term:`method`, is a callable. An " "instance of a class that implements the :meth:`~object.__call__` method is " "also a callable." msgstr "" -"一個 :term:`function` 與其延伸的 :term:`method` 都是 callable。一個有實" -"作 :meth:`~object.__call__` 方法的 class 之實例也是個 callable。" +"一個 :term:`function` 與其延伸的 :term:`method` 都是 callable。一個有實作 :" +"meth:`~object.__call__` 方法的 class 之實例也是個 callable。" -#: ../../glossary.rst:242 +#: ../../glossary.rst:244 msgid "callback" msgstr "callback(回呼)" -#: ../../glossary.rst:244 +#: ../../glossary.rst:246 msgid "" "A subroutine function which is passed as an argument to be executed at some " "point in the future." msgstr "" "作為引數被傳遞的一個副程式 (subroutine) 函式,會在未來的某個時間點被執行。" -#: ../../glossary.rst:246 +#: ../../glossary.rst:248 msgid "class" msgstr "class(類別)" -#: ../../glossary.rst:248 +#: ../../glossary.rst:250 msgid "" "A template for creating user-defined objects. Class definitions normally " "contain method definitions which operate on instances of the class." @@ -568,11 +566,11 @@ msgstr "" "一個用於建立使用者定義物件的模板。Class 的定義通常會包含 method 的定義,這些 " "method 可以在 class 的實例上進行操作。" -#: ../../glossary.rst:251 +#: ../../glossary.rst:253 msgid "class variable" msgstr "class variable(類別變數)" -#: ../../glossary.rst:253 +#: ../../glossary.rst:255 msgid "" "A variable defined in a class and intended to be modified only at class " "level (i.e., not in an instance of the class)." @@ -580,24 +578,24 @@ msgstr "" "一個在 class 中被定義,且應該只能在 class 層次(意即不是在 class 的實例中)被" "修改的變數。" -#: ../../glossary.rst:255 +#: ../../glossary.rst:257 msgid "closure variable" msgstr "closure variable(閉包變數)" -#: ../../glossary.rst:257 +#: ../../glossary.rst:259 msgid "" "A :term:`free variable` referenced from a :term:`nested scope` that is " "defined in an outer scope rather than being resolved at runtime from the " -"globals or builtin namespaces. May be explicitly defined with " -"the :keyword:`nonlocal` keyword to allow write access, or implicitly defined " -"if the variable is only being read." +"globals or builtin namespaces. May be explicitly defined with the :keyword:" +"`nonlocal` keyword to allow write access, or implicitly defined if the " +"variable is only being read." msgstr "" "從外部作用域中定義且從\\ :term:`巢狀作用域 `\\ 參照的\\ :term:`" "自由變數 `,不是於 runtime 從全域或內建命名空間解析。可以使" "用 :keyword:`nonlocal` 關鍵字明確定義以允許寫入存取,或者如果僅需讀取變數則隱" "式定義即可。" -#: ../../glossary.rst:262 +#: ../../glossary.rst:264 msgid "" "For example, in the ``inner`` function in the following code, both ``x`` and " "``print`` are :term:`free variables `, but only ``x`` is a " @@ -606,7 +604,7 @@ msgstr "" "例如在下面程式碼中的 ``inner`` 函式中,``x`` 和 ``print`` 都是\\ :term:`自由" "變數 `,但只有 ``x`` 是\\ *閉包變數*: ::" -#: ../../glossary.rst:265 +#: ../../glossary.rst:267 msgid "" "def outer():\n" " x = 0\n" @@ -624,7 +622,7 @@ msgstr "" " print(x)\n" " return inner" -#: ../../glossary.rst:273 +#: ../../glossary.rst:275 msgid "" "Due to the :attr:`codeobject.co_freevars` attribute (which, despite its " "name, only includes the names of closure variables rather than listing all " @@ -636,11 +634,11 @@ msgstr "" "名稱,而不是列出所有參照的自由變數),當預期含義是特指閉包變數時,有時候甚至" "也會使用更通用的\\ :term:`自由變數 `\\ 一詞。" -#: ../../glossary.rst:277 +#: ../../glossary.rst:279 msgid "complex number" msgstr "complex number(複數)" -#: ../../glossary.rst:279 +#: ../../glossary.rst:281 msgid "" "An extension of the familiar real number system in which all numbers are " "expressed as a sum of a real part and an imaginary part. Imaginary numbers " @@ -655,69 +653,68 @@ msgstr "" "一個我們熟悉的實數系統的擴充,在此所有數字都會被表示為一個實部和一個虛部之" "和。虛數就是虛數單位(``-1`` 的平方根)的實數倍,此單位通常在數學中被寫為 " "``i``,在工程學中被寫為 ``j``。Python 內建了對複數的支援,它是用後者的記法來" -"表示複數;虛部會帶著一個後綴的 ``j`` 被編寫,例如 ``3+1j``。若要" -"將 :mod:`math` 模組內的工具等效地用於複數,請使用 :mod:`cmath` 模組。複數的使" -"用是一個相當進階的數學功能。如果你沒有察覺到對它們的需求,那麼幾乎能確定你可" -"以安全地忽略它們。" +"表示複數;虛部會帶著一個後綴的 ``j`` 被編寫,例如 ``3+1j``。若要將 :mod:" +"`math` 模組內的工具等效地用於複數,請使用 :mod:`cmath` 模組。複數的使用是一個" +"相當進階的數學功能。如果你沒有察覺到對它們的需求,那麼幾乎能確定你可以安全地" +"忽略它們。" -#: ../../glossary.rst:289 +#: ../../glossary.rst:291 msgid "context" msgstr "context(情境)" -#: ../../glossary.rst:291 +#: ../../glossary.rst:293 msgid "" "This term has different meanings depending on where and how it is used. Some " "common meanings:" msgstr "" -#: ../../glossary.rst:294 +#: ../../glossary.rst:296 msgid "" "The temporary state or environment established by a :term:`context manager` " "via a :keyword:`with` statement." msgstr "" -#: ../../glossary.rst:296 +#: ../../glossary.rst:298 msgid "" -"The collection of key­value bindings associated with a " -"particular :class:`contextvars.Context` object and accessed " -"via :class:`~contextvars.ContextVar` objects. Also see :term:`context " -"variable`." +"The collection of key­value bindings associated with a particular :class:" +"`contextvars.Context` object and accessed via :class:`~contextvars." +"ContextVar` objects. Also see :term:`context variable`." msgstr "" -#: ../../glossary.rst:300 +#: ../../glossary.rst:302 msgid "" "A :class:`contextvars.Context` object. Also see :term:`current context`." msgstr "" "一個 :class:`contextvars.Context` 物件。另請參閱 :term:`current context`。" -#: ../../glossary.rst:302 +#: ../../glossary.rst:304 msgid "context management protocol" msgstr "context management protocol(情境管理協定)" -#: ../../glossary.rst:304 +#: ../../glossary.rst:306 msgid "" "The :meth:`~object.__enter__` and :meth:`~object.__exit__` methods called by " "the :keyword:`with` statement. See :pep:`343`." msgstr "" -"由 :keyword:`with` 陳述式所呼叫的 :meth:`~object.__enter__` " -"和 :meth:`~object.__exit__` 方法。另請參閱 :pep:`343`。" +"由 :keyword:`with` 陳述式所呼叫的 :meth:`~object.__enter__` 和 :meth:" +"`~object.__exit__` 方法。另請參閱 :pep:`343`。" -#: ../../glossary.rst:306 +#: ../../glossary.rst:308 msgid "context manager" msgstr "context manager(情境管理器)" -#: ../../glossary.rst:308 +#: ../../glossary.rst:310 msgid "" "An object which implements the :term:`context management protocol` and " -"controls the environment seen in a :keyword:`with` statement. " -"See :pep:`343`." +"controls the environment seen in a :keyword:`with` statement. See :pep:" +"`343`." msgstr "" -#: ../../glossary.rst:311 +#: ../../glossary.rst:313 msgid "context variable" msgstr "context variable(情境變數)" -#: ../../glossary.rst:313 +#: ../../glossary.rst:315 msgid "" "A variable whose value depends on which context is the :term:`current " "context`. Values are accessed via :class:`contextvars.ContextVar` objects. " @@ -725,11 +722,11 @@ msgid "" "asynchronous tasks." msgstr "" -#: ../../glossary.rst:317 +#: ../../glossary.rst:319 msgid "contiguous" msgstr "contiguous(連續的)" -#: ../../glossary.rst:321 +#: ../../glossary.rst:323 msgid "" "A buffer is considered contiguous exactly if it is either *C-contiguous* or " "*Fortran contiguous*. Zero-dimensional buffers are C and Fortran " @@ -746,11 +743,11 @@ msgstr "" "的順序瀏覽各個項目時,最後一個索引的變化最快。然而,在 Fortran contiguous 陣" "列中,第一個索引的變化最快。" -#: ../../glossary.rst:329 +#: ../../glossary.rst:331 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../glossary.rst:331 +#: ../../glossary.rst:333 msgid "" "Coroutines are a more generalized form of subroutines. Subroutines are " "entered at one point and exited at another point. Coroutines can be " @@ -761,27 +758,26 @@ msgstr "" "在另一個時間點被退出。協程可以在許多不同的時間點被進入、退出和回復。它們能夠" "以 :keyword:`async def` 陳述式被實作。另請參閱 :pep:`492`。" -#: ../../glossary.rst:336 +#: ../../glossary.rst:338 msgid "coroutine function" msgstr "coroutine function(協程函式)" -#: ../../glossary.rst:338 +#: ../../glossary.rst:340 msgid "" "A function which returns a :term:`coroutine` object. A coroutine function " -"may be defined with the :keyword:`async def` statement, and may " -"contain :keyword:`await`, :keyword:`async for`, and :keyword:`async with` " -"keywords. These were introduced by :pep:`492`." +"may be defined with the :keyword:`async def` statement, and may contain :" +"keyword:`await`, :keyword:`async for`, and :keyword:`async with` keywords. " +"These were introduced by :pep:`492`." msgstr "" -"一個回傳 :term:`coroutine`\\ (協程)物件的函式。一個協程函式能" -"以 :keyword:`async def` 陳述式被定義,並可能會包" -"含 :keyword:`await`、:keyword:`async for` 和 :keyword:`async with` 關鍵字。這" -"些關鍵字由 :pep:`492` 引入。" +"一個回傳 :term:`coroutine`\\ (協程)物件的函式。一個協程函式能以 :keyword:" +"`async def` 陳述式被定義,並可能會包含 :keyword:`await`、:keyword:`async " +"for` 和 :keyword:`async with` 關鍵字。這些關鍵字由 :pep:`492` 引入。" -#: ../../glossary.rst:343 +#: ../../glossary.rst:345 msgid "CPython" msgstr "CPython" -#: ../../glossary.rst:345 +#: ../../glossary.rst:347 msgid "" "The canonical implementation of the Python programming language, as " "distributed on `python.org `_. The term \"CPython\" " @@ -792,25 +788,25 @@ msgstr "" "`_ 上。「CPython」這個術語在必要時被使用,以區分此實" "作與其它語言的實作,例如 Jython 或 IronPython。" -#: ../../glossary.rst:349 +#: ../../glossary.rst:351 msgid "current context" msgstr "" -#: ../../glossary.rst:351 +#: ../../glossary.rst:353 msgid "" "The :term:`context` (:class:`contextvars.Context` object) that is currently " "used by :class:`~contextvars.ContextVar` objects to access (get or set) the " "values of :term:`context variables `. Each thread has its " -"own current context. Frameworks for executing asynchronous tasks " -"(see :mod:`asyncio`) associate each task with a context which becomes the " -"current context whenever the task starts or resumes execution." +"own current context. Frameworks for executing asynchronous tasks (see :mod:" +"`asyncio`) associate each task with a context which becomes the current " +"context whenever the task starts or resumes execution." msgstr "" -#: ../../glossary.rst:357 +#: ../../glossary.rst:359 msgid "cyclic isolate" msgstr "" -#: ../../glossary.rst:359 +#: ../../glossary.rst:361 msgid "" "A subgroup of one or more objects that reference each other in a reference " "cycle, but are not referenced by objects outside the group. The goal of " @@ -819,11 +815,11 @@ msgid "" "reclaimed." msgstr "" -#: ../../glossary.rst:363 +#: ../../glossary.rst:365 msgid "decorator" msgstr "decorator(裝飾器)" -#: ../../glossary.rst:365 +#: ../../glossary.rst:367 msgid "" "A function returning another function, usually applied as a function " "transformation using the ``@wrapper`` syntax. Common examples for " @@ -833,13 +829,13 @@ msgstr "" "式的變換 (function transformation)。裝飾器的常見範例是 :func:`classmethod` " "和 :func:`staticmethod`。" -#: ../../glossary.rst:369 +#: ../../glossary.rst:371 msgid "" "The decorator syntax is merely syntactic sugar, the following two function " "definitions are semantically equivalent::" msgstr "裝飾器語法只是語法糖。以下兩個函式定義在語義上是等效的: ::" -#: ../../glossary.rst:372 +#: ../../glossary.rst:374 msgid "" "def f(arg):\n" " ...\n" @@ -857,41 +853,40 @@ msgstr "" "def f(arg):\n" " ..." -#: ../../glossary.rst:380 +#: ../../glossary.rst:382 msgid "" "The same concept exists for classes, but is less commonly used there. See " "the documentation for :ref:`function definitions ` and :ref:`class " "definitions ` for more about decorators." msgstr "" -"Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱" -"\\ :ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" +"Class 也存在相同的概念,但在那裡比較不常用。關於裝飾器的更多內容,請參閱\\ :" +"ref:`函式定義 `\\ 和 :ref:`class 定義 `\\ 的說明文件。" -#: ../../glossary.rst:383 +#: ../../glossary.rst:385 msgid "descriptor" msgstr "descriptor(描述器)" -#: ../../glossary.rst:385 -msgid "" -"Any object which defines the " -"methods :meth:`~object.__get__`, :meth:`~object.__set__`, " -"or :meth:`~object.__delete__`. When a class attribute is a descriptor, its " -"special binding behavior is triggered upon attribute lookup. Normally, " -"using *a.b* to get, set or delete an attribute looks up the object named *b* " -"in the class dictionary for *a*, but if *b* is a descriptor, the respective " -"descriptor method gets called. Understanding descriptors is a key to a deep " -"understanding of Python because they are the basis for many features " -"including functions, methods, properties, class methods, static methods, and " -"reference to super classes." -msgstr "" -"任何定義了 :meth:`~object.__get__`、:meth:`~object.__set__` " -"或 :meth:`~object.__delete__` method 的物件。當一個 class 屬性是一個描述器" -"時,它的特殊連結行為會在屬性查找時被觸發。通常,使用 *a.b* 來取得、設定或刪除" -"某個屬性時,會在 *a* 的 class 字典中查找名稱為 *b* 的物件,但如果 *b* 是一個" -"描述器,則相對應的描述器 method 會被呼叫。對描述器的理解是深入理解 Python 的" -"關鍵,因為它們是許多功能的基礎,這些功能包括函式、method、屬性 (property)、" -"class method、靜態 method,以及對 super class(父類別)的參照。" - -#: ../../glossary.rst:396 +#: ../../glossary.rst:387 +msgid "" +"Any object which defines the methods :meth:`~object.__get__`, :meth:`~object." +"__set__`, or :meth:`~object.__delete__`. When a class attribute is a " +"descriptor, its special binding behavior is triggered upon attribute " +"lookup. Normally, using *a.b* to get, set or delete an attribute looks up " +"the object named *b* in the class dictionary for *a*, but if *b* is a " +"descriptor, the respective descriptor method gets called. Understanding " +"descriptors is a key to a deep understanding of Python because they are the " +"basis for many features including functions, methods, properties, class " +"methods, static methods, and reference to super classes." +msgstr "" +"任何定義了 :meth:`~object.__get__`、:meth:`~object.__set__` 或 :meth:" +"`~object.__delete__` method 的物件。當一個 class 屬性是一個描述器時,它的特殊" +"連結行為會在屬性查找時被觸發。通常,使用 *a.b* 來取得、設定或刪除某個屬性時," +"會在 *a* 的 class 字典中查找名稱為 *b* 的物件,但如果 *b* 是一個描述器,則相" +"對應的描述器 method 會被呼叫。對描述器的理解是深入理解 Python 的關鍵,因為它" +"們是許多功能的基礎,這些功能包括函式、method、屬性 (property)、class method、" +"靜態 method,以及對 super class(父類別)的參照。" + +#: ../../glossary.rst:398 msgid "" "For more information about descriptors' methods, see :ref:`descriptors` or " "the :ref:`Descriptor How To Guide `." @@ -899,11 +894,11 @@ msgstr "" "關於描述器 method 的更多資訊,請參閱\\ :ref:`descriptors`\\ 或\\ :ref:`描述器" "使用指南 `。" -#: ../../glossary.rst:398 +#: ../../glossary.rst:400 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../glossary.rst:400 +#: ../../glossary.rst:402 msgid "" "An associative array, where arbitrary keys are mapped to values. The keys " "can be any object with :meth:`~object.__hash__` and :meth:`~object.__eq__` " @@ -913,11 +908,11 @@ msgstr "" "有 :meth:`~object.__hash__` 和 :meth:`~object.__eq__` method 的物件。在 Perl " "中被稱為雜湊 (hash)。" -#: ../../glossary.rst:404 +#: ../../glossary.rst:406 msgid "dictionary comprehension" msgstr "dictionary comprehension(字典綜合運算)" -#: ../../glossary.rst:406 +#: ../../glossary.rst:408 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a dictionary with the results. ``results = {n: n ** 2 for n in " @@ -928,28 +923,28 @@ msgstr "" "字典回傳。``results = {n: n ** 2 for n in range(10)}`` 會產生一個字典,它包含" "了鍵 ``n`` 對映到值 ``n ** 2``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:410 +#: ../../glossary.rst:412 msgid "dictionary view" msgstr "dictionary view(字典檢視)" -#: ../../glossary.rst:412 +#: ../../glossary.rst:414 msgid "" -"The objects returned from :meth:`dict.keys`, :meth:`dict.values`, " -"and :meth:`dict.items` are called dictionary views. They provide a dynamic " -"view on the dictionary’s entries, which means that when the dictionary " -"changes, the view reflects these changes. To force the dictionary view to " -"become a full list use ``list(dictview)``. See :ref:`dict-views`." +"The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:" +"`dict.items` are called dictionary views. They provide a dynamic view on the " +"dictionary’s entries, which means that when the dictionary changes, the view " +"reflects these changes. To force the dictionary view to become a full list " +"use ``list(dictview)``. See :ref:`dict-views`." msgstr "" "從 :meth:`dict.keys`、:meth:`dict.values` 及 :meth:`dict.items` 回傳的物件被" "稱為字典檢視。它們提供了字典中項目的動態檢視,這表示當字典有變動時,該檢視會" "反映這些變動。若要強制將字典檢視轉為完整的 list(串列),須使用 " "``list(dictview)``。請參閱\\ :ref:`dict-views`。" -#: ../../glossary.rst:418 +#: ../../glossary.rst:420 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../glossary.rst:420 +#: ../../glossary.rst:422 msgid "" "A string literal which appears as the first expression in a class, function " "or module. While ignored when the suite is executed, it is recognized by " @@ -958,25 +953,25 @@ msgid "" "introspection, it is the canonical place for documentation of the object." msgstr "" "一個在 class、函式或模組中,作為第一個運算式出現的字串文本。雖然它在套件執行" -"時會被忽略,但它會被編譯器辨識,並被放入所屬 class、函式或模組" -"的 :attr:`~definition.__doc__` 屬性中。由於說明字串可以透過內省 " -"(introspection) 來瀏覽,因此它是物件的說明文件存放的標準位置。" +"時會被忽略,但它會被編譯器辨識,並被放入所屬 class、函式或模組的 :attr:" +"`~definition.__doc__` 屬性中。由於說明字串可以透過內省 (introspection) 來瀏" +"覽,因此它是物件的說明文件存放的標準位置。" -#: ../../glossary.rst:426 +#: ../../glossary.rst:428 msgid "duck-typing" msgstr "duck-typing(鴨子型別)" -#: ../../glossary.rst:428 +#: ../../glossary.rst:430 msgid "" "A programming style which does not look at an object's type to determine if " "it has the right interface; instead, the method or attribute is simply " "called or used (\"If it looks like a duck and quacks like a duck, it must be " "a duck.\") By emphasizing interfaces rather than specific types, well-" "designed code improves its flexibility by allowing polymorphic " -"substitution. Duck-typing avoids tests using :func:`type` " -"or :func:`isinstance`. (Note, however, that duck-typing can be complemented " -"with :term:`abstract base classes `.) Instead, it " -"typically employs :func:`hasattr` tests or :term:`EAFP` programming." +"substitution. Duck-typing avoids tests using :func:`type` or :func:" +"`isinstance`. (Note, however, that duck-typing can be complemented with :" +"term:`abstract base classes `.) Instead, it typically " +"employs :func:`hasattr` tests or :term:`EAFP` programming." msgstr "" "一種程式設計風格,它不是藉由檢查一個物件的型別來確定它是否具有正確的介面;取" "而代之的是,method 或屬性會單純地被呼叫或使用。(「如果它看起來像一隻鴨子而且" @@ -987,25 +982,25 @@ msgstr "" "來補充。)然而,它通常會採用 :func:`hasattr` 測試,或是 :term:`EAFP` 程式設計" "風格。" -#: ../../glossary.rst:437 +#: ../../glossary.rst:439 msgid "dunder" msgstr "dunder(雙底線)" -#: ../../glossary.rst:439 +#: ../../glossary.rst:441 msgid "" -"An informal short-hand for \"double underscore\", used when talking about " -"a :term:`special method`. For example, ``__init__`` is often pronounced " +"An informal short-hand for \"double underscore\", used when talking about a :" +"term:`special method`. For example, ``__init__`` is often pronounced " "\"dunder init\"." msgstr "" "一個非正式的縮寫,代表「雙底線 (double underscore)」,當談論到\\ :term:`特殊" "方法 `\\ 時使用。例如,``__init__`` 通常被叫做 \"dunder " "init\"。" -#: ../../glossary.rst:442 +#: ../../glossary.rst:444 msgid "EAFP" msgstr "EAFP" -#: ../../glossary.rst:444 +#: ../../glossary.rst:446 msgid "" "Easier to ask for forgiveness than permission. This common Python coding " "style assumes the existence of valid keys or attributes and catches " @@ -1016,26 +1011,26 @@ msgid "" msgstr "" "Easier to ask for forgiveness than permission.(請求寬恕比請求許可更容易。)" "這種常見的 Python 編碼風格會先假設有效的鍵或屬性的存在,並在該假設被推翻時再" -"捕獲例外。這種乾淨且快速的風格,其特色是存在許多的 :keyword:`try` " -"和 :keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見" -"的 :term:`LBYL` 風格形成了對比。" +"捕獲例外。這種乾淨且快速的風格,其特色是存在許多的 :keyword:`try` 和 :" +"keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見的 :term:`LBYL` 風" +"格形成了對比。" -#: ../../glossary.rst:450 +#: ../../glossary.rst:452 msgid "evaluate function" msgstr "evaluate function(求值函式)" -#: ../../glossary.rst:452 +#: ../../glossary.rst:454 msgid "" "A function that can be called to evaluate a lazily evaluated attribute of an " "object, such as the value of type aliases created with the :keyword:`type` " "statement." msgstr "" -#: ../../glossary.rst:455 +#: ../../glossary.rst:457 msgid "expression" msgstr "expression(運算式)" -#: ../../glossary.rst:457 +#: ../../glossary.rst:459 msgid "" "A piece of syntax which can be evaluated to some value. In other words, an " "expression is an accumulation of expression elements like literals, names, " @@ -1051,11 +1046,11 @@ msgstr "" "(陳述式)不能被用作運算式,例如 :keyword:`while`。賦值 (assignment) 也是陳述" "式,而不是運算式。" -#: ../../glossary.rst:464 +#: ../../glossary.rst:466 msgid "extension module" msgstr "extension module(擴充模組)" -#: ../../glossary.rst:466 +#: ../../glossary.rst:468 msgid "" "A module written in C or C++, using Python's C API to interact with the core " "and with user code." @@ -1063,28 +1058,28 @@ msgstr "" "一個以 C 或 C++ 編寫的模組,它使用 Python 的 C API 來與核心及使用者程式碼進行" "互動。" -#: ../../glossary.rst:468 +#: ../../glossary.rst:470 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../glossary.rst:469 +#: ../../glossary.rst:471 msgid "f-strings" msgstr "f-strings(f 字串)" -#: ../../glossary.rst:471 +#: ../../glossary.rst:473 msgid "" "String literals prefixed with ``f`` or ``F`` are commonly called \"f-" "strings\" which is short for :ref:`formatted string literals `. " "See also :pep:`498`." msgstr "" -"以 ``f`` 或 ``F`` 為前綴的字串文本通常被稱為「f 字串」,它是\\ :ref:`格式" -"化的字串文本 `\\ 的縮寫。另請參閱 :pep:`498`。" +"以 ``f`` 或 ``F`` 為前綴的字串文本通常被稱為「f 字串」,它是\\ :ref:`格式化的" +"字串文本 `\\ 的縮寫。另請參閱 :pep:`498`。" -#: ../../glossary.rst:474 +#: ../../glossary.rst:476 msgid "file object" msgstr "file object(檔案物件)" -#: ../../glossary.rst:476 +#: ../../glossary.rst:478 msgid "" "An object exposing a file-oriented API (with methods such as :meth:`!read` " "or :meth:`!write`) to an underlying resource. Depending on the way it was " @@ -1099,7 +1094,7 @@ msgstr "" "衝區、socket(插座)、管線 (pipe) 等)的存取。檔案物件也被稱為\\ :dfn:`類檔案" "物件 (file-like object)` 或\\ :dfn:`串流 (stream)`。" -#: ../../glossary.rst:484 +#: ../../glossary.rst:486 msgid "" "There are actually three categories of file objects: raw :term:`binary files " "`, buffered :term:`binary files ` and :term:`text " @@ -1107,24 +1102,23 @@ msgid "" "The canonical way to create a file object is by using the :func:`open` " "function." msgstr "" -"實際上,有三種檔案物件:原始的\\ :term:`二進位檔案 `、緩衝的" -"\\ :term:`二進位檔案 `\\ 和\\ :term:`文字檔案 `。它們" -"的介面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:`open` 函" -"式。" +"實際上,有三種檔案物件:原始的\\ :term:`二進位檔案 `、緩衝的\\ :" +"term:`二進位檔案 `\\ 和\\ :term:`文字檔案 `。它們的介" +"面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:`open` 函式。" -#: ../../glossary.rst:489 +#: ../../glossary.rst:491 msgid "file-like object" msgstr "file-like object(類檔案物件)" -#: ../../glossary.rst:491 +#: ../../glossary.rst:493 msgid "A synonym for :term:`file object`." msgstr ":term:`file object`\\ (檔案物件)的同義字。" -#: ../../glossary.rst:492 +#: ../../glossary.rst:494 msgid "filesystem encoding and error handler" msgstr "filesystem encoding and error handler(檔案系統編碼和錯誤處理函式)" -#: ../../glossary.rst:494 +#: ../../glossary.rst:496 msgid "" "Encoding and error handler used by Python to decode bytes from the operating " "system and encode Unicode to the operating system." @@ -1132,7 +1126,7 @@ msgstr "" "Python 所使用的一種編碼和錯誤處理函式,用來解碼來自作業系統的位元組,以及將 " "Unicode 編碼到作業系統。" -#: ../../glossary.rst:497 +#: ../../glossary.rst:499 msgid "" "The filesystem encoding must guarantee to successfully decode all bytes " "below 128. If the file system encoding fails to provide this guarantee, API " @@ -1141,43 +1135,43 @@ msgstr "" "檔案系統編碼必須保證能成功解碼所有小於 128 的位元組。如果檔案系統編碼無法提供" "此保證,則 API 函式會引發 :exc:`UnicodeError`。" -#: ../../glossary.rst:501 +#: ../../glossary.rst:503 msgid "" -"The :func:`sys.getfilesystemencoding` " -"and :func:`sys.getfilesystemencodeerrors` functions can be used to get the " -"filesystem encoding and error handler." +"The :func:`sys.getfilesystemencoding` and :func:`sys." +"getfilesystemencodeerrors` functions can be used to get the filesystem " +"encoding and error handler." msgstr "" ":func:`sys.getfilesystemencoding` 和 :func:`sys.getfilesystemencodeerrors` 函" "式可用於取得檔案系統編碼和錯誤處理函式。" -#: ../../glossary.rst:505 +#: ../../glossary.rst:507 msgid "" "The :term:`filesystem encoding and error handler` are configured at Python " -"startup by the :c:func:`PyConfig_Read` function: " -"see :c:member:`~PyConfig.filesystem_encoding` " -"and :c:member:`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." +"startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." +"filesystem_encoding` and :c:member:`~PyConfig.filesystem_errors` members of :" +"c:type:`PyConfig`." msgstr "" ":term:`filesystem encoding and error handler`\\ (檔案系統編碼和錯誤處理函" -"式)會在 Python 啟動時由 :c:func:`PyConfig_Read` 函式來配置:請參" -"閱 :c:member:`~PyConfig.filesystem_encoding`,以及 :c:type:`PyConfig` 的成" -"員 :c:member:`~PyConfig.filesystem_errors`。" +"式)會在 Python 啟動時由 :c:func:`PyConfig_Read` 函式來配置:請參閱 :c:" +"member:`~PyConfig.filesystem_encoding`,以及 :c:type:`PyConfig` 的成員 :c:" +"member:`~PyConfig.filesystem_errors`。" -#: ../../glossary.rst:510 +#: ../../glossary.rst:512 msgid "See also the :term:`locale encoding`." msgstr "另請參閱 :term:`locale encoding`\\ (區域編碼)。" -#: ../../glossary.rst:511 +#: ../../glossary.rst:513 msgid "finder" msgstr "finder(尋檢器)" -#: ../../glossary.rst:513 +#: ../../glossary.rst:515 msgid "" "An object that tries to find the :term:`loader` for a module that is being " "imported." msgstr "" "一個物件,它會嘗試為正在被 import 的模組尋找 :term:`loader`\\ (載入器)。" -#: ../../glossary.rst:516 +#: ../../glossary.rst:518 msgid "" "There are two types of finder: :term:`meta path finders ` " "for use with :data:`sys.meta_path`, and :term:`path entry finders ` 會使用 :data:`sys.meta_path`,而\\ :term:`路徑項目尋檢器 (path " "entry finder) ` 會使用 :data:`sys.path_hooks`。" -#: ../../glossary.rst:520 +#: ../../glossary.rst:522 msgid "" "See :ref:`finders-and-loaders` and :mod:`importlib` for much more detail." msgstr "請參閱 :ref:`finders-and-loaders` 和 :mod:`importlib` 以了解更多細節。" -#: ../../glossary.rst:521 +#: ../../glossary.rst:523 msgid "floor division" msgstr "floor division(向下取整除法)" -#: ../../glossary.rst:523 +#: ../../glossary.rst:525 msgid "" "Mathematical division that rounds down to nearest integer. The floor " "division operator is ``//``. For example, the expression ``11 // 4`` " @@ -1209,26 +1203,26 @@ msgstr "" "``2.75`` 不同。請注意,``(-11) // 4`` 的結果是 ``-3``,因為是 ``-2.75`` 被\\ " "*向下*\\ 無條件捨去。請參閱 :pep:`238`。" -#: ../../glossary.rst:528 +#: ../../glossary.rst:530 msgid "free threading" msgstr "free threading(自由執行緒)" -#: ../../glossary.rst:530 +#: ../../glossary.rst:532 msgid "" "A threading model where multiple threads can run Python bytecode " -"simultaneously within the same interpreter. This is in contrast to " -"the :term:`global interpreter lock` which allows only one thread to execute " +"simultaneously within the same interpreter. This is in contrast to the :" +"term:`global interpreter lock` which allows only one thread to execute " "Python bytecode at a time. See :pep:`703`." msgstr "" "為一種執行緒模型,多個執行緒可以在同一直譯器中同時運行 Python 位元組碼。這與" "\\ :term:`全域直譯器鎖 `\\ 形成對比,後者一次只允許" "一個執行緒執行 Python 位元組碼。請參閱 :pep:`703`。" -#: ../../glossary.rst:534 +#: ../../glossary.rst:536 msgid "free variable" msgstr "free variable(自由變數)" -#: ../../glossary.rst:536 +#: ../../glossary.rst:538 msgid "" "Formally, as defined in the :ref:`language execution model `, a " "free variable is any variable used in a namespace which is not a local " @@ -1238,31 +1232,31 @@ msgid "" "variable`." msgstr "" -#: ../../glossary.rst:541 +#: ../../glossary.rst:543 msgid "function" msgstr "function(函式)" -#: ../../glossary.rst:543 +#: ../../glossary.rst:545 msgid "" "A series of statements which returns some value to a caller. It can also be " "passed zero or more :term:`arguments ` which may be used in the " -"execution of the body. See also :term:`parameter`, :term:`method`, and " -"the :ref:`function` section." +"execution of the body. See also :term:`parameter`, :term:`method`, and the :" +"ref:`function` section." msgstr "" "一連串的陳述式,它能夠向呼叫者回傳一些值。它也可以被傳遞零個或多個\\ :term:`" -"引數 `,這些引數可被使用於函式本體的執行。另請參" -"閱 :term:`parameter`\\ (參數)、:term:`method`\\ (方法),以及" -"\\ :ref:`function`\\ 章節。" +"引數 `,這些引數可被使用於函式本體的執行。另請參閱 :term:" +"`parameter`\\ (參數)、:term:`method`\\ (方法),以及\\ :ref:`function`\\ " +"章節。" -#: ../../glossary.rst:547 +#: ../../glossary.rst:549 msgid "function annotation" msgstr "function annotation(函式註釋)" -#: ../../glossary.rst:549 +#: ../../glossary.rst:551 msgid "An :term:`annotation` of a function parameter or return value." msgstr "函式參數或回傳值的一個 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:551 +#: ../../glossary.rst:553 msgid "" "Function annotations are usually used for :term:`type hints `: " "for example, this function is expected to take two :class:`int` arguments " @@ -1271,7 +1265,7 @@ msgstr "" "函式註釋通常被使用於\\ :term:`型別提示 `:例如,這個函式預期會得到" "兩個 :class:`int` 引數,並會有一個 :class:`int` 回傳值: ::" -#: ../../glossary.rst:556 +#: ../../glossary.rst:558 msgid "" "def sum_two_numbers(a: int, b: int) -> int:\n" " return a + b" @@ -1279,11 +1273,11 @@ msgstr "" "def sum_two_numbers(a: int, b: int) -> int:\n" " return a + b" -#: ../../glossary.rst:559 +#: ../../glossary.rst:561 msgid "Function annotation syntax is explained in section :ref:`function`." msgstr "函式註釋的語法在\\ :ref:`function`\\ 章節有詳細解釋。" -#: ../../glossary.rst:561 +#: ../../glossary.rst:563 msgid "" "See :term:`variable annotation` and :pep:`484`, which describe this " "functionality. Also see :ref:`annotations-howto` for best practices on " @@ -1292,16 +1286,16 @@ msgstr "" "請參閱 :term:`variable annotation` 和 :pep:`484`,皆有此功能的描述。關於註釋" "的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:565 +#: ../../glossary.rst:567 msgid "__future__" msgstr "__future__" -#: ../../glossary.rst:567 +#: ../../glossary.rst:569 msgid "" "A :ref:`future statement `, ``from __future__ import ``, " "directs the compiler to compile the current module using syntax or semantics " -"that will become standard in a future release of Python. " -"The :mod:`__future__` module documents the possible values of *feature*. By " +"that will become standard in a future release of Python. The :mod:" +"`__future__` module documents the possible values of *feature*. By " "importing this module and evaluating its variables, you can see when a new " "feature was first added to the language and when it will (or did) become the " "default::" @@ -1312,7 +1306,7 @@ msgstr "" "import 此模組並對其變數求值,你可以看見一個新的功能是何時首次被新增到此語言" "中,以及它何時將會(或已經)成為預設的功能: ::" -#: ../../glossary.rst:575 +#: ../../glossary.rst:577 msgid "" ">>> import __future__\n" ">>> __future__.division\n" @@ -1322,11 +1316,11 @@ msgstr "" ">>> __future__.division\n" "_Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)" -#: ../../glossary.rst:578 +#: ../../glossary.rst:580 msgid "garbage collection" msgstr "garbage collection(垃圾回收)" -#: ../../glossary.rst:580 +#: ../../glossary.rst:582 msgid "" "The process of freeing memory when it is not used anymore. Python performs " "garbage collection via reference counting and a cyclic garbage collector " @@ -1338,11 +1332,11 @@ msgstr "" "垃圾回收器 (cyclic garbage collector) 來完成。垃圾回收器可以使用 :mod:`gc` 模" "組對其進行控制。" -#: ../../glossary.rst:585 ../../glossary.rst:586 +#: ../../glossary.rst:587 ../../glossary.rst:588 msgid "generator" msgstr "generator(產生器)" -#: ../../glossary.rst:588 +#: ../../glossary.rst:590 msgid "" "A function which returns a :term:`generator iterator`. It looks like a " "normal function except that it contains :keyword:`yield` expressions for " @@ -1353,7 +1347,7 @@ msgstr "" "個正常的函式,但不同的是它包含了 :keyword:`yield` 運算式,能產生一系列的值," "這些值可用於 for 迴圈,或是以 :func:`next` 函式,每次檢索其中的一個值。" -#: ../../glossary.rst:593 +#: ../../glossary.rst:595 msgid "" "Usually refers to a generator function, but may refer to a *generator " "iterator* in some contexts. In cases where the intended meaning isn't " @@ -1362,15 +1356,15 @@ msgstr "" "這個術語通常用來表示一個產生器函式,但在某些情境中,也可能是表示\\ *產生器疊" "代器*。萬一想表達的意思不夠清楚,那就使用完整的術語,以避免歧義。" -#: ../../glossary.rst:596 +#: ../../glossary.rst:598 msgid "generator iterator" msgstr "generator iterator(產生器疊代器)" -#: ../../glossary.rst:598 +#: ../../glossary.rst:600 msgid "An object created by a :term:`generator` function." msgstr "一個由 :term:`generator`\\ (產生器)函式所建立的物件。" -#: ../../glossary.rst:600 +#: ../../glossary.rst:602 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "execution state (including local variables and pending try-statements). " @@ -1381,11 +1375,11 @@ msgstr "" "try 陳述式)。當\\ *產生器疊代器*\\ 回復時,它會從停止的地方繼續執行(與那些" "每次呼叫時都要重新開始的函式有所不同)。" -#: ../../glossary.rst:606 ../../glossary.rst:607 +#: ../../glossary.rst:608 ../../glossary.rst:609 msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../glossary.rst:609 +#: ../../glossary.rst:611 msgid "" "An :term:`expression` that returns an :term:`iterator`. It looks like a " "normal expression followed by a :keyword:`!for` clause defining a loop " @@ -1397,7 +1391,7 @@ msgstr "" "變數、範圍以及一個選擇性的 :keyword:`!if` 子句。該組合運算式會為外層函式產生" "多個值: ::" -#: ../../glossary.rst:614 +#: ../../glossary.rst:616 msgid "" ">>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81\n" "285" @@ -1405,11 +1399,11 @@ msgstr "" ">>> sum(i*i for i in range(10)) # 平方之和 0, 1, 4, ... 81\n" "285" -#: ../../glossary.rst:616 +#: ../../glossary.rst:618 msgid "generic function" msgstr "generic function(泛型函式)" -#: ../../glossary.rst:618 +#: ../../glossary.rst:620 msgid "" "A function composed of multiple functions implementing the same operation " "for different types. Which implementation should be used during a call is " @@ -1418,50 +1412,49 @@ msgstr "" "一個由多個函式組成的函式,該函式會對不同的型別實作相同的運算。呼叫期間應該使" "用哪種實作,是由調度演算法 (dispatch algorithm) 來決定。" -#: ../../glossary.rst:622 +#: ../../glossary.rst:624 msgid "" -"See also the :term:`single dispatch` glossary entry, " -"the :func:`functools.singledispatch` decorator, and :pep:`443`." +"See also the :term:`single dispatch` glossary entry, the :func:`functools." +"singledispatch` decorator, and :pep:`443`." msgstr "" -"另請參閱 :term:`single dispatch`\\ (單一調度)術語表條" -"目、:func:`functools.singledispatch` 裝飾器和 :pep:`443`。" +"另請參閱 :term:`single dispatch`\\ (單一調度)術語表條目、:func:`functools." +"singledispatch` 裝飾器和 :pep:`443`。" -#: ../../glossary.rst:624 +#: ../../glossary.rst:626 msgid "generic type" msgstr "generic type(泛型型別)" -#: ../../glossary.rst:626 +#: ../../glossary.rst:628 msgid "" "A :term:`type` that can be parameterized; typically a :ref:`container " -"class` such as :class:`list` or :class:`dict`. Used " -"for :term:`type hints ` and :term:`annotations `." +"class` such as :class:`list` or :class:`dict`. Used for :" +"term:`type hints ` and :term:`annotations `." msgstr "" -"一個能夠被參數化 (parameterized) 的 :term:`type`\\ (型別);通常是一" -"個 :ref:`容器型別 `,像是 :class:`list` 和 :class:`dict`。它" -"被用於\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `。" +"一個能夠被參數化 (parameterized) 的 :term:`type`\\ (型別);通常是一個 :ref:" +"`容器型別 `,像是 :class:`list` 和 :class:`dict`。它被用於" +"\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `。" -#: ../../glossary.rst:631 +#: ../../glossary.rst:633 msgid "" -"For more details, see :ref:`generic alias types`, :pep:`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` " -"module." +"For more details, see :ref:`generic alias types`, :pep:" +"`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." msgstr "" -"詳情請參閱\\ :ref:`泛型別名型別 `、:pep:`483`、:pep:`484`、:pep:`585` 和 :mod:`typing` 模組。" +"詳情請參閱\\ :ref:`泛型別名型別 `、:pep:`483`、:pep:" +"`484`、:pep:`585` 和 :mod:`typing` 模組。" -#: ../../glossary.rst:633 +#: ../../glossary.rst:635 msgid "GIL" msgstr "GIL" -#: ../../glossary.rst:635 +#: ../../glossary.rst:637 msgid "See :term:`global interpreter lock`." msgstr "請參閱 :term:`global interpreter lock`\\ (全域直譯器鎖)。" -#: ../../glossary.rst:636 +#: ../../glossary.rst:638 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../glossary.rst:638 +#: ../../glossary.rst:640 msgid "" "The mechanism used by the :term:`CPython` interpreter to assure that only " "one thread executes Python :term:`bytecode` at a time. This simplifies the " @@ -1478,7 +1471,7 @@ msgstr "" "(multi-threaded),但代價是會犧牲掉多處理器的機器能夠提供的一大部分平行性 " "(parallelism)。" -#: ../../glossary.rst:647 +#: ../../glossary.rst:649 msgid "" "However, some extension modules, either standard or third-party, are " "designed so as to release the GIL when doing computationally intensive tasks " @@ -1489,7 +1482,7 @@ msgstr "" "計算密集 (computationally intensive) 的任務時,可以解除 GIL。另外,在執行 I/" "O 時,GIL 總是會被解除。" -#: ../../glossary.rst:652 +#: ../../glossary.rst:654 msgid "" "As of Python 3.13, the GIL can be disabled using the :option:`--disable-gil` " "build configuration. After building Python with this option, code must be " @@ -1504,18 +1497,18 @@ msgstr "" "多執行緒應用程式的效能,並使多核心 CPU 的高效使用變得更加容易。有關更多詳細資" "訊,請參閱 :pep:`703`。" -#: ../../glossary.rst:659 +#: ../../glossary.rst:661 msgid "" "In prior versions of Python's C API, a function might declare that it " -"requires the GIL to be held in order to use it. This refers to having " -"an :term:`attached thread state`." +"requires the GIL to be held in order to use it. This refers to having an :" +"term:`attached thread state`." msgstr "" -#: ../../glossary.rst:662 +#: ../../glossary.rst:664 msgid "hash-based pyc" msgstr "hash-based pyc(雜湊架構的 pyc)" -#: ../../glossary.rst:664 +#: ../../glossary.rst:666 msgid "" "A bytecode cache file that uses the hash rather than the last-modified time " "of the corresponding source file to determine its validity. See :ref:`pyc-" @@ -1524,23 +1517,23 @@ msgstr "" "一個位元組碼 (bytecode) 暫存檔,它使用雜湊值而不是對應原始檔案的最後修改時" "間,來確定其有效性。請參閱\\ :ref:`pyc-invalidation`。" -#: ../../glossary.rst:667 +#: ../../glossary.rst:669 msgid "hashable" msgstr "hashable(可雜湊的)" -#: ../../glossary.rst:669 +#: ../../glossary.rst:671 msgid "" "An object is *hashable* if it has a hash value which never changes during " "its lifetime (it needs a :meth:`~object.__hash__` method), and can be " "compared to other objects (it needs an :meth:`~object.__eq__` method). " "Hashable objects which compare equal must have the same hash value." msgstr "" -"如果一個物件有一個雜湊值,該值在其生命週期中永不改變(它需要一" -"個 :meth:`~object.__hash__` method),且可與其他物件互相比較(它需要一" -"個 :meth:`~object.__eq__` method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結" -"果為相等的多個可雜湊物件,它們必須擁有相同的雜湊值。" +"如果一個物件有一個雜湊值,該值在其生命週期中永不改變(它需要一個 :meth:" +"`~object.__hash__` method),且可與其他物件互相比較(它需要一個 :meth:" +"`~object.__eq__` method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的" +"多個可雜湊物件,它們必須擁有相同的雜湊值。" -#: ../../glossary.rst:675 +#: ../../glossary.rst:677 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." @@ -1548,7 +1541,7 @@ msgstr "" "可雜湊性 (hashability) 使一個物件可用作 dictionary(字典)的鍵和 set(集合)" "的成員,因為這些資料結構都在其內部使用了雜湊值。" -#: ../../glossary.rst:678 +#: ../../glossary.rst:680 msgid "" "Most of Python's immutable built-in objects are hashable; mutable containers " "(such as lists or dictionaries) are not; immutable containers (such as " @@ -1563,11 +1556,11 @@ msgstr "" "則這些物件會被預設為可雜湊的。它們在互相比較時都是不相等的(除非它們與自己比" "較),而它們的雜湊值則是衍生自它們的 :func:`id`。" -#: ../../glossary.rst:685 +#: ../../glossary.rst:687 msgid "IDLE" msgstr "IDLE" -#: ../../glossary.rst:687 +#: ../../glossary.rst:689 msgid "" "An Integrated Development and Learning Environment for Python. :ref:`idle` " "is a basic editor and interpreter environment which ships with the standard " @@ -1577,37 +1570,37 @@ msgstr "" "境)。:ref:`idle` 是一個基本的編輯器和直譯器環境,它和 Python 的標準發行版本" "一起被提供。" -#: ../../glossary.rst:690 +#: ../../glossary.rst:692 msgid "immortal" msgstr "immortal(不滅)" -#: ../../glossary.rst:692 +#: ../../glossary.rst:694 msgid "" -"*Immortal objects* are a CPython implementation detail introduced " -"in :pep:`683`." +"*Immortal objects* are a CPython implementation detail introduced in :pep:" +"`683`." msgstr "*不滅物件 (Immortal objects)* 是 :pep:`683` 引入的 CPython 實作細節。" -#: ../../glossary.rst:695 +#: ../../glossary.rst:697 msgid "" "If an object is immortal, its :term:`reference count` is never modified, and " "therefore it is never deallocated while the interpreter is running. For " "example, :const:`True` and :const:`None` are immortal in CPython." msgstr "" "如果一個物件是不滅的,它的\\ :term:`參照計數 `\\ 永遠不會被" -"修改,因此在直譯器運行時它永遠不會被釋放。例如,:const:`True` " -"和 :const:`None` 在 CPython 中是不滅的。" +"修改,因此在直譯器運行時它永遠不會被釋放。例如,:const:`True` 和 :const:" +"`None` 在 CPython 中是不滅的。" -#: ../../glossary.rst:699 +#: ../../glossary.rst:701 msgid "" -"Immortal objects can be identified via :func:`sys._is_immortal`, or " -"via :c:func:`PyUnstable_IsImmortal` in the C API." +"Immortal objects can be identified via :func:`sys._is_immortal`, or via :c:" +"func:`PyUnstable_IsImmortal` in the C API." msgstr "" -#: ../../glossary.rst:701 +#: ../../glossary.rst:703 msgid "immutable" msgstr "immutable(不可變物件)" -#: ../../glossary.rst:703 +#: ../../glossary.rst:705 msgid "" "An object with a fixed value. Immutable objects include numbers, strings " "and tuples. Such an object cannot be altered. A new object has to be " @@ -1619,11 +1612,11 @@ msgstr "" "能被改變的。如果一個不同的值必須被儲存,則必須建立一個新的物件。它們在需要恆" "定雜湊值的地方,扮演重要的角色,例如 dictionary(字典)中的一個鍵。" -#: ../../glossary.rst:708 +#: ../../glossary.rst:710 msgid "import path" msgstr "import path(引入路徑)" -#: ../../glossary.rst:710 +#: ../../glossary.rst:712 msgid "" "A list of locations (or :term:`path entries `) that are searched " "by the :term:`path based finder` for modules to import. During import, this " @@ -1635,11 +1628,11 @@ msgstr "" "的位置。在 import 期間,此位置列表通常是來自 :data:`sys.path`,但對於子套件 " "(subpackage) 而言,它也可能是來自父套件的 ``__path__`` 屬性。" -#: ../../glossary.rst:715 +#: ../../glossary.rst:717 msgid "importing" msgstr "importing(引入)" -#: ../../glossary.rst:717 +#: ../../glossary.rst:719 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." @@ -1647,23 +1640,23 @@ msgstr "" "一個過程。一個模組中的 Python 程式碼可以透過此過程,被另一個模組中的 Python " "程式碼使用。" -#: ../../glossary.rst:719 +#: ../../glossary.rst:721 msgid "importer" msgstr "importer(引入器)" -#: ../../glossary.rst:721 +#: ../../glossary.rst:723 msgid "" -"An object that both finds and loads a module; both a :term:`finder` " -"and :term:`loader` object." +"An object that both finds and loads a module; both a :term:`finder` and :" +"term:`loader` object." msgstr "" -"一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也" -"是 :term:`loader`\\ (載入器)物件。" +"一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也是 :term:" +"`loader`\\ (載入器)物件。" -#: ../../glossary.rst:723 +#: ../../glossary.rst:725 msgid "interactive" msgstr "interactive(互動的)" -#: ../../glossary.rst:725 +#: ../../glossary.rst:727 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " @@ -1677,11 +1670,11 @@ msgstr "" "從你的電腦的主選單選擇它)。這是測試新想法或檢查模組和包的非常強大的方法(請" "記住help(x))。更多互動式模式相關資訊請見 :ref:`tut-interac`。" -#: ../../glossary.rst:732 +#: ../../glossary.rst:734 msgid "interpreted" msgstr "interpreted(直譯的)" -#: ../../glossary.rst:734 +#: ../../glossary.rst:736 msgid "" "Python is an interpreted language, as opposed to a compiled one, though the " "distinction can be blurry because of the presence of the bytecode compiler. " @@ -1695,20 +1688,20 @@ msgstr "" "一個執行檔,然後再執行它。直譯語言通常比編譯語言有更短的開發/除錯週期,不過" "它們的程式通常也運行得較慢。另請參閱 :term:`interactive`\\ (互動的)。" -#: ../../glossary.rst:741 +#: ../../glossary.rst:743 msgid "interpreter shutdown" msgstr "interpreter shutdown(直譯器關閉)" -#: ../../glossary.rst:743 +#: ../../glossary.rst:745 msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " -"critical internal structures. It also makes several calls to " -"the :term:`garbage collector `. This can trigger the " -"execution of code in user-defined destructors or weakref callbacks. Code " -"executed during the shutdown phase can encounter various exceptions as the " -"resources it relies on may not function anymore (common examples are library " -"modules or the warnings machinery)." +"critical internal structures. It also makes several calls to the :term:" +"`garbage collector `. This can trigger the execution of " +"code in user-defined destructors or weakref callbacks. Code executed during " +"the shutdown phase can encounter various exceptions as the resources it " +"relies on may not function anymore (common examples are library modules or " +"the warnings machinery)." msgstr "" "當 Python 直譯器被要求關閉時,它會進入一個特殊階段,在此它逐漸釋放所有被配置" "的資源,例如模組和各種關鍵內部結構。它也會多次呼叫\\ :term:`垃圾回收器 " @@ -1717,109 +1710,104 @@ msgstr "" "段被執行的程式碼會遇到各種例外,因為它所依賴的資源可能不再有作用了(常見的例" "子是函式庫模組或是警告機制)。" -#: ../../glossary.rst:752 +#: ../../glossary.rst:754 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." msgstr "" "直譯器關閉的主要原因,是 ``__main__`` 模組或正被運行的腳本已經執行完成。" -#: ../../glossary.rst:754 +#: ../../glossary.rst:756 msgid "iterable" msgstr "iterable(可疊代物件)" -#: ../../glossary.rst:756 +#: ../../glossary.rst:758 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " -"and :class:`tuple`) and some non-sequence types " -"like :class:`dict`, :term:`file objects `, and objects of any " -"classes you define with an :meth:`~object.__iter__` method or with " -"a :meth:`~object.__getitem__` method that implements :term:`sequence` " -"semantics." +"and :class:`tuple`) and some non-sequence types like :class:`dict`, :term:" +"`file objects `, and objects of any classes you define with an :" +"meth:`~object.__iter__` method or with a :meth:`~object.__getitem__` method " +"that implements :term:`sequence` semantics." msgstr "" "一種能夠一次回傳一個其中成員的物件。可疊代物件的例子包括所有的序列型別(像" -"是 :class:`list`、:class:`str` 和 :class:`tuple`\\ )和某些非序列型別,像" -"是 :class:`dict`、:term:`檔案物件 `,以及你所定義的任何 class 物" -"件,只要那些 class 有實作 :term:`sequence`\\ (序列)語意" -"的 :meth:`~object.__iter__` 或是 :meth:`~object.__getitem__` method,該物件就" -"是可疊代物件。" +"是 :class:`list`、:class:`str` 和 :class:`tuple`\\ )和某些非序列型別,像是 :" +"class:`dict`、:term:`檔案物件 `,以及你所定義的任何 class 物件," +"只要那些 class 有實作 :term:`sequence`\\ (序列)語意的 :meth:`~object." +"__iter__` 或是 :meth:`~object.__getitem__` method,該物件就是可疊代物件。" -#: ../../glossary.rst:764 +#: ../../glossary.rst:766 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " -"iterable object is passed as an argument to the built-in " -"function :func:`iter`, it returns an iterator for the object. This iterator " -"is good for one pass over the set of values. When using iterables, it is " -"usually not necessary to call :func:`iter` or deal with iterator objects " -"yourself. The :keyword:`for` statement does that automatically for you, " -"creating a temporary unnamed variable to hold the iterator for the duration " -"of the loop. See also :term:`iterator`, :term:`sequence`, " -"and :term:`generator`." -msgstr "" -"可疊代物件可用於 :keyword:`for` 迴圈和許多其他需要一個序列的地方 " -"(:func:`zip`、:func:`map`\\ ...)。當一個可疊代物件作為引數被傳遞給內建函" -"式 :func:`iter` 時,它會為該物件回傳一個疊代器。此疊代器適用於針對一組值進行" -"一遍 (one pass) 運算。使用疊代器時,通常不一定要呼叫 :func:`iter` 或自行處理" -"疊代器物件。:keyword:`for` 陳述式會自動地為你處理這些事,它會建立一個暫時性的" -"未命名變數,用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代" -"器)、:term:`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" - -#: ../../glossary.rst:774 +"iterable object is passed as an argument to the built-in function :func:" +"`iter`, it returns an iterator for the object. This iterator is good for " +"one pass over the set of values. When using iterables, it is usually not " +"necessary to call :func:`iter` or deal with iterator objects yourself. The :" +"keyword:`for` statement does that automatically for you, creating a " +"temporary unnamed variable to hold the iterator for the duration of the " +"loop. See also :term:`iterator`, :term:`sequence`, and :term:`generator`." +msgstr "" +"可疊代物件可用於 :keyword:`for` 迴圈和許多其他需要一個序列的地方 (:func:" +"`zip`、:func:`map`\\ ...)。當一個可疊代物件作為引數被傳遞給內建函式 :func:" +"`iter` 時,它會為該物件回傳一個疊代器。此疊代器適用於針對一組值進行一遍 (one " +"pass) 運算。使用疊代器時,通常不一定要呼叫 :func:`iter` 或自行處理疊代器物" +"件。:keyword:`for` 陳述式會自動地為你處理這些事,它會建立一個暫時性的未命名變" +"數,用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、:" +"term:`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" + +#: ../../glossary.rst:776 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../glossary.rst:776 -msgid "" -"An object representing a stream of data. Repeated calls to the " -"iterator's :meth:`~iterator.__next__` method (or passing it to the built-in " -"function :func:`next`) return successive items in the stream. When no more " -"data are available a :exc:`StopIteration` exception is raised instead. At " -"this point, the iterator object is exhausted and any further calls to " -"its :meth:`!__next__` method just raise :exc:`StopIteration` again. " -"Iterators are required to have an :meth:`~iterator.__iter__` method that " -"returns the iterator object itself so every iterator is also iterable and " -"may be used in most places where other iterables are accepted. One notable " -"exception is code which attempts multiple iteration passes. A container " -"object (such as a :class:`list`) produces a fresh new iterator each time you " -"pass it to the :func:`iter` function or use it in a :keyword:`for` loop. " -"Attempting this with an iterator will just return the same exhausted " -"iterator object used in the previous iteration pass, making it appear like " -"an empty container." +#: ../../glossary.rst:778 +msgid "" +"An object representing a stream of data. Repeated calls to the iterator's :" +"meth:`~iterator.__next__` method (or passing it to the built-in function :" +"func:`next`) return successive items in the stream. When no more data are " +"available a :exc:`StopIteration` exception is raised instead. At this " +"point, the iterator object is exhausted and any further calls to its :meth:`!" +"__next__` method just raise :exc:`StopIteration` again. Iterators are " +"required to have an :meth:`~iterator.__iter__` method that returns the " +"iterator object itself so every iterator is also iterable and may be used in " +"most places where other iterables are accepted. One notable exception is " +"code which attempts multiple iteration passes. A container object (such as " +"a :class:`list`) produces a fresh new iterator each time you pass it to the :" +"func:`iter` function or use it in a :keyword:`for` loop. Attempting this " +"with an iterator will just return the same exhausted iterator object used in " +"the previous iteration pass, making it appear like an empty container." msgstr "" "一個表示資料流的物件。重複地呼叫疊代器的 :meth:`~iterator.__next__` method" "(或是將它傳遞給內建函式 :func:`next`\\ )會依序回傳資料流中的各項目。當不再" "有資料時,則會引發 :exc:`StopIteration` 例外。此時,該疊代器物件已被用盡,而" -"任何對其 :meth:`!__next__` method 的進一步呼叫,都只會再次引" -"發 :exc:`StopIteration`。疊代器必須有一個 :meth:`~iterator.__iter__` method," -"它會回傳疊代器物件本身,所以每個疊代器也都是可疊代物件,且可以用於大多數適用" -"其他可疊代物件的場合。一個明顯的例外,是嘗試多遍疊代 (multiple iteration " -"passes) 的程式碼。一個容器物件(像是 :class:`list`)在每次你將它傳遞" -"給 :func:`iter` 函式或在 :keyword:`for` 迴圈中使用它時,都會產生一個全新的疊" -"代器。使用疊代器嘗試此事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一" -"個已被用盡的疊代器物件,使其看起來就像一個空的容器。" - -#: ../../glossary.rst:791 +"任何對其 :meth:`!__next__` method 的進一步呼叫,都只會再次引發 :exc:" +"`StopIteration`。疊代器必須有一個 :meth:`~iterator.__iter__` method,它會回傳" +"疊代器物件本身,所以每個疊代器也都是可疊代物件,且可以用於大多數適用其他可疊" +"代物件的場合。一個明顯的例外,是嘗試多遍疊代 (multiple iteration passes) 的程" +"式碼。一個容器物件(像是 :class:`list`)在每次你將它傳遞給 :func:`iter` 函式" +"或在 :keyword:`for` 迴圈中使用它時,都會產生一個全新的疊代器。使用疊代器嘗試" +"此事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" +"件,使其看起來就像一個空的容器。" + +#: ../../glossary.rst:793 msgid "More information can be found in :ref:`typeiter`." msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" -#: ../../glossary.rst:795 +#: ../../glossary.rst:797 msgid "" -"CPython does not consistently apply the requirement that an iterator " -"define :meth:`~iterator.__iter__`. And also please note that the free-" -"threading CPython does not guarantee the thread-safety of iterator " -"operations." +"CPython does not consistently apply the requirement that an iterator define :" +"meth:`~iterator.__iter__`. And also please note that the free-threading " +"CPython does not guarantee the thread-safety of iterator operations." msgstr "" -"CPython 並不是始終如一地都會檢查「疊代器有定" -"義 :meth:`~iterator.__iter__`\\ 」這個規定。另請注意,free-threading(自由執" -"行緒)CPython 不保證疊代器操作的執行緒安全。" +"CPython 並不是始終如一地都會檢查「疊代器有定義 :meth:`~iterator." +"__iter__`\\ 」這個規定。另請注意,free-threading(自由執行緒)CPython 不保證" +"疊代器操作的執行緒安全。" -#: ../../glossary.rst:800 +#: ../../glossary.rst:802 msgid "key function" msgstr "key function(鍵函式)" -#: ../../glossary.rst:802 +#: ../../glossary.rst:804 msgid "" "A key function or collation function is a callable that returns a value used " "for sorting or ordering. For example, :func:`locale.strxfrm` is used to " @@ -1829,48 +1817,48 @@ msgstr "" "一個用於排序 (sorting) 或定序 (ordering) 的值。例如,:func:`locale.strxfrm` " "被用來產生一個了解區域特定排序慣例的排序鍵。" -#: ../../glossary.rst:807 +#: ../../glossary.rst:809 msgid "" "A number of tools in Python accept key functions to control how elements are " -"ordered or grouped. They " -"include :func:`min`, :func:`max`, :func:`sorted`, :meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, :func:`heapq.nlargest`, " -"and :func:`itertools.groupby`." +"ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" +"meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, :func:`heapq." +"nlargest`, and :func:`itertools.groupby`." msgstr "" -"Python 中的許多工具,都接受以鍵函式來控制元素被定序或分組的方式。它們包" -"括 :func:`min`、:func:`max`、:func:`sorted`、:meth:`list.sort`、:func:`heapq.merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest` " -"和 :func:`itertools.groupby`。" +"Python 中的許多工具,都接受以鍵函式來控制元素被定序或分組的方式。它們包括 :" +"func:`min`、:func:`max`、:func:`sorted`、:meth:`list.sort`、:func:`heapq." +"merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest` 和 :func:`itertools." +"groupby`。" -#: ../../glossary.rst:813 +#: ../../glossary.rst:815 msgid "" -"There are several ways to create a key function. For example. " -"the :meth:`str.lower` method can serve as a key function for case " -"insensitive sorts. Alternatively, a key function can be built from " -"a :keyword:`lambda` expression such as ``lambda r: (r[0], r[2])``. " -"Also, :func:`operator.attrgetter`, :func:`operator.itemgetter`, " -"and :func:`operator.methodcaller` are three key function constructors. See " -"the :ref:`Sorting HOW TO ` for examples of how to create and " -"use key functions." +"There are several ways to create a key function. For example. the :meth:" +"`str.lower` method can serve as a key function for case insensitive sorts. " +"Alternatively, a key function can be built from a :keyword:`lambda` " +"expression such as ``lambda r: (r[0], r[2])``. Also, :func:`operator." +"attrgetter`, :func:`operator.itemgetter`, and :func:`operator.methodcaller` " +"are three key function constructors. See the :ref:`Sorting HOW TO " +"` for examples of how to create and use key functions." msgstr "" "有幾種方法可以建立一個鍵函式。例如,:meth:`str.lower` method 可以作為不分大小" "寫排序的鍵函式。或者,一個鍵函式也可以從 :keyword:`lambda` 運算式被建造,例" -"如 ``lambda r: (r[0], r[2])``。另" -"外,:func:`operator.attrgetter`、:func:`operator.itemgetter` " -"和 :func:`operator.methodcaller` 為三個鍵函式的建構函式 (constructor)。關於如" -"何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 `。" +"如 ``lambda r: (r[0], r[2])``。另外,:func:`operator.attrgetter`、:func:" +"`operator.itemgetter` 和 :func:`operator.methodcaller` 為三個鍵函式的建構函" +"式 (constructor)。關於如何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 " +"`。" -#: ../../glossary.rst:820 +#: ../../glossary.rst:822 msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:822 ../../glossary.rst:1137 +#: ../../glossary.rst:824 ../../glossary.rst:1139 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" -#: ../../glossary.rst:823 +#: ../../glossary.rst:825 msgid "lambda" msgstr "lambda" -#: ../../glossary.rst:825 +#: ../../glossary.rst:827 msgid "" "An anonymous inline function consisting of a single :term:`expression` which " "is evaluated when the function is called. The syntax to create a lambda " @@ -1880,11 +1868,11 @@ msgstr "" "function),於該函式被呼叫時求值。建立 lambda 函式的語法是 ``lambda " "[parameters]: expression``" -#: ../../glossary.rst:828 +#: ../../glossary.rst:830 msgid "LBYL" msgstr "LBYL" -#: ../../glossary.rst:830 +#: ../../glossary.rst:832 msgid "" "Look before you leap. This coding style explicitly tests for pre-conditions " "before making calls or lookups. This style contrasts with the :term:`EAFP` " @@ -1892,10 +1880,10 @@ msgid "" "statements." msgstr "" "Look before you leap.(三思而後行。)這種編碼風格會在進行呼叫或查找之前,明確" -"地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許" -"多 :keyword:`if` 陳述式的存在。" +"地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" +"keyword:`if` 陳述式的存在。" -#: ../../glossary.rst:835 +#: ../../glossary.rst:837 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a " "race condition between \"the looking\" and \"the leaping\". For example, " @@ -1909,19 +1897,19 @@ msgstr "" "了 *key*,則該程式碼就會失效。這個問題可以用鎖 (lock) 或使用 EAFP 編碼方式來" "解決。" -#: ../../glossary.rst:840 +#: ../../glossary.rst:842 msgid "lexical analyzer" msgstr "lexical analyzer(詞法分析器)" -#: ../../glossary.rst:843 +#: ../../glossary.rst:845 msgid "Formal name for the *tokenizer*; see :term:`token`." msgstr "tokenizer 的正式名稱;請參閱 :term:`token`。" -#: ../../glossary.rst:844 +#: ../../glossary.rst:846 msgid "list" msgstr "list(串列)" -#: ../../glossary.rst:846 +#: ../../glossary.rst:848 msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " @@ -1931,11 +1919,11 @@ msgstr "" "似其他語言中的一個陣列 (array) 而較不像一個鏈結串列 (linked list),因為存取元" "素的時間複雜度是 *O*\\ (1)。" -#: ../../glossary.rst:849 +#: ../../glossary.rst:851 msgid "list comprehension" msgstr "list comprehension(串列綜合運算)" -#: ../../glossary.rst:851 +#: ../../glossary.rst:853 msgid "" "A compact way to process all or part of the elements in a sequence and " "return a list with the results. ``result = ['{:#04x}'.format(x) for x in " @@ -1945,101 +1933,98 @@ msgid "" msgstr "" "一種用來處理一個序列中的全部或部分元素,並將處理結果以一個 list 回傳的簡要方" "法。``result = ['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` 會產" -"生一個字串 list,其中包含 0 到 255 範圍內,所有偶數的十六進位數 " -"(0x..)。:keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有" -"元素都會被處理。" +"生一個字串 list,其中包含 0 到 255 範圍內,所有偶數的十六進位數 (0x..)。:" +"keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" +"處理。" -#: ../../glossary.rst:857 +#: ../../glossary.rst:859 msgid "loader" msgstr "loader(載入器)" -#: ../../glossary.rst:859 +#: ../../glossary.rst:861 msgid "" -"An object that loads a module. It must define the :meth:`!exec_module` " -"and :meth:`!create_module` methods to implement " -"the :class:`~importlib.abc.Loader` interface. A loader is typically returned " -"by a :term:`finder`. See also:" +"An object that loads a module. It must define the :meth:`!exec_module` and :" +"meth:`!create_module` methods to implement the :class:`~importlib.abc." +"Loader` interface. A loader is typically returned by a :term:`finder`. See " +"also:" msgstr "" "一個能夠載入模組的物件。它必須定義 :meth:`!exec_module` 和 :meth:`!" "create_module` 方法以實作 :class:`~importlib.abc.Loader` 介面。載入器通常是" "被 :term:`finder`\\ (尋檢器)回傳。更多細節請參閱:" -#: ../../glossary.rst:865 +#: ../../glossary.rst:867 msgid ":ref:`finders-and-loaders`" msgstr ":ref:`finders-and-loaders`" -#: ../../glossary.rst:866 +#: ../../glossary.rst:868 msgid ":class:`importlib.abc.Loader`" msgstr ":class:`importlib.abc.Loader`" -#: ../../glossary.rst:867 +#: ../../glossary.rst:869 msgid ":pep:`302`" msgstr ":pep:`302`" -#: ../../glossary.rst:868 +#: ../../glossary.rst:870 msgid "locale encoding" msgstr "locale encoding(區域編碼)" -#: ../../glossary.rst:870 +#: ../../glossary.rst:872 msgid "" -"On Unix, it is the encoding of the LC_CTYPE locale. It can be set " -"with :func:`locale.setlocale(locale.LC_CTYPE, new_locale) " -"`." +"On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:" +"`locale.setlocale(locale.LC_CTYPE, new_locale) `." msgstr "" -"在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以" -"用 :func:`locale.setlocale(locale.LC_CTYPE, new_locale) ` " -"來設定。" +"在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以用 :func:`locale." +"setlocale(locale.LC_CTYPE, new_locale) ` 來設定。" -#: ../../glossary.rst:873 +#: ../../glossary.rst:875 msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." msgstr "在 Windows 上,它是 ANSI 碼頁(code page,例如 ``\"cp1252\"``\\ )。" -#: ../../glossary.rst:875 +#: ../../glossary.rst:877 msgid "" "On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." msgstr "在 Android 和 VxWorks 上,Python 使用 ``\"utf-8\"`` 作為區域編碼。" -#: ../../glossary.rst:877 +#: ../../glossary.rst:879 msgid ":func:`locale.getencoding` can be used to get the locale encoding." msgstr ":func:`locale.getencoding` 可以用來取得區域編碼。" -#: ../../glossary.rst:879 +#: ../../glossary.rst:881 msgid "See also the :term:`filesystem encoding and error handler`." msgstr "也請參考 :term:`filesystem encoding and error handler`。" -#: ../../glossary.rst:880 +#: ../../glossary.rst:882 msgid "magic method" msgstr "magic method(魔術方法)" -#: ../../glossary.rst:884 +#: ../../glossary.rst:886 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method`\\ (特殊方法)的一個非正式同義詞。" -#: ../../glossary.rst:885 +#: ../../glossary.rst:887 msgid "mapping" msgstr "mapping(對映)" -#: ../../glossary.rst:887 +#: ../../glossary.rst:889 msgid "" "A container object that supports arbitrary key lookups and implements the " -"methods specified in the :class:`collections.abc.Mapping` " -"or :class:`collections.abc.MutableMapping` :ref:`abstract base classes " -"`. Examples " -"include :class:`dict`, :class:`collections.defaultdict`, :class:`collections.OrderedDict` " -"and :class:`collections.Counter`." +"methods specified in the :class:`collections.abc.Mapping` or :class:" +"`collections.abc.MutableMapping` :ref:`abstract base classes `. Examples include :class:`dict`, :class:" +"`collections.defaultdict`, :class:`collections.OrderedDict` and :class:" +"`collections.Counter`." msgstr "" "一個容器物件,它支援任意鍵的查找,且能實作 :ref:`abstract base classes(抽象" -"基底類別) `\\ " -"中,:class:`collections.abc.Mapping` " -"或 :class:`collections.abc.MutableMapping` 所指定的 method。範例包" -"括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections.OrderedDict` " -"和 :class:`collections.Counter`。" +"基底類別) `\\ 中,:class:`collections." +"abc.Mapping` 或 :class:`collections.abc.MutableMapping` 所指定的 method。範例" +"包括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections." +"OrderedDict` 和 :class:`collections.Counter`。" -#: ../../glossary.rst:893 +#: ../../glossary.rst:895 msgid "meta path finder" msgstr "meta path finder(元路徑尋檢器)" -#: ../../glossary.rst:895 +#: ../../glossary.rst:897 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders ` " "相關但是不同。" -#: ../../glossary.rst:899 +#: ../../glossary.rst:901 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." msgstr "" "關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`。" -#: ../../glossary.rst:901 +#: ../../glossary.rst:903 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../glossary.rst:903 +#: ../../glossary.rst:905 msgid "" "The class of a class. Class definitions create a class name, a class " "dictionary, and a list of base classes. The metaclass is responsible for " @@ -2080,31 +2065,31 @@ msgstr "" "性存取、增加執行緒安全性、追蹤物件建立、實作單例模式 (singleton),以及許多其" "他的任務。" -#: ../../glossary.rst:913 +#: ../../glossary.rst:915 msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:882 ../../glossary.rst:914 ../../glossary.rst:1288 +#: ../../glossary.rst:884 ../../glossary.rst:916 ../../glossary.rst:1290 msgid "method" msgstr "method(方法)" -#: ../../glossary.rst:916 +#: ../../glossary.rst:918 msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " -"first :term:`argument` (which is usually called ``self``). " -"See :term:`function` and :term:`nested scope`." +"first :term:`argument` (which is usually called ``self``). See :term:" +"`function` and :term:`nested scope`." msgstr "" "一個在 class 本體內被定義的函式。如果 method 作為其 class 實例的一個屬性被呼" "叫,則它將會得到該實例物件成為它的第一個 :term:`argument`\\ (引數)(此引數" "通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:`nested " "scope`\\ (巢狀作用域)。" -#: ../../glossary.rst:920 +#: ../../glossary.rst:922 msgid "method resolution order" msgstr "method resolution order(方法解析順序)" -#: ../../glossary.rst:922 +#: ../../glossary.rst:924 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See :ref:`python_2.3_mro` for details of the " @@ -2113,11 +2098,11 @@ msgstr "" "方法解析順序是在查找某個成員的過程中,base class(基底類別)被搜尋的順序。關" "於 Python 自 2.3 版直譯器所使用的演算法細節,請參閱 :ref:`python_2.3_mro`。" -#: ../../glossary.rst:925 +#: ../../glossary.rst:927 msgid "module" msgstr "module(模組)" -#: ../../glossary.rst:927 +#: ../../glossary.rst:929 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " @@ -2127,51 +2112,51 @@ msgstr "" "空間,它包含任意的 Python 物件。模組是藉由 :term:`importing` 的過程,被載入" "至 Python。" -#: ../../glossary.rst:931 +#: ../../glossary.rst:933 msgid "See also :term:`package`." msgstr "另請參閱 :term:`package`\\ (套件)。" -#: ../../glossary.rst:932 +#: ../../glossary.rst:934 msgid "module spec" msgstr "module spec(模組規格)" -#: ../../glossary.rst:934 +#: ../../glossary.rst:936 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." msgstr "" -"一個命名空間,它包含用於載入模組的 import 相關資訊。它" -"是 :class:`importlib.machinery.ModuleSpec` 的一個實例。" +"一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." +"machinery.ModuleSpec` 的一個實例。" -#: ../../glossary.rst:937 +#: ../../glossary.rst:939 msgid "See also :ref:`module-specs`." msgstr "另請參閱 :ref:`module-specs`。" -#: ../../glossary.rst:938 +#: ../../glossary.rst:940 msgid "MRO" msgstr "MRO" -#: ../../glossary.rst:940 +#: ../../glossary.rst:942 msgid "See :term:`method resolution order`." msgstr "請參閱 :term:`method resolution order`\\ (方法解析順序)。" -#: ../../glossary.rst:941 +#: ../../glossary.rst:943 msgid "mutable" msgstr "mutable(可變物件)" -#: ../../glossary.rst:943 +#: ../../glossary.rst:945 msgid "" -"Mutable objects can change their value but keep their :func:`id`. See " -"also :term:`immutable`." +"Mutable objects can change their value but keep their :func:`id`. See also :" +"term:`immutable`." msgstr "" -"可變物件可以改變它們的值,但維持它們的 :func:`id`。另請參" -"閱 :term:`immutable`\\ (不可變物件)。" +"可變物件可以改變它們的值,但維持它們的 :func:`id`。另請參閱 :term:" +"`immutable`\\ (不可變物件)。" -#: ../../glossary.rst:945 +#: ../../glossary.rst:947 msgid "named tuple" msgstr "named tuple(附名元組)" -#: ../../glossary.rst:947 +#: ../../glossary.rst:949 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " @@ -2181,16 +2166,16 @@ msgstr "" "索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以具有其他" "的特性。" -#: ../../glossary.rst:951 +#: ../../glossary.rst:953 msgid "" -"Several built-in types are named tuples, including the values returned " -"by :func:`time.localtime` and :func:`os.stat`. Another example " -"is :data:`sys.float_info`::" +"Several built-in types are named tuples, including the values returned by :" +"func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." +"float_info`::" msgstr "" "有些內建型別是 named tuple,包括由 :func:`time.localtime` 和 :func:`os.stat` " "回傳的值。另一個例子是 :data:`sys.float_info`: ::" -#: ../../glossary.rst:955 +#: ../../glossary.rst:957 msgid "" ">>> sys.float_info[1] # indexed access\n" "1024\n" @@ -2206,54 +2191,52 @@ msgstr "" ">>> isinstance(sys.float_info, tuple) # 屬於 tuple 型別\n" "True" -#: ../../glossary.rst:962 +#: ../../glossary.rst:964 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " "that inherits from :class:`tuple` and that defines named fields. Such a " -"class can be written by hand, or it can be created by " -"inheriting :class:`typing.NamedTuple`, or with the factory " -"function :func:`collections.namedtuple`. The latter techniques also add " -"some extra methods that may not be found in hand-written or built-in named " -"tuples." +"class can be written by hand, or it can be created by inheriting :class:" +"`typing.NamedTuple`, or with the factory function :func:`collections." +"namedtuple`. The latter techniques also add some extra methods that may not " +"be found in hand-written or built-in named tuples." msgstr "" "有些 named tuple 是內建型別(如上例)。或者,一個 named tuple 也可以從一個正" "規的 class 定義來建立,只要該 class 是繼承自 :class:`tuple`,且定義了附名欄" -"位 (named field) 即可。這類的 class 可以手工編寫、可以繼承" -"自 :class:`typing.NamedTuple` 來建立,也可以使用工廠函式 (factory " -"function) :func:`collections.namedtuple` 來建立。後者技術也增加了一些額外的 " -"method,這些 method 可能是在手寫或內建的 named tuple 中,無法找到的。" +"位 (named field) 即可。這類的 class 可以手工編寫、可以繼承自 :class:`typing." +"NamedTuple` 來建立,也可以使用工廠函式 (factory function) :func:`collections." +"namedtuple` 來建立。後者技術也增加了一些額外的 method,這些 method 可能是在手" +"寫或內建的 named tuple 中,無法找到的。" -#: ../../glossary.rst:970 +#: ../../glossary.rst:972 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../glossary.rst:972 +#: ../../glossary.rst:974 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " "as nested namespaces in objects (in methods). Namespaces support modularity " -"by preventing naming conflicts. For instance, the " -"functions :func:`builtins.open <.open>` and :func:`os.open` are " -"distinguished by their namespaces. Namespaces also aid readability and " -"maintainability by making it clear which module implements a function. For " -"instance, writing :func:`random.seed` or :func:`itertools.islice` makes it " -"clear that those functions are implemented by the :mod:`random` " -"and :mod:`itertools` modules, respectively." +"by preventing naming conflicts. For instance, the functions :func:`builtins." +"open <.open>` and :func:`os.open` are distinguished by their namespaces. " +"Namespaces also aid readability and maintainability by making it clear which " +"module implements a function. For instance, writing :func:`random.seed` or :" +"func:`itertools.islice` makes it clear that those functions are implemented " +"by the :mod:`random` and :mod:`itertools` modules, respectively." msgstr "" "變數被儲存的地方。命名空間是以 dictionary(字典)被實作。有區域的、全域的及內" "建的命名空間,而在物件中(在 method 中)也有巢狀的命名空間。命名空間藉由防止" -"命名衝突,來支援模組化。例如,函式 :func:`builtins.open <.open>` " -"和 :func:`os.open` 是透過它們的命名空間來區分彼此。命名空間也藉由明確地區分是" -"哪個模組在實作一個函式,來增進可讀性及可維護性。例如,寫" -"出 :func:`random.seed` 或 :func:`itertools.islice` 明確地表示,這些函式分別是" -"由 :mod:`random` 和 :mod:`itertools` 模組在實作。" +"命名衝突,來支援模組化。例如,函式 :func:`builtins.open <.open>` 和 :func:" +"`os.open` 是透過它們的命名空間來區分彼此。命名空間也藉由明確地區分是哪個模組" +"在實作一個函式,來增進可讀性及可維護性。例如,寫出 :func:`random.seed` 或 :" +"func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" +"`itertools` 模組在實作。" -#: ../../glossary.rst:982 +#: ../../glossary.rst:984 msgid "namespace package" msgstr "namespace package(命名空間套件)" -#: ../../glossary.rst:984 +#: ../../glossary.rst:986 msgid "" "A :term:`package` which serves only as a container for subpackages. " "Namespace packages may have no physical representation, and specifically are " @@ -2263,7 +2246,7 @@ msgstr "" "名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:`regular " "package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" -#: ../../glossary.rst:989 +#: ../../glossary.rst:991 msgid "" "Namespace packages allow several individually installable packages to have a " "common parent package. Otherwise, it is recommended to use a :term:`regular " @@ -2272,20 +2255,20 @@ msgstr "" "命名空間套件允許數個可獨立安裝的套件擁有一個共同的父套件。除此之外,建議使" "用 :term:`regular package`。" -#: ../../glossary.rst:992 +#: ../../glossary.rst:994 msgid "" "For more information, see :pep:`420` and :ref:`reference-namespace-package`." msgstr "更多資訊,請參閱 :pep:`420` 和 :ref:`reference-namespace-package`。" -#: ../../glossary.rst:994 +#: ../../glossary.rst:996 msgid "See also :term:`module`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:995 +#: ../../glossary.rst:997 msgid "nested scope" msgstr "nested scope(巢狀作用域)" -#: ../../glossary.rst:997 +#: ../../glossary.rst:999 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -2300,41 +2283,39 @@ msgstr "" "寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。:keyword:`nonlocal` 容許" "對外層作用域進行寫入。" -#: ../../glossary.rst:1004 +#: ../../glossary.rst:1006 msgid "new-style class" msgstr "new-style class(新式類別)" -#: ../../glossary.rst:1006 +#: ../../glossary.rst:1008 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " -"versatile features like :attr:`~object.__slots__`, descriptors, " -"properties, :meth:`~object.__getattribute__`, class methods, and static " -"methods." +"versatile features like :attr:`~object.__slots__`, descriptors, properties, :" +"meth:`~object.__getattribute__`, class methods, and static methods." msgstr "" "一個舊名,它是指現在所有的 class 物件所使用的 class 風格。在早期的 Python 版" -"本中,只有新式 class 才能使用 Python 較新的、多樣的功能,像" -"是 :attr:`~object.__slots__`、描述器 (descriptor)、屬性 " -"(property)、:meth:`~object.__getattribute__`、class method(類別方法)和 " -"static method(靜態方法)。" +"本中,只有新式 class 才能使用 Python 較新的、多樣的功能,像是 :attr:`~object." +"__slots__`、描述器 (descriptor)、屬性 (property)、:meth:`~object." +"__getattribute__`、class method(類別方法)和 static method(靜態方法)。" -#: ../../glossary.rst:1011 +#: ../../glossary.rst:1013 msgid "object" msgstr "object(物件)" -#: ../../glossary.rst:1013 +#: ../../glossary.rst:1015 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." msgstr "" -"具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任" -"何 :term:`new-style class`\\ (新式類別)的最終 base class(基底類別)。" +"具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" +"`new-style class`\\ (新式類別)的最終 base class(基底類別)。" -#: ../../glossary.rst:1016 +#: ../../glossary.rst:1018 msgid "optimized scope" msgstr "optimized scope(最佳化作用域)" -#: ../../glossary.rst:1018 +#: ../../glossary.rst:1020 msgid "" "A scope where target local variable names are reliably known to the compiler " "when the code is compiled, allowing optimization of read and write access to " @@ -2345,11 +2326,11 @@ msgid "" "to optimized scopes." msgstr "" -#: ../../glossary.rst:1025 +#: ../../glossary.rst:1027 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:1027 +#: ../../glossary.rst:1029 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with a ``__path__`` " @@ -2359,17 +2340,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:1031 +#: ../../glossary.rst:1033 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace " "package`\\ (命名空間套件)。" -#: ../../glossary.rst:1032 +#: ../../glossary.rst:1034 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:1034 +#: ../../glossary.rst:1036 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " @@ -2379,7 +2360,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:1038 +#: ../../glossary.rst:1040 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " @@ -2390,11 +2371,11 @@ msgstr "" "置 `\\ 或是作為\\ :term:`關鍵字引數 `\\ 被傳遞的引數。這" "是參數的預設類型,例如以下的 *foo* 和 *bar*: ::" -#: ../../glossary.rst:1043 +#: ../../glossary.rst:1045 msgid "def func(foo, bar=None): ..." msgstr "def func(foo, bar=None): ..." -#: ../../glossary.rst:1047 +#: ../../glossary.rst:1049 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2405,11 +2386,11 @@ msgstr "" "式定義的參數列表中包含一個 ``/`` 字元,就可以在該字元前面定義僅限位置參數,例" "如以下的 *posonly1* 和 *posonly2*: ::" -#: ../../glossary.rst:1052 +#: ../../glossary.rst:1054 msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." msgstr "def func(posonly1, posonly2, /, positional_or_keyword): ..." -#: ../../glossary.rst:1056 +#: ../../glossary.rst:1058 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -2422,11 +2403,11 @@ msgstr "" "單純的 ``*`` 字元,就可以在其後方定義僅限關鍵字參數,例如以下的 *kw_only1* " "和 *kw_only2*: ::" -#: ../../glossary.rst:1062 +#: ../../glossary.rst:1064 msgid "def func(arg, *, kw_only1, kw_only2): ..." msgstr "def func(arg, *, kw_only1, kw_only2): ..." -#: ../../glossary.rst:1064 +#: ../../glossary.rst:1066 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2438,11 +2419,11 @@ msgstr "" "數(在已被其他參數接受的任何位置引數之外)。這類參數是透過在其參數名稱字首加" "上 ``*`` 來定義的,例如以下的 *args*: ::" -#: ../../glossary.rst:1070 +#: ../../glossary.rst:1072 msgid "def func(*args, **kwargs): ..." msgstr "def func(*args, **kwargs): ..." -#: ../../glossary.rst:1072 +#: ../../glossary.rst:1074 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2453,29 +2434,29 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:1078 +#: ../../glossary.rst:1080 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:1081 +#: ../../glossary.rst:1083 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " -"the :class:`inspect.Parameter` class, the :ref:`function` section, " -"and :pep:`362`." +"the :class:`inspect.Parameter` class, the :ref:`function` section, and :pep:" +"`362`." msgstr "" "另請參閱術語表的 :term:`argument`\\ (引數)條目、常見問題中的\\ :ref:`引數和" "參數之間的差異 `、:class:`inspect.Parameter` " "class、:ref:`function`\\ 章節,以及 :pep:`362`。" -#: ../../glossary.rst:1085 +#: ../../glossary.rst:1087 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:1087 +#: ../../glossary.rst:1089 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2483,33 +2464,33 @@ msgstr "" "在 :term:`import path`\\ (引入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:1089 +#: ../../glossary.rst:1091 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:1091 +#: ../../glossary.rst:1093 msgid "" -"A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. " -"a :term:`path entry hook`) which knows how to locate modules given " -"a :term:`path entry`." +"A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" +"term:`path entry hook`) which knows how to locate modules given a :term:" +"`path entry`." msgstr "" -"被 :data:`sys.path_hooks` 中的一個可呼叫物件 (callable)(意即一" -"個 :term:`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一" -"個 :term:`path entry`\\ 定位模組。" +"被 :data:`sys.path_hooks` 中的一個可呼叫物件 (callable)(意即一個 :term:" +"`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一個 :term:" +"`path entry`\\ 定位模組。" -#: ../../glossary.rst:1095 +#: ../../glossary.rst:1097 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." msgstr "" -"關於路徑項目尋檢器實作的 method,請參" -"閱 :class:`importlib.abc.PathEntryFinder`。" +"關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." +"PathEntryFinder`。" -#: ../../glossary.rst:1097 +#: ../../glossary.rst:1099 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:1099 +#: ../../glossary.rst:1101 msgid "" "A callable on the :data:`sys.path_hooks` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " @@ -2519,11 +2500,11 @@ msgstr "" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:1102 +#: ../../glossary.rst:1104 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:1104 +#: ../../glossary.rst:1106 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." @@ -2531,33 +2512,33 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) ` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:1106 +#: ../../glossary.rst:1108 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:1108 +#: ../../glossary.rst:1110 msgid "" -"An object representing a file system path. A path-like object is either " -"a :class:`str` or :class:`bytes` object representing a path, or an object " -"implementing the :class:`os.PathLike` protocol. An object that supports " -"the :class:`os.PathLike` protocol can be converted to a :class:`str` " -"or :class:`bytes` file system path by calling the :func:`os.fspath` " -"function; :func:`os.fsdecode` and :func:`os.fsencode` can be used to " -"guarantee a :class:`str` or :class:`bytes` result instead, respectively. " -"Introduced by :pep:`519`." -msgstr "" -"一個表示檔案系統路徑的物件。類路徑物件可以是一個表示路徑的 :class:`str` " -"或 :class:`bytes` 物件,或是一個實作 :class:`os.PathLike` 協定的物件。透過呼" -"叫 :func:`os.fspath` 函式,一個支援 :class:`os.PathLike` 協定的物件可以被轉換" -"為 :class:`str` 或 :class:`bytes` 檔案系統路徑;而 :func:`os.fsdecode` " -"及 :func:`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結" -"果。由 :pep:`519` 引入。" - -#: ../../glossary.rst:1116 +"An object representing a file system path. A path-like object is either a :" +"class:`str` or :class:`bytes` object representing a path, or an object " +"implementing the :class:`os.PathLike` protocol. An object that supports the :" +"class:`os.PathLike` protocol can be converted to a :class:`str` or :class:" +"`bytes` file system path by calling the :func:`os.fspath` function; :func:" +"`os.fsdecode` and :func:`os.fsencode` can be used to guarantee a :class:" +"`str` or :class:`bytes` result instead, respectively. Introduced by :pep:" +"`519`." +msgstr "" +"一個表示檔案系統路徑的物件。類路徑物件可以是一個表示路徑的 :class:`str` 或 :" +"class:`bytes` 物件,或是一個實作 :class:`os.PathLike` 協定的物件。透過呼叫 :" +"func:`os.fspath` 函式,一個支援 :class:`os.PathLike` 協定的物件可以被轉換為 :" +"class:`str` 或 :class:`bytes` 檔案系統路徑;而 :func:`os.fsdecode` 及 :func:" +"`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" +"pep:`519` 引入。" + +#: ../../glossary.rst:1118 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:1118 +#: ../../glossary.rst:1120 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2568,7 +2549,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:1124 +#: ../../glossary.rst:1126 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2580,15 +2561,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:1130 +#: ../../glossary.rst:1132 msgid "See :pep:`1`." msgstr "請參閱 :pep:`1`。" -#: ../../glossary.rst:1131 +#: ../../glossary.rst:1133 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:1133 +#: ../../glossary.rst:1135 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." @@ -2596,15 +2577,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:1135 +#: ../../glossary.rst:1137 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:1138 +#: ../../glossary.rst:1140 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:1140 +#: ../../glossary.rst:1142 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2620,7 +2601,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:1149 +#: ../../glossary.rst:1151 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " @@ -2629,7 +2610,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:1153 +#: ../../glossary.rst:1155 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2638,19 +2619,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:1156 +#: ../../glossary.rst:1158 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:1158 +#: ../../glossary.rst:1160 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:1159 +#: ../../glossary.rst:1161 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1161 +#: ../../glossary.rst:1163 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " @@ -2659,11 +2640,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:1164 +#: ../../glossary.rst:1166 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:1166 +#: ../../glossary.rst:1168 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -2673,11 +2654,11 @@ msgid "" "Python sometimes use a numerical counter instead::" msgstr "" "一個想法或一段程式碼,它應用了 Python 語言最常見的慣用語,而不是使用其他語言" -"常見的概念來實作程式碼。例如,Python 中常見的一種習慣用法,是使用一" -"個 :keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並" -"沒有這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" +"常見的概念來實作程式碼。例如,Python 中常見的一種習慣用法,是使用一個 :" +"keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並沒有" +"這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" -#: ../../glossary.rst:1173 +#: ../../glossary.rst:1175 msgid "" "for i in range(len(food)):\n" " print(food[i])" @@ -2685,11 +2666,11 @@ msgstr "" "for i in range(len(food)):\n" " print(food[i])" -#: ../../glossary.rst:1176 +#: ../../glossary.rst:1178 msgid "As opposed to the cleaner, Pythonic method::" msgstr "相較之下,以下方法更簡潔、更具有 Python 風格: ::" -#: ../../glossary.rst:1178 +#: ../../glossary.rst:1180 msgid "" "for piece in food:\n" " print(piece)" @@ -2697,11 +2678,11 @@ msgstr "" "for piece in food:\n" " print(piece)" -#: ../../glossary.rst:1180 +#: ../../glossary.rst:1182 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:1182 +#: ../../glossary.rst:1184 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -2712,7 +2693,7 @@ msgstr "" "或 method 的「路徑」,如 :pep:`3155` 中的定義。對於頂層的函式和 class 而言," "限定名稱與其物件名稱相同: ::" -#: ../../glossary.rst:1187 +#: ../../glossary.rst:1189 msgid "" ">>> class C:\n" "... class D:\n" @@ -2738,16 +2719,16 @@ msgstr "" ">>> C.D.meth.__qualname__\n" "'C.D.meth'" -#: ../../glossary.rst:1199 +#: ../../glossary.rst:1201 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " -"dotted path to the module, including any parent packages, e.g. " -"``email.mime.text``::" +"dotted path to the module, including any parent packages, e.g. ``email.mime." +"text``::" msgstr "" "當用於引用模組時,*完全限定名稱 (fully qualified name)* 是表示該模組的完整點" "分隔路徑,包括任何的父套件,例如 ``email.mime.text``: ::" -#: ../../glossary.rst:1203 +#: ../../glossary.rst:1205 msgid "" ">>> import email.mime.text\n" ">>> email.mime.text.__name__\n" @@ -2757,11 +2738,11 @@ msgstr "" ">>> email.mime.text.__name__\n" "'email.mime.text'" -#: ../../glossary.rst:1206 +#: ../../glossary.rst:1208 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:1208 +#: ../../glossary.rst:1210 msgid "" "The number of references to an object. When the reference count of an " "object drops to zero, it is deallocated. Some objects are :term:`immortal` " @@ -2774,10 +2755,10 @@ msgstr "" "對於一個物件的參照次數。當一個物件的參照計數下降到零時,它會被解除配置 " "(deallocated)。有些物件是「\\ :term:`不滅的 ` (immortal)」並擁有不" "會被改變的參照計數,也因此永遠不會被解除配置。參照計數通常在 Python 程式碼中" -"看不到,但它卻是 :term:`CPython` 實作的一個關鍵元素。程式設計師可以呼" -"叫 :func:`~sys.getrefcount` 函式來回傳一個特定物件的參照計數。" +"看不到,但它卻是 :term:`CPython` 實作的一個關鍵元素。程式設計師可以呼叫 :" +"func:`~sys.getrefcount` 函式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:1217 +#: ../../glossary.rst:1219 msgid "" "In :term:`CPython`, reference counts are not considered to be stable or well-" "defined values; the number of references to an object, and how that number " @@ -2786,39 +2767,39 @@ msgstr "" "在 :term:`CPython` 中,參照計數不被視為穩定或明確定義的值;對物件的參照數量," "以及該數量如何受到 Python 程式碼的影響,在不同版本之間可能會有所不同。" -#: ../../glossary.rst:1221 +#: ../../glossary.rst:1223 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:1223 +#: ../../glossary.rst:1225 msgid "" -"A traditional :term:`package`, such as a directory containing an " -"``__init__.py`` file." +"A traditional :term:`package`, such as a directory containing an ``__init__." +"py`` file." msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:1226 +#: ../../glossary.rst:1228 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:1227 +#: ../../glossary.rst:1229 msgid "REPL" msgstr "REPL" -#: ../../glossary.rst:1229 +#: ../../glossary.rst:1231 msgid "" -"An acronym for the \"read–eval–print loop\", another name for " -"the :term:`interactive` interpreter shell." +"An acronym for the \"read–eval–print loop\", another name for the :term:" +"`interactive` interpreter shell." msgstr "" "「read-eval-print 迴圈 (read–eval–print loop)」的縮寫,是\\ :term:`互動式 " "`\\ 直譯器 shell 的另一個名稱。" -#: ../../glossary.rst:1231 +#: ../../glossary.rst:1233 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1233 +#: ../../glossary.rst:1235 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2831,66 +2812,66 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1238 +#: ../../glossary.rst:1240 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1240 +#: ../../glossary.rst:1242 msgid "" "An :term:`iterable` which supports efficient element access using integer " -"indices via the :meth:`~object.__getitem__` special method and defines " -"a :meth:`~object.__len__` method that returns the length of the sequence. " -"Some built-in sequence types " -"are :class:`list`, :class:`str`, :class:`tuple`, and :class:`bytes`. Note " -"that :class:`dict` also supports :meth:`~object.__getitem__` and :meth:`!" -"__len__`, but is considered a mapping rather than a sequence because the " -"lookups use arbitrary :term:`hashable` keys rather than integers." +"indices via the :meth:`~object.__getitem__` special method and defines a :" +"meth:`~object.__len__` method that returns the length of the sequence. Some " +"built-in sequence types are :class:`list`, :class:`str`, :class:`tuple`, " +"and :class:`bytes`. Note that :class:`dict` also supports :meth:`~object." +"__getitem__` and :meth:`!__len__`, but is considered a mapping rather than a " +"sequence because the lookups use arbitrary :term:`hashable` keys rather than " +"integers." msgstr "" "一個 :term:`iterable`\\ (可疊代物件),它透過 :meth:`~object.__getitem__` " "special method(特殊方法),使用整數索引來支援高效率的元素存取,並定義了一" -"個 :meth:`~object.__len__` method 來回傳該序列的長度。一些內建序列型別包" -"括 :class:`list`、:class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖" -"然 :class:`dict` 也支援 :meth:`~object.__getitem__` 和 :meth:`!__len__`,但它" -"被視為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`hashable` " -"鍵,而不是整數。" +"個 :meth:`~object.__len__` method 來回傳該序列的長度。一些內建序列型別包括 :" +"class:`list`、:class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖然 :" +"class:`dict` 也支援 :meth:`~object.__getitem__` 和 :meth:`!__len__`,但它被視" +"為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`hashable` 鍵," +"而不是整數。" -#: ../../glossary.rst:1249 +#: ../../glossary.rst:1251 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " -"richer interface that goes beyond just :meth:`~object.__getitem__` " -"and :meth:`~object.__len__`, " -"adding :meth:`~sequence.count`, :meth:`~sequence.index`, :meth:`~object.__contains__`, " -"and :meth:`~object.__reversed__`. Types that implement this expanded " -"interface can be registered explicitly using :func:`~abc.ABCMeta.register`. " -"For more documentation on sequence methods generally, see :ref:`Common " -"Sequence Operations `." +"richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" +"`~object.__len__`, adding :meth:`~sequence.count`, :meth:`~sequence.index`, :" +"meth:`~object.__contains__`, and :meth:`~object.__reversed__`. Types that " +"implement this expanded interface can be registered explicitly using :func:" +"`~abc.ABCMeta.register`. For more documentation on sequence methods " +"generally, see :ref:`Common Sequence Operations `." msgstr "" "抽象基底類別 (abstract base class) :class:`collections.abc.Sequence` 定義了一" -"個更加豐富的介面,並不僅止於 :meth:`~object.__getitem__` " -"和 :meth:`~object.__len__`,還增加了 :meth:`~sequence.count`、:meth:`~sequence.index`、:meth:`~object.__contains__` 和 :meth:`~object.__reversed__`。實作此" -"擴充介面的型別,可以使用 :func:`~abc.ABCMeta.register` 被明確地註冊。更多關於" -"序列方法的文件,請見\\ :ref:`常見序列操作 `。" +"個更加豐富的介面,並不僅止於 :meth:`~object.__getitem__` 和 :meth:`~object." +"__len__`,還增加了 :meth:`~sequence.count`、:meth:`~sequence.index`、:meth:" +"`~object.__contains__` 和 :meth:`~object.__reversed__`。實作此擴充介面的型" +"別,可以使用 :func:`~abc.ABCMeta.register` 被明確地註冊。更多關於序列方法的文" +"件,請見\\ :ref:`常見序列操作 `。" -#: ../../glossary.rst:1259 +#: ../../glossary.rst:1261 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1261 +#: ../../glossary.rst:1263 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " -"not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. " -"See :ref:`comprehensions`." +"not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. See :ref:" +"`comprehensions`." msgstr "" "一種緊密的方法,用來處理一個可疊代物件中的全部或部分元素,並將處理結果以一個 " "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" "個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:1265 +#: ../../glossary.rst:1267 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1267 +#: ../../glossary.rst:1269 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -2898,11 +2879,11 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1269 +#: ../../glossary.rst:1271 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1271 +#: ../../glossary.rst:1273 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -2914,11 +2895,11 @@ msgstr "" "之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" "用 :class:`slice` 物件。" -#: ../../glossary.rst:1275 +#: ../../glossary.rst:1277 msgid "soft deprecated" msgstr "soft deprecated(軟性棄用)" -#: ../../glossary.rst:1277 +#: ../../glossary.rst:1279 msgid "" "A soft deprecated API should not be used in new code, but it is safe for " "already existing code to use it. The API remains documented and tested, but " @@ -2927,13 +2908,13 @@ msgstr "" "被軟性棄用的 API 代表不應再用於新程式碼中,但在現有程式碼中繼續使用它仍會是安" "全的。API 仍會以文件記錄並會被測試,但不會被繼續改進。" -#: ../../glossary.rst:1281 +#: ../../glossary.rst:1283 msgid "" "Soft deprecation, unlike normal deprecation, does not plan on removing the " "API and will not emit warnings." msgstr "與正常棄用不同,軟性棄用沒有刪除 API 的規劃,也不會發出警告。" -#: ../../glossary.rst:1284 +#: ../../glossary.rst:1286 msgid "" "See `PEP 387: Soft Deprecation `_." @@ -2941,39 +2922,39 @@ msgstr "" "請參閱 `PEP 387:軟性棄用 `_。" -#: ../../glossary.rst:1286 +#: ../../glossary.rst:1288 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1290 +#: ../../glossary.rst:1292 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " -"with double underscores. Special methods are documented " -"in :ref:`specialnames`." +"with double underscores. Special methods are documented in :ref:" +"`specialnames`." msgstr "" "一種會被 Python 自動呼叫的 method,用於對某種型別執行某種運算,例如加法。這" -"種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在" -"\\ :ref:`specialnames`\\ 中有詳細說明。" +"種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" +"`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1294 +#: ../../glossary.rst:1296 msgid "standard library" msgstr "標準函式庫" -#: ../../glossary.rst:1296 +#: ../../glossary.rst:1298 msgid "" -"The collection of :term:`packages `, :term:`modules ` " -"and :term:`extension modules ` distributed as a part of " -"the official Python interpreter package. The exact membership of the " -"collection may vary based on platform, available system libraries, or other " -"criteria. Documentation can be found at :ref:`library-index`." +"The collection of :term:`packages `, :term:`modules ` and :" +"term:`extension modules ` distributed as a part of the " +"official Python interpreter package. The exact membership of the collection " +"may vary based on platform, available system libraries, or other criteria. " +"Documentation can be found at :ref:`library-index`." msgstr "" "包含\\ :term:`套件 `、:term:`模組 `\\ 和\\ :term:`擴充模組 " "`\\ 的集合,它們是作為官方 Python 直譯器套件的一部分來發" "行。該集合的成員可能會因平台、可用的系統函式庫或其他條件而有所不同。相關文件" "可以在 :ref:`library-index` 中找到。" -#: ../../glossary.rst:1302 +#: ../../glossary.rst:1304 msgid "" "See also :data:`sys.stdlib_module_names` for a list of all possible standard " "library module names." @@ -2981,58 +2962,58 @@ msgstr "" "請參閱 :data:`sys.stdlib_module_names` 以取得所有可能的標準函式庫模組名稱的列" "表。" -#: ../../glossary.rst:1304 +#: ../../glossary.rst:1306 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1306 +#: ../../glossary.rst:1308 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " -"an :term:`expression` or one of several constructs with a keyword, such " -"as :keyword:`if`, :keyword:`while` or :keyword:`for`." +"an :term:`expression` or one of several constructs with a keyword, such as :" +"keyword:`if`, :keyword:`while` or :keyword:`for`." msgstr "" -"陳述式是一個套組(suite,一個程式碼「區塊」)中的一部分。陳述式可以是一" -"個 :term:`expression`\\ (運算式),或是含有關鍵字(例" -"如 :keyword:`if`、:keyword:`while` 或 :keyword:`for`\\ )的多種結構之一。" +"陳述式是一個套組(suite,一個程式碼「區塊」)中的一部分。陳述式可以是一個 :" +"term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`、:keyword:" +"`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1309 +#: ../../glossary.rst:1311 msgid "static type checker" msgstr "static type checker(靜態型別檢查器)" -#: ../../glossary.rst:1311 +#: ../../glossary.rst:1313 msgid "" "An external tool that reads Python code and analyzes it, looking for issues " -"such as incorrect types. See also :term:`type hints ` and " -"the :mod:`typing` module." +"such as incorrect types. See also :term:`type hints ` and the :" +"mod:`typing` module." msgstr "" "會讀取 Python 程式碼並分析的外部工具,能夠找出錯誤,像是使用了不正確的型別。" "另請參閱\\ :term:`型別提示 (type hints) ` 以及 :mod:`typing` 模" "組。" -#: ../../glossary.rst:1314 +#: ../../glossary.rst:1316 msgid "stdlib" msgstr "stdlib(標準函式庫)" -#: ../../glossary.rst:1316 +#: ../../glossary.rst:1318 msgid "An abbreviation of :term:`standard library`." msgstr ":term:`standard library` 的縮寫。" -#: ../../glossary.rst:1317 +#: ../../glossary.rst:1319 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1319 +#: ../../glossary.rst:1321 msgid "" "In Python's C API, a strong reference is a reference to an object which is " "owned by the code holding the reference. The strong reference is taken by " -"calling :c:func:`Py_INCREF` when the reference is created and released " -"with :c:func:`Py_DECREF` when the reference is deleted." +"calling :c:func:`Py_INCREF` when the reference is created and released with :" +"c:func:`Py_DECREF` when the reference is deleted." msgstr "" "在 Python 的 C API 中,強參照是對物件的參照,該物件為持有該參照的程式碼所擁" -"有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透" -"過 :c:func:`Py_DECREF` 釋放強參照。" +"有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" +"func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1325 +#: ../../glossary.rst:1327 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -3042,40 +3023,41 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1330 +#: ../../glossary.rst:1332 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1331 +#: ../../glossary.rst:1333 msgid "t-string" msgstr "t-string(t 字串)" -#: ../../glossary.rst:1332 +#: ../../glossary.rst:1334 msgid "t-strings" msgstr "t-strings(t 字串)" -#: ../../glossary.rst:1334 +#: ../../glossary.rst:1336 msgid "" "String literals prefixed with ``t`` or ``T`` are commonly called \"t-" "strings\" which is short for :ref:`template string literals `." msgstr "" -"以 ``t`` 或 ``T`` 為前綴的字串文本通常被稱為「t 字串」,它是\\ :ref:`模板" -"化的字串文本 `\\ 的縮寫。" +"以 ``t`` 或 ``T`` 為前綴的字串文本通常被稱為「t 字串」,它是\\ :ref:`模板化的" +"字串文本 `\\ 的縮寫。" -#: ../../glossary.rst:1337 +#: ../../glossary.rst:1339 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1339 +#: ../../glossary.rst:1341 msgid "" "A string in Python is a sequence of Unicode code points (in range " "``U+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " "serialized as a sequence of bytes." msgstr "" -"Python 中的字串是一個 Unicode 編碼位置 (code point) 的序列(範圍在 ``U+0000`` -- " -"``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一個位元組序列。" +"Python 中的字串是一個 Unicode 編碼位置 (code point) 的序列(範圍在 " +"``U+0000`` -- ``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一" +"個位元組序列。" -#: ../../glossary.rst:1343 +#: ../../glossary.rst:1345 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -3083,7 +3065,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1346 +#: ../../glossary.rst:1348 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -3091,60 +3073,58 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1349 +#: ../../glossary.rst:1351 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1351 +#: ../../glossary.rst:1353 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " -"text file actually accesses a byte-oriented datastream and handles " -"the :term:`text encoding` automatically. Examples of text files are files " -"opened in text mode (``'r'`` or " -"``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, and instances " -"of :class:`io.StringIO`." +"text file actually accesses a byte-oriented datastream and handles the :term:" +"`text encoding` automatically. Examples of text files are files opened in " +"text mode (``'r'`` or ``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, and " +"instances of :class:`io.StringIO`." msgstr "" "一個能夠讀取和寫入 :class:`str` 物件的一個 :term:`file object`\\ (檔案物" "件)。通常,文字檔案實際上是存取位元組導向的資料流 (byte-oriented " "datastream) 並會自動處理 :term:`text encoding`\\ (文字編碼)。文字檔案的例子" -"有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔" -"案、:data:`sys.stdin`、:data:`sys.stdout` 以及 :class:`io.StringIO` 的實例。" +"有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、:data:`sys.stdin`、:data:" +"`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1358 +#: ../../glossary.rst:1360 msgid "" -"See also :term:`binary file` for a file object able to read and " -"write :term:`bytes-like objects `." +"See also :term:`binary file` for a file object able to read and write :term:" +"`bytes-like objects `." msgstr "" -"另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入" -"\\ :term:`類位元組串物件 (bytes-like object) ` 的檔案物" -"件。" +"另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" +"term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1360 +#: ../../glossary.rst:1362 msgid "thread state" msgstr "" -#: ../../glossary.rst:1363 +#: ../../glossary.rst:1365 msgid "" "The information used by the :term:`CPython` runtime to run in an OS thread. " "For example, this includes the current exception, if any, and the state of " "the bytecode interpreter." msgstr "" -#: ../../glossary.rst:1367 +#: ../../glossary.rst:1369 msgid "" "Each thread state is bound to a single OS thread, but threads may have many " "thread states available. At most, one of them may be :term:`attached " "` at once." msgstr "" -#: ../../glossary.rst:1371 +#: ../../glossary.rst:1373 msgid "" "An :term:`attached thread state` is required to call most of Python's C API, " "unless a function explicitly documents otherwise. The bytecode interpreter " "only runs under an attached thread state." msgstr "" -#: ../../glossary.rst:1375 +#: ../../glossary.rst:1377 msgid "" "Each thread state belongs to a single interpreter, but each interpreter may " "have many thread states, including multiple for the same OS thread. Thread " @@ -3153,17 +3133,17 @@ msgid "" "given moment." msgstr "" -#: ../../glossary.rst:1381 +#: ../../glossary.rst:1383 msgid "" "See :ref:`Thread State and the Global Interpreter Lock ` for more " "information." msgstr "" -#: ../../glossary.rst:1383 +#: ../../glossary.rst:1385 msgid "token" msgstr "token" -#: ../../glossary.rst:1386 +#: ../../glossary.rst:1388 msgid "" "A small unit of source code, generated by the :ref:`lexical analyzer " "` (also called the *tokenizer*). Names, numbers, strings, " @@ -3172,19 +3152,19 @@ msgstr "" "原始碼的小單位,由 :ref:`詞法分析器 ` (也稱為 *tokenizer*)產生。名" "稱、數字、字串、運算子、換行符號等都以 token 表示。" -#: ../../glossary.rst:1391 +#: ../../glossary.rst:1393 msgid "" -"The :mod:`tokenize` module exposes Python's lexical analyzer. " -"The :mod:`token` module contains information on the various types of tokens." +"The :mod:`tokenize` module exposes Python's lexical analyzer. The :mod:" +"`token` module contains information on the various types of tokens." msgstr "" ":mod:`tokenize` 模組公開了 Python 的詞法分析器。:mod:`token` 模組包含各種 " "token 類型的資訊。" -#: ../../glossary.rst:1394 +#: ../../glossary.rst:1396 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1396 +#: ../../glossary.rst:1398 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -3199,37 +3179,36 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1403 +#: ../../glossary.rst:1405 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1405 +#: ../../glossary.rst:1407 msgid "" "The type of a Python object determines what kind of object it is; every " -"object has a type. An object's type is accessible as " -"its :attr:`~object.__class__` attribute or can be retrieved with " -"``type(obj)``." +"object has a type. An object's type is accessible as its :attr:`~object." +"__class__` attribute or can be retrieved with ``type(obj)``." msgstr "" "一個 Python 物件的型別決定了它是什麼類型的物件;每個物件都有一個型別。一個物" "件的型別可以用它的 :attr:`~object.__class__` 屬性來存取,或以 ``type(obj)`` " "來檢索。" -#: ../../glossary.rst:1409 +#: ../../glossary.rst:1411 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1411 +#: ../../glossary.rst:1413 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1413 +#: ../../glossary.rst:1415 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" msgstr "" "型別別名對於簡化\\ :term:`型別提示 (type hint) ` 很有用。例如: ::" -#: ../../glossary.rst:1416 +#: ../../glossary.rst:1418 msgid "" "def remove_gray_shades(\n" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" @@ -3239,11 +3218,11 @@ msgstr "" " colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" " pass" -#: ../../glossary.rst:1420 +#: ../../glossary.rst:1422 msgid "could be made more readable like this::" msgstr "可以寫成這樣,更具有可讀性: ::" -#: ../../glossary.rst:1422 +#: ../../glossary.rst:1424 msgid "" "Color = tuple[int, int, int]\n" "\n" @@ -3255,15 +3234,15 @@ msgstr "" "def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" " pass" -#: ../../glossary.rst:1427 ../../glossary.rst:1441 +#: ../../glossary.rst:1429 ../../glossary.rst:1443 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1428 +#: ../../glossary.rst:1430 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1430 +#: ../../glossary.rst:1432 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -3271,7 +3250,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1433 +#: ../../glossary.rst:1435 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to :term:`static type checkers `. They can also aid " @@ -3281,45 +3260,45 @@ msgstr "" "(static type checkers) `\\ 很有用,並能協助 IDE 完成程式" "碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1437 +#: ../../glossary.rst:1439 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." msgstr "" -"全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使" -"用 :func:`typing.get_type_hints` 來存取。" +"全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" +"`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1442 +#: ../../glossary.rst:1444 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1444 +#: ../../glossary.rst:1446 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " "Windows convention ``'\\r\\n'``, and the old Macintosh convention " -"``'\\r'``. See :pep:`278` and :pep:`3116`, as well " -"as :func:`bytes.splitlines` for an additional use." +"``'\\r'``. See :pep:`278` and :pep:`3116`, as well as :func:`bytes." +"splitlines` for an additional use." msgstr "" "一種解譯文字流 (text stream) 的方式,會將以下所有的情況識別為一行的結束:" "Unix 行尾慣例 ``'\\n'``、Windows 慣例 ``'\\r\\n'`` 和舊的 Macintosh 慣例 " -"``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用" -"於 :func:`bytes.splitlines` 的附加用途。" +"``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." +"splitlines` 的附加用途。" -#: ../../glossary.rst:1449 +#: ../../glossary.rst:1451 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1451 +#: ../../glossary.rst:1453 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1453 +#: ../../glossary.rst:1455 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "註釋變數或 class 屬性時,賦值是選擇性的: ::" -#: ../../glossary.rst:1455 +#: ../../glossary.rst:1457 msgid "" "class C:\n" " field: 'annotation'" @@ -3327,7 +3306,7 @@ msgstr "" "class C:\n" " field: 'annotation'" -#: ../../glossary.rst:1458 +#: ../../glossary.rst:1460 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -3335,15 +3314,15 @@ msgstr "" "變數註釋通常用於\\ :term:`型別提示 (type hint) `:例如,這個變數預" "期會取得 :class:`int`\\ (整數)值: ::" -#: ../../glossary.rst:1462 +#: ../../glossary.rst:1464 msgid "count: int = 0" msgstr "count: int = 0" -#: ../../glossary.rst:1464 +#: ../../glossary.rst:1466 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1466 +#: ../../glossary.rst:1468 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -3352,11 +3331,11 @@ msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," "皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1470 +#: ../../glossary.rst:1472 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1472 +#: ../../glossary.rst:1474 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -3367,38 +3346,38 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1477 +#: ../../glossary.rst:1479 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1478 +#: ../../glossary.rst:1480 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1480 +#: ../../glossary.rst:1482 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." msgstr "" -"一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行" -"由 :term:`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" +"一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" +"`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1482 +#: ../../glossary.rst:1484 msgid "walrus operator" msgstr "walrus operator(海象運算子)" -#: ../../glossary.rst:1484 +#: ../../glossary.rst:1486 msgid "" "A light-hearted way to refer to the :ref:`assignment expression ` operator ``:=`` because it looks a bit like a walrus if you " "turn your head." msgstr "" -#: ../../glossary.rst:1487 +#: ../../glossary.rst:1489 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1489 +#: ../../glossary.rst:1491 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -3407,18 +3386,29 @@ msgstr "" "Python 設計原則與哲學的列表,其內容有助於理解和使用此語言。此列表可以透過在互" "動式提式字元後輸入「``import this``」來找到它。" -#: ../../glossary.rst:319 +#: ../../glossary.rst:24 +msgid "..." +msgstr "..." + +#: ../../glossary.rst:24 +msgid "ellipsis literal" +msgstr "刪節號字面值" + +#: ../../glossary.rst:321 msgid "C-contiguous" msgstr "C-contiguous(C 連續的)" -#: ../../glossary.rst:319 +#: ../../glossary.rst:321 msgid "Fortran contiguous" msgstr "Fortran contiguous(Fortran 連續的)" -#: ../../glossary.rst:882 +#: ../../glossary.rst:884 msgid "magic" msgstr "magic" -#: ../../glossary.rst:1288 +#: ../../glossary.rst:1290 msgid "special" msgstr "special" + +#~ msgid "The :const:`Ellipsis` built-in constant." +#~ msgstr "內建常數 :const:`Ellipsis`。" diff --git a/howto/enum.po b/howto/enum.po index 275ee13dff..36d792394f 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -45,6 +45,15 @@ msgid "" "... SATURDAY = 6\n" "... SUNDAY = 7" msgstr "" +">>> from enum import Enum\n" +">>> class Weekday(Enum):\n" +"... MONDAY = 1\n" +"... TUESDAY = 2\n" +"... WEDNESDAY = 3\n" +"... THURSDAY = 4\n" +"... FRIDAY = 5\n" +"... SATURDAY = 6\n" +"... SUNDAY = 7" #: ../../howto/enum.rst:28 msgid "Or perhaps the RGB primary colors::" @@ -58,6 +67,11 @@ msgid "" "... GREEN = 2\n" "... BLUE = 3" msgstr "" +">>> from enum import Enum\n" +">>> class Color(Enum):\n" +"... RED = 1\n" +"... GREEN = 2\n" +"... BLUE = 3" #: ../../howto/enum.rst:36 msgid "" @@ -315,15 +329,15 @@ msgstr "" #: ../../howto/enum.rst:154 msgid "" ">>> chores_for_ethan = {\n" -"... 'feed the cat': Weekday.MONDAY | Weekday.WEDNESDAY | " -"Weekday.FRIDAY,\n" +"... 'feed the cat': Weekday.MONDAY | Weekday.WEDNESDAY | Weekday." +"FRIDAY,\n" "... 'do the dishes': Weekday.TUESDAY | Weekday.THURSDAY,\n" "... 'answer SO questions': Weekday.SATURDAY,\n" "... }" msgstr "" ">>> chores_for_ethan = {\n" -"... 'feed the cat': Weekday.MONDAY | Weekday.WEDNESDAY | " -"Weekday.FRIDAY,\n" +"... 'feed the cat': Weekday.MONDAY | Weekday.WEDNESDAY | Weekday." +"FRIDAY,\n" "... 'do the dishes': Weekday.TUESDAY | Weekday.THURSDAY,\n" "... 'answer SO questions': Weekday.SATURDAY,\n" "... }" @@ -386,8 +400,8 @@ msgstr "" #: ../../howto/enum.rst:191 msgid "" -"Sometimes it's useful to access members in enumerations programmatically " -"(i.e. situations where ``Color.RED`` won't do because the exact color is not " +"Sometimes it's useful to access members in enumerations programmatically (i." +"e. situations where ``Color.RED`` won't do because the exact color is not " "known at program-writing time). ``Enum`` allows such access::" msgstr "" @@ -627,16 +641,16 @@ msgid "" ">>> list(Shape)\n" "[, , ]\n" ">>> list(Weekday)\n" -"[, , , " -", , , " -"]" +"[, , , , , , ]" msgstr "" ">>> list(Shape)\n" "[, , ]\n" ">>> list(Weekday)\n" -"[, , , " -", , , " -"]" +"[, , , , , , ]" #: ../../howto/enum.rst:319 msgid "" @@ -839,25 +853,24 @@ msgid "" "The rules for what is allowed are as follows: names that start and end with " "a single underscore are reserved by enum and cannot be used; all other " "attributes defined within an enumeration will become members of this " -"enumeration, with the exception of special methods " -"(:meth:`~object.__str__`, :meth:`~object.__add__`, etc.), descriptors " -"(methods are also descriptors), and variable names listed " -"in :attr:`~Enum._ignore_`." +"enumeration, with the exception of special methods (:meth:`~object." +"__str__`, :meth:`~object.__add__`, etc.), descriptors (methods are also " +"descriptors), and variable names listed in :attr:`~Enum._ignore_`." msgstr "" #: ../../howto/enum.rst:432 msgid "" -"Note: if your enumeration defines :meth:`~object.__new__` and/" -"or :meth:`~object.__init__`, any value(s) given to the enum member will be " -"passed into those methods. See `Planet`_ for an example." +"Note: if your enumeration defines :meth:`~object.__new__` and/or :meth:" +"`~object.__init__`, any value(s) given to the enum member will be passed " +"into those methods. See `Planet`_ for an example." msgstr "" #: ../../howto/enum.rst:438 msgid "" "The :meth:`~object.__new__` method, if defined, is used during creation of " "the Enum members; it is then replaced by Enum's :meth:`~object.__new__` " -"which is used after class creation for lookup of existing members. " -"See :ref:`new-vs-init` for more details." +"which is used after class creation for lookup of existing members. See :ref:" +"`new-vs-init` for more details." msgstr "" #: ../../howto/enum.rst:445 @@ -939,8 +952,8 @@ msgstr "" #: ../../howto/enum.rst:486 msgid "" -"When inheriting from a :class:`~dataclasses.dataclass`, " -"the :meth:`~Enum.__repr__` omits the inherited class' name. For example::" +"When inheriting from a :class:`~dataclasses.dataclass`, the :meth:`~Enum." +"__repr__` omits the inherited class' name. For example::" msgstr "" #: ../../howto/enum.rst:489 @@ -1041,10 +1054,9 @@ msgstr "" #: ../../howto/enum.rst:547 msgid "" -"It is possible to modify how enum members are pickled/unpickled by " -"defining :meth:`~object.__reduce_ex__` in the enumeration class. The " -"default method is by-value, but enums with complicated values may want to " -"use by-name::" +"It is possible to modify how enum members are pickled/unpickled by defining :" +"meth:`~object.__reduce_ex__` in the enumeration class. The default method " +"is by-value, but enums with complicated values may want to use by-name::" msgstr "" #: ../../howto/enum.rst:551 @@ -1153,10 +1165,10 @@ msgstr "" #: ../../howto/enum.rst:611 msgid "" -"The new pickle protocol 4 also, in some circumstances, relies " -"on :attr:`~type.__qualname__` being set to the location where pickle will be " -"able to find the class. For example, if the class was made available in " -"class SomeData in the global scope::" +"The new pickle protocol 4 also, in some circumstances, relies on :attr:" +"`~type.__qualname__` being set to the location where pickle will be able to " +"find the class. For example, if the class was made available in class " +"SomeData in the global scope::" msgstr "" #: ../../howto/enum.rst:616 @@ -1259,10 +1271,10 @@ msgstr "IntEnum" #: ../../howto/enum.rst:667 msgid "" -"The first variation of :class:`Enum` that is provided is also a subclass " -"of :class:`int`. Members of an :class:`IntEnum` can be compared to " -"integers; by extension, integer enumerations of different types can also be " -"compared to each other::" +"The first variation of :class:`Enum` that is provided is also a subclass of :" +"class:`int`. Members of an :class:`IntEnum` can be compared to integers; by " +"extension, integer enumerations of different types can also be compared to " +"each other::" msgstr "" #: ../../howto/enum.rst:672 @@ -1371,9 +1383,9 @@ msgid "" "The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " "based on :class:`int`. The difference being :class:`IntFlag` members can be " "combined using the bitwise operators (&, \\|, ^, ~) and the result is still " -"an :class:`IntFlag` member, if possible. " -"Like :class:`IntEnum`, :class:`IntFlag` members are also integers and can be " -"used wherever an :class:`int` is used." +"an :class:`IntFlag` member, if possible. Like :class:`IntEnum`, :class:" +"`IntFlag` members are also integers and can be used wherever an :class:`int` " +"is used." msgstr "" #: ../../howto/enum.rst:733 @@ -1463,8 +1475,8 @@ msgstr "" #: ../../howto/enum.rst:781 msgid "" "Another important difference between :class:`IntFlag` and :class:`Enum` is " -"that if no flags are set (the value is 0), its boolean evaluation " -"is :data:`False`::" +"that if no flags are set (the value is 0), its boolean evaluation is :data:" +"`False`::" msgstr "" #: ../../howto/enum.rst:784 @@ -1532,10 +1544,10 @@ msgstr "Flag" #: ../../howto/enum.rst:817 msgid "" "The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " -"members can be combined using the bitwise operators (&, \\|, ^, ~). " -"Unlike :class:`IntFlag`, they cannot be combined with, nor compared against, " -"any other :class:`Flag` enumeration, nor :class:`int`. While it is possible " -"to specify the values directly it is recommended to use :class:`auto` as the " +"members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" +"class:`IntFlag`, they cannot be combined with, nor compared against, any " +"other :class:`Flag` enumeration, nor :class:`int`. While it is possible to " +"specify the values directly it is recommended to use :class:`auto` as the " "value and let :class:`Flag` select an appropriate value." msgstr "" @@ -1644,10 +1656,10 @@ msgid "" "For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " "recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " "promises of an enumeration (by being comparable to integers, and thus by " -"transitivity to other unrelated enumerations). :class:`IntEnum` " -"and :class:`IntFlag` should be used only in cases where :class:`Enum` " -"and :class:`Flag` will not do; for example, when integer constants are " -"replaced with enumerations, or for interoperability with other systems." +"transitivity to other unrelated enumerations). :class:`IntEnum` and :class:" +"`IntFlag` should be used only in cases where :class:`Enum` and :class:`Flag` " +"will not do; for example, when integer constants are replaced with " +"enumerations, or for interoperability with other systems." msgstr "" #: ../../howto/enum.rst:886 @@ -1671,8 +1683,8 @@ msgstr "" #: ../../howto/enum.rst:894 msgid "" "This demonstrates how similar derived enumerations can be defined; for " -"example a :class:`!FloatEnum` that mixes in :class:`float` instead " -"of :class:`int`." +"example a :class:`!FloatEnum` that mixes in :class:`float` instead of :class:" +"`int`." msgstr "" #: ../../howto/enum.rst:897 @@ -1681,24 +1693,24 @@ msgstr "一些規則:" #: ../../howto/enum.rst:899 msgid "" -"When subclassing :class:`Enum`, mix-in types must appear before " -"the :class:`Enum` class itself in the sequence of bases, as in " -"the :class:`IntEnum` example above." +"When subclassing :class:`Enum`, mix-in types must appear before the :class:" +"`Enum` class itself in the sequence of bases, as in the :class:`IntEnum` " +"example above." msgstr "" #: ../../howto/enum.rst:902 msgid "" -"Mix-in types must be subclassable. For example, :class:`bool` " -"and :class:`range` are not subclassable and will throw an error during Enum " -"creation if used as the mix-in type." +"Mix-in types must be subclassable. For example, :class:`bool` and :class:" +"`range` are not subclassable and will throw an error during Enum creation if " +"used as the mix-in type." msgstr "" #: ../../howto/enum.rst:905 msgid "" "While :class:`Enum` can have members of any type, once you mix in an " -"additional type, all the members must have values of that type, " -"e.g. :class:`int` above. This restriction does not apply to mix-ins which " -"only add methods and don't specify another type." +"additional type, all the members must have values of that type, e.g. :class:" +"`int` above. This restriction does not apply to mix-ins which only add " +"methods and don't specify another type." msgstr "" #: ../../howto/enum.rst:909 @@ -1710,30 +1722,30 @@ msgstr "" #: ../../howto/enum.rst:912 msgid "" -"A ``data type`` is a mixin that defines :meth:`~object.__new__`, or " -"a :class:`~dataclasses.dataclass`" +"A ``data type`` is a mixin that defines :meth:`~object.__new__`, or a :class:" +"`~dataclasses.dataclass`" msgstr "" #: ../../howto/enum.rst:914 msgid "" -"%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` " -"class's :meth:`~object.__str__` and :meth:`~object.__repr__` respectively; " -"other codes (such as ``%i`` or ``%h`` for IntEnum) treat the enum member as " -"its mixed-in type." +"%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:" +"`~object.__str__` and :meth:`~object.__repr__` respectively; other codes " +"(such as ``%i`` or ``%h`` for IntEnum) treat the enum member as its mixed-in " +"type." msgstr "" #: ../../howto/enum.rst:917 msgid "" -":ref:`Formatted string literals `, :meth:`str.format`, " -"and :func:`format` will use the enum's :meth:`~object.__str__` method." +":ref:`Formatted string literals `, :meth:`str.format`, and :func:" +"`format` will use the enum's :meth:`~object.__str__` method." msgstr "" #: ../../howto/enum.rst:922 msgid "" "Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " -"designed to be drop-in replacements for existing constants, " -"their :meth:`~object.__str__` method has been reset to their data " -"types' :meth:`~object.__str__` method." +"designed to be drop-in replacements for existing constants, their :meth:" +"`~object.__str__` method has been reset to their data types' :meth:`~object." +"__str__` method." msgstr "" #: ../../howto/enum.rst:930 @@ -1744,8 +1756,8 @@ msgstr "" msgid "" ":meth:`~object.__new__` must be used whenever you want to customize the " "actual value of the :class:`Enum` member. Any other modifications may go in " -"either :meth:`~object.__new__` or :meth:`~object.__init__`, " -"with :meth:`~object.__init__` being preferred." +"either :meth:`~object.__new__` or :meth:`~object.__init__`, with :meth:" +"`~object.__init__` being preferred." msgstr "" #: ../../howto/enum.rst:936 @@ -1802,9 +1814,9 @@ msgstr "" #: ../../howto/enum.rst:976 msgid "" ":meth:`~object.__new__`, if specified, must create and return the enum " -"members; it is also a very good idea to set the " -"member's :attr:`~Enum._value_` appropriately. Once all the members are " -"created it is no longer used." +"members; it is also a very good idea to set the member's :attr:`~Enum." +"_value_` appropriately. Once all the members are created it is no longer " +"used." msgstr "" #: ../../howto/enum.rst:982 @@ -1827,9 +1839,9 @@ msgstr "" #: ../../howto/enum.rst:988 msgid "" -":attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or " -"a :class:`str`, that will not be transformed into members, and will be " -"removed from the final class" +":attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or a :" +"class:`str`, that will not be transformed into members, and will be removed " +"from the final class" msgstr "" #: ../../howto/enum.rst:991 @@ -1840,13 +1852,13 @@ msgstr "" #: ../../howto/enum.rst:993 msgid "" -":meth:`~EnumType._add_alias_` -- adds a new name as an alias to an existing " +":meth:`~Enum._add_alias_` -- adds a new name as an alias to an existing " "member." msgstr "" #: ../../howto/enum.rst:995 msgid "" -":meth:`~EnumType._add_value_alias_` -- adds a new value as an alias to an " +":meth:`~Enum._add_value_alias_` -- adds a new value as an alias to an " "existing member. See `MultiValueEnum`_ for an example." msgstr "" @@ -1973,11 +1985,11 @@ msgstr "" #: ../../howto/enum.rst:1074 msgid "" -"Enum classes that are mixed with non-:class:`Enum` types (such " -"as :class:`int`, :class:`str`, etc.) are evaluated according to the mixed-in " -"type's rules; otherwise, all members evaluate as :data:`True`. To make your " -"own enum's boolean evaluation depend on the member's value add the following " -"to your class::" +"Enum classes that are mixed with non-:class:`Enum` types (such as :class:" +"`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " +"rules; otherwise, all members evaluate as :data:`True`. To make your own " +"enum's boolean evaluation depend on the member's value add the following to " +"your class::" msgstr "" #: ../../howto/enum.rst:1080 @@ -2230,8 +2242,8 @@ msgstr "" #: ../../howto/enum.rst:1202 msgid "" "The default for Flag is ``STRICT``, the default for ``IntFlag`` is " -"``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see " -"``ssl.Options`` for an example of when ``KEEP`` is needed)." +"``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." +"Options`` for an example of when ``KEEP`` is needed)." msgstr "" #: ../../howto/enum.rst:1210 @@ -2240,8 +2252,8 @@ msgstr "Enums 和 Flags 有何不同?" #: ../../howto/enum.rst:1212 msgid "" -"Enums have a custom metaclass that affects many aspects of both " -"derived :class:`Enum` classes and their instances (members)." +"Enums have a custom metaclass that affects many aspects of both derived :" +"class:`Enum` classes and their instances (members)." msgstr "" #: ../../howto/enum.rst:1217 @@ -2250,14 +2262,14 @@ msgstr "Enum 類別" #: ../../howto/enum.rst:1219 msgid "" -"The :class:`EnumType` metaclass is responsible for providing " -"the :meth:`~object.__contains__`, :meth:`~object.__dir__`, :meth:`~object.__iter__` " +"The :class:`EnumType` metaclass is responsible for providing the :meth:" +"`~object.__contains__`, :meth:`~object.__dir__`, :meth:`~object.__iter__` " "and other methods that allow one to do things with an :class:`Enum` class " "that fail on a typical class, such as ``list(Color)`` or ``some_enum_var in " "Color``. :class:`EnumType` is responsible for ensuring that various other " -"methods on the final :class:`Enum` class are correct (such " -"as :meth:`~object.__new__`, :meth:`~object.__getnewargs__`, :meth:`~object.__str__` " -"and :meth:`~object.__repr__`)." +"methods on the final :class:`Enum` class are correct (such as :meth:`~object." +"__new__`, :meth:`~object.__getnewargs__`, :meth:`~object.__str__` and :meth:" +"`~object.__repr__`)." msgstr "" #: ../../howto/enum.rst:1228 @@ -2268,8 +2280,8 @@ msgstr "Flag 類別" msgid "" "Flags have an expanded view of aliasing: to be canonical, the value of a " "flag needs to be a power-of-two value, and not a duplicate name. So, in " -"addition to the :class:`Enum` definition of alias, a flag with no value " -"(a.k.a. ``0``) or with more than one power-of-two value (e.g. ``3``) is " +"addition to the :class:`Enum` definition of alias, a flag with no value (a.k." +"a. ``0``) or with more than one power-of-two value (e.g. ``3``) is " "considered an alias." msgstr "" @@ -2279,11 +2291,11 @@ msgstr "" #: ../../howto/enum.rst:1238 msgid "" -"The most interesting thing about enum members is that they are " -"singletons. :class:`EnumType` creates them all while it is creating the enum " -"class itself, and then puts a custom :meth:`~object.__new__` in place to " -"ensure that no new ones are ever instantiated by returning only the existing " -"member instances." +"The most interesting thing about enum members is that they are singletons. :" +"class:`EnumType` creates them all while it is creating the enum class " +"itself, and then puts a custom :meth:`~object.__new__` in place to ensure " +"that no new ones are ever instantiated by returning only the existing member " +"instances." msgstr "" #: ../../howto/enum.rst:1244 @@ -2342,11 +2354,10 @@ msgstr "" #: ../../howto/enum.rst:1273 msgid "" -"While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, " -"and :class:`IntFlag` are expected to cover the majority of use-cases, they " -"cannot cover them all. Here are recipes for some different types of " -"enumerations that can be used directly, or as examples for creating one's " -"own." +"While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" +"class:`IntFlag` are expected to cover the majority of use-cases, they cannot " +"cover them all. Here are recipes for some different types of enumerations " +"that can be used directly, or as examples for creating one's own." msgstr "" #: ../../howto/enum.rst:1280 @@ -2438,8 +2449,8 @@ msgstr "" #: ../../howto/enum.rst:1323 msgid "" -"This is also a good example of why you might want to write your " -"own :meth:`~object.__repr__`::" +"This is also a good example of why you might want to write your own :meth:" +"`~object.__repr__`::" msgstr "" #: ../../howto/enum.rst:1326 @@ -2796,11 +2807,11 @@ msgid "" "... Period['day_%d' % i] = i\n" "...\n" ">>> list(Period)[:2]\n" -"[, ]\n" +"[, ]\n" ">>> list(Period)[-2:]\n" -"[, ]" +"[, ]" msgstr "" ">>> from datetime import timedelta\n" ">>> class Period(timedelta, Enum):\n" @@ -2811,11 +2822,11 @@ msgstr "" "... Period['day_%d' % i] = i\n" "...\n" ">>> list(Period)[:2]\n" -"[, ]\n" +"[, ]\n" ">>> list(Period)[-2:]\n" -"[, ]" +"[, ]" #: ../../howto/enum.rst:1558 msgid "Subclassing EnumType" diff --git a/howto/remote_debugging.po b/howto/remote_debugging.po index 2ae74b8ad2..32a5a54f6e 100644 --- a/howto/remote_debugging.po +++ b/howto/remote_debugging.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-13 00:14+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -22,11 +22,143 @@ msgstr "" #: ../../howto/remote_debugging.rst:6 msgid "" +"This protocol enables external tools to attach to a running CPython process " +"and execute Python code remotely." +msgstr "" + +#: ../../howto/remote_debugging.rst:9 +msgid "" +"Most platforms require elevated privileges to attach to another Python " +"process." +msgstr "" + +#: ../../howto/remote_debugging.rst:14 +msgid "Permission requirements" +msgstr "" + +#: ../../howto/remote_debugging.rst:16 +msgid "" +"Attaching to a running Python process for remote debugging requires elevated " +"privileges on most platforms. The specific requirements and troubleshooting " +"steps depend on your operating system:" +msgstr "" + +#: ../../howto/remote_debugging.rst:21 +msgid "Linux" +msgstr "Linux" + +#: ../../howto/remote_debugging.rst:22 +msgid "" +"The tracer process must have the ``CAP_SYS_PTRACE`` capability or equivalent " +"privileges. You can only trace processes you own and can signal. Tracing may " +"fail if the process is already being traced, or if it is running with set-" +"user-ID or set-group-ID. Security modules like Yama may further restrict " +"tracing." +msgstr "" + +#: ../../howto/remote_debugging.rst:28 +msgid "To temporarily relax ptrace restrictions (until reboot), run:" +msgstr "" + +#: ../../howto/remote_debugging.rst:30 +msgid "``echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope``" +msgstr "" + +#: ../../howto/remote_debugging.rst:34 +msgid "" +"Disabling ``ptrace_scope`` reduces system hardening and should only be done " +"in trusted environments." +msgstr "" + +#: ../../howto/remote_debugging.rst:37 +msgid "" +"If running inside a container, use ``--cap-add=SYS_PTRACE`` or ``--" +"privileged``, and run as root if needed." +msgstr "" + +#: ../../howto/remote_debugging.rst:40 +msgid "Try re-running the command with elevated privileges:" +msgstr "" + +#: ../../howto/remote_debugging.rst:42 +msgid "``sudo -E !!``" +msgstr "``sudo -E !!``" + +#: ../../howto/remote_debugging.rst:46 +msgid "macOS" +msgstr "macOS" + +#: ../../howto/remote_debugging.rst:47 +msgid "" +"To attach to another process, you typically need to run your debugging tool " +"with elevated privileges. This can be done by using ``sudo`` or running as " +"root." +msgstr "" + +#: ../../howto/remote_debugging.rst:51 +msgid "" +"Even when attaching to processes you own, macOS may block debugging unless " +"the debugger is run with root privileges due to system security restrictions." +msgstr "" + +#: ../../howto/remote_debugging.rst:56 +msgid "Windows" +msgstr "Windows" + +#: ../../howto/remote_debugging.rst:57 +msgid "" +"To attach to another process, you usually need to run your debugging tool " +"with administrative privileges. Start the command prompt or terminal as " +"Administrator." +msgstr "" + +#: ../../howto/remote_debugging.rst:61 +msgid "" +"Some processes may still be inaccessible even with Administrator rights, " +"unless you have the ``SeDebugPrivilege`` privilege enabled." +msgstr "" + +#: ../../howto/remote_debugging.rst:64 +msgid "" +"To resolve file or folder access issues, adjust the security permissions:" +msgstr "" + +#: ../../howto/remote_debugging.rst:66 +msgid "Right-click the file or folder and select **Properties**." +msgstr "" + +#: ../../howto/remote_debugging.rst:67 +msgid "Go to the **Security** tab to view users and groups with access." +msgstr "" + +#: ../../howto/remote_debugging.rst:68 +msgid "Click **Edit** to modify permissions." +msgstr "" + +#: ../../howto/remote_debugging.rst:69 +msgid "Select your user account." +msgstr "選擇你的使用者帳戶。" + +#: ../../howto/remote_debugging.rst:70 +msgid "In **Permissions**, check **Read** or **Full control** as needed." +msgstr "" + +#: ../../howto/remote_debugging.rst:71 +msgid "Click **Apply**, then **OK** to confirm." +msgstr "點擊 **Apply**,然後點擊 **OK** 來確認。" + +#: ../../howto/remote_debugging.rst:76 +msgid "" +"Ensure you've satisfied all :ref:`permission-requirements` before proceeding." +msgstr "" + +#: ../../howto/remote_debugging.rst:78 +msgid "" "This section describes the low-level protocol that enables external tools to " "inject and execute a Python script within a running CPython process." msgstr "" -#: ../../howto/remote_debugging.rst:9 +#: ../../howto/remote_debugging.rst:81 msgid "" "This mechanism forms the basis of the :func:`sys.remote_exec` function, " "which instructs a remote Python process to execute a ``.py`` file. However, " @@ -37,14 +169,14 @@ msgid "" "of the protocol, regardless of programming language." msgstr "" -#: ../../howto/remote_debugging.rst:19 +#: ../../howto/remote_debugging.rst:91 msgid "" "The execution of the injected script depends on the interpreter reaching a " "safe evaluation point. As a result, execution may be delayed depending on " "the runtime state of the target process." msgstr "" -#: ../../howto/remote_debugging.rst:23 +#: ../../howto/remote_debugging.rst:95 msgid "" "Once injected, the script is executed by the interpreter within the target " "process the next time a safe evaluation point is reached. This approach " @@ -52,7 +184,7 @@ msgid "" "structure of the running Python application." msgstr "" -#: ../../howto/remote_debugging.rst:28 +#: ../../howto/remote_debugging.rst:100 msgid "" "Subsequent sections provide a step-by-step description of the protocol, " "including techniques for locating interpreter structures in memory, safely " @@ -61,11 +193,11 @@ msgid "" "included to clarify each operation." msgstr "" -#: ../../howto/remote_debugging.rst:35 +#: ../../howto/remote_debugging.rst:107 msgid "Locating the PyRuntime structure" msgstr "" -#: ../../howto/remote_debugging.rst:37 +#: ../../howto/remote_debugging.rst:109 msgid "" "CPython places the ``PyRuntime`` structure in a dedicated binary section to " "help external tools find it at runtime. The name and format of this section " @@ -74,14 +206,14 @@ msgid "" "structure by examining the binary on disk." msgstr "" -#: ../../howto/remote_debugging.rst:43 +#: ../../howto/remote_debugging.rst:115 msgid "" "The ``PyRuntime`` structure contains CPython’s global interpreter state and " "provides access to other internal data, including the list of interpreters, " "thread states, and debugger support fields." msgstr "" -#: ../../howto/remote_debugging.rst:47 +#: ../../howto/remote_debugging.rst:119 msgid "" "To work with a remote Python process, a debugger must first find the memory " "address of the ``PyRuntime`` structure in the target process. This address " @@ -89,66 +221,66 @@ msgid "" "where the operating system loaded the binary." msgstr "" -#: ../../howto/remote_debugging.rst:52 +#: ../../howto/remote_debugging.rst:124 msgid "" "The method for finding ``PyRuntime`` depends on the platform, but the steps " "are the same in general:" msgstr "" -#: ../../howto/remote_debugging.rst:55 +#: ../../howto/remote_debugging.rst:127 msgid "" "Find the base address where the Python binary or shared library was loaded " "in the target process." msgstr "" -#: ../../howto/remote_debugging.rst:57 +#: ../../howto/remote_debugging.rst:129 msgid "" "Use the on-disk binary to locate the offset of the ``.PyRuntime`` section." msgstr "" -#: ../../howto/remote_debugging.rst:58 +#: ../../howto/remote_debugging.rst:130 msgid "" "Add the section offset to the base address to compute the address in memory." msgstr "" -#: ../../howto/remote_debugging.rst:60 +#: ../../howto/remote_debugging.rst:132 msgid "" "The sections below explain how to do this on each supported platform and " "include example code." msgstr "" -#: ../../howto/remote_debugging.rst:64 +#: ../../howto/remote_debugging.rst:136 msgid "Linux (ELF)" -msgstr "" +msgstr "Linux (ELF)" -#: ../../howto/remote_debugging.rst:65 +#: ../../howto/remote_debugging.rst:137 msgid "To find the ``PyRuntime`` structure on Linux:" msgstr "" -#: ../../howto/remote_debugging.rst:67 +#: ../../howto/remote_debugging.rst:139 msgid "" "Read the process’s memory map (for example, ``/proc//maps``) to find " "the address where the Python executable or ``libpython`` was loaded." msgstr "" -#: ../../howto/remote_debugging.rst:69 +#: ../../howto/remote_debugging.rst:141 msgid "" -"Parse the ELF section headers in the binary to get the offset of the " -"``.PyRuntime`` section." +"Parse the ELF section headers in the binary to get the offset of the ``." +"PyRuntime`` section." msgstr "" -#: ../../howto/remote_debugging.rst:71 +#: ../../howto/remote_debugging.rst:143 msgid "" "Add that offset to the base address from step 1 to get the memory address of " "``PyRuntime``." msgstr "" -#: ../../howto/remote_debugging.rst:74 ../../howto/remote_debugging.rst:136 -#: ../../howto/remote_debugging.rst:206 ../../howto/remote_debugging.rst:475 +#: ../../howto/remote_debugging.rst:146 ../../howto/remote_debugging.rst:208 +#: ../../howto/remote_debugging.rst:278 ../../howto/remote_debugging.rst:547 msgid "The following is an example implementation::" -msgstr "" +msgstr "以下是一個範例實作: ::" -#: ../../howto/remote_debugging.rst:76 +#: ../../howto/remote_debugging.rst:148 msgid "" "def find_py_runtime_linux(pid: int) -> int:\n" " # Step 1: Try to find the Python executable in memory\n" @@ -171,7 +303,7 @@ msgid "" " return base_address + section_offset" msgstr "" -#: ../../howto/remote_debugging.rst:97 +#: ../../howto/remote_debugging.rst:169 msgid "" "On Linux systems, there are two main approaches to read memory from another " "process. The first is through the ``/proc`` filesystem, specifically by " @@ -185,7 +317,7 @@ msgid "" "multiple context switches between the tracer and tracee processes." msgstr "" -#: ../../howto/remote_debugging.rst:108 +#: ../../howto/remote_debugging.rst:180 msgid "" "For parsing ELF sections, the process involves reading and interpreting the " "ELF file format structures from the binary file on disk. The ELF header " @@ -198,34 +330,34 @@ msgid "" "memory." msgstr "" -#: ../../howto/remote_debugging.rst:117 +#: ../../howto/remote_debugging.rst:189 msgid "" "You can read more about the ELF file format in the `ELF specification " "`_." msgstr "" -#: ../../howto/remote_debugging.rst:122 +#: ../../howto/remote_debugging.rst:194 msgid "macOS (Mach-O)" -msgstr "" +msgstr "macOS (Mach-O)" -#: ../../howto/remote_debugging.rst:123 +#: ../../howto/remote_debugging.rst:195 msgid "To find the ``PyRuntime`` structure on macOS:" -msgstr "" +msgstr "在 macOS 上找 ``PyRuntime`` 結構:" -#: ../../howto/remote_debugging.rst:125 +#: ../../howto/remote_debugging.rst:197 msgid "" "Call ``task_for_pid()`` to get the ``mach_port_t`` task port for the target " "process. This handle is needed to read memory using APIs like " "``mach_vm_read_overwrite`` and ``mach_vm_region``." msgstr "" -#: ../../howto/remote_debugging.rst:128 +#: ../../howto/remote_debugging.rst:200 msgid "" "Scan the memory regions to find the one containing the Python executable or " "``libpython``." msgstr "" -#: ../../howto/remote_debugging.rst:130 +#: ../../howto/remote_debugging.rst:202 msgid "" "Load the binary file from disk and parse the Mach-O headers to find the " "section named ``PyRuntime`` in the ``__DATA`` segment. On macOS, symbol " @@ -234,7 +366,7 @@ msgid "" "is not affected." msgstr "" -#: ../../howto/remote_debugging.rst:138 +#: ../../howto/remote_debugging.rst:210 msgid "" "def find_py_runtime_macos(pid: int) -> int:\n" " # Step 1: Get access to the process's memory\n" @@ -260,7 +392,7 @@ msgid "" " return base_address + section_offset" msgstr "" -#: ../../howto/remote_debugging.rst:161 +#: ../../howto/remote_debugging.rst:233 msgid "" "On macOS, accessing another process's memory requires using Mach-O specific " "APIs and file formats. The first step is obtaining a ``task_port`` handle " @@ -269,7 +401,7 @@ msgid "" "``mach_vm_read_overwrite()``." msgstr "" -#: ../../howto/remote_debugging.rst:167 +#: ../../howto/remote_debugging.rst:239 msgid "" "The process memory can be examined using ``mach_vm_region()`` to scan " "through the virtual memory space, while ``proc_regionfilename()`` helps " @@ -278,7 +410,7 @@ msgid "" "locate the ``PyRuntime`` structure." msgstr "" -#: ../../howto/remote_debugging.rst:172 +#: ../../howto/remote_debugging.rst:244 msgid "" "The Mach-O format organizes code and data into segments and sections. The " "``PyRuntime`` structure lives in a section named ``__PyRuntime`` within the " @@ -289,22 +421,22 @@ msgid "" "section offsets from the Mach-O headers." msgstr "" -#: ../../howto/remote_debugging.rst:180 +#: ../../howto/remote_debugging.rst:252 msgid "" "Note that accessing another process's memory on macOS typically requires " "elevated privileges - either root access or special security entitlements " "granted to the debugging process." msgstr "" -#: ../../howto/remote_debugging.rst:186 +#: ../../howto/remote_debugging.rst:258 msgid "Windows (PE)" -msgstr "" +msgstr "Windows (PE)" -#: ../../howto/remote_debugging.rst:187 +#: ../../howto/remote_debugging.rst:259 msgid "To find the ``PyRuntime`` structure on Windows:" -msgstr "" +msgstr "在 Windows 上找 ``PyRuntime`` 結構:" -#: ../../howto/remote_debugging.rst:189 +#: ../../howto/remote_debugging.rst:261 msgid "" "Use the ToolHelp API to enumerate all modules loaded in the target process. " "This is done using functions such as `CreateToolhelp32Snapshot `_." msgstr "" -#: ../../howto/remote_debugging.rst:196 +#: ../../howto/remote_debugging.rst:268 msgid "" -"Identify the module corresponding to :file:`python.exe` " -"or :file:`python{XY}.dll`, where ``X`` and ``Y`` are the major and minor " -"version numbers of the Python version, and record its base address." +"Identify the module corresponding to :file:`python.exe` or :file:`python{XY}." +"dll`, where ``X`` and ``Y`` are the major and minor version numbers of the " +"Python version, and record its base address." msgstr "" -#: ../../howto/remote_debugging.rst:199 +#: ../../howto/remote_debugging.rst:271 msgid "" "Locate the ``PyRuntim`` section. Due to the PE format's 8-character limit on " "section names (defined as ``IMAGE_SIZEOF_SHORT_NAME``), the original name " @@ -330,13 +462,13 @@ msgid "" "structure." msgstr "" -#: ../../howto/remote_debugging.rst:203 +#: ../../howto/remote_debugging.rst:275 msgid "" "Retrieve the section’s relative virtual address (RVA) and add it to the base " "address of the module." msgstr "" -#: ../../howto/remote_debugging.rst:208 +#: ../../howto/remote_debugging.rst:280 msgid "" "def find_py_runtime_windows(pid: int) -> int:\n" " # Step 1: Try to find the Python executable in memory\n" @@ -360,7 +492,7 @@ msgid "" " return base_address + section_rva" msgstr "" -#: ../../howto/remote_debugging.rst:230 +#: ../../howto/remote_debugging.rst:302 msgid "" "On Windows, accessing another process's memory requires using the Windows " "API functions like ``CreateToolhelp32Snapshot()`` and ``Module32First()/" @@ -369,14 +501,14 @@ msgid "" "memory operations through ``ReadProcessMemory()``." msgstr "" -#: ../../howto/remote_debugging.rst:236 +#: ../../howto/remote_debugging.rst:308 msgid "" "The process memory can be examined by enumerating loaded modules to find the " "Python binary or DLL. When found, its PE headers need to be parsed to locate " "the ``PyRuntime`` structure." msgstr "" -#: ../../howto/remote_debugging.rst:240 +#: ../../howto/remote_debugging.rst:312 msgid "" "The PE format organizes code and data into sections. The ``PyRuntime`` " "structure lives in a section named \"PyRuntim\" (truncated from " @@ -387,25 +519,25 @@ msgid "" "address from the PE section headers." msgstr "" -#: ../../howto/remote_debugging.rst:247 +#: ../../howto/remote_debugging.rst:319 msgid "" "Note that accessing another process's memory on Windows typically requires " "appropriate privileges - either administrative access or the " "``SeDebugPrivilege`` privilege granted to the debugging process." msgstr "" -#: ../../howto/remote_debugging.rst:253 +#: ../../howto/remote_debugging.rst:325 msgid "Reading _Py_DebugOffsets" -msgstr "" +msgstr "讀取 _Py_DebugOffsets" -#: ../../howto/remote_debugging.rst:255 +#: ../../howto/remote_debugging.rst:327 msgid "" "Once the address of the ``PyRuntime`` structure has been determined, the " "next step is to read the ``_Py_DebugOffsets`` structure located at the " "beginning of the ``PyRuntime`` block." msgstr "" -#: ../../howto/remote_debugging.rst:259 +#: ../../howto/remote_debugging.rst:331 msgid "" "This structure provides version-specific field offsets that are needed to " "safely read interpreter and thread state memory. These offsets vary between " @@ -413,11 +545,11 @@ msgid "" "compatible." msgstr "" -#: ../../howto/remote_debugging.rst:263 +#: ../../howto/remote_debugging.rst:335 msgid "To read and check the debug offsets, follow these steps:" msgstr "" -#: ../../howto/remote_debugging.rst:265 +#: ../../howto/remote_debugging.rst:337 msgid "" "Read memory from the target process starting at the ``PyRuntime`` address, " "covering the same number of bytes as the ``_Py_DebugOffsets`` structure. " @@ -426,47 +558,47 @@ msgid "" "same within a given minor version, but may change in major versions." msgstr "" -#: ../../howto/remote_debugging.rst:271 +#: ../../howto/remote_debugging.rst:343 msgid "Check that the structure contains valid data:" msgstr "" -#: ../../howto/remote_debugging.rst:273 +#: ../../howto/remote_debugging.rst:345 msgid "The ``cookie`` field must match the expected debug marker." msgstr "" -#: ../../howto/remote_debugging.rst:274 +#: ../../howto/remote_debugging.rst:346 msgid "" "The ``version`` field must match the version of the Python interpreter used " "by the debugger." msgstr "" -#: ../../howto/remote_debugging.rst:276 +#: ../../howto/remote_debugging.rst:348 msgid "" "If either the debugger or the target process is using a pre-release version " "(for example, an alpha, beta, or release candidate), the versions must match " "exactly." msgstr "" -#: ../../howto/remote_debugging.rst:279 +#: ../../howto/remote_debugging.rst:351 msgid "" "The ``free_threaded`` field must have the same value in both the debugger " "and the target process." msgstr "" -#: ../../howto/remote_debugging.rst:282 +#: ../../howto/remote_debugging.rst:354 msgid "" "If the structure is valid, the offsets it contains can be used to locate " "fields in memory. If any check fails, the debugger should stop the operation " "to avoid reading memory in the wrong format." msgstr "" -#: ../../howto/remote_debugging.rst:286 +#: ../../howto/remote_debugging.rst:358 msgid "" "The following is an example implementation that reads and checks " "``_Py_DebugOffsets``::" msgstr "" -#: ../../howto/remote_debugging.rst:289 +#: ../../howto/remote_debugging.rst:361 msgid "" "def read_debug_offsets(pid: int, py_runtime_addr: int) -> DebugOffsets:\n" " # Step 1: Read memory from the target process at the PyRuntime address\n" @@ -490,11 +622,11 @@ msgid "" " return debug_offsets" msgstr "" -#: ../../howto/remote_debugging.rst:314 +#: ../../howto/remote_debugging.rst:386 msgid "**Process suspension recommended**" msgstr "" -#: ../../howto/remote_debugging.rst:316 +#: ../../howto/remote_debugging.rst:388 msgid "" "To avoid race conditions and ensure memory consistency, it is strongly " "recommended that the target process be suspended before performing any " @@ -504,14 +636,14 @@ msgid "" "memory reads or writes." msgstr "" -#: ../../howto/remote_debugging.rst:323 +#: ../../howto/remote_debugging.rst:395 msgid "" "A debugger may suspend execution by attaching to the process with ``ptrace`` " "or by sending a ``SIGSTOP`` signal. Execution should only be resumed after " "debugger-side memory operations are complete." msgstr "" -#: ../../howto/remote_debugging.rst:329 +#: ../../howto/remote_debugging.rst:401 msgid "" "Some tools, such as profilers or sampling-based debuggers, may operate on a " "running process without suspension. In such cases, tools must be explicitly " @@ -520,11 +652,11 @@ msgid "" "robust approach." msgstr "" -#: ../../howto/remote_debugging.rst:337 +#: ../../howto/remote_debugging.rst:409 msgid "Locating the interpreter and thread state" msgstr "" -#: ../../howto/remote_debugging.rst:339 +#: ../../howto/remote_debugging.rst:411 msgid "" "Before code can be injected and executed in a remote Python process, the " "debugger must choose a thread in which to schedule execution. This is " @@ -534,7 +666,7 @@ msgid "" "request execution of injected scripts." msgstr "" -#: ../../howto/remote_debugging.rst:346 +#: ../../howto/remote_debugging.rst:418 msgid "" "The ``PyThreadState`` structure represents a thread running inside a Python " "interpreter. It maintains the thread’s evaluation context and contains the " @@ -543,7 +675,7 @@ msgid "" "remotely." msgstr "" -#: ../../howto/remote_debugging.rst:351 +#: ../../howto/remote_debugging.rst:423 msgid "" "A thread is typically selected based on its role or ID. In most cases, the " "main thread is used, but some tools may target a specific thread by its " @@ -551,11 +683,11 @@ msgid "" "both the interpreter and the associated thread state structures in memory." msgstr "" -#: ../../howto/remote_debugging.rst:356 +#: ../../howto/remote_debugging.rst:428 msgid "The relevant internal structures are defined as follows:" msgstr "" -#: ../../howto/remote_debugging.rst:358 +#: ../../howto/remote_debugging.rst:430 msgid "" "``PyInterpreterState`` represents an isolated Python interpreter instance. " "Each interpreter maintains its own set of imported modules, built-in state, " @@ -563,52 +695,52 @@ msgid "" "interpreter, CPython supports multiple interpreters in the same process." msgstr "" -#: ../../howto/remote_debugging.rst:363 +#: ../../howto/remote_debugging.rst:435 msgid "" "``PyThreadState`` represents a thread running within an interpreter. It " "contains execution state and the control fields used by the debugger." msgstr "" -#: ../../howto/remote_debugging.rst:366 +#: ../../howto/remote_debugging.rst:438 msgid "To locate a thread:" msgstr "" -#: ../../howto/remote_debugging.rst:368 +#: ../../howto/remote_debugging.rst:440 msgid "" "Use the offset ``runtime_state.interpreters_head`` to obtain the address of " "the first interpreter in the ``PyRuntime`` structure. This is the entry " "point to the linked list of active interpreters." msgstr "" -#: ../../howto/remote_debugging.rst:372 +#: ../../howto/remote_debugging.rst:444 msgid "" "Use the offset ``interpreter_state.threads_main`` to access the main thread " "state associated with the selected interpreter. This is typically the most " "reliable thread to target." msgstr "" -#: ../../howto/remote_debugging.rst:376 +#: ../../howto/remote_debugging.rst:448 msgid "" -"3. Optionally, use the offset ``interpreter_state.threads_head`` to iterate " +"Optionally, use the offset ``interpreter_state.threads_head`` to iterate " "through the linked list of all thread states. Each ``PyThreadState`` " "structure contains a ``native_thread_id`` field, which may be compared to a " "target thread ID to find a specific thread." msgstr "" -#: ../../howto/remote_debugging.rst:381 +#: ../../howto/remote_debugging.rst:453 msgid "" -"1. Once a valid ``PyThreadState`` has been found, its address can be used in " +"Once a valid ``PyThreadState`` has been found, its address can be used in " "later steps of the protocol, such as writing debugger control fields and " "scheduling execution." msgstr "" -#: ../../howto/remote_debugging.rst:385 +#: ../../howto/remote_debugging.rst:457 msgid "" "The following is an example implementation that locates the main thread " "state::" msgstr "" -#: ../../howto/remote_debugging.rst:387 +#: ../../howto/remote_debugging.rst:459 msgid "" "def find_main_thread_state(\n" " pid: int, py_runtime_addr: int, debug_offsets: DebugOffsets,\n" @@ -632,13 +764,13 @@ msgid "" " return thread_state_addr" msgstr "" -#: ../../howto/remote_debugging.rst:408 +#: ../../howto/remote_debugging.rst:480 msgid "" "The following example demonstrates how to locate a thread by its native " "thread ID::" msgstr "" -#: ../../howto/remote_debugging.rst:411 +#: ../../howto/remote_debugging.rst:483 msgid "" "def find_thread_by_id(\n" " pid: int,\n" @@ -667,18 +799,18 @@ msgid "" " raise RuntimeError(\"Thread with the given ID was not found\")" msgstr "" -#: ../../howto/remote_debugging.rst:438 +#: ../../howto/remote_debugging.rst:510 msgid "" "Once a valid thread state has been located, the debugger can proceed with " "modifying its control fields and scheduling execution, as described in the " "next section." msgstr "" -#: ../../howto/remote_debugging.rst:443 +#: ../../howto/remote_debugging.rst:515 msgid "Writing control information" msgstr "" -#: ../../howto/remote_debugging.rst:445 +#: ../../howto/remote_debugging.rst:517 msgid "" "Once a valid ``PyThreadState`` structure has been identified, the debugger " "may modify control fields within it to schedule the execution of a specified " @@ -687,7 +819,7 @@ msgid "" "code at a safe point in the evaluation loop." msgstr "" -#: ../../howto/remote_debugging.rst:451 +#: ../../howto/remote_debugging.rst:523 msgid "" "Each ``PyThreadState`` contains a ``_PyRemoteDebuggerSupport`` structure " "used for communication between the debugger and the interpreter. The " @@ -695,57 +827,47 @@ msgid "" "and include the following:" msgstr "" -#: ../../howto/remote_debugging.rst:456 -msgid "" -"``debugger_script_path``: A fixed-size buffer that holds the full path to a" -msgstr "" - -#: ../../howto/remote_debugging.rst:457 +#: ../../howto/remote_debugging.rst:528 msgid "" +"``debugger_script_path``: A fixed-size buffer that holds the full path to a " "Python source file (``.py``). This file must be accessible and readable by " "the target process when execution is triggered." msgstr "" -#: ../../howto/remote_debugging.rst:460 +#: ../../howto/remote_debugging.rst:532 msgid "" -"``debugger_pending_call``: An integer flag. Setting this to ``1`` tells the" -msgstr "" - -#: ../../howto/remote_debugging.rst:461 -msgid "interpreter that a script is ready to be executed." +"``debugger_pending_call``: An integer flag. Setting this to ``1`` tells the " +"interpreter that a script is ready to be executed." msgstr "" -#: ../../howto/remote_debugging.rst:463 -msgid "``eval_breaker``: A field checked by the interpreter during execution." -msgstr "" - -#: ../../howto/remote_debugging.rst:464 +#: ../../howto/remote_debugging.rst:535 msgid "" +"``eval_breaker``: A field checked by the interpreter during execution. " "Setting bit 5 (``_PY_EVAL_PLEASE_STOP_BIT``, value ``1U << 5``) in this " "field causes the interpreter to pause and check for debugger activity." msgstr "" -#: ../../howto/remote_debugging.rst:467 +#: ../../howto/remote_debugging.rst:539 msgid "" "To complete the injection, the debugger must perform the following steps:" msgstr "" -#: ../../howto/remote_debugging.rst:469 +#: ../../howto/remote_debugging.rst:541 msgid "Write the full script path into the ``debugger_script_path`` buffer." msgstr "" -#: ../../howto/remote_debugging.rst:470 +#: ../../howto/remote_debugging.rst:542 msgid "Set ``debugger_pending_call`` to ``1``." msgstr "" -#: ../../howto/remote_debugging.rst:471 +#: ../../howto/remote_debugging.rst:543 msgid "" "Read the current value of ``eval_breaker``, set bit 5 " "(``_PY_EVAL_PLEASE_STOP_BIT``), and write the updated value back. This " "signals the interpreter to check for debugger activity." msgstr "" -#: ../../howto/remote_debugging.rst:477 +#: ../../howto/remote_debugging.rst:549 msgid "" "def inject_script(\n" " pid: int,\n" @@ -784,20 +906,20 @@ msgid "" " write_int(pid, eval_breaker_ptr, breaker)" msgstr "" -#: ../../howto/remote_debugging.rst:514 +#: ../../howto/remote_debugging.rst:586 msgid "" "Once these fields are set, the debugger may resume the process (if it was " "suspended). The interpreter will process the request at the next safe " "evaluation point, load the script from disk, and execute it." msgstr "" -#: ../../howto/remote_debugging.rst:518 +#: ../../howto/remote_debugging.rst:590 msgid "" "It is the responsibility of the debugger to ensure that the script file " "remains present and accessible to the target process during execution." msgstr "" -#: ../../howto/remote_debugging.rst:523 +#: ../../howto/remote_debugging.rst:595 msgid "" "Script execution is asynchronous. The script file cannot be deleted " "immediately after injection. The debugger should wait until the injected " @@ -808,41 +930,41 @@ msgid "" "the file is no longer needed." msgstr "" -#: ../../howto/remote_debugging.rst:532 +#: ../../howto/remote_debugging.rst:604 msgid "Summary" msgstr "" -#: ../../howto/remote_debugging.rst:534 +#: ../../howto/remote_debugging.rst:606 msgid "To inject and execute a Python script in a remote process:" msgstr "" -#: ../../howto/remote_debugging.rst:536 +#: ../../howto/remote_debugging.rst:608 msgid "Locate the ``PyRuntime`` structure in the target process’s memory." msgstr "" -#: ../../howto/remote_debugging.rst:537 +#: ../../howto/remote_debugging.rst:609 msgid "" "Read and validate the ``_Py_DebugOffsets`` structure at the beginning of " "``PyRuntime``." msgstr "" -#: ../../howto/remote_debugging.rst:539 +#: ../../howto/remote_debugging.rst:611 msgid "Use the offsets to locate a valid ``PyThreadState``." msgstr "" -#: ../../howto/remote_debugging.rst:540 +#: ../../howto/remote_debugging.rst:612 msgid "Write the path to a Python script into ``debugger_script_path``." msgstr "" -#: ../../howto/remote_debugging.rst:541 +#: ../../howto/remote_debugging.rst:613 msgid "Set the ``debugger_pending_call`` flag to ``1``." msgstr "" -#: ../../howto/remote_debugging.rst:542 +#: ../../howto/remote_debugging.rst:614 msgid "Set ``_PY_EVAL_PLEASE_STOP_BIT`` in the ``eval_breaker`` field." msgstr "" -#: ../../howto/remote_debugging.rst:543 +#: ../../howto/remote_debugging.rst:615 msgid "" "Resume the process (if suspended). The script will execute at the next safe " "evaluation point." diff --git a/library/argparse.po b/library/argparse.po index 7f010326db..41fc0df320 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: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-18 00:15+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-" @@ -47,16 +47,16 @@ msgstr "教學" #: ../../library/argparse.rst:30 msgid "" "This page contains the API reference information. For a more gentle " -"introduction to Python command-line parsing, have a look at " -"the :ref:`argparse tutorial `." +"introduction to Python command-line parsing, have a look at the :ref:" +"`argparse tutorial `." msgstr "" #: ../../library/argparse.rst:34 msgid "" "The :mod:`!argparse` module makes it easy to write user-friendly command-" "line interfaces. The program defines what arguments it requires, and :mod:`!" -"argparse` will figure out how to parse those out of :data:`sys.argv`. " -"The :mod:`!argparse` module also automatically generates help and usage " +"argparse` will figure out how to parse those out of :data:`sys.argv`. The :" +"mod:`!argparse` module also automatically generates help and usage " "messages. The module will also issue errors when users give the program " "invalid arguments." msgstr "" @@ -116,8 +116,8 @@ msgstr "" #: ../../library/argparse.rst:65 msgid "" -"If you're looking for a guide about how to upgrade :mod:`optparse` code " -"to :mod:`!argparse`, see :ref:`Upgrading Optparse Code `." msgstr "" @@ -136,7 +136,8 @@ msgstr "" msgid "" "prog_ - The name of the program (default: generated from the ``__main__`` " "module attributes and ``sys.argv[0]``)" -msgstr "prog_ - 程式的名稱(預設值:從 ``__main__`` 模組屬性和 ``sys.argv[0]`` 產生)" +msgstr "" +"prog_ - 程式的名稱(預設值:從 ``__main__`` 模組屬性和 ``sys.argv[0]`` 產生)" #: ../../library/argparse.rst:86 msgid "" @@ -371,10 +372,10 @@ msgstr "" #: ../../library/argparse.rst:211 msgid "" "When a custom usage message is specified for the main parser, you may also " -"want to consider passing the ``prog`` argument " -"to :meth:`~ArgumentParser.add_subparsers` or the ``prog`` and the ``usage`` " -"arguments to :meth:`~_SubParsersAction.add_parser`, to ensure consistent " -"command prefixes and usage information across subparsers." +"want to consider passing the ``prog`` argument to :meth:`~ArgumentParser." +"add_subparsers` or the ``prog`` and the ``usage`` arguments to :meth:" +"`~_SubParsersAction.add_parser`, to ensure consistent command prefixes and " +"usage information across subparsers." msgstr "" #: ../../library/argparse.rst:221 @@ -450,11 +451,11 @@ msgstr "parents" msgid "" "Sometimes, several parsers share a common set of arguments. Rather than " "repeating the definitions of these arguments, a single parser with all the " -"shared arguments and passed to ``parents=`` argument " -"to :class:`ArgumentParser` can be used. The ``parents=`` argument takes a " -"list of :class:`ArgumentParser` objects, collects all the positional and " -"optional actions from them, and adds these actions to " -"the :class:`ArgumentParser` object being constructed::" +"shared arguments and passed to ``parents=`` argument to :class:" +"`ArgumentParser` can be used. The ``parents=`` argument takes a list of :" +"class:`ArgumentParser` objects, collects all the positional and optional " +"actions from them, and adds these actions to the :class:`ArgumentParser` " +"object being constructed::" msgstr "" #: ../../library/argparse.rst:268 @@ -513,9 +514,9 @@ msgstr "" #: ../../library/argparse.rst:305 msgid "" ":class:`RawDescriptionHelpFormatter` and :class:`RawTextHelpFormatter` give " -"more control over how textual descriptions are displayed. By " -"default, :class:`ArgumentParser` objects line-wrap the description_ and " -"epilog_ texts in command-line help messages::" +"more control over how textual descriptions are displayed. By default, :class:" +"`ArgumentParser` objects line-wrap the description_ and epilog_ texts in " +"command-line help messages::" msgstr "" #: ../../library/argparse.rst:310 @@ -747,9 +748,9 @@ msgstr "" #: ../../library/argparse.rst:437 msgid "" -"Arguments read from a file must be one per line by default (but see " -"also :meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if " -"they were in the same place as the original file referencing argument on the " +"Arguments read from a file must be one per line by default (but see also :" +"meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if they " +"were in the same place as the original file referencing argument on the " "command line. So in the example above, the expression ``['-f', 'foo', " "'@args.txt']`` is considered equivalent to the expression ``['-f', 'foo', '-" "f', 'bar']``." @@ -777,10 +778,10 @@ msgstr "" #: ../../library/argparse.rst:455 msgid "" ":class:`ArgumentParser` changed encoding and errors to read arguments files " -"from default (e.g. :func:`locale.getpreferredencoding(False) " -"` and ``\"strict\"``) to the :term:`filesystem " -"encoding and error handler`. Arguments file should be encoded in UTF-8 " -"instead of ANSI Codepage on Windows." +"from default (e.g. :func:`locale.getpreferredencoding(False) ` and ``\"strict\"``) to the :term:`filesystem encoding " +"and error handler`. Arguments file should be encoded in UTF-8 instead of " +"ANSI Codepage on Windows." msgstr "" #: ../../library/argparse.rst:463 @@ -789,15 +790,14 @@ msgstr "argument_default" #: ../../library/argparse.rst:465 msgid "" -"Generally, argument defaults are specified either by passing a default " -"to :meth:`~ArgumentParser.add_argument` or by calling " -"the :meth:`~ArgumentParser.set_defaults` methods with a specific set of name-" -"value pairs. Sometimes however, it may be useful to specify a single parser-" -"wide default for arguments. This can be accomplished by passing the " -"``argument_default=`` keyword argument to :class:`ArgumentParser`. For " -"example, to globally suppress attribute creation " -"on :meth:`~ArgumentParser.parse_args` calls, we supply " -"``argument_default=SUPPRESS``::" +"Generally, argument defaults are specified either by passing a default to :" +"meth:`~ArgumentParser.add_argument` or by calling the :meth:`~ArgumentParser." +"set_defaults` methods with a specific set of name-value pairs. Sometimes " +"however, it may be useful to specify a single parser-wide default for " +"arguments. This can be accomplished by passing the ``argument_default=`` " +"keyword argument to :class:`ArgumentParser`. For example, to globally " +"suppress attribute creation on :meth:`~ArgumentParser.parse_args` calls, we " +"supply ``argument_default=SUPPRESS``::" msgstr "" #: ../../library/argparse.rst:474 @@ -824,9 +824,9 @@ msgstr "allow_abbrev" #: ../../library/argparse.rst:487 msgid "" -"Normally, when you pass an argument list to " -"the :meth:`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, " -"it :ref:`recognizes abbreviations ` of long options." +"Normally, when you pass an argument list to the :meth:`~ArgumentParser." +"parse_args` method of an :class:`ArgumentParser`, it :ref:`recognizes " +"abbreviations ` of long options." msgstr "" #: ../../library/argparse.rst:491 @@ -933,8 +933,8 @@ msgstr "" #: ../../library/argparse.rst:547 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 :class:`ArgumentParser`::" +"This can be achieved by passing ``False`` as the ``add_help=`` argument to :" +"class:`ArgumentParser`::" msgstr "" #: ../../library/argparse.rst:551 @@ -985,10 +985,9 @@ msgstr "exit_on_error" #: ../../library/argparse.rst:576 msgid "" -"Normally, when you pass an invalid argument list to " -"the :meth:`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, " -"it will print a *message* to :data:`sys.stderr` and exit with a status code " -"of 2." +"Normally, when you pass an invalid argument list to the :meth:" +"`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, it will " +"print a *message* to :data:`sys.stderr` and exit with a status code of 2." msgstr "" #: ../../library/argparse.rst:580 @@ -1154,8 +1153,8 @@ msgstr "" #: ../../library/argparse.rst:679 msgid "" -"dest_ - The name of the attribute to be added to the object returned " -"by :meth:`parse_args`." +"dest_ - The name of the attribute to be added to the object returned by :" +"meth:`parse_args`." msgstr "" #: ../../library/argparse.rst:682 @@ -1170,9 +1169,9 @@ msgstr "name or flags" msgid "" "The :meth:`~ArgumentParser.add_argument` method must know whether an " "optional argument, like ``-f`` or ``--foo``, or a positional argument, like " -"a list of filenames, is expected. The first arguments passed " -"to :meth:`~ArgumentParser.add_argument` must therefore be either a series of " -"flags, or a simple argument name." +"a list of filenames, is expected. The first arguments passed to :meth:" +"`~ArgumentParser.add_argument` must therefore be either a series of flags, " +"or a simple argument name." msgstr "" #: ../../library/argparse.rst:698 @@ -1322,24 +1321,24 @@ msgstr "" #: ../../library/argparse.rst:777 msgid "" -"``'append'`` - This stores a list, and appends each argument value to the " -"list. It is useful to allow an option to be specified multiple times. If the " -"default value is non-empty, the default elements will be present in the " -"parsed value for the option, with any values from the command line appended " -"after those default values. Example usage::" +"``'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 " +"non-empty list, the parsed value will start with the default list's elements " +"and any values from the command line will be appended after those default " +"values. Example usage::" msgstr "" #: ../../library/argparse.rst:783 msgid "" ">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', action='append')\n" +">>> parser.add_argument('--foo', action='append', default=['0'])\n" ">>> parser.parse_args('--foo 1 --foo 2'.split())\n" -"Namespace(foo=['1', '2'])" +"Namespace(foo=['0', '1', '2'])" msgstr "" ">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', action='append')\n" +">>> parser.add_argument('--foo', action='append', default=['0'])\n" ">>> parser.parse_args('--foo 1 --foo 2'.split())\n" -"Namespace(foo=['1', '2'])" +"Namespace(foo=['0', '1', '2'])" #: ../../library/argparse.rst:788 msgid "" @@ -1421,9 +1420,9 @@ msgstr "" #: ../../library/argparse.rst:830 msgid "" -"``'version'`` - This expects a ``version=`` keyword argument in " -"the :meth:`~ArgumentParser.add_argument` call, and prints version " -"information and exits when invoked::" +"``'version'`` - This expects a ``version=`` keyword argument in the :meth:" +"`~ArgumentParser.add_argument` call, and prints version information and " +"exits when invoked::" msgstr "" #: ../../library/argparse.rst:834 @@ -1450,10 +1449,10 @@ msgid "" "arguments (e.g. ``'store'``, ``'append'``, ``'extend'``, or custom actions " "with non-zero ``nargs``) can be used with positional arguments." msgstr "" -"你也可以傳遞一個 :class:`Action` 子類別(例" -"如 :class:`BooleanOptionalAction`)或實作相同介面的其他物件。只有會消耗命令列" -"引數的 action(例如 ``'store'``、``'append'``、``'extend'`` 或 ``nargs`` 不為" -"零的自定義 action)可以被用於位置引數。" +"你也可以傳遞一個 :class:`Action` 子類別(例如 :class:" +"`BooleanOptionalAction`)或實作相同介面的其他物件。只有會消耗命令列引數的 " +"action(例如 ``'store'``、``'append'``、``'extend'`` 或 ``nargs`` 不為零的自" +"定義 action)可以被用於位置引數。" #: ../../library/argparse.rst:846 msgid "" @@ -1666,11 +1665,10 @@ msgstr "" msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='store_const'`` or ``action='append_const'``. These actions add " -"the ``const`` value to one of the attributes of the object returned " -"by :meth:`~ArgumentParser.parse_args`. See the action_ description for " -"examples. If ``const`` is not provided " -"to :meth:`~ArgumentParser.add_argument`, it will receive a default value of " -"``None``." +"the ``const`` value to one of the attributes of the object returned by :meth:" +"`~ArgumentParser.parse_args`. See the action_ description for examples. If " +"``const`` is not provided to :meth:`~ArgumentParser.add_argument`, it will " +"receive a default value of ``None``." msgstr "" #: ../../library/argparse.rst:980 @@ -1679,8 +1677,8 @@ msgid "" "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " "argument that can be followed by zero or one command-line arguments. When " "parsing the command line, if the option string is encountered with no " -"command-line argument following it, the value of ``const`` will be assumed " -"to be ``None`` instead. See the nargs_ description for examples." +"command-line argument following it, the value from ``const`` will be used. " +"See the nargs_ description for examples." msgstr "" #: ../../library/argparse.rst:987 @@ -1696,11 +1694,11 @@ msgstr "default" #: ../../library/argparse.rst:996 msgid "" "All optional arguments and some positional arguments may be omitted at the " -"command line. The ``default`` keyword argument " -"of :meth:`~ArgumentParser.add_argument`, whose value defaults to ``None``, " -"specifies what value should be used if the command-line argument is not " -"present. For optional arguments, the ``default`` value is used when the " -"option string was not present at the command line::" +"command line. The ``default`` keyword argument of :meth:`~ArgumentParser." +"add_argument`, whose value defaults to ``None``, specifies what value should " +"be used if the command-line argument is not present. For optional arguments, " +"the ``default`` value is used when the option string was not present at the " +"command line::" msgstr "" #: ../../library/argparse.rst:1003 @@ -1741,9 +1739,8 @@ msgstr "" 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_ " -"conversion argument, if provided, before setting the attribute on " -"the :class:`Namespace` return value. Otherwise, the parser uses the value " -"as is::" +"conversion argument, if provided, before setting the attribute on the :class:" +"`Namespace` return value. Otherwise, the parser uses the value as is::" msgstr "" #: ../../library/argparse.rst:1023 @@ -1834,9 +1831,9 @@ msgstr "" 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 " -"function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, " -"or :exc:`ValueError`, the exception is caught and a nicely formatted error " -"message is displayed. Other exception types are not handled." +"function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:" +"`ValueError`, the exception is caught and a nicely formatted error message " +"is displayed. Other exception types are not handled." msgstr "" #: ../../library/argparse.rst:1074 @@ -1905,9 +1902,9 @@ msgstr "" #: ../../library/argparse.rst:1109 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.JSONDecodeError` would not be well formatted and " -"a :exc:`FileNotFoundError` exception would not be handled at all." +"better reporting than can be given by the ``type`` keyword. A :exc:`~json." +"JSONDecodeError` would not be well formatted and a :exc:`FileNotFoundError` " +"exception would not be handled at all." msgstr "" #: ../../library/argparse.rst:1114 @@ -1961,24 +1958,31 @@ msgstr "" #: ../../library/argparse.rst:1145 msgid "" -"Note that inclusion in the *choices* sequence is checked after any type_ " -"conversions have been performed, so the type of the objects in the *choices* " -"sequence should match the type_ specified." -msgstr "" - -#: ../../library/argparse.rst:1149 -msgid "" "Any sequence can be passed as the *choices* value, so :class:`list` " "objects, :class:`tuple` objects, and custom sequences are all supported." msgstr "" -#: ../../library/argparse.rst:1152 +#: ../../library/argparse.rst:1148 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." msgstr "" -#: ../../library/argparse.rst:1155 +#: ../../library/argparse.rst:1151 +msgid "" +"Note that *choices* are checked after any type_ conversions have been " +"performed, so objects in *choices* should match the type_ specified. This " +"can make *choices* appear unfamiliar in usage, help, or error messages." +msgstr "" + +#: ../../library/argparse.rst:1156 +msgid "" +"To keep *choices* user-friendly, consider a custom type wrapper that " +"converts and formats values, or omit type_ and handle conversion in your " +"application code." +msgstr "" + +#: ../../library/argparse.rst:1160 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 " @@ -1986,11 +1990,11 @@ msgid "" "are many choices), just specify an explicit metavar_." msgstr "" -#: ../../library/argparse.rst:1164 +#: ../../library/argparse.rst:1169 msgid "required" msgstr "required" -#: ../../library/argparse.rst:1166 +#: ../../library/argparse.rst:1171 msgid "" "In general, the :mod:`!argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " @@ -1998,7 +2002,7 @@ msgid "" "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" -#: ../../library/argparse.rst:1171 +#: ../../library/argparse.rst:1176 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', required=True)\n" @@ -2016,24 +2020,24 @@ msgstr "" "usage: [-h] --foo FOO\n" ": error: the following arguments are required: --foo" -#: ../../library/argparse.rst:1179 +#: ../../library/argparse.rst:1184 msgid "" -"As the example shows, if an option is marked as " -"``required``, :meth:`~ArgumentParser.parse_args` will report an error if " -"that option is not present at the command line." +"As the example shows, if an option is marked as ``required``, :meth:" +"`~ArgumentParser.parse_args` will report an error if that option is not " +"present at the command line." msgstr "" -#: ../../library/argparse.rst:1185 +#: ../../library/argparse.rst:1190 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." msgstr "" -#: ../../library/argparse.rst:1192 +#: ../../library/argparse.rst:1197 msgid "help" msgstr "help" -#: ../../library/argparse.rst:1194 +#: ../../library/argparse.rst:1199 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`` " @@ -2041,16 +2045,16 @@ msgid "" "each argument." msgstr "" -#: ../../library/argparse.rst:1199 +#: ../../library/argparse.rst:1204 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " "available specifiers include the program name, ``%(prog)s`` and most keyword " -"arguments to :meth:`~ArgumentParser.add_argument`, e.g. ``%(default)s``, ``%" -"(type)s``, etc.::" +"arguments to :meth:`~ArgumentParser.add_argument`, e.g. ``%(default)s``, " +"``%(type)s``, etc.::" msgstr "" -#: ../../library/argparse.rst:1204 +#: ../../library/argparse.rst:1209 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" @@ -2076,19 +2080,19 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1216 +#: ../../library/argparse.rst:1221 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." msgstr "" -#: ../../library/argparse.rst:1219 +#: ../../library/argparse.rst:1224 msgid "" ":mod:`!argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" -#: ../../library/argparse.rst:1222 +#: ../../library/argparse.rst:1227 msgid "" ">>> parser = argparse.ArgumentParser(prog='frobble')\n" ">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" @@ -2106,11 +2110,11 @@ msgstr "" "options:\n" " -h, --help show this help message and exit" -#: ../../library/argparse.rst:1234 +#: ../../library/argparse.rst:1239 msgid "metavar" msgstr "metavar" -#: ../../library/argparse.rst:1236 +#: ../../library/argparse.rst:1241 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " "refer to each expected argument. By default, :class:`!ArgumentParser` " @@ -2122,7 +2126,7 @@ msgid "" "command-line argument will be referred to as ``FOO``. An example::" msgstr "" -#: ../../library/argparse.rst:1245 +#: ../../library/argparse.rst:1250 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2154,11 +2158,11 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo FOO" -#: ../../library/argparse.rst:1260 +#: ../../library/argparse.rst:1265 msgid "An alternative name can be specified with ``metavar``::" msgstr "" -#: ../../library/argparse.rst:1262 +#: ../../library/argparse.rst:1267 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', metavar='YYY')\n" @@ -2190,21 +2194,21 @@ msgstr "" " -h, --help show this help message and exit\n" " --foo YYY" -#: ../../library/argparse.rst:1277 +#: ../../library/argparse.rst:1282 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " "determined by the dest_ value." msgstr "" -#: ../../library/argparse.rst:1281 +#: ../../library/argparse.rst:1286 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " "each of the arguments::" msgstr "" -#: ../../library/argparse.rst:1285 +#: ../../library/argparse.rst:1290 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', nargs=2)\n" @@ -2228,21 +2232,21 @@ msgstr "" " -x X X\n" " --foo bar baz" -#: ../../library/argparse.rst:1300 +#: ../../library/argparse.rst:1305 msgid "dest" msgstr "dest" -#: ../../library/argparse.rst:1302 +#: ../../library/argparse.rst:1307 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " -"attribute is determined by the ``dest`` keyword argument " -"of :meth:`~ArgumentParser.add_argument`. For positional argument actions, " -"``dest`` is normally supplied as the first argument " -"to :meth:`~ArgumentParser.add_argument`::" +"attribute is determined by the ``dest`` keyword argument of :meth:" +"`~ArgumentParser.add_argument`. For positional argument actions, ``dest`` " +"is normally supplied as the first argument to :meth:`~ArgumentParser." +"add_argument`::" msgstr "" -#: ../../library/argparse.rst:1309 +#: ../../library/argparse.rst:1314 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('bar')\n" @@ -2254,7 +2258,7 @@ msgstr "" ">>> parser.parse_args(['XXX'])\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1314 +#: ../../library/argparse.rst:1319 msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " @@ -2266,7 +2270,7 @@ msgid "" "below illustrate this behavior::" msgstr "" -#: ../../library/argparse.rst:1323 +#: ../../library/argparse.rst:1328 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" @@ -2284,11 +2288,11 @@ msgstr "" ">>> parser.parse_args('--foo 1 -y 2'.split())\n" "Namespace(foo_bar='1', x='2')" -#: ../../library/argparse.rst:1331 +#: ../../library/argparse.rst:1336 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "" -#: ../../library/argparse.rst:1333 +#: ../../library/argparse.rst:1338 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', dest='bar')\n" @@ -2300,11 +2304,11 @@ msgstr "" ">>> parser.parse_args('--foo XXX'.split())\n" "Namespace(bar='XXX')" -#: ../../library/argparse.rst:1342 +#: ../../library/argparse.rst:1347 msgid "deprecated" msgstr "deprecated" -#: ../../library/argparse.rst:1344 +#: ../../library/argparse.rst:1349 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 " @@ -2315,7 +2319,7 @@ msgid "" "will be printed to :data:`sys.stderr` when the argument is used::" msgstr "" -#: ../../library/argparse.rst:1354 +#: ../../library/argparse.rst:1359 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser(prog='snake.py')\n" @@ -2335,28 +2339,28 @@ msgstr "" "snake.py: warning: option '--legs' is deprecated\n" "Namespace(legs=4)" -#: ../../library/argparse.rst:1367 +#: ../../library/argparse.rst:1372 msgid "Action classes" msgstr "Action 類別" -#: ../../library/argparse.rst:1369 +#: ../../library/argparse.rst:1374 msgid "" ":class:`!Action` classes implement the Action API, a callable which returns " "a callable which processes arguments from the command-line. Any object which " -"follows this API may be passed as the ``action`` parameter " -"to :meth:`~ArgumentParser.add_argument`." +"follows this API may be passed as the ``action`` parameter to :meth:" +"`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1378 +#: ../../library/argparse.rst:1383 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 " "from the command line. The :class:`!Action` class must accept the two " -"positional arguments plus any keyword arguments passed " -"to :meth:`ArgumentParser.add_argument` except for the ``action`` itself." +"positional arguments plus any keyword arguments passed to :meth:" +"`ArgumentParser.add_argument` except for the ``action`` itself." msgstr "" -#: ../../library/argparse.rst:1384 +#: ../../library/argparse.rst:1389 msgid "" "Instances of :class:`!Action` (or return value of any callable to the " "``action`` parameter) should have attributes :attr:`!dest`, :attr:`!" @@ -2365,46 +2369,46 @@ msgid "" "is to call :meth:`!Action.__init__`." msgstr "" -#: ../../library/argparse.rst:1392 +#: ../../library/argparse.rst:1397 msgid "" ":class:`!Action` instances should be callable, so subclasses must override " "the :meth:`!__call__` method, which should accept four parameters:" msgstr "" -#: ../../library/argparse.rst:1395 +#: ../../library/argparse.rst:1400 msgid "" "*parser* - The :class:`ArgumentParser` object which contains this action." msgstr "" -#: ../../library/argparse.rst:1397 +#: ../../library/argparse.rst:1402 msgid "" -"*namespace* - The :class:`Namespace` object that will be returned " -"by :meth:`~ArgumentParser.parse_args`. Most actions add an attribute to " -"this object using :func:`setattr`." +"*namespace* - The :class:`Namespace` object that will be returned by :meth:" +"`~ArgumentParser.parse_args`. Most actions add an attribute to this object " +"using :func:`setattr`." msgstr "" -#: ../../library/argparse.rst:1401 +#: ../../library/argparse.rst:1406 msgid "" "*values* - The associated command-line arguments, with any type conversions " -"applied. Type conversions are specified with the type_ keyword argument " -"to :meth:`~ArgumentParser.add_argument`." +"applied. Type conversions are specified with the type_ keyword argument to :" +"meth:`~ArgumentParser.add_argument`." msgstr "" -#: ../../library/argparse.rst:1405 +#: ../../library/argparse.rst:1410 msgid "" "*option_string* - The option string that was used to invoke this action. The " "``option_string`` argument is optional, and will be absent if the action is " "associated with a positional argument." msgstr "" -#: ../../library/argparse.rst:1409 +#: ../../library/argparse.rst:1414 msgid "" "The :meth:`!__call__` method may perform arbitrary actions, but will " "typically set attributes on the ``namespace`` based on ``dest`` and " "``values``." msgstr "" -#: ../../library/argparse.rst:1414 +#: ../../library/argparse.rst:1419 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 " @@ -2412,7 +2416,7 @@ msgid "" "will be used." msgstr "" -#: ../../library/argparse.rst:1420 +#: ../../library/argparse.rst:1425 msgid "" "A subclass of :class:`Action` for handling boolean flags with positive and " "negative options. Adding a single argument such as ``--foo`` automatically " @@ -2420,7 +2424,7 @@ msgid "" "``False`` respectively::" msgstr "" -#: ../../library/argparse.rst:1425 +#: ../../library/argparse.rst:1430 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -2434,47 +2438,47 @@ msgstr "" ">>> parser.parse_args(['--no-foo'])\n" "Namespace(foo=False)" -#: ../../library/argparse.rst:1435 +#: ../../library/argparse.rst:1440 msgid "The parse_args() method" msgstr "parse_args() 方法" -#: ../../library/argparse.rst:1439 +#: ../../library/argparse.rst:1444 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." msgstr "" -#: ../../library/argparse.rst:1442 +#: ../../library/argparse.rst:1447 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " "created and how they are assigned. See the documentation for :meth:`!" "add_argument` for details." msgstr "" -#: ../../library/argparse.rst:1446 +#: ../../library/argparse.rst:1451 msgid "" -"args_ - List of strings to parse. The default is taken " -"from :data:`sys.argv`." +"args_ - List of strings to parse. The default is taken from :data:`sys." +"argv`." msgstr "" -#: ../../library/argparse.rst:1449 +#: ../../library/argparse.rst:1454 msgid "" -"namespace_ - An object to take the attributes. The default is a new " -"empty :class:`Namespace` object." +"namespace_ - An object to take the attributes. The default is a new empty :" +"class:`Namespace` object." msgstr "" -#: ../../library/argparse.rst:1454 +#: ../../library/argparse.rst:1459 msgid "Option value syntax" msgstr "" -#: ../../library/argparse.rst:1456 +#: ../../library/argparse.rst:1461 msgid "" "The :meth:`~ArgumentParser.parse_args` method supports several ways of " "specifying the value of an option (if it takes one). In the simplest case, " "the option and its value are passed as two separate arguments::" msgstr "" -#: ../../library/argparse.rst:1460 +#: ../../library/argparse.rst:1465 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2492,14 +2496,14 @@ msgstr "" ">>> parser.parse_args(['--foo', 'FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1468 +#: ../../library/argparse.rst:1473 msgid "" "For long options (options with names longer than a single character), the " "option and value can also be passed as a single command-line argument, using " "``=`` to separate them::" msgstr "" -#: ../../library/argparse.rst:1472 +#: ../../library/argparse.rst:1477 msgid "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" @@ -2507,13 +2511,13 @@ msgstr "" ">>> parser.parse_args(['--foo=FOO'])\n" "Namespace(foo='FOO', x=None)" -#: ../../library/argparse.rst:1475 +#: ../../library/argparse.rst:1480 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" msgstr "" -#: ../../library/argparse.rst:1478 +#: ../../library/argparse.rst:1483 msgid "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" @@ -2521,13 +2525,13 @@ msgstr "" ">>> parser.parse_args(['-xX'])\n" "Namespace(foo=None, x='X')" -#: ../../library/argparse.rst:1481 +#: ../../library/argparse.rst:1486 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" msgstr "" -#: ../../library/argparse.rst:1484 +#: ../../library/argparse.rst:1489 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x', action='store_true')\n" @@ -2543,11 +2547,11 @@ msgstr "" ">>> parser.parse_args(['-xyzZ'])\n" "Namespace(x=True, y=True, z='Z')" -#: ../../library/argparse.rst:1493 +#: ../../library/argparse.rst:1498 msgid "Invalid arguments" msgstr "無效引數" -#: ../../library/argparse.rst:1495 +#: ../../library/argparse.rst:1500 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -2555,7 +2559,7 @@ msgid "" "an error, it exits and prints the error along with a usage message::" msgstr "" -#: ../../library/argparse.rst:1500 +#: ../../library/argparse.rst:1505 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('--foo', type=int)\n" @@ -2595,11 +2599,11 @@ msgstr "" "usage: PROG [-h] [--foo FOO] [bar]\n" "PROG: error: extra arguments found: badger" -#: ../../library/argparse.rst:1521 +#: ../../library/argparse.rst:1526 msgid "Arguments containing ``-``" msgstr "包含 ``-`` 的引數" -#: ../../library/argparse.rst:1523 +#: ../../library/argparse.rst:1528 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -2611,7 +2615,7 @@ msgid "" "negative numbers::" msgstr "" -#: ../../library/argparse.rst:1531 +#: ../../library/argparse.rst:1536 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-x')\n" @@ -2644,7 +2648,7 @@ msgid "" "PROG: error: argument -1: expected one argument" msgstr "" -#: ../../library/argparse.rst:1561 +#: ../../library/argparse.rst:1566 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -2652,7 +2656,7 @@ msgid "" "positional argument::" msgstr "" -#: ../../library/argparse.rst:1566 +#: ../../library/argparse.rst:1571 msgid "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" @@ -2660,24 +2664,24 @@ msgstr "" ">>> parser.parse_args(['--', '-f'])\n" "Namespace(foo='-f', one=None)" -#: ../../library/argparse.rst:1569 +#: ../../library/argparse.rst:1574 msgid "" "See also :ref:`the argparse howto on ambiguous arguments ` for more details." msgstr "" -#: ../../library/argparse.rst:1575 +#: ../../library/argparse.rst:1580 msgid "Argument abbreviations (prefix matching)" msgstr "引數縮寫 (前綴匹配)" -#: ../../library/argparse.rst:1577 +#: ../../library/argparse.rst:1582 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "` allows long options to be abbreviated to a prefix, if the " "abbreviation is unambiguous (the prefix matches a unique option)::" msgstr "" -#: ../../library/argparse.rst:1581 +#: ../../library/argparse.rst:1586 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> parser.add_argument('-bacon')\n" @@ -2701,17 +2705,17 @@ msgstr "" "usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" "PROG: error: ambiguous option: -ba could match -badger, -bacon" -#: ../../library/argparse.rst:1592 +#: ../../library/argparse.rst:1597 msgid "" "An error is produced for arguments that could produce more than one options. " "This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." msgstr "" -#: ../../library/argparse.rst:1598 +#: ../../library/argparse.rst:1603 msgid "Beyond ``sys.argv``" -msgstr "" +msgstr "``sys.argv`` 之外" -#: ../../library/argparse.rst:1600 +#: ../../library/argparse.rst:1605 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 " @@ -2719,7 +2723,7 @@ msgid "" "useful for testing at the interactive prompt::" msgstr "" -#: ../../library/argparse.rst:1605 +#: ../../library/argparse.rst:1610 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument(\n" @@ -2745,24 +2749,24 @@ msgstr "" ">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" "Namespace(accumulate=, integers=[1, 2, 3, 4])" -#: ../../library/argparse.rst:1620 +#: ../../library/argparse.rst:1625 msgid "The Namespace object" msgstr "命名空間物件" -#: ../../library/argparse.rst:1624 +#: ../../library/argparse.rst:1629 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." msgstr "" -#: ../../library/argparse.rst:1627 +#: ../../library/argparse.rst:1632 msgid "" "This class is deliberately simple, just an :class:`object` subclass with a " "readable string representation. If you prefer to have dict-like view of the " "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" -#: ../../library/argparse.rst:1631 +#: ../../library/argparse.rst:1636 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -2776,14 +2780,14 @@ msgstr "" ">>> vars(args)\n" "{'foo': 'BAR'}" -#: ../../library/argparse.rst:1637 +#: ../../library/argparse.rst:1642 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " "to an already existing object, rather than a new :class:`Namespace` object. " "This can be achieved by specifying the ``namespace=`` keyword argument::" msgstr "" -#: ../../library/argparse.rst:1641 +#: ../../library/argparse.rst:1646 msgid "" ">>> class C:\n" "... pass\n" @@ -2805,93 +2809,92 @@ msgstr "" ">>> c.foo\n" "'BAR'" -#: ../../library/argparse.rst:1653 +#: ../../library/argparse.rst:1658 msgid "Other utilities" msgstr "" -#: ../../library/argparse.rst:1656 +#: ../../library/argparse.rst:1661 msgid "Sub-commands" msgstr "子命令" -#: ../../library/argparse.rst:1663 +#: ../../library/argparse.rst:1668 msgid "" "Many programs split up their functionality into a number of subcommands, for " "example, the ``svn`` program can invoke subcommands like ``svn checkout``, " "``svn update``, and ``svn commit``. Splitting up functionality this way can " "be a particularly good idea when a program performs several different " -"functions which require different kinds of command-line " -"arguments. :class:`ArgumentParser` supports the creation of such subcommands " -"with the :meth:`!add_subparsers` method. The :meth:`!add_subparsers` method " -"is normally called with no arguments and returns a special action object. " -"This object has a single method, :meth:`~_SubParsersAction.add_parser`, " -"which takes a command name and any :class:`!ArgumentParser` constructor " -"arguments, and returns an :class:`!ArgumentParser` object that can be " -"modified as usual." +"functions which require different kinds of command-line arguments. :class:" +"`ArgumentParser` supports the creation of such subcommands with the :meth:`!" +"add_subparsers` method. The :meth:`!add_subparsers` method is normally " +"called with no arguments and returns a special action object. This object " +"has a single method, :meth:`~_SubParsersAction.add_parser`, which takes a " +"command name and any :class:`!ArgumentParser` constructor arguments, and " +"returns an :class:`!ArgumentParser` object that can be modified as usual." msgstr "" -#: ../../library/argparse.rst:1675 +#: ../../library/argparse.rst:1680 msgid "Description of parameters:" msgstr "參數的解釋:" -#: ../../library/argparse.rst:1677 +#: ../../library/argparse.rst:1682 msgid "" "*title* - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" -#: ../../library/argparse.rst:1681 +#: ../../library/argparse.rst:1686 msgid "" "*description* - description for the sub-parser group in help output, by " "default ``None``" msgstr "" -#: ../../library/argparse.rst:1684 +#: ../../library/argparse.rst:1689 msgid "" "*prog* - usage information that will be displayed with sub-command help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" -#: ../../library/argparse.rst:1688 +#: ../../library/argparse.rst:1693 msgid "" "*parser_class* - class which will be used to create sub-parser instances, by " "default the class of the current parser (e.g. :class:`ArgumentParser`)" msgstr "" -#: ../../library/argparse.rst:1691 +#: ../../library/argparse.rst:1696 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "" -#: ../../library/argparse.rst:1694 +#: ../../library/argparse.rst:1699 msgid "" "dest_ - name of the attribute under which sub-command name will be stored; " "by default ``None`` and no value is stored" msgstr "" -#: ../../library/argparse.rst:1697 +#: ../../library/argparse.rst:1702 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" msgstr "" -#: ../../library/argparse.rst:1700 +#: ../../library/argparse.rst:1705 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "" -#: ../../library/argparse.rst:1702 +#: ../../library/argparse.rst:1707 msgid "" "metavar_ - string presenting available subcommands in help; by default it is " "``None`` and presents subcommands in form {cmd1, cmd2, ..}" msgstr "" -#: ../../library/argparse.rst:1705 +#: ../../library/argparse.rst:1710 msgid "Some example usage::" msgstr "一些使用範例: ::" -#: ../../library/argparse.rst:1707 +#: ../../library/argparse.rst:1712 msgid "" ">>> # create the top-level parser\n" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" @@ -2914,7 +2917,7 @@ msgid "" "Namespace(baz='Z', foo=True)" msgstr "" -#: ../../library/argparse.rst:1726 +#: ../../library/argparse.rst:1731 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 " @@ -2924,7 +2927,7 @@ msgid "" "``baz`` attributes are present." msgstr "" -#: ../../library/argparse.rst:1733 +#: ../../library/argparse.rst:1738 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 " @@ -2933,7 +2936,7 @@ msgid "" "to :meth:`~_SubParsersAction.add_parser` as above.)" msgstr "" -#: ../../library/argparse.rst:1741 +#: ../../library/argparse.rst:1746 msgid "" ">>> parser.parse_args(['--help'])\n" "usage: PROG [-h] [--foo] {a,b} ...\n" @@ -2991,14 +2994,14 @@ msgstr "" " -h, --help show this help message and exit\n" " --baz {X,Y,Z} baz help" -#: ../../library/argparse.rst:1769 +#: ../../library/argparse.rst:1774 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " "commands will appear in their own group in the help output. For example::" msgstr "" -#: ../../library/argparse.rst:1773 +#: ../../library/argparse.rst:1778 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(title='subcommands',\n" @@ -3034,7 +3037,7 @@ msgstr "" "\n" " {foo,bar} additional help" -#: ../../library/argparse.rst:1790 +#: ../../library/argparse.rst:1795 msgid "" "Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional " "*aliases* argument, which allows multiple strings to refer to the same " @@ -3042,7 +3045,7 @@ msgid "" "``checkout``::" msgstr "" -#: ../../library/argparse.rst:1795 +#: ../../library/argparse.rst:1800 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers()\n" @@ -3058,13 +3061,13 @@ msgstr "" ">>> parser.parse_args(['co', 'bar'])\n" "Namespace(foo='bar')" -#: ../../library/argparse.rst:1802 +#: ../../library/argparse.rst:1807 msgid "" ":meth:`~_SubParsersAction.add_parser` supports also an additional " "*deprecated* argument, which allows to deprecate the subparser." msgstr "" -#: ../../library/argparse.rst:1816 +#: ../../library/argparse.rst:1821 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 " @@ -3072,7 +3075,7 @@ msgid "" "example::" msgstr "" -#: ../../library/argparse.rst:1821 +#: ../../library/argparse.rst:1826 msgid "" ">>> # subcommand functions\n" ">>> def foo(args):\n" @@ -3107,7 +3110,7 @@ msgid "" "((XYZYX))" msgstr "" -#: ../../library/argparse.rst:1853 +#: ../../library/argparse.rst:1858 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -3117,7 +3120,7 @@ msgid "" "argument to the :meth:`add_subparsers` call will work::" msgstr "" -#: ../../library/argparse.rst:1860 +#: ../../library/argparse.rst:1865 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" @@ -3137,30 +3140,30 @@ msgstr "" ">>> parser.parse_args(['2', 'frobble'])\n" "Namespace(subparser_name='2', y='frobble')" -#: ../../library/argparse.rst:1869 +#: ../../library/argparse.rst:1874 msgid "New *required* keyword-only parameter." msgstr "" -#: ../../library/argparse.rst:1872 +#: ../../library/argparse.rst:1877 msgid "" "Subparser's *prog* is no longer affected by a custom usage message in the " "main parser." msgstr "" -#: ../../library/argparse.rst:1878 +#: ../../library/argparse.rst:1883 msgid "FileType objects" msgstr "FileType 物件" -#: ../../library/argparse.rst:1882 +#: ../../library/argparse.rst:1887 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " -"argument of :meth:`ArgumentParser.add_argument`. Arguments that " -"have :class:`FileType` objects as their type will open command-line " -"arguments as files with the requested modes, buffer sizes, encodings and " -"error handling (see the :func:`open` function for more details)::" +"argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" +"`FileType` objects as their type will open command-line arguments as files " +"with the requested modes, buffer sizes, encodings and error handling (see " +"the :func:`open` function for more details)::" msgstr "" -#: ../../library/argparse.rst:1888 +#: ../../library/argparse.rst:1893 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" @@ -3178,14 +3181,14 @@ msgstr "" "Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " "raw=<_io.FileIO name='raw.dat' mode='wb'>)" -#: ../../library/argparse.rst:1894 +#: ../../library/argparse.rst:1899 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " "convert this into :data:`sys.stdin` for readable :class:`FileType` objects " "and :data:`sys.stdout` for writable :class:`FileType` objects::" msgstr "" -#: ../../library/argparse.rst:1898 +#: ../../library/argparse.rst:1903 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" @@ -3197,7 +3200,7 @@ msgstr "" ">>> parser.parse_args(['-'])\n" "Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -#: ../../library/argparse.rst:1905 +#: ../../library/argparse.rst:1910 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 " @@ -3206,15 +3209,15 @@ msgid "" "manage the files." msgstr "" -#: ../../library/argparse.rst:1911 +#: ../../library/argparse.rst:1916 msgid "Added the *encodings* and *errors* parameters." msgstr "" -#: ../../library/argparse.rst:1918 +#: ../../library/argparse.rst:1923 msgid "Argument groups" msgstr "" -#: ../../library/argparse.rst:1923 +#: ../../library/argparse.rst:1928 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " "\"positional arguments\" and \"options\" when displaying help messages. When " @@ -3223,7 +3226,7 @@ msgid "" "method::" msgstr "" -#: ../../library/argparse.rst:1929 +#: ../../library/argparse.rst:1934 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group = parser.add_argument_group('group')\n" @@ -3247,18 +3250,18 @@ msgstr "" " bar bar help\n" " --foo FOO foo help" -#: ../../library/argparse.rst:1940 +#: ../../library/argparse.rst:1945 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " -"has an :meth:`~ArgumentParser.add_argument` method just like a " -"regular :class:`ArgumentParser`. When an argument is added to the group, " -"the parser treats it just like a normal argument, but displays the argument " -"in a separate group for help messages. The :meth:`!add_argument_group` " -"method accepts *title* and *description* arguments which can be used to " -"customize this display::" +"has an :meth:`~ArgumentParser.add_argument` method just like a regular :" +"class:`ArgumentParser`. When an argument is added to the group, the parser " +"treats it just like a normal argument, but displays the argument in a " +"separate group for help messages. The :meth:`!add_argument_group` method " +"accepts *title* and *description* arguments which can be used to customize " +"this display::" msgstr "" -#: ../../library/argparse.rst:1948 +#: ../../library/argparse.rst:1953 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" ">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" @@ -3296,44 +3299,44 @@ msgstr "" "\n" " --bar BAR bar help" -#: ../../library/argparse.rst:1966 +#: ../../library/argparse.rst:1971 msgid "" "The optional, keyword-only parameters argument_default_ and " "conflict_handler_ allow for finer-grained control of the behavior of the " -"argument group. These parameters have the same meaning as in " -"the :class:`ArgumentParser` constructor, but apply specifically to the " -"argument group rather than the entire parser." +"argument group. These parameters have the same meaning as in the :class:" +"`ArgumentParser` constructor, but apply specifically to the argument group " +"rather than the entire parser." msgstr "" -#: ../../library/argparse.rst:1971 +#: ../../library/argparse.rst:1976 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." msgstr "" -#: ../../library/argparse.rst:1974 +#: ../../library/argparse.rst:1979 msgid "" "Calling :meth:`add_argument_group` on an argument group now raises an " "exception. This nesting was never supported, often failed to work correctly, " "and was unintentionally exposed through inheritance." msgstr "" -#: ../../library/argparse.rst:1979 +#: ../../library/argparse.rst:1984 msgid "Passing prefix_chars_ to :meth:`add_argument_group` is now deprecated." msgstr "" -#: ../../library/argparse.rst:1985 +#: ../../library/argparse.rst:1990 msgid "Mutual exclusion" msgstr "" -#: ../../library/argparse.rst:1989 +#: ../../library/argparse.rst:1994 msgid "" "Create a mutually exclusive group. :mod:`!argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" -#: ../../library/argparse.rst:1993 +#: ../../library/argparse.rst:1998 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group()\n" @@ -3359,14 +3362,14 @@ msgstr "" "usage: PROG [-h] [--foo | --bar]\n" "PROG: error: argument --bar: not allowed with argument --foo" -#: ../../library/argparse.rst:2005 +#: ../../library/argparse.rst:2010 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" -#: ../../library/argparse.rst:2009 +#: ../../library/argparse.rst:2014 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_mutually_exclusive_group(required=True)\n" @@ -3384,16 +3387,15 @@ msgstr "" "usage: PROG [-h] (--foo | --bar)\n" "PROG: error: one of the arguments --foo --bar is required" -#: ../../library/argparse.rst:2017 +#: ../../library/argparse.rst:2022 msgid "" "Note that currently mutually exclusive argument groups do not support the " -"*title* and *description* arguments " -"of :meth:`~ArgumentParser.add_argument_group`. However, a mutually exclusive " -"group can be added to an argument group that has a title and description. " -"For example::" +"*title* and *description* arguments of :meth:`~ArgumentParser." +"add_argument_group`. However, a mutually exclusive group can be added to an " +"argument group that has a title and description. For example::" msgstr "" -#: ../../library/argparse.rst:2023 +#: ../../library/argparse.rst:2028 msgid "" ">>> parser = argparse.ArgumentParser(prog='PROG')\n" ">>> group = parser.add_argument_group('Group title', 'Group description')\n" @@ -3429,7 +3431,7 @@ msgstr "" " --foo FOO foo help\n" " --bar BAR bar help" -#: ../../library/argparse.rst:2040 +#: ../../library/argparse.rst:2045 msgid "" "Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " "on a mutually exclusive group now raises an exception. This nesting was " @@ -3437,20 +3439,20 @@ msgid "" "exposed through inheritance." msgstr "" -#: ../../library/argparse.rst:2048 +#: ../../library/argparse.rst:2053 msgid "Parser defaults" msgstr "" -#: ../../library/argparse.rst:2052 +#: ../../library/argparse.rst:2057 msgid "" -"Most of the time, the attributes of the object returned " -"by :meth:`parse_args` will be fully determined by inspecting the command-" -"line arguments and the argument actions. :meth:`set_defaults` allows some " +"Most of the time, the attributes of the object returned by :meth:" +"`parse_args` will be fully determined by inspecting the command-line " +"arguments and the argument actions. :meth:`set_defaults` allows some " "additional attributes that are determined without any inspection of the " "command line to be added::" msgstr "" -#: ../../library/argparse.rst:2058 +#: ../../library/argparse.rst:2063 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('foo', type=int)\n" @@ -3464,12 +3466,12 @@ msgstr "" ">>> parser.parse_args(['736'])\n" "Namespace(bar=42, baz='badger', foo=736)" -#: ../../library/argparse.rst:2064 +#: ../../library/argparse.rst:2069 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" -#: ../../library/argparse.rst:2066 +#: ../../library/argparse.rst:2071 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='bar')\n" @@ -3483,21 +3485,20 @@ msgstr "" ">>> parser.parse_args([])\n" "Namespace(foo='spam')" -#: ../../library/argparse.rst:2072 +#: ../../library/argparse.rst:2077 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " "example of this type." msgstr "" -#: ../../library/argparse.rst:2078 +#: ../../library/argparse.rst:2083 msgid "" -"Get the default value for a namespace attribute, as set by " -"either :meth:`~ArgumentParser.add_argument` or " -"by :meth:`~ArgumentParser.set_defaults`::" +"Get the default value for a namespace attribute, as set by either :meth:" +"`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" msgstr "" -#: ../../library/argparse.rst:2082 +#: ../../library/argparse.rst:2087 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', default='badger')\n" @@ -3509,54 +3510,54 @@ msgstr "" ">>> parser.get_default('foo')\n" "'badger'" -#: ../../library/argparse.rst:2089 +#: ../../library/argparse.rst:2094 msgid "Printing help" msgstr "印出幫助訊息" -#: ../../library/argparse.rst:2091 +#: ../../library/argparse.rst:2096 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " "several formatting methods are available:" msgstr "" -#: ../../library/argparse.rst:2097 +#: ../../library/argparse.rst:2102 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " "assumed." msgstr "" -#: ../../library/argparse.rst:2103 +#: ../../library/argparse.rst:2108 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " "``None``, :data:`sys.stdout` is assumed." msgstr "" -#: ../../library/argparse.rst:2107 +#: ../../library/argparse.rst:2112 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" msgstr "" -#: ../../library/argparse.rst:2112 +#: ../../library/argparse.rst:2117 msgid "" -"Return a string containing a brief description of how " -"the :class:`ArgumentParser` should be invoked on the command line." +"Return a string containing a brief description of how the :class:" +"`ArgumentParser` should be invoked on the command line." msgstr "" -#: ../../library/argparse.rst:2117 +#: ../../library/argparse.rst:2122 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." msgstr "" -#: ../../library/argparse.rst:2122 +#: ../../library/argparse.rst:2127 msgid "Partial parsing" msgstr "" -#: ../../library/argparse.rst:2126 +#: ../../library/argparse.rst:2131 msgid "" "Sometimes a script only needs to handle a specific set of command-line " "arguments, leaving any unrecognized arguments for another script or program. " @@ -3564,7 +3565,7 @@ msgid "" "useful." msgstr "" -#: ../../library/argparse.rst:2131 +#: ../../library/argparse.rst:2136 msgid "" "This method works similarly to :meth:`~ArgumentParser.parse_args`, but it " "does not raise an error for extra, unrecognized arguments. Instead, it " @@ -3572,7 +3573,7 @@ msgid "" "populated namespace and the list of any unrecognized arguments." msgstr "" -#: ../../library/argparse.rst:2138 +#: ../../library/argparse.rst:2143 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo', action='store_true')\n" @@ -3586,19 +3587,19 @@ msgstr "" ">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" "(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" -#: ../../library/argparse.rst:2145 +#: ../../library/argparse.rst:2150 msgid "" -":ref:`Prefix matching ` rules apply " -"to :meth:`~ArgumentParser.parse_known_args`. The parser may consume an " -"option even if it's just a prefix of one of its known options, instead of " -"leaving it in the remaining arguments list." +":ref:`Prefix matching ` rules apply to :meth:" +"`~ArgumentParser.parse_known_args`. The parser may consume an option even if " +"it's just a prefix of one of its known options, instead of leaving it in the " +"remaining arguments list." msgstr "" -#: ../../library/argparse.rst:2152 +#: ../../library/argparse.rst:2157 msgid "Customizing file parsing" msgstr "" -#: ../../library/argparse.rst:2156 +#: ../../library/argparse.rst:2161 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -3606,20 +3607,20 @@ msgid "" "reading." msgstr "" -#: ../../library/argparse.rst:2161 +#: ../../library/argparse.rst:2166 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " "The method is called once per line read from the argument file, in order." msgstr "" -#: ../../library/argparse.rst:2165 +#: ../../library/argparse.rst:2170 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -#: ../../library/argparse.rst:2168 +#: ../../library/argparse.rst:2173 msgid "" "class MyArgumentParser(argparse.ArgumentParser):\n" " def convert_arg_line_to_args(self, arg_line):\n" @@ -3629,18 +3630,18 @@ msgstr "" " def convert_arg_line_to_args(self, arg_line):\n" " return arg_line.split()" -#: ../../library/argparse.rst:2174 +#: ../../library/argparse.rst:2179 msgid "Exiting methods" msgstr "" -#: ../../library/argparse.rst:2178 +#: ../../library/argparse.rst:2183 msgid "" "This method terminates the program, exiting with the specified *status* and, " "if given, it prints a *message* to :data:`sys.stderr` before that. The user " "can override this method to handle these steps differently::" msgstr "" -#: ../../library/argparse.rst:2182 +#: ../../library/argparse.rst:2187 msgid "" "class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" " def exit(self, status=0, message=None):\n" @@ -3654,17 +3655,17 @@ msgstr "" " raise Exception(f'Exiting because of an error: {message}')\n" " exit(status)" -#: ../../library/argparse.rst:2190 +#: ../../library/argparse.rst:2195 msgid "" -"This method prints a usage message, including the *message*, " -"to :data:`sys.stderr` and terminates the program with a status code of 2." +"This method prints a usage message, including the *message*, to :data:`sys." +"stderr` and terminates the program with a status code of 2." msgstr "" -#: ../../library/argparse.rst:2195 +#: ../../library/argparse.rst:2200 msgid "Intermixed parsing" msgstr "" -#: ../../library/argparse.rst:2200 +#: ../../library/argparse.rst:2205 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -3672,7 +3673,7 @@ msgid "" "parsing style." msgstr "" -#: ../../library/argparse.rst:2205 +#: ../../library/argparse.rst:2210 msgid "" "These parsers do not support all the :mod:`!argparse` features, and will " "raise exceptions if unsupported features are used. In particular, " @@ -3680,16 +3681,15 @@ msgid "" "positionals are not supported." msgstr "" -#: ../../library/argparse.rst:2210 +#: ../../library/argparse.rst:2215 msgid "" -"The following example shows the difference " -"between :meth:`~ArgumentParser.parse_known_args` " -"and :meth:`~ArgumentParser.parse_intermixed_args`: the former returns " -"``['2', '3']`` as unparsed arguments, while the latter collects all the " -"positionals into ``rest``. ::" +"The following example shows the difference between :meth:`~ArgumentParser." +"parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " +"former returns ``['2', '3']`` as unparsed arguments, while the latter " +"collects all the positionals into ``rest``. ::" msgstr "" -#: ../../library/argparse.rst:2216 +#: ../../library/argparse.rst:2221 msgid "" ">>> parser = argparse.ArgumentParser()\n" ">>> parser.add_argument('--foo')\n" @@ -3709,7 +3709,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:2225 +#: ../../library/argparse.rst:2230 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -3717,11 +3717,11 @@ msgid "" "there are any remaining unparsed argument strings." msgstr "" -#: ../../library/argparse.rst:2234 +#: ../../library/argparse.rst:2239 msgid "Registering custom types or actions" msgstr "" -#: ../../library/argparse.rst:2238 +#: ../../library/argparse.rst:2243 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 " @@ -3729,7 +3729,7 @@ msgid "" "the type by their registered name instead of their callable name." msgstr "" -#: ../../library/argparse.rst:2243 +#: ../../library/argparse.rst:2248 msgid "" "The :meth:`!register` method accepts three arguments - a *registry_name*, " "specifying the internal registry where the object will be stored (e.g., " @@ -3737,12 +3737,12 @@ msgid "" "be registered, and object, the callable to be registered." msgstr "" -#: ../../library/argparse.rst:2248 +#: ../../library/argparse.rst:2253 msgid "" "The following example shows how to register a custom type with a parser::" msgstr "" -#: ../../library/argparse.rst:2250 +#: ../../library/argparse.rst:2255 msgid "" ">>> import argparse\n" ">>> parser = argparse.ArgumentParser()\n" @@ -3758,26 +3758,26 @@ msgid "" "PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'" msgstr "" -#: ../../library/argparse.rst:2262 +#: ../../library/argparse.rst:2267 msgid "Exceptions" msgstr "例外" -#: ../../library/argparse.rst:2266 +#: ../../library/argparse.rst:2271 msgid "An error from creating or using an argument (optional or positional)." msgstr "" -#: ../../library/argparse.rst:2268 +#: ../../library/argparse.rst:2273 msgid "" "The string value of this exception is the message, augmented with " "information about the argument that caused it." msgstr "" -#: ../../library/argparse.rst:2273 +#: ../../library/argparse.rst:2278 msgid "" "Raised when something goes wrong converting a command line string to a type." msgstr "" -#: ../../library/argparse.rst:2277 +#: ../../library/argparse.rst:2282 msgid "Guides and Tutorials" msgstr "" @@ -3800,11 +3800,11 @@ msgstr "+ (加號)" #~ msgid "" #~ ">>> parser = argparse.ArgumentParser()\n" -#~ ">>> parser.add_argument('infile', nargs='?', " -#~ "type=argparse.FileType('r'),\n" +#~ ">>> parser.add_argument('infile', nargs='?', type=argparse." +#~ "FileType('r'),\n" #~ "... default=sys.stdin)\n" -#~ ">>> parser.add_argument('outfile', nargs='?', " -#~ "type=argparse.FileType('w'),\n" +#~ ">>> parser.add_argument('outfile', nargs='?', type=argparse." +#~ "FileType('w'),\n" #~ "... default=sys.stdout)\n" #~ ">>> parser.parse_args(['input.txt', 'output.txt'])\n" #~ "Namespace(infile=<_io.TextIOWrapper name='input.txt' encoding='UTF-8'>,\n" @@ -3815,11 +3815,11 @@ msgstr "+ (加號)" #~ " outfile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" #~ msgstr "" #~ ">>> parser = argparse.ArgumentParser()\n" -#~ ">>> parser.add_argument('infile', nargs='?', " -#~ "type=argparse.FileType('r'),\n" +#~ ">>> parser.add_argument('infile', nargs='?', type=argparse." +#~ "FileType('r'),\n" #~ "... default=sys.stdin)\n" -#~ ">>> parser.add_argument('outfile', nargs='?', " -#~ "type=argparse.FileType('w'),\n" +#~ ">>> parser.add_argument('outfile', nargs='?', type=argparse." +#~ "FileType('w'),\n" #~ "... default=sys.stdout)\n" #~ ">>> parser.parse_args(['input.txt', 'output.txt'])\n" #~ "Namespace(infile=<_io.TextIOWrapper name='input.txt' encoding='UTF-8'>,\n" diff --git a/library/collections.abc.po b/library/collections.abc.po index 1999abb4ab..9cd5830693 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-18 00:15+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,8 +33,8 @@ msgstr "**原始碼:**\\ :source:`Lib/_collections_abc.py`" msgid "" "This module provides :term:`abstract base classes ` " "that can be used to test whether a class provides a particular interface; " -"for example, whether it is :term:`hashable` or whether it is " -"a :term:`mapping`." +"for example, whether it is :term:`hashable` or whether it is a :term:" +"`mapping`." msgstr "" #: ../../library/collections.abc.rst:27 @@ -112,9 +112,9 @@ msgstr "" msgid "" "In this example, class :class:`!D` does not need to define ``__contains__``, " "``__iter__``, and ``__reversed__`` because the :ref:`in-operator " -"`, the :term:`iteration ` logic, and " -"the :func:`reversed` function automatically fall back to using " -"``__getitem__`` and ``__len__``." +"`, the :term:`iteration ` logic, and the :func:" +"`reversed` function automatically fall back to using ``__getitem__`` and " +"``__len__``." msgstr "" #: ../../library/collections.abc.rst:82 @@ -239,7 +239,7 @@ msgstr ":class:`Generator` [1]_" msgid ":class:`Iterator`" msgstr ":class:`Iterator`" -#: ../../library/collections.abc.rst:127 ../../library/collections.abc.rst:173 +#: ../../library/collections.abc.rst:127 ../../library/collections.abc.rst:176 msgid "``send``, ``throw``" msgstr "``send``、``throw``" @@ -271,11 +271,12 @@ msgstr ":class:`Collection` [1]_" msgid ":class:`Sized`, :class:`Iterable`, :class:`Container`" msgstr ":class:`Sized`、:class:`Iterable`、:class:`Container`" -#: ../../library/collections.abc.rst:130 ../../library/collections.abc.rst:143 +#: ../../library/collections.abc.rst:130 ../../library/collections.abc.rst:146 msgid "``__contains__``, ``__iter__``, ``__len__``" msgstr "``__contains__``、``__iter__``、``__len__``" #: ../../library/collections.abc.rst:134 ../../library/collections.abc.rst:137 +#: ../../library/collections.abc.rst:143 msgid ":class:`Sequence`" msgstr ":class:`Sequence`" @@ -283,7 +284,7 @@ msgstr ":class:`Sequence`" msgid ":class:`Reversible`, :class:`Collection`" msgstr ":class:`Reversible`, :class:`Collection`" -#: ../../library/collections.abc.rst:134 +#: ../../library/collections.abc.rst:134 ../../library/collections.abc.rst:143 msgid "``__getitem__``, ``__len__``" msgstr "``__getitem__``、``__len__``" @@ -309,15 +310,23 @@ msgid "" "``extend``, ``pop``, ``remove``, and ``__iadd__``" msgstr "" -#: ../../library/collections.abc.rst:143 ../../library/collections.abc.rst:148 +#: ../../library/collections.abc.rst:143 +msgid ":class:`ByteString`" +msgstr ":class:`ByteString`" + +#: ../../library/collections.abc.rst:143 +msgid "Inherited :class:`Sequence` methods" +msgstr ":class:`Sequence` 的繼承方法" + +#: ../../library/collections.abc.rst:146 ../../library/collections.abc.rst:151 msgid ":class:`Set`" msgstr ":class:`Set`" -#: ../../library/collections.abc.rst:143 ../../library/collections.abc.rst:154 +#: ../../library/collections.abc.rst:146 ../../library/collections.abc.rst:157 msgid ":class:`Collection`" msgstr ":class:`Collection`" -#: ../../library/collections.abc.rst:143 +#: ../../library/collections.abc.rst:146 msgid "" "``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, ``__gt__``, ``__ge__``, " "``__and__``, ``__or__``, ``__sub__``, ``__rsub__``, ``__xor__``, " @@ -327,29 +336,29 @@ msgstr "" "``__and__``、``__or__``、``__sub__``、``__rsub__``、``__xor__``、" "``__rxor__`` 和 ``isdisjoint``" -#: ../../library/collections.abc.rst:148 +#: ../../library/collections.abc.rst:151 msgid ":class:`MutableSet`" msgstr ":class:`MutableSet`" -#: ../../library/collections.abc.rst:148 +#: ../../library/collections.abc.rst:151 msgid "``__contains__``, ``__iter__``, ``__len__``, ``add``, ``discard``" msgstr "``__contains__``、``__iter__``、``__len__``、``add``、``discard``" -#: ../../library/collections.abc.rst:148 +#: ../../library/collections.abc.rst:151 msgid "" "Inherited :class:`Set` methods and ``clear``, ``pop``, ``remove``, " "``__ior__``, ``__iand__``, ``__ixor__``, and ``__isub__``" msgstr "" -#: ../../library/collections.abc.rst:154 ../../library/collections.abc.rst:158 +#: ../../library/collections.abc.rst:157 ../../library/collections.abc.rst:161 msgid ":class:`Mapping`" msgstr ":class:`Mapping`" -#: ../../library/collections.abc.rst:154 +#: ../../library/collections.abc.rst:157 msgid "``__getitem__``, ``__iter__``, ``__len__``" msgstr "``__getitem__``、``__iter__``、``__len__``" -#: ../../library/collections.abc.rst:154 +#: ../../library/collections.abc.rst:157 msgid "" "``__contains__``, ``keys``, ``items``, ``values``, ``get``, ``__eq__``, and " "``__ne__``" @@ -357,128 +366,128 @@ msgstr "" "``__contains__``、``keys``、``items``、``values``、``get``、``__eq__`` 和 " "``__ne__``" -#: ../../library/collections.abc.rst:158 +#: ../../library/collections.abc.rst:161 msgid ":class:`MutableMapping`" msgstr ":class:`MutableMapping`" -#: ../../library/collections.abc.rst:158 +#: ../../library/collections.abc.rst:161 msgid "" "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__iter__``, ``__len__``" msgstr "" "``__getitem__``、``__setitem__``、``__delitem__``、``__iter__``、``__len__``" -#: ../../library/collections.abc.rst:158 +#: ../../library/collections.abc.rst:161 msgid "" "Inherited :class:`Mapping` methods and ``pop``, ``popitem``, ``clear``, " "``update``, and ``setdefault``" msgstr "" -#: ../../library/collections.abc.rst:165 +#: ../../library/collections.abc.rst:168 msgid ":class:`MappingView`" msgstr ":class:`MappingView`" -#: ../../library/collections.abc.rst:165 +#: ../../library/collections.abc.rst:168 msgid ":class:`Sized`" msgstr ":class:`Sized`" -#: ../../library/collections.abc.rst:165 +#: ../../library/collections.abc.rst:168 msgid "``__init__``, ``__len__`` and ``__repr__``" msgstr "``__init__``、``__len__`` 和 ``__repr__``" -#: ../../library/collections.abc.rst:166 +#: ../../library/collections.abc.rst:169 msgid ":class:`ItemsView`" msgstr ":class:`ItemsView`" -#: ../../library/collections.abc.rst:166 ../../library/collections.abc.rst:168 +#: ../../library/collections.abc.rst:169 ../../library/collections.abc.rst:171 msgid ":class:`MappingView`, :class:`Set`" msgstr ":class:`MappingView`、:class:`Set`" -#: ../../library/collections.abc.rst:166 ../../library/collections.abc.rst:168 -#: ../../library/collections.abc.rst:170 +#: ../../library/collections.abc.rst:169 ../../library/collections.abc.rst:171 +#: ../../library/collections.abc.rst:173 msgid "``__contains__``, ``__iter__``" msgstr "``__contains__``、``__iter__``" -#: ../../library/collections.abc.rst:168 +#: ../../library/collections.abc.rst:171 msgid ":class:`KeysView`" msgstr ":class:`KeysView`" -#: ../../library/collections.abc.rst:170 +#: ../../library/collections.abc.rst:173 msgid ":class:`ValuesView`" msgstr ":class:`ValuesView`" -#: ../../library/collections.abc.rst:170 +#: ../../library/collections.abc.rst:173 msgid ":class:`MappingView`, :class:`Collection`" msgstr ":class:`MappingView`、:class:`Collection`" -#: ../../library/collections.abc.rst:172 +#: ../../library/collections.abc.rst:175 msgid ":class:`Awaitable` [1]_" msgstr ":class:`Awaitable` [1]_" -#: ../../library/collections.abc.rst:172 +#: ../../library/collections.abc.rst:175 msgid "``__await__``" msgstr "``__await__``" -#: ../../library/collections.abc.rst:173 +#: ../../library/collections.abc.rst:176 msgid ":class:`Coroutine` [1]_" msgstr ":class:`Coroutine` [1]_" -#: ../../library/collections.abc.rst:173 +#: ../../library/collections.abc.rst:176 msgid ":class:`Awaitable`" msgstr ":class:`Awaitable`" -#: ../../library/collections.abc.rst:173 +#: ../../library/collections.abc.rst:176 msgid "``close``" msgstr "``close``" -#: ../../library/collections.abc.rst:174 +#: ../../library/collections.abc.rst:177 msgid ":class:`AsyncIterable` [1]_" msgstr ":class:`AsyncIterable` [1]_" -#: ../../library/collections.abc.rst:174 ../../library/collections.abc.rst:175 +#: ../../library/collections.abc.rst:177 ../../library/collections.abc.rst:178 msgid "``__aiter__``" msgstr "``__aiter__``" -#: ../../library/collections.abc.rst:175 +#: ../../library/collections.abc.rst:178 msgid ":class:`AsyncIterator` [1]_" msgstr ":class:`AsyncIterator` [1]_" -#: ../../library/collections.abc.rst:175 +#: ../../library/collections.abc.rst:178 msgid ":class:`AsyncIterable`" msgstr ":class:`AsyncIterable`" -#: ../../library/collections.abc.rst:175 +#: ../../library/collections.abc.rst:178 msgid "``__anext__``" msgstr "``__anext__``" -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:179 msgid ":class:`AsyncGenerator` [1]_" msgstr ":class:`AsyncGenerator` [1]_" -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:179 msgid ":class:`AsyncIterator`" msgstr ":class:`AsyncIterator`" -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:179 msgid "``asend``, ``athrow``" msgstr "``asend``、``athrow``" -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:179 msgid "``aclose``, ``__aiter__``, ``__anext__``" msgstr "``aclose``、``__aiter__``、``__anext__``" -#: ../../library/collections.abc.rst:177 +#: ../../library/collections.abc.rst:180 msgid ":class:`Buffer` [1]_" msgstr ":class:`Buffer` [1]_" -#: ../../library/collections.abc.rst:177 +#: ../../library/collections.abc.rst:180 msgid "``__buffer__``" msgstr "``__buffer__``" -#: ../../library/collections.abc.rst:182 +#: ../../library/collections.abc.rst:185 msgid "Footnotes" msgstr "註腳" -#: ../../library/collections.abc.rst:183 +#: ../../library/collections.abc.rst:186 msgid "" "These ABCs override :meth:`~abc.ABCMeta.__subclasshook__` to support testing " "an interface by verifying the required methods are present and have not been " @@ -486,222 +495,227 @@ msgid "" "interfaces require registration or direct subclassing." msgstr "" -#: ../../library/collections.abc.rst:189 +#: ../../library/collections.abc.rst:192 msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but " "it does not detect classes that iterate with the :meth:`~object.__getitem__` " -"method. The only reliable way to determine whether an object " -"is :term:`iterable` is to call ``iter(obj)``." +"method. The only reliable way to determine whether an object is :term:" +"`iterable` is to call ``iter(obj)``." msgstr "" -#: ../../library/collections.abc.rst:197 +#: ../../library/collections.abc.rst:200 msgid "Collections Abstract Base Classes -- Detailed Descriptions" msgstr "" -#: ../../library/collections.abc.rst:202 +#: ../../library/collections.abc.rst:205 msgid "ABC for classes that provide the :meth:`~object.__contains__` method." msgstr "" -#: ../../library/collections.abc.rst:206 +#: ../../library/collections.abc.rst:209 msgid "ABC for classes that provide the :meth:`~object.__hash__` method." msgstr "" -#: ../../library/collections.abc.rst:210 +#: ../../library/collections.abc.rst:213 msgid "ABC for classes that provide the :meth:`~object.__len__` method." msgstr "" -#: ../../library/collections.abc.rst:214 +#: ../../library/collections.abc.rst:217 msgid "ABC for classes that provide the :meth:`~object.__call__` method." msgstr "" -#: ../../library/collections.abc.rst:216 +#: ../../library/collections.abc.rst:219 msgid "" "See :ref:`annotating-callables` for details on how to use :class:`!Callable` " "in type annotations." msgstr "" -#: ../../library/collections.abc.rst:221 +#: ../../library/collections.abc.rst:224 msgid "ABC for classes that provide the :meth:`~container.__iter__` method." msgstr "" -#: ../../library/collections.abc.rst:223 +#: ../../library/collections.abc.rst:226 msgid "" "Checking ``isinstance(obj, Iterable)`` detects classes that are registered " "as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but " "it does not detect classes that iterate with the :meth:`~object.__getitem__` " -"method. The only reliable way to determine whether an object " -"is :term:`iterable` is to call ``iter(obj)``." +"method. The only reliable way to determine whether an object is :term:" +"`iterable` is to call ``iter(obj)``." msgstr "" -#: ../../library/collections.abc.rst:232 +#: ../../library/collections.abc.rst:235 msgid "ABC for sized iterable container classes." msgstr "" -#: ../../library/collections.abc.rst:238 +#: ../../library/collections.abc.rst:241 msgid "" -"ABC for classes that provide the :meth:`~iterator.__iter__` " -"and :meth:`~iterator.__next__` methods. See also the definition " -"of :term:`iterator`." +"ABC for classes that provide the :meth:`~iterator.__iter__` and :meth:" +"`~iterator.__next__` methods. See also the definition of :term:`iterator`." msgstr "" -#: ../../library/collections.abc.rst:244 +#: ../../library/collections.abc.rst:247 msgid "" "ABC for iterable classes that also provide the :meth:`~object.__reversed__` " "method." msgstr "" -#: ../../library/collections.abc.rst:251 +#: ../../library/collections.abc.rst:254 msgid "" -"ABC for :term:`generator` classes that implement the protocol defined " -"in :pep:`342` that extends :term:`iterators ` with " -"the :meth:`~generator.send`, :meth:`~generator.throw` " -"and :meth:`~generator.close` methods." +"ABC for :term:`generator` classes that implement the protocol defined in :" +"pep:`342` that extends :term:`iterators ` with the :meth:" +"`~generator.send`, :meth:`~generator.throw` and :meth:`~generator.close` " +"methods." msgstr "" -#: ../../library/collections.abc.rst:256 +#: ../../library/collections.abc.rst:259 msgid "" -"See :ref:`annotating-generators-and-coroutines` for details on " -"using :class:`!Generator` in type annotations." +"See :ref:`annotating-generators-and-coroutines` for details on using :class:" +"`!Generator` in type annotations." msgstr "" -#: ../../library/collections.abc.rst:264 +#: ../../library/collections.abc.rst:268 msgid "ABCs for read-only and mutable :term:`sequences `." msgstr "" -#: ../../library/collections.abc.rst:266 +#: ../../library/collections.abc.rst:270 msgid "" -"Implementation note: Some of the mixin methods, such " -"as :meth:`~container.__iter__`, :meth:`~object.__reversed__`, " -"and :meth:`~sequence.index` make repeated calls to the " -"underlying :meth:`~object.__getitem__` method. Consequently, " -"if :meth:`~object.__getitem__` is implemented with constant access speed, " -"the mixin methods will have linear performance; however, if the underlying " -"method is linear (as it would be with a linked list), the mixins will have " -"quadratic performance and will likely need to be overridden." +"Implementation note: Some of the mixin methods, such as :meth:`~container." +"__iter__`, :meth:`~object.__reversed__`, and :meth:`~sequence.index` make " +"repeated calls to the underlying :meth:`~object.__getitem__` method. " +"Consequently, if :meth:`~object.__getitem__` is implemented with constant " +"access speed, the mixin methods will have linear performance; however, if " +"the underlying method is linear (as it would be with a linked list), the " +"mixins will have quadratic performance and will likely need to be overridden." msgstr "" -#: ../../library/collections.abc.rst:278 +#: ../../library/collections.abc.rst:282 msgid "Return first index of *value*." msgstr "" -#: ../../library/collections.abc.rst:280 +#: ../../library/collections.abc.rst:284 msgid "Raises :exc:`ValueError` if the value is not present." msgstr "" -#: ../../library/collections.abc.rst:282 +#: ../../library/collections.abc.rst:286 msgid "" "Supporting the *start* and *stop* arguments is optional, but recommended." msgstr "" -#: ../../library/collections.abc.rst:284 +#: ../../library/collections.abc.rst:288 msgid "" "The :meth:`~sequence.index` method gained support for the *stop* and *start* " "arguments." msgstr "" -#: ../../library/collections.abc.rst:291 +#: ../../library/collections.abc.rst:292 +msgid "" +"The :class:`ByteString` ABC has been deprecated. For use in type " +"annotations, prefer a union, like ``bytes | bytearray``, or :class:" +"`collections.abc.Buffer`. For use as an ABC, prefer :class:`Sequence` or :" +"class:`collections.abc.Buffer`." +msgstr "" + +#: ../../library/collections.abc.rst:301 msgid "ABCs for read-only and mutable :ref:`sets `." msgstr "" -#: ../../library/collections.abc.rst:296 +#: ../../library/collections.abc.rst:306 msgid "ABCs for read-only and mutable :term:`mappings `." msgstr "" -#: ../../library/collections.abc.rst:303 +#: ../../library/collections.abc.rst:313 msgid "" "ABCs for mapping, items, keys, and values :term:`views `." msgstr "" -#: ../../library/collections.abc.rst:307 +#: ../../library/collections.abc.rst:317 msgid "" "ABC for :term:`awaitable` objects, which can be used in :keyword:`await` " -"expressions. Custom implementations must provide " -"the :meth:`~object.__await__` method." +"expressions. Custom implementations must provide the :meth:`~object." +"__await__` method." msgstr "" -#: ../../library/collections.abc.rst:311 +#: ../../library/collections.abc.rst:321 msgid "" -":term:`Coroutine ` objects and instances of " -"the :class:`~collections.abc.Coroutine` ABC are all instances of this ABC." +":term:`Coroutine ` objects and instances of the :class:" +"`~collections.abc.Coroutine` ABC are all instances of this ABC." msgstr "" -#: ../../library/collections.abc.rst:315 +#: ../../library/collections.abc.rst:325 msgid "" "In CPython, generator-based coroutines (:term:`generators ` " "decorated with :func:`@types.coroutine `) are *awaitables*, " "even though they do not have an :meth:`~object.__await__` method. Using " -"``isinstance(gencoro, Awaitable)`` for them will return ``False``. " -"Use :func:`inspect.isawaitable` to detect them." +"``isinstance(gencoro, Awaitable)`` for them will return ``False``. Use :func:" +"`inspect.isawaitable` to detect them." msgstr "" -#: ../../library/collections.abc.rst:325 +#: ../../library/collections.abc.rst:335 msgid "" "ABC for :term:`coroutine` compatible classes. These implement the following " -"methods, defined in :ref:`coroutine-" -"objects`: :meth:`~coroutine.send`, :meth:`~coroutine.throw`, " -"and :meth:`~coroutine.close`. Custom implementations must also " -"implement :meth:`~object.__await__`. All :class:`Coroutine` instances are " -"also instances of :class:`Awaitable`." +"methods, defined in :ref:`coroutine-objects`: :meth:`~coroutine.send`, :meth:" +"`~coroutine.throw`, and :meth:`~coroutine.close`. Custom implementations " +"must also implement :meth:`~object.__await__`. All :class:`Coroutine` " +"instances are also instances of :class:`Awaitable`." msgstr "" -#: ../../library/collections.abc.rst:333 +#: ../../library/collections.abc.rst:343 msgid "" "In CPython, generator-based coroutines (:term:`generators ` " "decorated with :func:`@types.coroutine `) are *awaitables*, " "even though they do not have an :meth:`~object.__await__` method. Using " -"``isinstance(gencoro, Coroutine)`` for them will return ``False``. " -"Use :func:`inspect.isawaitable` to detect them." +"``isinstance(gencoro, Coroutine)`` for them will return ``False``. Use :func:" +"`inspect.isawaitable` to detect them." msgstr "" -#: ../../library/collections.abc.rst:339 +#: ../../library/collections.abc.rst:349 msgid "" -"See :ref:`annotating-generators-and-coroutines` for details on " -"using :class:`!Coroutine` in type annotations. The variance and order of " -"type parameters correspond to those of :class:`Generator`." +"See :ref:`annotating-generators-and-coroutines` for details on using :class:" +"`!Coroutine` in type annotations. The variance and order of type parameters " +"correspond to those of :class:`Generator`." msgstr "" -#: ../../library/collections.abc.rst:348 +#: ../../library/collections.abc.rst:358 msgid "" "ABC for classes that provide an ``__aiter__`` method. See also the " "definition of :term:`asynchronous iterable`." msgstr "" -#: ../../library/collections.abc.rst:355 +#: ../../library/collections.abc.rst:365 msgid "" "ABC for classes that provide ``__aiter__`` and ``__anext__`` methods. See " "also the definition of :term:`asynchronous iterator`." msgstr "" -#: ../../library/collections.abc.rst:362 +#: ../../library/collections.abc.rst:372 msgid "" "ABC for :term:`asynchronous generator` classes that implement the protocol " "defined in :pep:`525` and :pep:`492`." msgstr "" -#: ../../library/collections.abc.rst:365 +#: ../../library/collections.abc.rst:375 msgid "" -"See :ref:`annotating-generators-and-coroutines` for details on " -"using :class:`!AsyncGenerator` in type annotations." +"See :ref:`annotating-generators-and-coroutines` for details on using :class:" +"`!AsyncGenerator` in type annotations." msgstr "" -#: ../../library/collections.abc.rst:372 +#: ../../library/collections.abc.rst:382 msgid "" "ABC for classes that provide the :meth:`~object.__buffer__` method, " "implementing the :ref:`buffer protocol `. See :pep:`688`." msgstr "" -#: ../../library/collections.abc.rst:378 +#: ../../library/collections.abc.rst:388 msgid "Examples and Recipes" msgstr "" -#: ../../library/collections.abc.rst:380 +#: ../../library/collections.abc.rst:390 msgid "" "ABCs allow us to ask classes or instances if they provide particular " "functionality, for example::" msgstr "" -#: ../../library/collections.abc.rst:383 +#: ../../library/collections.abc.rst:393 msgid "" "size = None\n" "if isinstance(myvar, collections.abc.Sized):\n" @@ -711,18 +725,17 @@ msgstr "" "if isinstance(myvar, collections.abc.Sized):\n" " size = len(myvar)" -#: ../../library/collections.abc.rst:387 +#: ../../library/collections.abc.rst:397 msgid "" "Several of the ABCs are also useful as mixins that make it easier to develop " "classes supporting container APIs. For example, to write a class supporting " "the full :class:`Set` API, it is only necessary to supply the three " -"underlying abstract " -"methods: :meth:`~object.__contains__`, :meth:`~container.__iter__`, " -"and :meth:`~object.__len__`. The ABC supplies the remaining methods such " -"as :meth:`!__and__` and :meth:`~frozenset.isdisjoint`::" +"underlying abstract methods: :meth:`~object.__contains__`, :meth:`~container." +"__iter__`, and :meth:`~object.__len__`. The ABC supplies the remaining " +"methods such as :meth:`!__and__` and :meth:`~frozenset.isdisjoint`::" msgstr "" -#: ../../library/collections.abc.rst:394 +#: ../../library/collections.abc.rst:404 msgid "" "class ListBasedSet(collections.abc.Set):\n" " ''' Alternate set implementation favoring space over speed\n" @@ -748,31 +761,31 @@ msgid "" "automatically" msgstr "" -#: ../../library/collections.abc.rst:416 +#: ../../library/collections.abc.rst:426 msgid "Notes on using :class:`Set` and :class:`MutableSet` as a mixin:" msgstr "" -#: ../../library/collections.abc.rst:419 +#: ../../library/collections.abc.rst:429 msgid "" "Since some set operations create new sets, the default mixin methods need a " "way to create new instances from an :term:`iterable`. The class constructor " "is assumed to have a signature in the form ``ClassName(iterable)``. That " -"assumption is factored-out to an internal :class:`classmethod` " -"called :meth:`!_from_iterable` which calls ``cls(iterable)`` to produce a " -"new set. If the :class:`Set` mixin is being used in a class with a different " -"constructor signature, you will need to override :meth:`!_from_iterable` " -"with a classmethod or regular method that can construct new instances from " -"an iterable argument." +"assumption is factored-out to an internal :class:`classmethod` called :meth:" +"`!_from_iterable` which calls ``cls(iterable)`` to produce a new set. If " +"the :class:`Set` mixin is being used in a class with a different constructor " +"signature, you will need to override :meth:`!_from_iterable` with a " +"classmethod or regular method that can construct new instances from an " +"iterable argument." msgstr "" -#: ../../library/collections.abc.rst:430 +#: ../../library/collections.abc.rst:440 msgid "" "To override the comparisons (presumably for speed, as the semantics are " "fixed), redefine :meth:`~object.__le__` and :meth:`~object.__ge__`, then the " "other operations will automatically follow suit." msgstr "" -#: ../../library/collections.abc.rst:436 +#: ../../library/collections.abc.rst:446 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 " @@ -781,12 +794,12 @@ msgid "" "define ``__hash__ = Set._hash``." msgstr "" -#: ../../library/collections.abc.rst:444 +#: ../../library/collections.abc.rst:454 msgid "" "`OrderedSet recipe `_ for an " "example built on :class:`MutableSet`." msgstr "" -#: ../../library/collections.abc.rst:447 +#: ../../library/collections.abc.rst:457 msgid "For more about ABCs, see the :mod:`abc` module and :pep:`3119`." msgstr "關於 ABC 的更多資訊請見 :mod:`abc` module 和 :pep:`3119`。" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 447755e442..0db2ac39ec 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2023-01-24 03:33+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -30,7 +30,8 @@ msgid "" "interpreter.py`" msgstr "" "**原始碼:**\\ :source:`Lib/concurrent/futures/thread.py`、:source:`Lib/" -"concurrent/futures/process.py` 與 :source:`Lib/concurrent/futures/interpreter.py`" +"concurrent/futures/process.py` 與 :source:`Lib/concurrent/futures/" +"interpreter.py`" #: ../../library/concurrent.futures.rst:15 msgid "" @@ -42,14 +43,15 @@ msgstr "" #: ../../library/concurrent.futures.rst:18 msgid "" -"The asynchronous execution can be performed with threads, " -"using :class:`ThreadPoolExecutor` or :class:`InterpreterPoolExecutor`, or " -"separate processes, using :class:`ProcessPoolExecutor`. Each implements the " -"same interface, which is defined by the abstract :class:`Executor` class." +"The asynchronous execution can be performed with threads, using :class:" +"`ThreadPoolExecutor` or :class:`InterpreterPoolExecutor`, or separate " +"processes, using :class:`ProcessPoolExecutor`. Each implements the same " +"interface, which is defined by the abstract :class:`Executor` class." msgstr "" -"非同步執行可以透過 :class:`ThreadPoolExecutor` 或 :class:`InterpreterPoolExecutor` 來使用執行緒 (thread) 執行,或" -"透過 :class:`ProcessPoolExecutor` 來使用單獨行程 (process) 執行。兩者都實作了" -"相同的介面,該介面由抽象的 :class:`Executor` 類別定義。" +"非同步執行可以透過 :class:`ThreadPoolExecutor` 或 :class:" +"`InterpreterPoolExecutor` 來使用執行緒 (thread) 執行,或透過 :class:" +"`ProcessPoolExecutor` 來使用單獨行程 (process) 執行。兩者都實作了相同的介面," +"該介面由抽象的 :class:`Executor` 類別定義。" #: ../../includes/wasm-notavail.rst:3 msgid "Availability" @@ -114,11 +116,11 @@ msgstr "*fn* 是非同步執行的,並且對 *fn* 的多次呼叫可以並行 #: ../../library/concurrent.futures.rst:56 msgid "" -"The returned iterator raises a :exc:`TimeoutError` " -"if :meth:`~iterator.__next__` is called and the result isn't available after " -"*timeout* seconds from the original call to :meth:`Executor.map`. *timeout* " -"can be an int or a float. If *timeout* is not specified or ``None``, there " -"is no limit to the wait time." +"The returned iterator raises a :exc:`TimeoutError` if :meth:`~iterator." +"__next__` is called and the result isn't available after *timeout* seconds " +"from the original call to :meth:`Executor.map`. *timeout* can be an int or a " +"float. If *timeout* is not specified or ``None``, there is no limit to the " +"wait time." msgstr "" "如果 :meth:`~iterator.__next__` 被呼叫,且在原先呼叫 :meth:`Executor.map` 的 " "*timeout* 秒後結果仍不可用,回傳的疊代器就會引發 :exc:`TimeoutError`。" @@ -138,14 +140,14 @@ msgid "" "(approximate) size of these chunks can be specified by setting *chunksize* " "to a positive integer. For very long iterables, using a large value for " "*chunksize* can significantly improve performance compared to the default " -"size of 1. With :class:`ThreadPoolExecutor` " -"and :class:`InterpreterPoolExecutor`, *chunksize* has no effect." +"size of 1. With :class:`ThreadPoolExecutor` and :class:" +"`InterpreterPoolExecutor`, *chunksize* has no effect." msgstr "" "使用 :class:`ProcessPoolExecutor` 時,此方法將 *iterables* 分成許多分塊 " "(chunks),並將其作為獨立的任務來提交給池 (pool)。可以透過將 *chunksize* 設定" "為正整數來指定這些分塊的(約略)大小。對於非常長的可疊代物件,*chunksize* 使" -"用較大的值(與預設大小 1 相比)可以顯著提高性能。對" -"於 :class:`ThreadPoolExecutor` 和 :class:`InterpreterPoolExecutor`,*chunksize* 無效。" +"用較大的值(與預設大小 1 相比)可以顯著提高性能。對於 :class:" +"`ThreadPoolExecutor` 和 :class:`InterpreterPoolExecutor`,*chunksize* 無效。" #: ../../library/concurrent.futures.rst:74 msgid "Added the *chunksize* parameter." @@ -158,13 +160,13 @@ msgstr "新增 *buffersize* 參數。" #: ../../library/concurrent.futures.rst:82 msgid "" "Signal the executor that it should free any resources that it is using when " -"the currently pending futures are done executing. Calls " -"to :meth:`Executor.submit` and :meth:`Executor.map` made after shutdown will " -"raise :exc:`RuntimeError`." +"the currently pending futures are done executing. Calls to :meth:`Executor." +"submit` and :meth:`Executor.map` made after shutdown will raise :exc:" +"`RuntimeError`." msgstr "" "向 executor 發出訊號 (signal),表明它應該在目前未定 (pending) 的 future 完成" -"執行時釋放它正在使用的任何資源。在關閉後呼叫 :meth:`Executor.submit` " -"和 :meth:`Executor.map` 將引發 :exc:`RuntimeError`。" +"執行時釋放它正在使用的任何資源。在關閉後呼叫 :meth:`Executor.submit` 和 :" +"meth:`Executor.map` 將引發 :exc:`RuntimeError`。" #: ../../library/concurrent.futures.rst:87 msgid "" @@ -203,14 +205,14 @@ msgstr "" #: ../../library/concurrent.futures.rst:104 msgid "" -"You can avoid having to call this method explicitly if you use " -"the :keyword:`with` statement, which will shutdown the :class:`Executor` " -"(waiting as if :meth:`Executor.shutdown` were called with *wait* set to " -"``True``)::" +"You can avoid having to call this method explicitly if you use the executor " +"as a :term:`context manager` via the :keyword:`with` statement, which will " +"shutdown the :class:`Executor` (waiting as if :meth:`Executor.shutdown` were " +"called with *wait* set to ``True``)::" msgstr "" -"如果使用 :keyword:`with` 陳述式,那你就可以不用明確地呼叫此方法,這將會自己關" -"閉 :class:`Executor`\\(如同呼叫 :meth:`Executor.shutdown` 時 *wait* 被設定" -"為 ``True`` 般等待): ::" +"如果使用 :keyword:`with` 陳述式來將 executor 用作 :term:`context manager`,那你就" +"可以不用明確地呼叫此方法,這將會自己關閉 :class:`Executor`\\(如同呼" +"叫 :meth:`Executor.shutdown` 時 *wait* 被設定為 ``True`` 般等待): ::" #: ../../library/concurrent.futures.rst:109 msgid "" @@ -343,16 +345,16 @@ msgid "" msgstr "" "*initializer* 是一個可選的可呼叫物件,在每個工作執行緒開始時呼叫; " "*initargs* 是傳遞給 initializer 的引數元組 (tuple)。如果 *initializer* 引發例" -"外,所有目前未定的作業以及任何向池中提交 (submit) 更多作業的嘗試都將引" -"發 :exc:`~concurrent.futures.thread.BrokenThreadPool`。" +"外,所有目前未定的作業以及任何向池中提交 (submit) 更多作業的嘗試都將引發 :" +"exc:`~concurrent.futures.thread.BrokenThreadPool`。" #: ../../library/concurrent.futures.rst:175 msgid "" "If *max_workers* is ``None`` or not given, it will default to the number of " -"processors on the machine, multiplied by ``5``, assuming " -"that :class:`ThreadPoolExecutor` is often used to overlap I/O instead of CPU " -"work and the number of workers should be higher than the number of workers " -"for :class:`ProcessPoolExecutor`." +"processors on the machine, multiplied by ``5``, assuming that :class:" +"`ThreadPoolExecutor` is often used to overlap I/O instead of CPU work and " +"the number of workers should be higher than the number of workers for :class:" +"`ProcessPoolExecutor`." msgstr "" "如果 *max_workers* 為 ``None`` 或未給定,它將預設為機器上的處理器數量乘以 " "``5``,這假定了 :class:`ThreadPoolExecutor` 通常用於 I/O 重疊而非 CPU 密集的" @@ -361,9 +363,9 @@ msgstr "" #: ../../library/concurrent.futures.rst:183 msgid "" -"Added the *thread_name_prefix* parameter to allow users to control " -"the :class:`threading.Thread` names for worker threads created by the pool " -"for easier debugging." +"Added the *thread_name_prefix* parameter to allow users to control the :" +"class:`threading.Thread` names for worker threads created by the pool for " +"easier debugging." msgstr "" "新增 *thread_name_prefix* 參數以允許使用者控制由池所建立的工作執行緒 (worker " "thread) 的 :class:`threading.Thread` 名稱,以便於除錯。" @@ -394,8 +396,8 @@ msgstr "" #: ../../library/concurrent.futures.rst:200 msgid "" -"Default value of *max_workers* is changed to ``min(32, " -"(os.process_cpu_count() or 1) + 4)``." +"Default value of *max_workers* is changed to ``min(32, (os." +"process_cpu_count() or 1) + 4)``." msgstr "" "*max_workers* 的預設值被改為 ``min(32, (os.process_cpu_count() or 1) + 4)``。" @@ -523,8 +525,8 @@ msgstr "" #: ../../library/concurrent.futures.rst:308 msgid "" -"The executor may replace uncaught exceptions from *initializer* " -"with :class:`~concurrent.futures.interpreter.ExecutionFailed`." +"The executor may replace uncaught exceptions from *initializer* with :class:" +"`~concurrent.futures.interpreter.ExecutionFailed`." msgstr "" #: ../../library/concurrent.futures.rst:311 @@ -543,13 +545,11 @@ msgstr "" msgid "" "When a worker's current task raises an uncaught exception, the worker always " "tries to preserve the exception as-is. If that is successful then it also " -"sets the ``__cause__`` to a " -"corresponding :class:`~concurrent.futures.interpreter.ExecutionFailed` " -"instance, which contains a summary of the original exception. In the " -"uncommon case that the worker is not able to preserve the original as-is " -"then it directly preserves the " -"corresponding :class:`~concurrent.futures.interpreter.ExecutionFailed` " -"instance instead." +"sets the ``__cause__`` to a corresponding :class:`~concurrent.futures." +"interpreter.ExecutionFailed` instance, which contains a summary of the " +"original exception. In the uncommon case that the worker is not able to " +"preserve the original as-is then it directly preserves the corresponding :" +"class:`~concurrent.futures.interpreter.ExecutionFailed` instance instead." msgstr "" #: ../../library/concurrent.futures.rst:330 @@ -559,15 +559,15 @@ msgstr "ProcessPoolExecutor" #: ../../library/concurrent.futures.rst:332 msgid "" "The :class:`ProcessPoolExecutor` class is an :class:`Executor` subclass that " -"uses a pool of processes to execute calls " -"asynchronously. :class:`ProcessPoolExecutor` uses the :mod:`multiprocessing` " -"module, which allows it to side-step the :term:`Global Interpreter Lock " -"` but also means that only picklable objects can be " -"executed and returned." +"uses a pool of processes to execute calls asynchronously. :class:" +"`ProcessPoolExecutor` uses the :mod:`multiprocessing` module, which allows " +"it to side-step the :term:`Global Interpreter Lock ` but also means that only picklable objects can be executed and " +"returned." msgstr "" ":class:`ProcessPoolExecutor` 類別是一個 :class:`Executor` 的子類別,它使用行" -"程池來非同步地執行呼叫。:class:`ProcessPoolExecutor` 使用" -"了 :mod:`multiprocessing` 模組,這允許它避開\\ :term:`全域直譯器鎖 (Global " +"程池來非同步地執行呼叫。:class:`ProcessPoolExecutor` 使用了 :mod:" +"`multiprocessing` 模組,這允許它避開\\ :term:`全域直譯器鎖 (Global " "Interpreter Lock) `,但也意味著只能執行和回傳可被 " "pickle 的 (picklable) 物件。" @@ -577,9 +577,9 @@ msgid "" "means that :class:`ProcessPoolExecutor` will not work in the interactive " "interpreter." msgstr "" -"``__main__`` 模組必須可以被工作子行程 (worker subprocess) 引入。這意味" -"著 :class:`ProcessPoolExecutor` 將無法在交互式直譯器 (interactive " -"interpreter) 中工作。" +"``__main__`` 模組必須可以被工作子行程 (worker subprocess) 引入。這意味著 :" +"class:`ProcessPoolExecutor` 將無法在交互式直譯器 (interactive interpreter) 中" +"工作。" #: ../../library/concurrent.futures.rst:342 msgid "" @@ -592,10 +592,9 @@ msgstr "" #: ../../library/concurrent.futures.rst:345 msgid "" "Note that the restrictions on functions and arguments needing to picklable " -"as per :class:`multiprocessing.Process` apply when " -"using :meth:`~Executor.submit` and :meth:`~Executor.map` on " -"a :class:`ProcessPoolExecutor`. A function defined in a REPL or a lambda " -"should not be expected to work." +"as per :class:`multiprocessing.Process` apply when using :meth:`~Executor." +"submit` and :meth:`~Executor.map` on a :class:`ProcessPoolExecutor`. A " +"function defined in a REPL or a lambda should not be expected to work." msgstr "" #: ../../library/concurrent.futures.rst:352 @@ -609,18 +608,18 @@ msgid "" "the default chosen will be at most ``61``, even if more processors are " "available. *mp_context* can be a :mod:`multiprocessing` context or ``None``. " "It will be used to launch the workers. If *mp_context* is ``None`` or not " -"given, the default :mod:`multiprocessing` context is used. " -"See :ref:`multiprocessing-start-methods`." +"given, the default :mod:`multiprocessing` context is used. See :ref:" +"`multiprocessing-start-methods`." msgstr "" "一個 :class:`Executor` 子類別,它使用了最多有 *max_workers* 個行程的池來非同" -"步地執行呼叫。如果 *max_workers* 為 ``None`` 或未給定,它將被預設" -"為 :func:`os.process_cpu_count`。如果 *max_workers* 小於或等於 ``0``,則會引" -"發 :exc:`ValueError`。在 Windows 上,*max_workers* 必須小於或等於 ``61``。如" -"果不是,則會引發 :exc:`ValueError`。如果 *max_workers* 為 ``None``,則預設選" -"擇最多為 ``61``,即便有更多處理器可用。*mp_context* 可以" -"是 :mod:`multiprocessing` 情境 (context) 或 ``None``。它將用於啟動 worker。如" -"果 *mp_context* 為 ``None`` 或未給定,則使用預設的 :mod:`multiprocessing` 情" -"境。請見 :ref:`multiprocessing-start-methods`。" +"步地執行呼叫。如果 *max_workers* 為 ``None`` 或未給定,它將被預設為 :func:" +"`os.process_cpu_count`。如果 *max_workers* 小於或等於 ``0``,則會引發 :exc:" +"`ValueError`。在 Windows 上,*max_workers* 必須小於或等於 ``61``。如果不是," +"則會引發 :exc:`ValueError`。如果 *max_workers* 為 ``None``,則預設選擇最多為 " +"``61``,即便有更多處理器可用。*mp_context* 可以是 :mod:`multiprocessing` 情" +"境 (context) 或 ``None``。它將用於啟動 worker。如果 *mp_context* 為 ``None`` " +"或未給定,則使用預設的 :mod:`multiprocessing` 情境。請見 :ref:" +"`multiprocessing-start-methods`。" #: ../../library/concurrent.futures.rst:366 msgid "" @@ -632,8 +631,8 @@ msgid "" msgstr "" "*initializer* 是一個可選的可呼叫物件,在每個工作行程 (worker process) 開始時" "呼叫;*initargs* 是傳遞給 initializer 的引數元組。如果 *initializer* 引發例" -"外,所有目前未定的作業以及任何向池中提交更多作業的嘗試都將引" -"發 :exc:`~concurrent.futures.process.BrokenProcessPool`。" +"外,所有目前未定的作業以及任何向池中提交更多作業的嘗試都將引發 :exc:" +"`~concurrent.futures.process.BrokenProcessPool`。" #: ../../library/concurrent.futures.rst:372 msgid "" @@ -653,15 +652,14 @@ msgstr "" #: ../../library/concurrent.futures.rst:380 msgid "" -"When one of the worker processes terminates abruptly, " -"a :exc:`~concurrent.futures.process.BrokenProcessPool` error is now raised. " -"Previously, behaviour was undefined but operations on the executor or its " -"futures would often freeze or deadlock." +"When one of the worker processes terminates abruptly, a :exc:`~concurrent." +"futures.process.BrokenProcessPool` error is now raised. Previously, " +"behaviour was undefined but operations on the executor or its futures would " +"often freeze or deadlock." msgstr "" -"當其中一個工作行程突然終止時,現在會引" -"發 :exc:`~concurrent.futures.process.BrokenProcessPool` 錯誤。在過去,此行為" -"是未定義的 (undefined),但對 executor 或其 future 的操作經常會發生凍結或死" -"鎖。" +"當其中一個工作行程突然終止時,現在會引發 :exc:`~concurrent.futures.process." +"BrokenProcessPool` 錯誤。在過去,此行為是未定義的 (undefined),但對 executor " +"或其 future 的操作經常會發生凍結或死鎖。" #: ../../library/concurrent.futures.rst:387 msgid "" @@ -679,12 +677,11 @@ msgstr "" #: ../../library/concurrent.futures.rst:397 msgid "" -"On POSIX systems, if your application has multiple threads and " -"the :mod:`multiprocessing` context uses the ``\"fork\"`` start method: " -"The :func:`os.fork` function called internally to spawn workers may raise " -"a :exc:`DeprecationWarning`. Pass a *mp_context* configured to use a " -"different start method. See the :func:`os.fork` documentation for further " -"explanation." +"On POSIX systems, if your application has multiple threads and the :mod:" +"`multiprocessing` context uses the ``\"fork\"`` start method: The :func:`os." +"fork` function called internally to spawn workers may raise a :exc:" +"`DeprecationWarning`. Pass a *mp_context* configured to use a different " +"start method. See the :func:`os.fork` documentation for further explanation." msgstr "" "在 POSIX 系統上,如果你的應用程式有多個執行緒並且 :mod:`multiprocessing` 情境" "使用了 ``\"fork\"`` 啟動方法:內部呼叫以產生 worker 的 :func:`os.fork` 函式可" @@ -693,24 +690,24 @@ msgstr "" #: ../../library/concurrent.futures.rst:405 msgid "" -"*max_workers* uses :func:`os.process_cpu_count` by default, instead " -"of :func:`os.cpu_count`." +"*max_workers* uses :func:`os.process_cpu_count` by default, instead of :func:" +"`os.cpu_count`." msgstr "" #: ../../library/concurrent.futures.rst:409 msgid "" "The default process start method (see :ref:`multiprocessing-start-methods`) " -"changed away from *fork*. If you require the *fork* start method " -"for :class:`ProcessPoolExecutor` you must explicitly pass " -"``mp_context=multiprocessing.get_context(\"fork\")``." +"changed away from *fork*. If you require the *fork* start method for :class:" +"`ProcessPoolExecutor` you must explicitly pass ``mp_context=multiprocessing." +"get_context(\"fork\")``." msgstr "" #: ../../library/concurrent.futures.rst:417 msgid "" -"Attempt to terminate all living worker processes immediately by " -"calling :meth:`Process.terminate ` on " -"each of them. Internally, it will also call :meth:`Executor.shutdown` to " -"ensure that all other resources associated with the executor are freed." +"Attempt to terminate all living worker processes immediately by calling :" +"meth:`Process.terminate ` on each of " +"them. Internally, it will also call :meth:`Executor.shutdown` to ensure that " +"all other resources associated with the executor are freed." msgstr "" #: ../../library/concurrent.futures.rst:422 @@ -722,10 +719,10 @@ msgstr "" #: ../../library/concurrent.futures.rst:429 msgid "" -"Attempt to kill all living worker processes immediately by " -"calling :meth:`Process.kill ` on each of them. " -"Internally, it will also call :meth:`Executor.shutdown` to ensure that all " -"other resources associated with the executor are freed." +"Attempt to kill all living worker processes immediately by calling :meth:" +"`Process.kill ` on each of them. Internally, " +"it will also call :meth:`Executor.shutdown` to ensure that all other " +"resources associated with the executor are freed." msgstr "" #: ../../library/concurrent.futures.rst:442 @@ -809,8 +806,8 @@ msgid "" "The :class:`Future` class encapsulates the asynchronous execution of a " "callable. :class:`Future` instances are created by :meth:`Executor.submit`." msgstr "" -":class:`Future` 類別封裝了可呼叫物件的非同步執行。:class:`Future` 實例" -"由 :meth:`Executor.submit` 建立。" +":class:`Future` 類別封裝了可呼叫物件的非同步執行。:class:`Future` 實例由 :" +"meth:`Executor.submit` 建立。" #: ../../library/concurrent.futures.rst:487 msgid "" @@ -915,8 +912,8 @@ msgstr "如果 future 已經完成或被取消,*fn* 將立即被呼叫。" #: ../../library/concurrent.futures.rst:555 msgid "" -"The following :class:`Future` methods are meant for use in unit tests " -"and :class:`Executor` implementations." +"The following :class:`Future` methods are meant for use in unit tests and :" +"class:`Executor` implementations." msgstr "以下 :class:`Future` 方法旨在用於單元測試和 :class:`Executor` 實作。" #: ../../library/concurrent.futures.rst:560 @@ -930,14 +927,14 @@ msgstr "" #: ../../library/concurrent.futures.rst:564 msgid "" -"If the method returns ``False`` then the :class:`Future` was cancelled, " -"i.e. :meth:`Future.cancel` was called and returned ``True``. Any threads " +"If the method returns ``False`` then the :class:`Future` was cancelled, i." +"e. :meth:`Future.cancel` was called and returned ``True``. Any threads " "waiting on the :class:`Future` completing (i.e. through :func:`as_completed` " "or :func:`wait`) will be woken up." msgstr "" -"如果該方法回傳 ``False`` 則 :class:`Future` 已被取消," -"即 :meth:`Future.cancel` 被呼叫並回傳 ``True``。任何等待 :class:`Future` 完成" -"的執行緒(即透過 :func:`as_completed` 或 :func:`wait`)將被喚醒。" +"如果該方法回傳 ``False`` 則 :class:`Future` 已被取消,即 :meth:`Future." +"cancel` 被呼叫並回傳 ``True``。任何等待 :class:`Future` 完成的執行緒(即透" +"過 :func:`as_completed` 或 :func:`wait`)將被喚醒。" #: ../../library/concurrent.futures.rst:569 msgid "" @@ -950,12 +947,11 @@ msgstr "" #: ../../library/concurrent.futures.rst:573 msgid "" -"This method can only be called once and cannot be called " -"after :meth:`Future.set_result` or :meth:`Future.set_exception` have been " -"called." +"This method can only be called once and cannot be called after :meth:`Future." +"set_result` or :meth:`Future.set_exception` have been called." msgstr "" -"此方法只能呼叫一次,且不能在呼叫 :meth:`Future.set_result` " -"或 :meth:`Future.set_exception` 之後呼叫。" +"此方法只能呼叫一次,且不能在呼叫 :meth:`Future.set_result` 或 :meth:`Future." +"set_exception` 之後呼叫。" #: ../../library/concurrent.futures.rst:579 msgid "" @@ -972,16 +968,16 @@ msgstr "此方法只能在 :class:`Executor` 實作中和單元測試中使用 #: ../../library/concurrent.futures.rst:585 #: ../../library/concurrent.futures.rst:598 msgid "" -"This method raises :exc:`concurrent.futures.InvalidStateError` if " -"the :class:`Future` is already done." +"This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:" +"`Future` is already done." msgstr "" -"如果 :class:`Future` 已經完成,此方法會引" -"發 :exc:`concurrent.futures.InvalidStateError`。" +"如果 :class:`Future` 已經完成,此方法會引發 :exc:`concurrent.futures." +"InvalidStateError`。" #: ../../library/concurrent.futures.rst:592 msgid "" -"Sets the result of the work associated with the :class:`Future` to " -"the :class:`Exception` *exception*." +"Sets the result of the work associated with the :class:`Future` to the :" +"class:`Exception` *exception*." msgstr "" "將與 :class:`Future` 關聯的工作結果設定為 :class:`Exception` *exception*。" @@ -991,13 +987,13 @@ msgstr "模組函式" #: ../../library/concurrent.futures.rst:608 msgid "" -"Wait for the :class:`Future` instances (possibly created by " -"different :class:`Executor` instances) given by *fs* to complete. Duplicate " -"futures given to *fs* are removed and will be returned only once. Returns a " -"named 2-tuple of sets. The first set, named ``done``, contains the futures " -"that completed (finished or cancelled futures) before the wait completed. " -"The second set, named ``not_done``, contains the futures that did not " -"complete (pending or running futures)." +"Wait for the :class:`Future` instances (possibly created by different :class:" +"`Executor` instances) given by *fs* to complete. Duplicate futures given to " +"*fs* are removed and will be returned only once. Returns a named 2-tuple of " +"sets. The first set, named ``done``, contains the futures that completed " +"(finished or cancelled futures) before the wait completed. The second set, " +"named ``not_done``, contains the futures that did not complete (pending or " +"running futures)." msgstr "" "等待 *fs* 給定的 :class:`Future` 實例(可能由不同的 :class:`Executor` 實例建" "立)完成。提供給 *fs* 的重複 future 將被刪除,並且只會回傳一次。回傳一個集合" @@ -1035,8 +1031,8 @@ msgstr "當任何 future 完成或被取消時,該函式就會回傳。" #: ../../library/concurrent.futures.rst:633 msgid "" "The function will return when any future finishes by raising an exception. " -"If no future raises an exception then it is equivalent " -"to :const:`ALL_COMPLETED`." +"If no future raises an exception then it is equivalent to :const:" +"`ALL_COMPLETED`." msgstr "" "該函式會在任何 future 透過引發例外而完結時回傳。如果 future 沒有引發例外,那" "麼它等同於 :const:`ALL_COMPLETED`。" @@ -1060,10 +1056,10 @@ msgstr "" "回傳由 *fs* 給定的 :class:`Future` 實例(可能由不同的 :class:`Executor` 實例" "建立)的疊代器,它在完成時產生 future(已完成或被取消的 future)。*fs* 給定的" "任何重複的 future 將只被回傳一次。呼叫 :func:`as_completed` 之前完成的任何 " -"future 將首先產生。如果 :meth:`~iterator.__next__` 被呼叫,並且在原先呼" -"叫 :func:`as_completed` 的 *timeout* 秒後結果仍不可用,則回傳的疊代器會引" -"發 :exc:`TimeoutError`。*timeout* 可以是整數或浮點數。如果未指定 *timeout* 或" -"為 ``None``,則等待時間就沒有限制。" +"future 將首先產生。如果 :meth:`~iterator.__next__` 被呼叫,並且在原先呼叫 :" +"func:`as_completed` 的 *timeout* 秒後結果仍不可用,則回傳的疊代器會引發 :exc:" +"`TimeoutError`。*timeout* 可以是整數或浮點數。如果未指定 *timeout* 或為 " +"``None``,則等待時間就沒有限制。" #: ../../library/concurrent.futures.rst:655 msgid ":pep:`3148` -- futures - execute computations asynchronously" @@ -1112,23 +1108,21 @@ msgstr "目前狀態下不允許的 future 操作被執行時而引發。" #: ../../library/concurrent.futures.rst:698 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class " -"is raised when one of the workers of " -"a :class:`~concurrent.futures.ThreadPoolExecutor` has failed initializing." +"is raised when one of the workers of a :class:`~concurrent.futures." +"ThreadPoolExecutor` has failed initializing." msgstr "" -"衍生自 :exc:`~concurrent.futures.BrokenExecutor`," -"當 :class:`~concurrent.futures.ThreadPoolExecutor` 的其中一個 worker 初始化失" -"敗時會引發此例外類別。" +"衍生自 :exc:`~concurrent.futures.BrokenExecutor`,當 :class:`~concurrent." +"futures.ThreadPoolExecutor` 的其中一個 worker 初始化失敗時會引發此例外類別。" #: ../../library/concurrent.futures.rst:709 msgid "" "Derived from :exc:`~concurrent.futures.thread.BrokenThreadPool`, this " -"exception class is raised when one of the workers of " -"a :class:`~concurrent.futures.InterpreterPoolExecutor` has failed " -"initializing." +"exception class is raised when one of the workers of a :class:`~concurrent." +"futures.InterpreterPoolExecutor` has failed initializing." msgstr "" -"衍生自 :exc:`~concurrent.futures.thread.BrokenThreadPool`," -"當 :class:`~concurrent.futures.InterpreterPoolExecutor` 的其中一個 worker 初始化失" -"敗時會引發此例外類別。" +"衍生自 :exc:`~concurrent.futures.thread.BrokenThreadPool`,當 :class:" +"`~concurrent.futures.InterpreterPoolExecutor` 的其中一個 worker 初始化失敗時" +"會引發此例外類別。" #: ../../library/concurrent.futures.rst:718 msgid "" @@ -1139,13 +1133,12 @@ msgstr "" #: ../../library/concurrent.futures.rst:729 msgid "" -"Derived from :exc:`~concurrent.futures.BrokenExecutor` " -"(formerly :exc:`RuntimeError`), this exception class is raised when one of " -"the workers of a :class:`~concurrent.futures.ProcessPoolExecutor` has " -"terminated in a non-clean fashion (for example, if it was killed from the " -"outside)." +"Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:" +"`RuntimeError`), this exception class is raised when one of the workers of " +"a :class:`~concurrent.futures.ProcessPoolExecutor` has terminated in a non-" +"clean fashion (for example, if it was killed from the outside)." msgstr "" -"衍生自 :exc:`~concurrent.futures.BrokenExecutor`\\(以前" -"為 :exc:`RuntimeError`)," -"當 :class:`~concurrent.futures.ProcessPoolExecutor` 的其中一個 worker 以不乾" -"淨的方式終止時將引發此例外類別(例如它是從外面被 kill 掉的)。" +"衍生自 :exc:`~concurrent.futures.BrokenExecutor`\\(以前為 :exc:" +"`RuntimeError`),當 :class:`~concurrent.futures.ProcessPoolExecutor` 的其中" +"一個 worker 以不乾淨的方式終止時將引發此例外類別(例如它是從外面被 kill 掉" +"的)。" diff --git a/library/constants.po b/library/constants.po index a22d36e509..ec45a2b3ab 100644 --- a/library/constants.po +++ b/library/constants.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2021-11-19 23:36+0800\n" "Last-Translator: Jordan Su \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -58,22 +58,21 @@ msgstr "" #: ../../library/constants.rst:30 msgid "" -"A special value which should be returned by the binary special methods " -"(e.g. :meth:`~object.__eq__`, :meth:`~object.__lt__`, :meth:`~object.__add__`, :meth:`~object.__rsub__`, " -"etc.) to indicate that the operation is not implemented with respect to the " -"other type; may be returned by the in-place binary special methods " -"(e.g. :meth:`~object.__imul__`, :meth:`~object.__iand__`, etc.) for the same " -"purpose. It should not be evaluated in a boolean context. :data:`!" -"NotImplemented` is the sole instance of the :data:`types.NotImplementedType` " -"type." -msgstr "" -"會被二元特殊方法 (binary special methods)" -"(如::meth:`~object.__eq__`、:meth:`~object.__lt__`、:meth:`~object.__add__`、:meth:`~object.__rsub__` " -"等)所回傳的特殊值,代表著該運算沒有針對其他型別的實作。同理也可以被原地二元" -"特殊方法 (in-place binary special methods) " -"(如::meth:`~object.__imul__`、:meth:`~object.__iand__` 等)回傳。它不應該被" -"作為 boolean(布林)來解讀。:data:`!NotImplemented` 是型" -"別 :data:`types.NotImplementedType` 的唯一實例。" +"A special value which should be returned by the binary special methods (e." +"g. :meth:`~object.__eq__`, :meth:`~object.__lt__`, :meth:`~object.__add__`, :" +"meth:`~object.__rsub__`, etc.) to indicate that the operation is not " +"implemented with respect to the other type; may be returned by the in-place " +"binary special methods (e.g. :meth:`~object.__imul__`, :meth:`~object." +"__iand__`, etc.) for the same purpose. It should not be evaluated in a " +"boolean context. :data:`!NotImplemented` is the sole instance of the :data:" +"`types.NotImplementedType` type." +msgstr "" +"會被二元特殊方法 (binary special methods)(如::meth:`~object.__eq__`、:meth:" +"`~object.__lt__`、:meth:`~object.__add__`、:meth:`~object.__rsub__` 等)所回" +"傳的特殊值,代表著該運算沒有針對其他型別的實作。同理也可以被原地二元特殊方法 " +"(in-place binary special methods) (如::meth:`~object.__imul__`、:meth:" +"`~object.__iand__` 等)回傳。它不應該被作為 boolean(布林)來解讀。:data:`!" +"NotImplemented` 是型別 :data:`types.NotImplementedType` 的唯一實例。" #: ../../library/constants.rst:40 msgid "" @@ -98,60 +97,61 @@ msgstr "請參見 :ref:`implementing-the-arithmetic-operations` 以找到更多 #: ../../library/constants.rst:51 msgid "" ":data:`!NotImplemented` and :exc:`!NotImplementedError` are not " -"interchangeable. This constant should only be used as described above; " -"see :exc:`NotImplementedError` for details on correct usage of the exception." +"interchangeable. This constant should only be used as described above; see :" +"exc:`NotImplementedError` for details on correct usage of the exception." msgstr "" ":data:`!NotImplemented` 與 :exc:`!NotImplementedError` 並不一樣且不可互換。這" -"個常數只能用於上述的情況;欲知更多如何正確使用它們的細節,請參" -"見 :exc:`NotImplementedError`。" +"個常數只能用於上述的情況;欲知更多如何正確使用它們的細節,請參見 :exc:" +"`NotImplementedError`。" #: ../../library/constants.rst:56 msgid "Evaluating :data:`!NotImplemented` in a boolean context was deprecated." -msgstr "" +msgstr "在 boolean(布林)上下文中對 :data:`!NotImplemented` 求值的操作已被棄用。" #: ../../library/constants.rst:59 msgid "" -"Evaluating :data:`!NotImplemented` in a boolean context now raises " -"a :exc:`TypeError`. It previously evaluated to :const:`True` and emitted " -"a :exc:`DeprecationWarning` since Python 3.9." +"Evaluating :data:`!NotImplemented` in a boolean context now raises a :exc:" +"`TypeError`. It previously evaluated to :const:`True` and emitted a :exc:" +"`DeprecationWarning` since Python 3.9." msgstr "" -"在 boolean(布林)上下文中解讀 :data:`!NotImplemented` 現在會引發 :exc:`TypeError`。" -"過去自 Python 3.9 以來,這會被解讀成 :const:`True`,並發出 :exc:`DeprecationWarning`" +"在 boolean 上下文中解讀 :data:`!NotImplemented` 現在會引發 :exc:" +"`TypeError`。過去自 Python 3.9 以來,這會被解讀成 :const:`True`,並發出 :exc:" +"`DeprecationWarning`" #: ../../library/constants.rst:68 msgid "" -"The same as the ellipsis literal \"``...``\". Special value used mostly in " -"conjunction with extended slicing syntax for user-defined container data " -"types. ``Ellipsis`` is the sole instance of the :data:`types.EllipsisType` " -"type." +"The same as the ellipsis literal \"``...``\", an object frequently used to " +"indicate that something is omitted. Assignment to ``Ellipsis`` is possible, " +"but assignment to ``...`` raises a :exc:`SyntaxError`. ``Ellipsis`` is the " +"sole instance of the :data:`types.EllipsisType` type." msgstr "" -"與刪節號 \"``...``\" 字面相同。為一特殊值,大多用於結合使用者定義資料型別的延" -"伸切片語法 (extended slicing syntax)。``Ellipsis`` 是型" -"別 :data:`types.EllipsisType` 的唯一實例。" +"與刪節號 \"``...``\" 字面相同,是一個經常被用來表示某些東西被省略的物件。對於 " +"``Ellipsis`` 的賦值是可能的,但對於 ``...`` 的賦值會引發 :exc:`SyntaxError`。" +"``Ellipsis`` 是型別 :data:`types.EllipsisType` 的唯一實例。" -#: ../../library/constants.rst:75 +#: ../../library/constants.rst:76 msgid "" "This constant is true if Python was not started with an :option:`-O` option. " "See also the :keyword:`assert` statement." msgstr "" -"如果 Python 沒有被以 :option:`-O` 選項啟動,則此常數為 true。請參" -"見 :keyword:`assert` 陳述式。" +"如果 Python 沒有被以 :option:`-O` 選項啟動,則此常數為 true。請參見 :keyword:" +"`assert` 陳述式。" -#: ../../library/constants.rst:81 +#: ../../library/constants.rst:82 msgid "" "The names :data:`None`, :data:`False`, :data:`True` and :data:`__debug__` " -"cannot be reassigned (assignments to them, even as an attribute name, " -"raise :exc:`SyntaxError`), so they can be considered \"true\" constants." +"cannot be reassigned (assignments to them, even as an attribute name, raise :" +"exc:`SyntaxError`), so they can be considered \"true\" constants." msgstr "" ":data:`None`,:data:`False`,:data:`True`,以及 :data:`__debug__` 都是不能被" -"重新賦值的(任何對它們的賦值,即使是屬性的名稱,也會拋" -"出 :exc:`SyntaxError`)。因此,它們可以被視為”真正的”常數。" +"重新賦值的(任何對它們的賦值,即使是屬性的名稱,也會拋出 :exc:" +"`SyntaxError`)。因此,它們可以被視為”真正的”常數。" -#: ../../library/constants.rst:89 +#: ../../library/constants.rst:90 msgid "Constants added by the :mod:`site` module" msgstr "由 :mod:`site` module(模組)所添增的常數" -#: ../../library/constants.rst:91 +#: ../../library/constants.rst:92 msgid "" "The :mod:`site` module (which is imported automatically during startup, " "except if the :option:`-S` command-line option is given) adds several " @@ -162,7 +162,7 @@ msgstr "" "指令行選項)會添增一些常數到內建命名空間 (built-in namespace) 中。它們在互動" "式直譯器中是很有幫助的,但不應該在程式 (programs) 中被使用。" -#: ../../library/constants.rst:99 +#: ../../library/constants.rst:100 msgid "" "Objects that when printed, print a message like \"Use quit() or Ctrl-D (i.e. " "EOF) to exit\", and when accessed directly in the interactive interpreter or " @@ -172,24 +172,24 @@ msgstr "" "直接在互動式直譯器中存取或作為函式呼叫時,會引發 :exc:`SystemExit` 並帶有指定" "的返回碼(exit code)。" -#: ../../library/constants.rst:107 +#: ../../library/constants.rst:108 msgid "" "Object that when printed, prints the message \"Type help() for interactive " "help, or help(object) for help about object.\", and when accessed directly " -"in the interactive interpreter, invokes the built-in help system " -"(see :func:`help`)." +"in the interactive interpreter, invokes the built-in help system (see :func:" +"`help`)." msgstr "" "當印出此物件時,會印出訊息 \"Type help() for interactive help, or " "help(object) for help about object.\",並在互動式直譯器中直接存取時,會叫用內" "建的幫助系統(參見 :func:`help`)。" -#: ../../library/constants.rst:115 +#: ../../library/constants.rst:116 msgid "" "Objects that when printed or called, print the text of copyright or credits, " "respectively." msgstr "當印出或是呼叫此物件時,分別會印出版權與致謝的文字。" -#: ../../library/constants.rst:120 +#: ../../library/constants.rst:121 msgid "" "Object that when printed, prints the message \"Type license() to see the " "full license text\", and when called, displays the full license text in a " @@ -204,4 +204,4 @@ msgstr "..." #: ../../library/constants.rst:65 msgid "ellipsis literal" -msgstr "ellipsis literal(刪節號)" +msgstr "ellipsis literal(刪節號字面值)" diff --git a/library/csv.po b/library/csv.po index f4fc801561..300da9c590 100644 --- a/library/csv.po +++ b/library/csv.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2023-11-08 15:06+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -105,22 +105,22 @@ msgstr "" "其中每個字串都要是讀取器所定義的 csv 格式,csvfile 通常是個類檔案物件或者 " "list。如果 *csvfile* 是個檔案物件,則需開啟時使用 ``newline=''``。 [1]_ " "*dialect* 為一個可選填的參數,可以用為特定的 CSV dialect(方言) 定義一組參" -"數。它可能為 :class:`Dialect` 的一個子類別 (subclass) 的實例或是" -"由 :func:`list_dialects` 函式回傳的多個字串中的其中之一。另一個可選填的關鍵字" -"引數 *fmtparams* 可以在這個 dialect 中覆寫 (override) 個別的格式化參數 " -"(formatting parameter)。關於 dialect 及格式化參數的完整說明,請見段" -"落 :ref:`csv-fmt-params`。" +"數。它可能為 :class:`Dialect` 的一個子類別 (subclass) 的實例或是由 :func:" +"`list_dialects` 函式回傳的多個字串中的其中之一。另一個可選填的關鍵字引數 " +"*fmtparams* 可以在這個 dialect 中覆寫 (override) 個別的格式化參數 " +"(formatting parameter)。關於 dialect 及格式化參數的完整說明,請見段落 :ref:" +"`csv-fmt-params`。" #: ../../library/csv.rst:72 msgid "" "Each row read from the csv file is returned as a list of strings. No " -"automatic data type conversion is performed unless " -"the :data:`QUOTE_NONNUMERIC` format option is specified (in which case " -"unquoted fields are transformed into floats)." +"automatic data type conversion is performed unless the :data:" +"`QUOTE_NONNUMERIC` format option is specified (in which case unquoted fields " +"are transformed into floats)." msgstr "" -"從 CSV 檔案讀取的每一列會回傳為一個字串列表。除非格式選" -"項 :data:`QUOTE_NONNUMERIC` 有被指定(在這個情況之下,沒有引號的欄位都會被轉" -"換成浮點數),否則不會進行自動資料型別轉換。" +"從 CSV 檔案讀取的每一列會回傳為一個字串列表。除非格式選項 :data:" +"`QUOTE_NONNUMERIC` 有被指定(在這個情況之下,沒有引號的欄位都會被轉換成浮點" +"數),否則不會進行自動資料型別轉換。" #: ../../library/csv.rst:76 ../../library/csv.rst:106 ../../library/csv.rst:181 #: ../../library/csv.rst:219 @@ -152,12 +152,12 @@ msgid "" "object with a :meth:`~io.TextIOBase.write` method. If *csvfile* is a file " "object, it should be opened with ``newline=''`` [1]_. An optional *dialect* " "parameter can be given which is used to define a set of parameters specific " -"to a particular CSV dialect. It may be an instance of a subclass of " -"the :class:`Dialect` class or one of the strings returned by " -"the :func:`list_dialects` function. The other optional *fmtparams* keyword " -"arguments can be given to override individual formatting parameters in the " -"current dialect. For full details about dialects and formatting parameters, " -"see the :ref:`csv-fmt-params` section. To make it as easy as possible to " +"to a particular CSV dialect. It may be an instance of a subclass of the :" +"class:`Dialect` class or one of the strings returned by the :func:" +"`list_dialects` function. The other optional *fmtparams* keyword arguments " +"can be given to override individual formatting parameters in the current " +"dialect. For full details about dialects and formatting parameters, see " +"the :ref:`csv-fmt-params` section. To make it as easy as possible to " "interface with modules which implement the DB API, the value :const:`None` " "is written as the empty string. While this isn't a reversible " "transformation, it makes it easier to dump SQL NULL data values to CSV files " @@ -208,8 +208,8 @@ msgstr "" #: ../../library/csv.rst:127 msgid "" -"Delete the dialect associated with *name* from the dialect registry. " -"An :exc:`Error` is raised if *name* is not a registered dialect name." +"Delete the dialect associated with *name* from the dialect registry. An :" +"exc:`Error` is raised if *name* is not a registered dialect name." msgstr "" "從 dialect 註冊表 (registry) 中,刪除與 *name* 關聯的 dialect。若 *name* 如果" "不是註冊的 dialect 名稱,則會產生一個 :exc:`Error`。" @@ -221,8 +221,8 @@ msgid "" "immutable :class:`Dialect`." msgstr "" "回傳一個與 *name* 關聯的 dialect。若 *name* 如果不是註冊的 dialect 名稱,則會" -"產生一個 :exc:`Error`。這個函式會回傳一個 immutable (不可變物" -"件) :class:`Dialect`。" +"產生一個 :exc:`Error`。這個函式會回傳一個 immutable (不可變物件) :class:" +"`Dialect`。" #: ../../library/csv.rst:139 msgid "Return the names of all registered dialects." @@ -246,8 +246,8 @@ msgid "" "information in each row to a :class:`dict` whose keys are given by the " "optional *fieldnames* parameter." msgstr "" -"建立一個物件,其運作上就像一般的讀取器,但可以將每一列資訊 map (對映) " -"到 :class:`dict` 中,可以透過選填的參數 *fieldnames* 設定 key。" +"建立一個物件,其運作上就像一般的讀取器,但可以將每一列資訊 map (對映) 到 :" +"class:`dict` 中,可以透過選填的參數 *fieldnames* 設定 key。" #: ../../library/csv.rst:157 msgid "" @@ -277,8 +277,8 @@ msgstr "" #: ../../library/csv.rst:170 msgid "" -"All other optional or keyword arguments are passed to the " -"underlying :class:`reader` instance." +"All other optional or keyword arguments are passed to the underlying :class:" +"`reader` instance." msgstr "所有其他選填的引數或關鍵字引數皆會傳遞至下層的 :class:`reader` 實例。" #: ../../library/csv.rst:173 ../../library/csv.rst:217 @@ -332,10 +332,10 @@ msgid "" "written if the dictionary is missing a key in *fieldnames*. If the " "dictionary passed to the :meth:`~csvwriter.writerow` method contains a key " "not found in *fieldnames*, the optional *extrasaction* parameter indicates " -"what action to take. If it is set to ``'raise'``, the default value, " -"a :exc:`ValueError` is raised. If it is set to ``'ignore'``, extra values in " -"the dictionary are ignored. Any other optional or keyword arguments are " -"passed to the underlying :class:`writer` instance." +"what action to take. If it is set to ``'raise'``, the default value, a :exc:" +"`ValueError` is raised. If it is set to ``'ignore'``, extra values in the " +"dictionary are ignored. Any other optional or keyword arguments are passed " +"to the underlying :class:`writer` instance." msgstr "" "建立一個物件,其運作上就像一般的寫入器,但可以將 dictionary map 到輸出的列" "上。參數 *fieldnames* 是一個鍵值的 :mod:`sequence ` 且可以辨" @@ -384,13 +384,13 @@ msgid "" "The :class:`Dialect` class is a container class whose attributes contain " "information for how to handle doublequotes, whitespace, delimiters, etc. Due " "to the lack of a strict CSV specification, different applications produce " -"subtly different CSV data. :class:`Dialect` instances define " -"how :class:`reader` and :class:`writer` instances behave." +"subtly different CSV data. :class:`Dialect` instances define how :class:" +"`reader` and :class:`writer` instances behave." msgstr "" "類別 :class:`Dialect` 是一個容器類別,其屬性 (attribute) 包含如何處理雙引號、" "空白、分隔符號等資訊。由於缺少一個嚴謹的 CSV 技術規範,不同的應用程式會產出有" -"巧妙不同的 CSV 資料。:class:`Dialect` 實例定義了 :class:`reader` 以" -"及 :class:`writer` 的實例該如何表示。" +"巧妙不同的 CSV 資料。:class:`Dialect` 實例定義了 :class:`reader` 以及 :class:" +"`writer` 的實例該如何表示。" #: ../../library/csv.rst:241 msgid "" @@ -461,10 +461,10 @@ msgstr "" #: ../../library/csv.rst:288 msgid "" -"Analyze the sample text (presumed to be in CSV format) and " -"return :const:`True` if the first row appears to be a series of column " -"headers. Inspecting each column, one of two key criteria will be considered " -"to estimate if the sample contains a header:" +"Analyze the sample text (presumed to be in CSV format) and return :const:" +"`True` if the first row appears to be a series of column headers. Inspecting " +"each column, one of two key criteria will be considered to estimate if the " +"sample contains a header:" msgstr "" "如果第一列的文字顯示將作為一系列的欄位標題,會分析 sample 文字(假定他是 CSV " "格式)並回傳 :const:`True`。檢查每一欄時,會考慮是否滿足兩個關鍵標準其中之" @@ -486,8 +486,8 @@ msgid "" "Twenty rows after the first row are sampled; if more than half of columns + " "rows meet the criteria, :const:`True` is returned." msgstr "" -"對第一列之後的二十個列進行取樣;如果超過一半的行及列滿足條件,則返" -"回 :const:`True`。" +"對第一列之後的二十個列進行取樣;如果超過一半的行及列滿足條件,則返回 :const:" +"`True`。" #: ../../library/csv.rst:302 msgid "" @@ -538,16 +538,16 @@ msgstr "引導 :class:`writer` 物件引用所有非數字的欄位。" #: ../../library/csv.rst:334 msgid "" -"Instructs :class:`reader` objects to convert all non-quoted fields to " -"type :class:`float`." +"Instructs :class:`reader` objects to convert all non-quoted fields to type :" +"class:`float`." msgstr "引導 :class:`reader` 物件轉換所有非引用的欄位為 :class:`float`。" #: ../../library/csv.rst:337 msgid "" -"Some numeric types, such as :class:`bool`, :class:`~fractions.Fraction`, " -"or :class:`~enum.IntEnum`, have a string representation that cannot be " -"converted to :class:`float`. They cannot be read in " -"the :data:`QUOTE_NONNUMERIC` and :data:`QUOTE_STRINGS` modes." +"Some numeric types, such as :class:`bool`, :class:`~fractions.Fraction`, or :" +"class:`~enum.IntEnum`, have a string representation that cannot be converted " +"to :class:`float`. They cannot be read in the :data:`QUOTE_NONNUMERIC` and :" +"data:`QUOTE_STRINGS` modes." msgstr "" #: ../../library/csv.rst:345 @@ -593,17 +593,17 @@ msgid "" "are strings. This is similar to :data:`QUOTE_NONNUMERIC`, except that if a " "field value is ``None`` an empty (unquoted) string is written." msgstr "" -"引導 :class:`writer` 物件永遠在字串的欄位前後放置引號。這" -"與 :data:`QUOTE_NONNUMERIC` 相似,除非如果欄位值為 ``None``,該欄位則被寫成空" -"(沒有引號)字串。" +"引導 :class:`writer` 物件永遠在字串的欄位前後放置引號。這與 :data:" +"`QUOTE_NONNUMERIC` 相似,除非如果欄位值為 ``None``,該欄位則被寫成空(沒有引" +"號)字串。" #: ../../library/csv.rst:372 msgid "" "Instructs :class:`reader` objects to interpret an empty (unquoted) string as " "``None`` and to otherwise behave as :data:`QUOTE_NONNUMERIC`." msgstr "" -"引導 :class:`reader` 物件將空(沒有引號)字串直譯為 ``None``,否則會" -"和 :data:`QUOTE_ALL` 有相同的表現方式。" +"引導 :class:`reader` 物件將空(沒有引號)字串直譯為 ``None``,否則會和 :data:" +"`QUOTE_ALL` 有相同的表現方式。" #: ../../library/csv.rst:377 msgid "The :mod:`csv` module defines the following exception:" @@ -622,19 +622,19 @@ msgid "" "To make it easier to specify the format of input and output records, " "specific formatting parameters are grouped together into dialects. A " "dialect is a subclass of the :class:`Dialect` class containing various " -"attributes describing the format of the CSV file. When " -"creating :class:`reader` or :class:`writer` objects, the programmer can " -"specify a string or a subclass of the :class:`Dialect` class as the dialect " -"parameter. In addition to, or instead of, the *dialect* parameter, the " -"programmer can also specify individual formatting parameters, which have the " -"same names as the attributes defined below for the :class:`Dialect` class." +"attributes describing the format of the CSV file. When creating :class:" +"`reader` or :class:`writer` objects, the programmer can specify a string or " +"a subclass of the :class:`Dialect` class as the dialect parameter. In " +"addition to, or instead of, the *dialect* parameter, the programmer can also " +"specify individual formatting parameters, which have the same names as the " +"attributes defined below for the :class:`Dialect` class." msgstr "" "為了讓指定輸入及輸出紀錄的格式更方便,特定的格式化參數會被組成 dialect。一個 " "dialect 是 :class:`Dialect` class 的子類別,其包含多個描述 CSV 檔案格式的多個" "屬性。當建立 :class:`reader` 或 :class:`writer` 物件時,程式設計師可以指定一" "個字串或是一個 :class:`Dialect` 的子類別作為 dialect 參數。此外,或是作為替" -"代,在\\ *dialect*\\ 參數中,程式設計師可以指定個別的格式化參數,其" -"與 :class:`Dialect` 類別定義的屬性具有相同的名字。" +"代,在\\ *dialect*\\ 參數中,程式設計師可以指定個別的格式化參數,其與 :class:" +"`Dialect` 類別定義的屬性具有相同的名字。" #: ../../library/csv.rst:399 msgid "Dialects support the following attributes:" @@ -648,9 +648,9 @@ msgstr "一個單一字元 (one-character) 的字串可已用來分割欄位。 #: ../../library/csv.rst:409 msgid "" "Controls how instances of *quotechar* appearing inside a field should " -"themselves be quoted. When :const:`True`, the character is doubled. " -"When :const:`False`, the *escapechar* is used as a prefix to the " -"*quotechar*. It defaults to :const:`True`." +"themselves be quoted. When :const:`True`, the character is doubled. When :" +"const:`False`, the *escapechar* is used as a prefix to the *quotechar*. It " +"defaults to :const:`True`." msgstr "" "控制 *quotechar* 的實例何時出現在欄位之中,並讓它們自己被放在引號之內。當屬性" "為 :const:`True`,字元會是雙引號。若為 :const:`False`,在 *quotechar* 之前會" @@ -658,8 +658,8 @@ msgstr "" #: ../../library/csv.rst:414 msgid "" -"On output, if *doublequote* is :const:`False` and no *escapechar* is " -"set, :exc:`Error` is raised if a *quotechar* is found in a field." +"On output, if *doublequote* is :const:`False` and no *escapechar* is set, :" +"exc:`Error` is raised if a *quotechar* is found in a field." msgstr "" "在輸出時,若 *doublequote* 是 :const:`False` 且\\ *逸出字元*\\ 沒有被設定,當" "一個\\ *引號*\\ 在欄位中被發現時,:exc:`Error` 會被引發。" @@ -673,8 +673,8 @@ msgstr "一個單一字元的字串,會被寫入器用來逸出需要逸出的 #: ../../library/csv.rst:423 msgid "" "the *delimiter*, the *quotechar*, ``'\\r'``, ``'\\n'`` and any of the " -"characters in *lineterminator* are escaped if *quoting* is set " -"to :const:`QUOTE_NONE`;" +"characters in *lineterminator* are escaped if *quoting* is set to :const:" +"`QUOTE_NONE`;" msgstr "" #: ../../library/csv.rst:426 @@ -737,37 +737,38 @@ msgid "" "``None``, and :const:`QUOTE_NONE` otherwise." msgstr "" "控制 writer 何時產生引號,以及 reader 如何辨識引號。如 *quotechar* 不為 " -"``None``,則可以使用任何 :ref:`QUOTE_\\* 常數 `\\ 且預設" -"為 :const:`QUOTE_MINIMAL`。否則預設為 :const:`QUOTE_NONE`。" +"``None``,則可以使用任何 :ref:`QUOTE_\\* 常數 `\\ 且預設為 :" +"const:`QUOTE_MINIMAL`。否則預設為 :const:`QUOTE_NONE`。" #: ../../library/csv.rst:469 msgid "" "When :const:`True`, spaces immediately following the *delimiter* are " -"ignored. The default is :const:`False`." +"ignored. The default is :const:`False`. When combining ``delimiter=' '`` " +"with ``skipinitialspace=True``, unquoted empty fields are not allowed." msgstr "" -"若為 :const:`True`,在緊接著\\ *delimiter*\\ 後的空格會被忽略。預設" -"為 :const:`False`。" +"若為 :const:`True`,在緊接著\\ *delimiter*\\ 後的空格會被忽略。預設為 :const:" +"`False`。當結合 ``delimiter=' '`` 與 ``skipinitialspace=True`` 時,不允許沒有引號的空欄位。" -#: ../../library/csv.rst:475 +#: ../../library/csv.rst:476 msgid "" "When ``True``, raise exception :exc:`Error` on bad CSV input. The default is " "``False``." msgstr "" "若為 ``True``,若有錯誤的 CSV 輸入則會引發 :exc:`Error`。預設為 ``False``。" -#: ../../library/csv.rst:481 +#: ../../library/csv.rst:482 msgid "Reader Objects" msgstr "讀取器物件" -#: ../../library/csv.rst:483 +#: ../../library/csv.rst:484 msgid "" -"Reader objects (:class:`DictReader` instances and objects returned by " -"the :func:`reader` function) have the following public methods:" +"Reader objects (:class:`DictReader` instances and objects returned by the :" +"func:`reader` function) have the following public methods:" msgstr "" "讀取器物件(:func:`reader` 函式回傳的 :class:`DictReader` 實例與物件)有下列" "公開方法 (public method):" -#: ../../library/csv.rst:488 +#: ../../library/csv.rst:489 msgid "" "Return the next row of the reader's iterable object as a list (if the object " "was returned from :func:`reader`) or a dict (if it is a :class:`DictReader` " @@ -775,28 +776,28 @@ msgid "" "should call this as ``next(reader)``." msgstr "" "回傳一個列表為讀入器的可疊代物件的下一列內容(若該物件是由 :func:`reader` 回" -"傳)或是一個 dict(若為 :class:`DictReader` 實例),會依據目前" -"的 :class:`Dialect` 進行剖析。通常會用 ``next(reader)`` 來進行呼叫。" +"傳)或是一個 dict(若為 :class:`DictReader` 實例),會依據目前的 :class:" +"`Dialect` 進行剖析。通常會用 ``next(reader)`` 來進行呼叫。" -#: ../../library/csv.rst:494 +#: ../../library/csv.rst:495 msgid "Reader objects have the following public attributes:" msgstr "讀取器物件有下列公開屬性 (public attributes):" -#: ../../library/csv.rst:498 +#: ../../library/csv.rst:499 msgid "A read-only description of the dialect in use by the parser." msgstr "dialect 的唯讀敘述,會被剖析器使用。" -#: ../../library/csv.rst:503 +#: ../../library/csv.rst:504 msgid "" "The number of lines read from the source iterator. This is not the same as " "the number of records returned, as records can span multiple lines." msgstr "來源疊代器所讀取的行數。這與回傳的紀錄數不同,因為可以進行跨行紀錄。" -#: ../../library/csv.rst:507 +#: ../../library/csv.rst:508 msgid "DictReader objects have the following public attribute:" msgstr "DictReader 物件有下列公開屬性:" -#: ../../library/csv.rst:511 +#: ../../library/csv.rst:512 msgid "" "If not passed as a parameter when creating the object, this attribute is " "initialized upon first access or when the first record is read from the file." @@ -804,11 +805,11 @@ msgstr "" "若在建立物件時沒有作為參數傳遞,這個屬性會在第一次存取之前或是第一筆資料被讀" "取之前進行初始化 (initialize)。" -#: ../../library/csv.rst:518 +#: ../../library/csv.rst:519 msgid "Writer Objects" msgstr "寫入器物件" -#: ../../library/csv.rst:520 +#: ../../library/csv.rst:521 msgid "" ":class:`writer` objects (:class:`DictWriter` instances and objects returned " "by the :func:`writer` function) have the following public methods. A *row* " @@ -826,7 +827,7 @@ msgstr "" "遞)。請注意,在寫入複數 (complex number) 時會用小括號 (parens) 包起來。這可" "能在其他程式讀取 CSV 檔案時導致某些問題(假設他們完全支援複雜數字)。" -#: ../../library/csv.rst:531 +#: ../../library/csv.rst:532 msgid "" "Write the *row* parameter to the writer's file object, formatted according " "to the current :class:`Dialect`. Return the return value of the call to the " @@ -835,11 +836,11 @@ msgstr "" "將參數 *row* 寫入至寫入器的檔案物件中,並依照目前的 :class:`Dialect` 進行格式" "化。回傳下層檔案物件 *write* 方法的回傳值。" -#: ../../library/csv.rst:535 +#: ../../library/csv.rst:536 msgid "Added support of arbitrary iterables." msgstr "新增對任意可疊代物件 (arbitrary iterables) 的支援。" -#: ../../library/csv.rst:540 +#: ../../library/csv.rst:541 msgid "" "Write all elements in *rows* (an iterable of *row* objects as described " "above) to the writer's file object, formatted according to the current " @@ -848,19 +849,19 @@ msgstr "" "將 *rows* 中所有元素(為上述的一個可疊代的 *row* 物件)寫入至寫入器的檔案物件" "中,並依照目前的 dialect 進行格式化。" -#: ../../library/csv.rst:544 +#: ../../library/csv.rst:545 msgid "Writer objects have the following public attribute:" msgstr "寫入器物件有下列公開屬性:" -#: ../../library/csv.rst:549 +#: ../../library/csv.rst:550 msgid "A read-only description of the dialect in use by the writer." msgstr "dialect 的唯讀敘述,會被寫入器使用。" -#: ../../library/csv.rst:552 +#: ../../library/csv.rst:553 msgid "DictWriter objects have the following public method:" msgstr "DictWriter 物件有下列公開方法:" -#: ../../library/csv.rst:557 +#: ../../library/csv.rst:558 msgid "" "Write a row with the field names (as specified in the constructor) to the " "writer's file object, formatted according to the current dialect. Return the " @@ -870,23 +871,23 @@ msgstr "" "中,並依照目前的 dialect 進行格式化。回傳內部呼叫 :meth:`csvwriter.writerow` " "的回傳值。" -#: ../../library/csv.rst:562 +#: ../../library/csv.rst:563 msgid "" -":meth:`writeheader` now also returns the value returned by " -"the :meth:`csvwriter.writerow` method it uses internally." +":meth:`writeheader` now also returns the value returned by the :meth:" +"`csvwriter.writerow` method it uses internally." msgstr "" ":meth:`writeheader` 現在也會回傳內部呼叫 :meth:`csvwriter.writerow` 的回傳" "值。" -#: ../../library/csv.rst:570 +#: ../../library/csv.rst:571 msgid "Examples" msgstr "範例" -#: ../../library/csv.rst:572 +#: ../../library/csv.rst:573 msgid "The simplest example of reading a CSV file::" msgstr "最簡單的讀取 CSV 檔案範例: ::" -#: ../../library/csv.rst:574 +#: ../../library/csv.rst:575 msgid "" "import csv\n" "with open('some.csv', newline='') as f:\n" @@ -900,11 +901,11 @@ msgstr "" " for row in reader:\n" " print(row)" -#: ../../library/csv.rst:580 +#: ../../library/csv.rst:581 msgid "Reading a file with an alternate format::" msgstr "讀取一個其他格式的檔案: ::" -#: ../../library/csv.rst:582 +#: ../../library/csv.rst:583 msgid "" "import csv\n" "with open('passwd', newline='') as f:\n" @@ -918,11 +919,11 @@ msgstr "" " for row in reader:\n" " print(row)" -#: ../../library/csv.rst:588 +#: ../../library/csv.rst:589 msgid "The corresponding simplest possible writing example is::" msgstr "相對最簡單、可行的寫入範例為: ::" -#: ../../library/csv.rst:590 +#: ../../library/csv.rst:591 msgid "" "import csv\n" "with open('some.csv', 'w', newline='') as f:\n" @@ -930,18 +931,18 @@ msgid "" " writer.writerows(someiterable)" msgstr "" -#: ../../library/csv.rst:595 +#: ../../library/csv.rst:596 msgid "" "Since :func:`open` is used to open a CSV file for reading, the file will by " -"default be decoded into unicode using the system default encoding " -"(see :func:`locale.getencoding`). To decode a file using a different " -"encoding, use the ``encoding`` argument of open::" +"default be decoded into unicode using the system default encoding (see :func:" +"`locale.getencoding`). To decode a file using a different encoding, use the " +"``encoding`` argument of open::" msgstr "" "當 :func:`open` 被使用於開啟並讀取一個 CSV 檔案,該檔案會預設使用系統預設的編" "碼格式(請見 :func:`locale.getencoding`),並解碼為 unicode。若要使用不同編碼" "格式進行檔案解碼,請使用 open 函式的 ``encoding`` 引數: ::" -#: ../../library/csv.rst:600 +#: ../../library/csv.rst:601 msgid "" "import csv\n" "with open('some.csv', newline='', encoding='utf-8') as f:\n" @@ -955,7 +956,7 @@ msgstr "" " for row in reader:\n" " print(row)" -#: ../../library/csv.rst:606 +#: ../../library/csv.rst:607 msgid "" "The same applies to writing in something other than the system default " "encoding: specify the encoding argument when opening the output file." @@ -963,11 +964,11 @@ msgstr "" "同理可以應用到使用不同編碼格式進行寫入:當開啟輸出檔案時,指定 ``encoding`` " "引數。" -#: ../../library/csv.rst:609 +#: ../../library/csv.rst:610 msgid "Registering a new dialect::" msgstr "註冊一個新的 dialect : ::" -#: ../../library/csv.rst:611 +#: ../../library/csv.rst:612 msgid "" "import csv\n" "csv.register_dialect('unixpwd', delimiter=':', quoting=csv.QUOTE_NONE)\n" @@ -979,13 +980,13 @@ msgstr "" "with open('passwd', newline='') as f:\n" " reader = csv.reader(f, 'unixpwd')" -#: ../../library/csv.rst:616 +#: ../../library/csv.rst:617 msgid "" "A slightly more advanced use of the reader --- catching and reporting " "errors::" msgstr "稍微進階的讀取器用法 -- 擷取及回報錯誤: ::" -#: ../../library/csv.rst:618 +#: ../../library/csv.rst:619 msgid "" "import csv, sys\n" "filename = 'some.csv'\n" @@ -1007,13 +1008,13 @@ msgstr "" " except csv.Error as e:\n" " sys.exit(f'file {filename}, line {reader.line_num}: {e}')" -#: ../../library/csv.rst:628 +#: ../../library/csv.rst:629 msgid "" "And while the module doesn't directly support parsing strings, it can easily " "be done::" msgstr "而當模組無法直接支援剖析字串時,仍可以輕鬆的解決: ::" -#: ../../library/csv.rst:631 +#: ../../library/csv.rst:632 msgid "" "import csv\n" "for row in csv.reader(['one,two,three']):\n" @@ -1023,20 +1024,20 @@ msgstr "" "for row in csv.reader(['one,two,three']):\n" " print(row)" -#: ../../library/csv.rst:637 +#: ../../library/csv.rst:638 msgid "Footnotes" msgstr "註解" -#: ../../library/csv.rst:638 +#: ../../library/csv.rst:639 msgid "" "If ``newline=''`` is not specified, newlines embedded inside quoted fields " -"will not be interpreted correctly, and on platforms that use ``\\r\\n`` " -"linendings on write an extra ``\\r`` will be added. It should always be " -"safe to specify ``newline=''``, since the csv module does its own " -"(:term:`universal `) newline handling." +"will not be interpreted correctly, and on platforms that use ``\\r\\n`` line " +"endings on write an extra ``\\r`` will be added. It should always be safe " +"to specify ``newline=''``, since the csv module does its own (:term:" +"`universal `) newline handling." msgstr "" "如果 ``newline=''`` 沒有被指定,則嵌入引號中的換行符號不會被正確直譯,使用 " -"``\\r\\n`` 行尾 (linending) 的平台會寫入額外的 ``\\r``。自從 csv 模組有自己 " +"``\\r\\n`` 行尾 (line ending) 的平台會寫入額外的 ``\\r``。自從 csv 模組有自己 " "(:term:`統一的 `) 換行處理方式,因此指定 ``newline=''`` " "會永遠是安全的。" diff --git a/library/enum.po b/library/enum.po index fd17ead394..23d76be011 100644 --- a/library/enum.po +++ b/library/enum.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2024-12-21 13:50+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -125,8 +125,8 @@ msgid "" "The enum members have *names* and *values* (the name of :attr:`!Color.RED` " "is ``RED``, the value of :attr:`!Color.BLUE` is ``3``, etc.)" msgstr "" -"列舉成員有\\ *名稱*\\ 和\\ *值*\\ (:attr:`!Color.RED` 的名稱是 " -"``RED``,:attr:`!Color.BLUE` 的值是 ``3`` 諸如此類)" +"列舉成員有\\ *名稱*\\ 和\\ *值*\\ (:attr:`!Color.RED` 的名稱是 ``RED``,:" +"attr:`!Color.BLUE` 的值是 ``3`` 諸如此類)" #: ../../library/enum.rst:65 msgid "Module Contents" @@ -154,8 +154,8 @@ msgstr ":class:`IntEnum`" #: ../../library/enum.rst:77 msgid "" -"Base class for creating enumerated constants that are also subclasses " -"of :class:`int`. (`Notes`_)" +"Base class for creating enumerated constants that are also subclasses of :" +"class:`int`. (`Notes`_)" msgstr "" "用來建立列舉常數的基礎類別,同時也是 :class:`int` 的子類別。(`備註 " "`_)" @@ -166,8 +166,8 @@ msgstr ":class:`StrEnum`" #: ../../library/enum.rst:82 msgid "" -"Base class for creating enumerated constants that are also subclasses " -"of :class:`str`. (`Notes`_)" +"Base class for creating enumerated constants that are also subclasses of :" +"class:`str`. (`Notes`_)" msgstr "" "用來建立列舉常數的基礎類別,同時也是 :class:`str` 的子類別。(`備註 " "`_)" @@ -181,8 +181,8 @@ msgid "" "Base class for creating enumerated constants that can be combined using the " "bitwise operations without losing their :class:`Flag` membership." msgstr "" -"用來建立列舉常數的基礎類別,可以使用位元操作來結合成員且其結果不失" -"去 :class:`Flag` 的成員資格。" +"用來建立列舉常數的基礎類別,可以使用位元操作來結合成員且其結果不失去 :class:" +"`Flag` 的成員資格。" #: ../../library/enum.rst:90 msgid ":class:`IntFlag`" @@ -191,13 +191,12 @@ msgstr ":class:`IntFlag`" #: ../../library/enum.rst:92 msgid "" "Base class for creating enumerated constants that can be combined using the " -"bitwise operators without losing their :class:`IntFlag` " -"membership. :class:`IntFlag` members are also subclasses of :class:`int`. " -"(`Notes`_)" +"bitwise operators without losing their :class:`IntFlag` membership. :class:" +"`IntFlag` members are also subclasses of :class:`int`. (`Notes`_)" msgstr "" -"用來建立列舉常數的基礎類別,可以使用位元操作來結合成員且其結果不失" -"去 :class:`IntFlag` 的成員資格。:class:`IntFlag` 的成員也是 :class:`int` 的子" -"類別。(`備註 `_)" +"用來建立列舉常數的基礎類別,可以使用位元操作來結合成員且其結果不失去 :class:" +"`IntFlag` 的成員資格。:class:`IntFlag` 的成員也是 :class:`int` 的子類別。(`" +"備註 `_)" #: ../../library/enum.rst:96 msgid ":class:`ReprEnum`" @@ -221,8 +220,8 @@ msgid "" "``UNIQUE``, for use with :func:`verify` to ensure various constraints are " "met by a given enumeration." msgstr "" -"一個有 ``CONTINUOUS``、``NAMED_FLAGS`` 及 ``UNIQUE`` 這些值的列舉," -"和 :func:`verify` 一起使用來確保給定的列舉符合多種限制。" +"一個有 ``CONTINUOUS``、``NAMED_FLAGS`` 及 ``UNIQUE`` 這些值的列舉,和 :func:" +"`verify` 一起使用來確保給定的列舉符合多種限制。" #: ../../library/enum.rst:107 msgid ":class:`FlagBoundary`" @@ -251,9 +250,9 @@ msgstr ":class:`auto`" #: ../../library/enum.rst:119 msgid "" -"Instances are replaced with an appropriate value for Enum " -"members. :class:`StrEnum` defaults to the lower-cased version of the member " -"name, while other Enums default to 1 and increase from there." +"Instances are replaced with an appropriate value for Enum members. :class:" +"`StrEnum` defaults to the lower-cased version of the member name, while " +"other Enums default to 1 and increase from there." msgstr "" "列舉成員的實例會被取代成合適的值。:class:`StrEnum` 預設是小寫版本的成員名稱," "其它列舉則預設是 1 且往後遞增。" @@ -358,20 +357,26 @@ msgstr "" #: ../../library/enum.rst:173 msgid "" -"``EnumType`` is responsible for setting the correct :meth:`!" -"__repr__`, :meth:`!__str__`, :meth:`!__format__`, and :meth:`!__reduce__` " -"methods on the final *enum*, as well as creating the enum members, properly " -"handling duplicates, providing iteration over the enum class, etc." +"``EnumType`` is responsible for setting the correct :meth:`!__repr__`, :meth:" +"`!__str__`, :meth:`!__format__`, and :meth:`!__reduce__` methods on the " +"final *enum*, as well as creating the enum members, properly handling " +"duplicates, providing iteration over the enum class, etc." msgstr "" -"``EnumType`` 負責在最後的\\ *列舉*\\ 上面設定正確的 :meth:`!" -"__repr__`、:meth:`!__str__`、:meth:`!__format__` 及 :meth:`!__reduce__` 方" -"法,以及建立列舉成員、正確處理重複、提供列舉類別的疊代等等。" +"``EnumType`` 負責在最後的\\ *列舉*\\ 上面設定正確的 :meth:`!__repr__`、:meth:" +"`!__str__`、:meth:`!__format__` 及 :meth:`!__reduce__` 方法,以及建立列舉成" +"員、正確處理重複、提供列舉類別的疊代等等。" #: ../../library/enum.rst:180 +msgid "" +"Before 3.11 ``EnumType`` was called ``EnumMeta``, which is still available " +"as an alias." +msgstr "在 3.11 之前,``EnumType`` 稱作 ``EnumMeta``,其目前仍可作為別名使用。" + +#: ../../library/enum.rst:184 msgid "This method is called in two different ways:" msgstr "這個方法可以用兩種不同的方式呼叫:" -#: ../../library/enum.rst:182 +#: ../../library/enum.rst:186 msgid "to look up an existing member:" msgstr "查詢已存在的成員:" @@ -379,7 +384,7 @@ msgstr "查詢已存在的成員:" msgid "cls" msgstr "cls" -#: ../../library/enum.rst:184 ../../library/enum.rst:190 +#: ../../library/enum.rst:188 ../../library/enum.rst:194 msgid "The enum class being called." msgstr "所呼叫的列舉類別。" @@ -387,17 +392,17 @@ msgstr "所呼叫的列舉類別。" msgid "value" msgstr "value" -#: ../../library/enum.rst:185 +#: ../../library/enum.rst:189 msgid "The value to lookup." msgstr "要查詢的值。" -#: ../../library/enum.rst:187 +#: ../../library/enum.rst:191 msgid "" "to use the ``cls`` enum to create a new enum (only if the existing enum does " "not have any members):" msgstr "使用 ``cls`` 列舉來建立新列舉(只有在現有列舉沒有任何成員時)" -#: ../../library/enum.rst:191 +#: ../../library/enum.rst:195 msgid "The name of the new Enum to create." msgstr "要建立的新列舉的名稱。" @@ -405,7 +410,7 @@ msgstr "要建立的新列舉的名稱。" msgid "names" msgstr "names" -#: ../../library/enum.rst:192 +#: ../../library/enum.rst:196 msgid "The names/values of the members for the new Enum." msgstr "新列舉的成員的名稱/值。" @@ -413,7 +418,7 @@ msgstr "新列舉的成員的名稱/值。" msgid "module" msgstr "module" -#: ../../library/enum.rst:193 +#: ../../library/enum.rst:197 msgid "The name of the module the new Enum is created in." msgstr "新列舉要建立在哪個模組名稱下。" @@ -421,7 +426,7 @@ msgstr "新列舉要建立在哪個模組名稱下。" msgid "qualname" msgstr "qualname" -#: ../../library/enum.rst:194 +#: ../../library/enum.rst:198 msgid "The actual location in the module where this Enum can be found." msgstr "這個列舉在模組裡實際上的位置。" @@ -429,7 +434,7 @@ msgstr "這個列舉在模組裡實際上的位置。" msgid "type" msgstr "type" -#: ../../library/enum.rst:195 +#: ../../library/enum.rst:199 msgid "A mix-in type for the new Enum." msgstr "新列舉的混合型別。" @@ -437,7 +442,7 @@ msgstr "新列舉的混合型別。" msgid "start" msgstr "start" -#: ../../library/enum.rst:196 +#: ../../library/enum.rst:200 msgid "The first integer value for the Enum (used by :class:`auto`)." msgstr "列舉的第一個整數值(由 :class:`auto` 所使用)" @@ -445,16 +450,16 @@ msgstr "列舉的第一個整數值(由 :class:`auto` 所使用)" msgid "boundary" msgstr "boundary" -#: ../../library/enum.rst:197 +#: ../../library/enum.rst:201 msgid "" "How to handle out-of-range values from bit operations (:class:`Flag` only)." msgstr "在位元操作時怎麼處理範圍外的值(只有 :class:`Flag` 會用到)" -#: ../../library/enum.rst:201 +#: ../../library/enum.rst:205 msgid "Returns ``True`` if member belongs to the ``cls``::" msgstr "如果 member 屬於 ``cls`` 則回傳 ``True``: ::" -#: ../../library/enum.rst:203 +#: ../../library/enum.rst:207 msgid "" ">>> some_var = Color.RED\n" ">>> some_var in Color\n" @@ -468,7 +473,7 @@ msgstr "" ">>> Color.RED.value in Color\n" "True" -#: ../../library/enum.rst:211 +#: ../../library/enum.rst:215 msgid "" "Before Python 3.12, a ``TypeError`` is raised if a non-Enum-member is used " "in a containment check." @@ -476,7 +481,7 @@ msgstr "" "在 Python 3.12 之前,如果用非列舉成員做屬於檢查 (containment check) 會引發 " "``TypeError``。" -#: ../../library/enum.rst:216 +#: ../../library/enum.rst:220 msgid "" "Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the " "names of the members in *cls*::" @@ -484,7 +489,7 @@ msgstr "" "回傳 ``['__class__', '__doc__', '__members__', '__module__']`` 及 *cls* 的成" "員名稱: ::" -#: ../../library/enum.rst:219 +#: ../../library/enum.rst:223 msgid "" ">>> dir(Color)\n" "['BLUE', 'GREEN', 'RED', '__class__', '__contains__', '__doc__', " @@ -496,13 +501,13 @@ msgstr "" "'__getitem__', '__init_subclass__', '__iter__', '__len__', '__members__', " "'__module__', '__name__', '__qualname__']" -#: ../../library/enum.rst:224 +#: ../../library/enum.rst:228 msgid "" -"Returns the Enum member in *cls* matching *name*, or raises " -"a :exc:`KeyError`::" +"Returns the Enum member in *cls* matching *name*, or raises a :exc:" +"`KeyError`::" msgstr "回傳 *cls* 中符合 *name* 的列舉成員,或引發 :exc:`KeyError`: ::" -#: ../../library/enum.rst:226 +#: ../../library/enum.rst:230 msgid "" ">>> Color['BLUE']\n" "" @@ -510,11 +515,11 @@ msgstr "" ">>> Color['BLUE']\n" "" -#: ../../library/enum.rst:231 +#: ../../library/enum.rst:235 msgid "Returns each member in *cls* in definition order::" msgstr "以定義的順序回傳在 *cls* 中的每個成員: ::" -#: ../../library/enum.rst:233 +#: ../../library/enum.rst:237 msgid "" ">>> list(Color)\n" "[, , ]" @@ -522,11 +527,11 @@ msgstr "" ">>> list(Color)\n" "[, , ]" -#: ../../library/enum.rst:238 +#: ../../library/enum.rst:242 msgid "Returns the number of member in *cls*::" msgstr "回傳 *cls* 的成員數量: ::" -#: ../../library/enum.rst:240 +#: ../../library/enum.rst:244 msgid "" ">>> len(Color)\n" "3" @@ -534,15 +539,15 @@ msgstr "" ">>> len(Color)\n" "3" -#: ../../library/enum.rst:245 +#: ../../library/enum.rst:249 msgid "Returns a mapping of every enum name to its member, including aliases" msgstr "回傳每個列舉名稱到其成員的對映,包括別名" -#: ../../library/enum.rst:249 +#: ../../library/enum.rst:253 msgid "Returns each member in *cls* in reverse definition order::" msgstr "以跟定義相反的順序回傳 *cls* 的每個成員: ::" -#: ../../library/enum.rst:251 +#: ../../library/enum.rst:255 msgid "" ">>> list(reversed(Color))\n" "[, , ]" @@ -550,35 +555,15 @@ msgstr "" ">>> list(reversed(Color))\n" "[, , ]" -#: ../../library/enum.rst:256 -msgid "" -"Adds a new name as an alias to an existing member. Raises " -"a :exc:`NameError` if the name is already assigned to a different member." -msgstr "" -"為已存在的成員新增一個名稱作為別名。如果該名稱已經被指派給不同的成員,則會引發 :exc:`NameError`。" - #: ../../library/enum.rst:261 -msgid "" -"Adds a new value as an alias to an existing member. Raises " -"a :exc:`ValueError` if the value is already linked with a different member." -msgstr "" -"為已存在的成員新增一個值作為別名。如果該值已經被連結到不同的成員,則會引發 :exc:`ValueError`。" - -#: ../../library/enum.rst:266 -msgid "" -"Before 3.11 ``EnumType`` was called ``EnumMeta``, which is still available " -"as an alias." -msgstr "在 3.11 之前,``EnumType`` 稱作 ``EnumMeta``,其目前仍可作為別名使用。" - -#: ../../library/enum.rst:271 msgid "*Enum* is the base class for all *enum* enumerations." msgstr "*Enum* 是所有 *enum* 列舉的基礎類別。" -#: ../../library/enum.rst:275 +#: ../../library/enum.rst:265 msgid "The name used to define the ``Enum`` member::" msgstr "用來定義 ``Enum`` 成員的名稱: ::" -#: ../../library/enum.rst:277 +#: ../../library/enum.rst:267 msgid "" ">>> Color.BLUE.name\n" "'BLUE'" @@ -586,11 +571,11 @@ msgstr "" ">>> Color.BLUE.name\n" "'BLUE'" -#: ../../library/enum.rst:282 +#: ../../library/enum.rst:272 msgid "The value given to the ``Enum`` member::" msgstr "``Enum`` 成員給定的值: ::" -#: ../../library/enum.rst:284 +#: ../../library/enum.rst:274 msgid "" ">>> Color.RED.value\n" "1" @@ -598,61 +583,61 @@ msgstr "" ">>> Color.RED.value\n" "1" -#: ../../library/enum.rst:287 ../../library/enum.rst:307 +#: ../../library/enum.rst:277 ../../library/enum.rst:297 msgid "Value of the member, can be set in :meth:`~Enum.__new__`." msgstr "成員的值,可以在 :meth:`~Enum.__new__` 設定。" -#: ../../library/enum.rst:289 +#: ../../library/enum.rst:279 msgid "Enum member values" msgstr "列舉成員的值" -#: ../../library/enum.rst:291 +#: ../../library/enum.rst:281 msgid "" "Member values can be anything: :class:`int`, :class:`str`, etc. If the " "exact value is unimportant you may use :class:`auto` instances and an " "appropriate value will be chosen for you. See :class:`auto` for the details." msgstr "" "成員的值可以是任何值::class:`int`、:class:`str` 等等。如果實際使用什麼值並不" -"重要,你可以使用 :class:`auto` 實例,它會為你選擇合適的值。更多細節請參" -"考 :class:`auto`。" +"重要,你可以使用 :class:`auto` 實例,它會為你選擇合適的值。更多細節請參考 :" +"class:`auto`。" -#: ../../library/enum.rst:296 +#: ../../library/enum.rst:286 msgid "" "While mutable/unhashable values, such as :class:`dict`, :class:`list` or a " "mutable :class:`~dataclasses.dataclass`, can be used, they will have a " "quadratic performance impact during creation relative to the total number of " "mutable/unhashable values in the enum." msgstr "" -"雖然可以使用可變的 (mutable) / 不可雜湊的 (unhashable) 值,例" -"如 :class:`dict`、:class:`list` 或可變的 :class:`~dataclasses.dataclass`,它" -"們在建立期間會對效能產生相對於列舉中可變的 / 不可雜湊的值總數量的二次方影響。" +"雖然可以使用可變的 (mutable) / 不可雜湊的 (unhashable) 值,例如 :class:" +"`dict`、:class:`list` 或可變的 :class:`~dataclasses.dataclass`,它們在建立期" +"間會對效能產生相對於列舉中可變的 / 不可雜湊的值總數量的二次方影響。" -#: ../../library/enum.rst:303 +#: ../../library/enum.rst:293 msgid "Name of the member." msgstr "成員名稱。" -#: ../../library/enum.rst:311 +#: ../../library/enum.rst:301 msgid "" "No longer used, kept for backward compatibility. (class attribute, removed " "during class creation)." msgstr "已不再使用,只為了向後相容而保留(類別屬性,在類別建立時移除)" -#: ../../library/enum.rst:316 +#: ../../library/enum.rst:306 msgid "" "``_ignore_`` is only used during creation and is removed from the " "enumeration once creation is complete." msgstr "``_ignore_`` 只有在建立的時候用到,在列舉建立完成後會被移除。" -#: ../../library/enum.rst:319 +#: ../../library/enum.rst:309 msgid "" "``_ignore_`` is a list of names that will not become members, and whose " -"names will also be removed from the completed enumeration. " -"See :ref:`TimePeriod ` for an example." +"names will also be removed from the completed enumeration. See :ref:" +"`TimePeriod ` for an example." msgstr "" "``_ignore_`` 是一個不會變成成員的名稱串列,在列舉建立完成後其名稱會被移除。範" "例請參考 :ref:`TimePeriod `。" -#: ../../library/enum.rst:325 +#: ../../library/enum.rst:315 msgid "" "Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " "public methods defined on *self.__class__*::" @@ -660,7 +645,7 @@ msgstr "" "回傳 ``['__class__', '__doc__', '__module__', 'name', 'value']`` 及任何 " "*self.__class__* 上定義的公開方法: ::" -#: ../../library/enum.rst:328 +#: ../../library/enum.rst:318 msgid "" ">>> from datetime import date\n" ">>> class Weekday(Enum):\n" @@ -700,11 +685,11 @@ msgstr "" msgid "name" msgstr "name" -#: ../../library/enum.rst:346 +#: ../../library/enum.rst:336 msgid "The name of the member being defined (e.g. 'RED')." msgstr "定義的成員名稱(例如 'RED')。" -#: ../../library/enum.rst:347 +#: ../../library/enum.rst:337 msgid "The start value for the Enum; the default is 1." msgstr "列舉的開始值,預設為 1。" @@ -712,7 +697,7 @@ msgstr "列舉的開始值,預設為 1。" msgid "count" msgstr "count" -#: ../../library/enum.rst:348 +#: ../../library/enum.rst:338 msgid "The number of members currently defined, not including this one." msgstr "已定義的成員數量,不包含目前這一個。" @@ -720,17 +705,17 @@ msgstr "已定義的成員數量,不包含目前這一個。" msgid "last_values" msgstr "last_values" -#: ../../library/enum.rst:349 +#: ../../library/enum.rst:339 msgid "A list of the previous values." msgstr "一個之前值的串列。" -#: ../../library/enum.rst:351 +#: ../../library/enum.rst:341 msgid "" -"A *staticmethod* that is used to determine the next value returned " -"by :class:`auto`::" +"A *staticmethod* that is used to determine the next value returned by :class:" +"`auto`::" msgstr "一個 *staticmethod*,用來決定 :class:`auto` 下一個要回傳的值的: ::" -#: ../../library/enum.rst:354 +#: ../../library/enum.rst:344 msgid "" ">>> from enum import auto\n" ">>> class PowersOfThree(Enum):\n" @@ -754,7 +739,7 @@ msgstr "" ">>> PowersOfThree.SECOND.value\n" "9" -#: ../../library/enum.rst:367 +#: ../../library/enum.rst:357 msgid "" "By default, does nothing. If multiple values are given in the member " "assignment, those values become separate arguments to ``__init__``; e.g." @@ -762,19 +747,19 @@ msgstr "" "預設情況下,不執行任何操作。如果在成員賦值中給出多個值,這些值將成為與 " "``__init__`` 分別的引數;例如" -#: ../../library/enum.rst:374 +#: ../../library/enum.rst:364 msgid "" "``Weekday.__init__()`` would be called as ``Weekday.__init__(self, 1, " "'Mon')``" msgstr "``Weekday.__init__()`` 將被稱為 ``Weekday.__init__(self, 1, 'Mon')``" -#: ../../library/enum.rst:378 +#: ../../library/enum.rst:368 msgid "" "A *classmethod* that is used to further configure subsequent subclasses. By " "default, does nothing." msgstr "一個 *classmethod*,用來進一步設定後續的子類別,預設不做任何事。" -#: ../../library/enum.rst:383 +#: ../../library/enum.rst:373 msgid "" "A *classmethod* for looking up values not found in *cls*. By default it " "does nothing, but can be overridden to implement custom search behavior::" @@ -782,7 +767,7 @@ msgstr "" "一個 *classmethod*,用來查詢在 *cls* 裡找不到的值。預設不做任何事,但可以被覆" "寫以實作客製化的搜尋行為: ::" -#: ../../library/enum.rst:386 +#: ../../library/enum.rst:376 msgid "" ">>> from enum import StrEnum\n" ">>> class Build(StrEnum):\n" @@ -818,7 +803,7 @@ msgstr "" ">>> Build('deBUG')\n" "" -#: ../../library/enum.rst:405 +#: ../../library/enum.rst:395 msgid "" "By default, doesn't exist. If specified, either in the enum class " "definition or in a mixin class (such as ``int``), all values given in the " @@ -827,12 +812,12 @@ msgstr "" "預設情況下不存在。如果有指定,無論是在列舉類別定義中還是在 mixin 類別中(例" "如 ``int``\\ ),都將傳遞成員賦值中給出的所有值;例如" -#: ../../library/enum.rst:413 +#: ../../library/enum.rst:403 msgid "" "results in the call ``int('1a', 16)`` and a value of ``26`` for the member." msgstr "會產生呼叫 ``int('1a', 16)`` 而該成員的值為 ``26``。" -#: ../../library/enum.rst:417 +#: ../../library/enum.rst:407 msgid "" "When writing a custom ``__new__``, do not use ``super().__new__`` -- call " "the appropriate ``__new__`` instead." @@ -840,7 +825,7 @@ msgstr "" "當寫自訂的 ``__new__`` 時,不要使用 ``super().__new__``,而是要呼叫適當的 " "``__new__``。" -#: ../../library/enum.rst:422 +#: ../../library/enum.rst:412 msgid "" "Returns the string used for *repr()* calls. By default, returns the *Enum* " "name, member name, and value, but can be overridden::" @@ -848,7 +833,7 @@ msgstr "" "回傳呼叫 *repr()* 時使用的字串。預設回傳 *Enum* 名稱、成員名稱及值,但可以被" "覆寫: ::" -#: ../../library/enum.rst:425 +#: ../../library/enum.rst:415 msgid "" ">>> class OtherStyle(Enum):\n" "... ALTERNATE = auto()\n" @@ -858,8 +843,8 @@ msgid "" "... cls_name = self.__class__.__name__\n" "... return f'{cls_name}.{self.name}'\n" "...\n" -">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), " -"f\"{OtherStyle.ALTERNATE}\"\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." +"ALTERNATE}\"\n" "(OtherStyle.ALTERNATE, 'OtherStyle.ALTERNATE', 'OtherStyle.ALTERNATE')" msgstr "" ">>> class OtherStyle(Enum):\n" @@ -870,11 +855,11 @@ msgstr "" "... cls_name = self.__class__.__name__\n" "... return f'{cls_name}.{self.name}'\n" "...\n" -">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), " -"f\"{OtherStyle.ALTERNATE}\"\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." +"ALTERNATE}\"\n" "(OtherStyle.ALTERNATE, 'OtherStyle.ALTERNATE', 'OtherStyle.ALTERNATE')" -#: ../../library/enum.rst:438 +#: ../../library/enum.rst:428 msgid "" "Returns the string used for *str()* calls. By default, returns the *Enum* " "name and member name, but can be overridden::" @@ -882,7 +867,7 @@ msgstr "" "回傳呼叫 *str()* 時使用的字串。預設回傳 *Enum* 名稱及成員名稱,但可以被覆" "寫: ::" -#: ../../library/enum.rst:441 +#: ../../library/enum.rst:431 msgid "" ">>> class OtherStyle(Enum):\n" "... ALTERNATE = auto()\n" @@ -891,8 +876,8 @@ msgid "" "... def __str__(self):\n" "... return f'{self.name}'\n" "...\n" -">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), " -"f\"{OtherStyle.ALTERNATE}\"\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." +"ALTERNATE}\"\n" "(, 'ALTERNATE', 'ALTERNATE')" msgstr "" ">>> class OtherStyle(Enum):\n" @@ -902,11 +887,11 @@ msgstr "" "... def __str__(self):\n" "... return f'{self.name}'\n" "...\n" -">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), " -"f\"{OtherStyle.ALTERNATE}\"\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." +"ALTERNATE}\"\n" "(, 'ALTERNATE', 'ALTERNATE')" -#: ../../library/enum.rst:453 +#: ../../library/enum.rst:443 msgid "" "Returns the string used for *format()* and *f-string* calls. By default, " "returns :meth:`__str__` return value, but can be overridden::" @@ -914,7 +899,7 @@ msgstr "" "回傳呼叫 *format()* 及 *f-string* 時使用的字串。預設回傳 :meth:`__str__` 的回" "傳值,但可以被覆寫: ::" -#: ../../library/enum.rst:456 +#: ../../library/enum.rst:446 msgid "" ">>> class OtherStyle(Enum):\n" "... ALTERNATE = auto()\n" @@ -923,8 +908,8 @@ msgid "" "... def __format__(self, spec):\n" "... return f'{self.name}'\n" "...\n" -">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), " -"f\"{OtherStyle.ALTERNATE}\"\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." +"ALTERNATE}\"\n" "(, 'OtherStyle.ALTERNATE', 'ALTERNATE')" msgstr "" ">>> class OtherStyle(Enum):\n" @@ -934,21 +919,61 @@ msgstr "" "... def __format__(self, spec):\n" "... return f'{self.name}'\n" "...\n" -">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), " -"f\"{OtherStyle.ALTERNATE}\"\n" +">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." +"ALTERNATE}\"\n" "(, 'OtherStyle.ALTERNATE', 'ALTERNATE')" -#: ../../library/enum.rst:468 +#: ../../library/enum.rst:458 msgid "" "Using :class:`auto` with :class:`Enum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`Enum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:471 +#: ../../library/enum.rst:461 msgid "Added :ref:`enum-dataclass-support`" msgstr "新增 :ref:`enum-dataclass-support`" -#: ../../library/enum.rst:476 +#: ../../library/enum.rst:465 +msgid "Adds a new name as an alias to an existing member::" +msgstr "新增一個名稱作為現有成員的別名: ::" + +#: ../../library/enum.rst:467 +msgid "" +">>> Color.RED._add_alias_(\"ERROR\")\n" +">>> Color.ERROR\n" +"" +msgstr "" +">>> Color.RED._add_alias_(\"ERROR\")\n" +">>> Color.ERROR\n" +"" + +#: ../../library/enum.rst:471 +msgid "" +"Raises a :exc:`NameError` if the name is already assigned to a different " +"member." +msgstr "如果該名稱已經被指派給不同的成員,則會引發 :exc:`NameError`。" + +#: ../../library/enum.rst:477 +msgid "Adds a new value as an alias to an existing member::" +msgstr "新增一個值作為現有成員的別名: ::" + +#: ../../library/enum.rst:479 +msgid "" +">>> Color.RED._add_value_alias_(42)\n" +">>> Color(42)\n" +"" +msgstr "" +">>> Color.RED._add_value_alias_(42)\n" +">>> Color(42)\n" +"" + +#: ../../library/enum.rst:483 +msgid "" +"Raises a :exc:`ValueError` if the value is already linked with a different " +"member." +msgstr "如果該值已經被連結到不同的成員,則會引發 :exc:`ValueError`。" + +#: ../../library/enum.rst:490 msgid "" "*IntEnum* is the same as :class:`Enum`, but its members are also integers " "and can be used anywhere that an integer can be used. If any integer " @@ -958,23 +983,23 @@ msgstr "" "*IntEnum* 和 :class:`Enum` 一樣,但其成員同時也是整數而可以被用在任何使用整數" "的地方。如果 *IntEnum* 成員經過任何整數運算,結果值會失去其列舉狀態。" -#: ../../library/enum.rst:497 +#: ../../library/enum.rst:511 msgid "" "Using :class:`auto` with :class:`IntEnum` results in integers of increasing " "value, starting with ``1``." msgstr ":class:`IntEnum` 使用 :class:`auto` 會產生從 ``1`` 開始遞增的整數。" -#: ../../library/enum.rst:500 +#: ../../library/enum.rst:514 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` was " "already :meth:`!int.__format__` for that same reason." msgstr "" "為了更好地支援\\ *現存常數取代 (replacement of existing constants)* 的使用情" -"境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理" -"由,:meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" +"境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" +"meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:507 +#: ../../library/enum.rst:521 msgid "" "*StrEnum* is the same as :class:`Enum`, but its members are also strings and " "can be used in most of the same places that a string can be used. The result " @@ -984,7 +1009,7 @@ msgstr "" "*StrEnum* 和 :class:`Enum` 一樣,但其成員同時也是字串而可以被用在幾乎所有使用" "字串的地方。*StrEnum* 成員經過任何字串操作的結果會不再是列舉的一部份。" -#: ../../library/enum.rst:528 +#: ../../library/enum.rst:542 msgid "" "There are places in the stdlib that check for an exact :class:`str` instead " "of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " @@ -995,23 +1020,23 @@ msgstr "" "是 ``type(unknown) == str`` 而不是 ``isinstance(unknown, str)``),在這些地方" "你需要使用 ``str(MyStrEnum.MY_MEMBER)``。" -#: ../../library/enum.rst:535 +#: ../../library/enum.rst:549 msgid "" "Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " "name as the value." msgstr ":class:`StrEnum` 使用 :class:`auto` 會產生小寫的成員名稱當作值。" -#: ../../library/enum.rst:540 +#: ../../library/enum.rst:554 msgid "" ":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` is " "likewise :meth:`!str.__format__` for that same reason." msgstr "" "為了更好地支援\\ *現存常數取代 (replacement of existing constants)* 的使用情" -"境,:meth:`~object.__str__` 現在會是 :meth:`!str.__str__`。為了同樣的理" -"由,:meth:`~object.__format__` 也會是 :meth:`!str.__format__`。" +"境,:meth:`~object.__str__` 現在會是 :meth:`!str.__str__`。為了同樣的理由,:" +"meth:`~object.__format__` 也會是 :meth:`!str.__format__`。" -#: ../../library/enum.rst:548 +#: ../../library/enum.rst:562 msgid "" "``Flag`` is the same as :class:`Enum`, but its members support the bitwise " "operators ``&`` (*AND*), ``|`` (*OR*), ``^`` (*XOR*), and ``~`` (*INVERT*); " @@ -1021,11 +1046,11 @@ msgstr "" "(*OR*)、``^`` (*XOR*) 和 ``~`` (*INVERT*);這些操作的結果是列舉的成員(的別" "名)。" -#: ../../library/enum.rst:554 +#: ../../library/enum.rst:568 msgid "Returns *True* if value is in self::" msgstr "如果 value 在 self 裡則回傳 *True*: ::" -#: ../../library/enum.rst:556 +#: ../../library/enum.rst:570 msgid "" ">>> from enum import Flag, auto\n" ">>> class Color(Flag):\n" @@ -1061,11 +1086,11 @@ msgstr "" ">>> white in purple\n" "False" -#: ../../library/enum.rst:575 +#: ../../library/enum.rst:589 msgid "Returns all contained non-alias members::" msgstr "回傳所有包含的非別名成員: ::" -#: ../../library/enum.rst:577 +#: ../../library/enum.rst:591 msgid "" ">>> list(Color.RED)\n" "[]\n" @@ -1077,11 +1102,11 @@ msgstr "" ">>> list(purple)\n" "[, ]" -#: ../../library/enum.rst:586 +#: ../../library/enum.rst:600 msgid "Returns number of members in flag::" msgstr "回傳旗標裡的成員數量: ::" -#: ../../library/enum.rst:588 +#: ../../library/enum.rst:602 msgid "" ">>> len(Color.GREEN)\n" "1\n" @@ -1093,11 +1118,11 @@ msgstr "" ">>> len(white)\n" "3" -#: ../../library/enum.rst:597 +#: ../../library/enum.rst:611 msgid "Returns *True* if any members in flag, *False* otherwise::" msgstr "如果成員在旗標裡則回傳 *True*,否則回傳 *False*: ::" -#: ../../library/enum.rst:599 +#: ../../library/enum.rst:613 msgid "" ">>> bool(Color.GREEN)\n" "True\n" @@ -1115,11 +1140,11 @@ msgstr "" ">>> bool(black)\n" "False" -#: ../../library/enum.rst:609 +#: ../../library/enum.rst:623 msgid "Returns current flag binary or'ed with other::" msgstr "回傳和 other 做 OR 過後的二進位旗標: ::" -#: ../../library/enum.rst:611 +#: ../../library/enum.rst:625 msgid "" ">>> Color.RED | Color.GREEN\n" "" @@ -1127,11 +1152,11 @@ msgstr "" ">>> Color.RED | Color.GREEN\n" "" -#: ../../library/enum.rst:616 +#: ../../library/enum.rst:630 msgid "Returns current flag binary and'ed with other::" msgstr "回傳和 other 做 AND 過後的二進位旗標: ::" -#: ../../library/enum.rst:618 +#: ../../library/enum.rst:632 msgid "" ">>> purple & white\n" "\n" @@ -1143,11 +1168,11 @@ msgstr "" ">>> purple & Color.GREEN\n" "" -#: ../../library/enum.rst:625 +#: ../../library/enum.rst:639 msgid "Returns current flag binary xor'ed with other::" msgstr "回傳和 other 做 XOR 過後的二進位旗標: ::" -#: ../../library/enum.rst:627 +#: ../../library/enum.rst:641 msgid "" ">>> purple ^ white\n" "\n" @@ -1159,11 +1184,11 @@ msgstr "" ">>> purple ^ Color.GREEN\n" "" -#: ../../library/enum.rst:634 +#: ../../library/enum.rst:648 msgid "Returns all the flags in *type(self)* that are not in *self*::" msgstr "回傳所有在 *type(self)* 但不在 *self* 裡的旗標: ::" -#: ../../library/enum.rst:636 +#: ../../library/enum.rst:650 msgid "" ">>> ~white\n" "\n" @@ -1179,7 +1204,7 @@ msgstr "" ">>> ~Color.RED\n" "" -#: ../../library/enum.rst:645 +#: ../../library/enum.rst:659 msgid "" "Function used to format any remaining unnamed numeric values. Default is " "the value's repr; common choices are :func:`hex` and :func:`oct`." @@ -1187,17 +1212,17 @@ msgstr "" "用來格式化任何剩下未命名數值的函式。預設是值的 repr,常見選擇是 :func:`hex` " "和 :func:`oct`。" -#: ../../library/enum.rst:650 +#: ../../library/enum.rst:664 msgid "" "Using :class:`auto` with :class:`Flag` results in integers that are powers " "of two, starting with ``1``." msgstr ":class:`Flag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:653 +#: ../../library/enum.rst:667 msgid "The *repr()* of zero-valued flags has changed. It is now:" msgstr "值為 0 的旗標的 *repr()* 已改變。現在是:" -#: ../../library/enum.rst:661 +#: ../../library/enum.rst:675 msgid "" "``IntFlag`` is the same as :class:`Flag`, but its members are also integers " "and can be used anywhere that an integer can be used." @@ -1205,13 +1230,13 @@ msgstr "" "``IntFlag`` 和 :class:`Flag` 一樣,但其成員同時也是整數而可以被用在任何使用整" "數的地方。" -#: ../../library/enum.rst:675 +#: ../../library/enum.rst:689 msgid "" "If any integer operation is performed with an *IntFlag* member, the result " "is not an *IntFlag*::" msgstr "如果 *IntFlag* 成員經過任何整數運算,其結果不是 *IntFlag*: ::" -#: ../../library/enum.rst:678 +#: ../../library/enum.rst:692 msgid "" ">>> Color.RED + 2\n" "3" @@ -1219,25 +1244,25 @@ msgstr "" ">>> Color.RED + 2\n" "3" -#: ../../library/enum.rst:681 +#: ../../library/enum.rst:695 msgid "If a :class:`Flag` operation is performed with an *IntFlag* member and:" msgstr "如果 *IntFlag* 成員經過 :class:`Flag` 操作且:" -#: ../../library/enum.rst:683 +#: ../../library/enum.rst:697 msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" msgstr "結果是合法的 *IntFlag*:回傳 *IntFlag*" -#: ../../library/enum.rst:684 +#: ../../library/enum.rst:698 msgid "" -"the result is not a valid *IntFlag*: the result depends on " -"the :class:`FlagBoundary` setting" +"the result is not a valid *IntFlag*: the result depends on the :class:" +"`FlagBoundary` setting" msgstr "結果不是合法的 *IntFlag*:結果會根據 :class:`FlagBoundary` 的設定" -#: ../../library/enum.rst:686 +#: ../../library/enum.rst:700 msgid "The :func:`repr` of unnamed zero-valued flags has changed. It is now::" msgstr "未命名且值為 0 的旗標的 :func:`repr` 已改變。現在是: ::" -#: ../../library/enum.rst:688 +#: ../../library/enum.rst:702 msgid "" ">>> Color(0)\n" "" @@ -1245,24 +1270,24 @@ msgstr "" ">>> Color(0)\n" "" -#: ../../library/enum.rst:693 +#: ../../library/enum.rst:707 msgid "" "Using :class:`auto` with :class:`IntFlag` results in integers that are " "powers of two, starting with ``1``." msgstr "" ":class:`IntFlag` 使用 :class:`auto` 會產生從 ``1`` 開始 2 的次方的整數。" -#: ../../library/enum.rst:698 +#: ../../library/enum.rst:712 msgid "" ":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " "*replacement of existing constants* use-case. :meth:`~object.__format__` " "was already :meth:`!int.__format__` for that same reason." msgstr "" "為了更好地支援\\ *現存常數取代 (replacement of existing constants)* 的使用情" -"境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理" -"由,:meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" +"境,:meth:`~object.__str__` 現在會是 :meth:`!int.__str__`。為了同樣的理由,:" +"meth:`~object.__format__` 已經是 :meth:`!int.__format__`。" -#: ../../library/enum.rst:702 +#: ../../library/enum.rst:716 msgid "" "Inversion of an :class:`!IntFlag` now returns a positive value that is the " "union of all flags not in the given flag, rather than a negative value. This " @@ -1271,7 +1296,7 @@ msgstr "" ":class:`!IntFlag` 的反轉 (inversion) 現在會回傳正值,該值是不在給定旗標的所有" "旗標聯集,而不是一個負值。這符合現有 :class:`Flag` 的行為。" -#: ../../library/enum.rst:708 +#: ../../library/enum.rst:722 msgid "" ":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " "but the :class:`str() ` of the mixed-in data type:" @@ -1279,25 +1304,24 @@ msgstr "" ":class:`!ReprEnum` 使用 :class:`Enum` 的 :meth:`repr() `,但使" "用混合資料型別的 :class:`str() `:" -#: ../../library/enum.rst:711 +#: ../../library/enum.rst:725 msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" msgstr "對 :class:`IntEnum` 和 :class:`IntFlag` 是 :meth:`!int.__str__`" -#: ../../library/enum.rst:712 +#: ../../library/enum.rst:726 msgid ":meth:`!str.__str__` for :class:`StrEnum`" msgstr "對 :class:`StrEnum` 是 :meth:`!str.__str__`" -#: ../../library/enum.rst:714 +#: ../../library/enum.rst:728 msgid "" -"Inherit from :class:`!ReprEnum` to keep the :class:`str() " -"` / :func:`format` of the mixed-in data type instead of using " -"the :class:`Enum`-default :meth:`str() `." +"Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" +"`format` of the mixed-in data type instead of using the :class:`Enum`-" +"default :meth:`str() `." msgstr "" -"繼承 :class:`!ReprEnum` 來保留混合資料型別的 :class:`str() " -"` / :func:`format`,而不是使用 :class:`Enum` 預設的 :meth:`str() " -"`。" +"繼承 :class:`!ReprEnum` 來保留混合資料型別的 :class:`str() ` / :func:" +"`format`,而不是使用 :class:`Enum` 預設的 :meth:`str() `。" -#: ../../library/enum.rst:723 +#: ../../library/enum.rst:737 msgid "" "*EnumCheck* contains the options used by the :func:`verify` decorator to " "ensure various constraints; failed constraints result in a :exc:`ValueError`." @@ -1305,11 +1329,11 @@ msgstr "" "*EnumCheck* 包含 :func:`verify` 裝飾器使用的選項,以確保多樣的限制,不符合限" "制會產生 :exc:`ValueError`。" -#: ../../library/enum.rst:728 +#: ../../library/enum.rst:742 msgid "Ensure that each value has only one name::" msgstr "確保每個值只有一個名稱: ::" -#: ../../library/enum.rst:730 +#: ../../library/enum.rst:744 msgid "" ">>> from enum import Enum, verify, UNIQUE\n" ">>> @verify(UNIQUE)\n" @@ -1333,13 +1357,13 @@ msgstr "" "...\n" "ValueError: aliases found in : CRIMSON -> RED" -#: ../../library/enum.rst:744 +#: ../../library/enum.rst:758 msgid "" "Ensure that there are no missing values between the lowest-valued member and " "the highest-valued member::" msgstr "確保在最小值成員跟最大值成員間沒有缺少值: ::" -#: ../../library/enum.rst:747 +#: ../../library/enum.rst:761 msgid "" ">>> from enum import Enum, verify, CONTINUOUS\n" ">>> @verify(CONTINUOUS)\n" @@ -1361,7 +1385,7 @@ msgstr "" "...\n" "ValueError: invalid enum 'Color': missing values 3, 4" -#: ../../library/enum.rst:759 +#: ../../library/enum.rst:773 msgid "" "Ensure that any flag groups/masks contain only named flags -- useful when " "values are specified instead of being generated by :func:`auto`::" @@ -1369,7 +1393,7 @@ msgstr "" "確保任何旗標群組 / 遮罩只包含命名旗標 -- 當值是用指定而不是透過 :func:`auto` " "產生時是很實用的: ::" -#: ../../library/enum.rst:762 +#: ../../library/enum.rst:776 msgid "" ">>> from enum import Flag, verify, NAMED_FLAGS\n" ">>> @verify(NAMED_FLAGS)\n" @@ -1397,24 +1421,24 @@ msgstr "" "ValueError: invalid Flag 'Color': aliases WHITE and NEON are missing " "combined values of 0x18 [use enum.show_flag_values(value) for details]" -#: ../../library/enum.rst:776 +#: ../../library/enum.rst:790 msgid "" "CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." msgstr "CONTINUOUS 和 NAMED_FLAGS 是設計用來運作在整數值的成員上。" -#: ../../library/enum.rst:782 +#: ../../library/enum.rst:796 msgid "" -"``FlagBoundary`` controls how out-of-range values are handled " -"in :class:`Flag` and its subclasses." +"``FlagBoundary`` controls how out-of-range values are handled in :class:" +"`Flag` and its subclasses." msgstr "``FlagBoundary`` 控制在 :class:`Flag` 及其子類別中如何處理範圍外的值。" -#: ../../library/enum.rst:787 +#: ../../library/enum.rst:801 msgid "" "Out-of-range values cause a :exc:`ValueError` to be raised. This is the " "default for :class:`Flag`::" msgstr "範圍外的值會引發 :exc:`ValueError`。這是 :class:`Flag` 的預設行為: ::" -#: ../../library/enum.rst:790 +#: ../../library/enum.rst:804 msgid "" ">>> from enum import Flag, STRICT, auto\n" ">>> class StrictFlag(Flag, boundary=STRICT):\n" @@ -1442,13 +1466,13 @@ msgstr "" " given 0b0 10100\n" " allowed 0b0 00111" -#: ../../library/enum.rst:805 +#: ../../library/enum.rst:819 msgid "" -"Out-of-range values have invalid values removed, leaving a " -"valid :class:`Flag` value::" +"Out-of-range values have invalid values removed, leaving a valid :class:" +"`Flag` value::" msgstr "會移除範圍外的值中的非法值,留下合法的 :class:`Flag` 值: ::" -#: ../../library/enum.rst:808 +#: ../../library/enum.rst:822 msgid "" ">>> from enum import Flag, CONFORM, auto\n" ">>> class ConformFlag(Flag, boundary=CONFORM):\n" @@ -1468,13 +1492,13 @@ msgstr "" ">>> ConformFlag(2**2 + 2**4)\n" "" -#: ../../library/enum.rst:819 +#: ../../library/enum.rst:833 msgid "" -"Out-of-range values lose their :class:`Flag` membership and revert " -"to :class:`int`." +"Out-of-range values lose their :class:`Flag` membership and revert to :class:" +"`int`." msgstr "範圍外的值會失去它們的 :class:`Flag` 成員資格且恢復成 :class:`int`。" -#: ../../library/enum.rst:832 +#: ../../library/enum.rst:846 msgid "" "Out-of-range values are kept, and the :class:`Flag` membership is kept. This " "is the default for :class:`IntFlag`::" @@ -1482,7 +1506,7 @@ msgstr "" "範圍外的值會被保留,:class:`Flag` 成員資格也會被保留。這是 :class:`IntFlag` " "的預設行為: ::" -#: ../../library/enum.rst:835 +#: ../../library/enum.rst:849 msgid "" ">>> from enum import Flag, KEEP, auto\n" ">>> class KeepFlag(Flag, boundary=KEEP):\n" @@ -1502,7 +1526,7 @@ msgstr "" ">>> KeepFlag(2**2 + 2**4)\n" "" -#: ../../library/enum.rst:848 +#: ../../library/enum.rst:862 msgid "" "*EnumDict* is a subclass of :class:`dict` that is used as the namespace for " "defining enum classes (see :ref:`prepare`). It is exposed to allow " @@ -1511,31 +1535,31 @@ msgid "" "created, otherwise private names and internal classes will not be handled " "correctly." msgstr "" -"*EnumDict* 是 :class:`dict` 的子類別,用來作為定義列舉類別的命名空間(參" -"見 :ref:`prepare`)。它被公開來使得 :class:`EnumType` 的子類別能具有進階行" -"為,例如讓每個成員有多個值。它應該在被呼叫時帶上正在建立的列舉類別名稱,否則" -"私有名稱和內部類別將無法被正確處理。" +"*EnumDict* 是 :class:`dict` 的子類別,用來作為定義列舉類別的命名空間(參見 :" +"ref:`prepare`)。它被公開來使得 :class:`EnumType` 的子類別能具有進階行為,例" +"如讓每個成員有多個值。它應該在被呼叫時帶上正在建立的列舉類別名稱,否則私有名" +"稱和內部類別將無法被正確處理。" -#: ../../library/enum.rst:855 +#: ../../library/enum.rst:869 msgid "" -"Note that only the :class:`~collections.abc.MutableMapping` interface " -"(:meth:`~object.__setitem__` and :meth:`~dict.update`) is overridden. It may " -"be possible to bypass the checks using other :class:`!dict` operations " -"like :meth:`|= `." +"Note that only the :class:`~collections.abc.MutableMapping` interface (:meth:" +"`~object.__setitem__` and :meth:`~dict.update`) is overridden. It may be " +"possible to bypass the checks using other :class:`!dict` operations like :" +"meth:`|= `." msgstr "" -"注意只有 :class:`~collections.abc.MutableMapping` 介面" -"(:meth:`~object.__setitem__` 和 :meth:`~dict.update`)被覆寫。可能可以使用其" -"他 :class:`!dict` 操作來繞過檢查,例如 :meth:`|= `。" +"注意只有 :class:`~collections.abc.MutableMapping` 介面(:meth:`~object." +"__setitem__` 和 :meth:`~dict.update`)被覆寫。可能可以使用其他 :class:`!" +"dict` 操作來繞過檢查,例如 :meth:`|= `。" -#: ../../library/enum.rst:862 +#: ../../library/enum.rst:876 msgid "A list of member names." msgstr "一個成員名稱的串列。" -#: ../../library/enum.rst:869 +#: ../../library/enum.rst:883 msgid "Supported ``__dunder__`` names" msgstr "支援的 ``__dunder__`` 名稱" -#: ../../library/enum.rst:871 +#: ../../library/enum.rst:885 msgid "" ":attr:`~EnumType.__members__` is a read-only ordered mapping of " "``member_name``:``member`` items. It is only available on the class." @@ -1543,7 +1567,7 @@ msgstr "" ":attr:`~EnumType.__members__` 是一個唯讀有序的\\ ``成員名稱``:``成員``\\ 項" "目的對映。只有在類別上可用。" -#: ../../library/enum.rst:874 +#: ../../library/enum.rst:888 msgid "" ":meth:`~Enum.__new__`, if specified, must create and return the enum " "members; it is also a very good idea to set the member's :attr:`!_value_` " @@ -1553,47 +1577,35 @@ msgstr "" "的 :attr:`!_value_` 也是一個很好的主意。一旦所有成員都建立之後就不會再被用" "到。" -#: ../../library/enum.rst:880 +#: ../../library/enum.rst:894 msgid "Supported ``_sunder_`` names" msgstr "支援的 ``_sunder_`` 名稱" -#: ../../library/enum.rst:882 -msgid "" -":meth:`~EnumType._add_alias_` -- adds a new name as an alias to an existing " -"member." -msgstr ":meth:`~EnumType._add_alias_` -- 新增一個名稱作為現有成員的別名。" - -#: ../../library/enum.rst:884 -msgid "" -":meth:`~EnumType._add_value_alias_` -- adds a new value as an alias to an " -"existing member." -msgstr ":meth:`~EnumType._add_value_alias_` -- 新增一個值作為現有成員的別名。" - -#: ../../library/enum.rst:886 +#: ../../library/enum.rst:896 msgid ":attr:`~Enum._name_` -- name of the member" msgstr ":attr:`~Enum._name_` -- 成員名稱" -#: ../../library/enum.rst:887 +#: ../../library/enum.rst:897 msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" msgstr ":attr:`~Enum._value_` -- 成員的值;可以在 ``__new__`` 設定" -#: ../../library/enum.rst:888 +#: ../../library/enum.rst:898 msgid "" ":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " "may be overridden" msgstr "" ":meth:`~Enum._missing_` -- 當值沒有被找到時會使用的查詢函式;可以被覆寫" -#: ../../library/enum.rst:890 +#: ../../library/enum.rst:900 msgid "" -":attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or " -"a :class:`str`, that will not be transformed into members, and will be " -"removed from the final class" +":attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or a :" +"class:`str`, that will not be transformed into members, and will be removed " +"from the final class" msgstr "" -":attr:`~Enum._ignore_` -- 一個名稱的串列,可以是 :class:`list` " -"或 :class:`str`,它不會被轉換成成員,且在最後的類別上會被移除" +":attr:`~Enum._ignore_` -- 一個名稱的串列,可以是 :class:`list` 或 :class:" +"`str`,它不會被轉換成成員,且在最後的類別上會被移除" -#: ../../library/enum.rst:893 +#: ../../library/enum.rst:903 msgid "" ":attr:`~Enum._order_` -- no longer used, kept for backward compatibility " "(class attribute, removed during class creation)" @@ -1601,28 +1613,40 @@ msgstr "" ":attr:`~Enum._order_` -- 不再被使用,僅為了向後相容而保留(類別屬性,在類別建" "立時移除)" -#: ../../library/enum.rst:895 +#: ../../library/enum.rst:905 msgid "" ":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " "an enum member; may be overridden" msgstr "" ":meth:`~Enum._generate_next_value_` -- 用來為列舉成員取得合適的值;可以被覆寫" -#: ../../library/enum.rst:900 +#: ../../library/enum.rst:910 msgid "" "For standard :class:`Enum` classes the next value chosen is the highest " "value seen incremented by one." msgstr "" "對標準的 :class:`Enum` 類別來說,下一個被選擇的值是所看過的最大值加一。" -#: ../../library/enum.rst:903 +#: ../../library/enum.rst:913 msgid "" "For :class:`Flag` classes the next value chosen will be the next highest " "power-of-two." msgstr "" "對 :class:`Flag` 類別來說,下一個被選擇的值是下一個最大的 2 的次方的數字。" -#: ../../library/enum.rst:906 +#: ../../library/enum.rst:916 +msgid "" +":meth:`~Enum._add_alias_` -- adds a new name as an alias to an existing " +"member." +msgstr ":meth:`~Enum._add_alias_` -- 新增一個名稱作為現有成員的別名。" + +#: ../../library/enum.rst:918 +msgid "" +":meth:`~Enum._add_value_alias_` -- adds a new value as an alias to an " +"existing member." +msgstr ":meth:`~Enum._add_value_alias_` -- 新增一個值作為現有成員的別名。" + +#: ../../library/enum.rst:921 msgid "" "While ``_sunder_`` names are generally reserved for the further development " "of the :class:`Enum` class and can not be used, some are explicitly allowed:" @@ -1630,57 +1654,55 @@ msgstr "" "雖然 ``_sunder_`` 名稱通常保留用於 :class:`Enum` 類別的進一步開發而不能被使" "用,但有些是明確允許的:" -#: ../../library/enum.rst:909 +#: ../../library/enum.rst:924 msgid "" "``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_" msgstr "" "``_repr_*``\\ (例如 ``_repr_html_``),例如用於 `IPython 的豐富顯示 " "`_" -#: ../../library/enum.rst:911 +#: ../../library/enum.rst:926 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``、``_order_``、``_generate_next_value_``" -#: ../../library/enum.rst:912 +#: ../../library/enum.rst:927 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:913 +#: ../../library/enum.rst:928 msgid "``_add_alias_``, ``_add_value_alias_``, ``_repr_*``" msgstr "``_add_alias_``、``_add_value_alias_``、``_repr_*``" -#: ../../library/enum.rst:919 +#: ../../library/enum.rst:934 msgid "Utilities and Decorators" msgstr "通用項目與裝飾器" -#: ../../library/enum.rst:923 +#: ../../library/enum.rst:938 msgid "" "*auto* can be used in place of a value. If used, the *Enum* machinery will " "call an :class:`Enum`'s :meth:`~Enum._generate_next_value_` to get an " "appropriate value. For :class:`Enum` and :class:`IntEnum` that appropriate " -"value will be the last value plus one; for :class:`Flag` " -"and :class:`IntFlag` it will be the first power-of-two greater than the " -"highest value; for :class:`StrEnum` it will be the lower-cased version of " -"the member's name. Care must be taken if mixing *auto()* with manually " -"specified values." +"value will be the last value plus one; for :class:`Flag` and :class:" +"`IntFlag` it will be the first power-of-two greater than the highest value; " +"for :class:`StrEnum` it will be the lower-cased version of the member's " +"name. Care must be taken if mixing *auto()* with manually specified values." msgstr "" -"*auto* 可以用來取代給值。如果使用的話,*Enum* 系統會呼叫 :class:`Enum` " -"的 :meth:`~Enum._generate_next_value_` 來取得合適的值。對 :class:`Enum` " -"和 :class:`IntEnum` 來說,合適的值是最後一個值加一;對 :class:`Flag` " -"和 :class:`IntFlag` 來說,是第一個比最大值還大的 2 的次方的數字;" -"對 :class:`StrEnum` 來說,是成員名稱的小寫版本。如果混用 *auto()* 和手動指定" -"值的話要特別注意。" +"*auto* 可以用來取代給值。如果使用的話,*Enum* 系統會呼叫 :class:`Enum` 的 :" +"meth:`~Enum._generate_next_value_` 來取得合適的值。對 :class:`Enum` 和 :" +"class:`IntEnum` 來說,合適的值是最後一個值加一;對 :class:`Flag` 和 :class:" +"`IntFlag` 來說,是第一個比最大值還大的 2 的次方的數字;對 :class:`StrEnum` 來" +"說,是成員名稱的小寫版本。如果混用 *auto()* 和手動指定值的話要特別注意。" -#: ../../library/enum.rst:931 +#: ../../library/enum.rst:946 msgid "" "*auto* instances are only resolved when at the top level of an assignment:" msgstr "*auto* 實例只有在最上層的賦值時才會被解析:" -#: ../../library/enum.rst:933 +#: ../../library/enum.rst:948 msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" msgstr "``FIRST = auto()`` 可以運作(auto() 會被取代成 ``1``)" -#: ../../library/enum.rst:934 +#: ../../library/enum.rst:949 msgid "" "``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " "is used to create the ``SECOND`` enum member;" @@ -1688,7 +1710,7 @@ msgstr "" "``SECOND = auto(), -2`` 可以運作(auto 會被取代成 ``2``, 因此 ``2, -2`` 會被" "用來建立列舉成員 ``SECOND``;" -#: ../../library/enum.rst:936 +#: ../../library/enum.rst:951 msgid "" "``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " "create the ``THREE`` enum member)" @@ -1696,19 +1718,19 @@ msgstr "" "``THREE = [auto(), -3]`` *無法*\\ 運作(\\ ``, -3`` 會被用來建立列" "舉成員 ``THREE``)" -#: ../../library/enum.rst:941 +#: ../../library/enum.rst:956 msgid "" "In prior versions, ``auto()`` had to be the only thing on the assignment " "line to work properly." msgstr "在之前的版本中,``auto()`` 必須是賦值行裡的唯一內容才能運作正確。" -#: ../../library/enum.rst:944 +#: ../../library/enum.rst:959 msgid "" "``_generate_next_value_`` can be overridden to customize the values used by " "*auto*." msgstr "可以覆寫 ``_generate_next_value_`` 來客製 *auto* 使用的值。" -#: ../../library/enum.rst:947 +#: ../../library/enum.rst:962 msgid "" "in 3.13 the default ``_generate_next_value_`` will always return the highest " "member value incremented by 1, and will fail if any member is an " @@ -1717,7 +1739,7 @@ msgstr "" "在 3.13 預設 ``_generate_next_value_`` 總是回傳最大的成員值加一,如果任何成員" "是不相容的型別就會失敗。" -#: ../../library/enum.rst:953 +#: ../../library/enum.rst:968 msgid "" "A decorator similar to the built-in *property*, but specifically for " "enumerations. It allows member attributes to have the same names as members " @@ -1726,7 +1748,7 @@ msgstr "" "和內建的 *property* 相似的裝飾器,但只專門針對列舉。它允許成員屬性和成員本身" "有相同名稱。" -#: ../../library/enum.rst:957 +#: ../../library/enum.rst:972 msgid "" "the *property* and the member must be defined in separate classes; for " "example, the *value* and *name* attributes are defined in the *Enum* class, " @@ -1736,17 +1758,17 @@ msgstr "" "*屬性*\\ 和成員必須定義在分開的類別裡;例如 *value* 和 *name* 屬性定義在 " "*Enum* 類別而 *Enum* 子類別可以定義成員名稱為 ``value`` 和 ``name``。" -#: ../../library/enum.rst:966 +#: ../../library/enum.rst:981 msgid "" "A :keyword:`class` decorator specifically for enumerations. It searches an " "enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " "if any are found :exc:`ValueError` is raised with the details::" msgstr "" -"專門針對列舉的 :keyword:`class` 裝飾器。它搜尋列舉" -"的 :attr:`~EnumType.__members__`,蒐集任何它找到的別名;如果有找到任何別名則" -"引發 :exc:`ValueError` 並附上細節: ::" +"專門針對列舉的 :keyword:`class` 裝飾器。它搜尋列舉的 :attr:`~EnumType." +"__members__`,蒐集任何它找到的別名;如果有找到任何別名則引發 :exc:" +"`ValueError` 並附上細節: ::" -#: ../../library/enum.rst:970 +#: ../../library/enum.rst:985 msgid "" ">>> from enum import Enum, unique\n" ">>> @unique\n" @@ -1772,24 +1794,24 @@ msgstr "" "...\n" "ValueError: duplicate values found in : FOUR -> THREE" -#: ../../library/enum.rst:984 +#: ../../library/enum.rst:999 msgid "" -"A :keyword:`class` decorator specifically for enumerations. Members " -"from :class:`EnumCheck` are used to specify which constraints should be " -"checked on the decorated enumeration." +"A :keyword:`class` decorator specifically for enumerations. Members from :" +"class:`EnumCheck` are used to specify which constraints should be checked on " +"the decorated enumeration." msgstr "" "專門針對列舉的 :keyword:`class` 裝飾器。使用 :class:`EnumCheck` 裡的成員來指" "定在裝飾的列舉上應該檢查什麼限制。" -#: ../../library/enum.rst:992 +#: ../../library/enum.rst:1007 msgid "A decorator for use in enums: its target will become a member." msgstr "列舉所使用的裝飾器:其目標會變成成員。" -#: ../../library/enum.rst:998 +#: ../../library/enum.rst:1013 msgid "A decorator for use in enums: its target will not become a member." msgstr "列舉所使用的裝飾器:其目標不會變成成員。" -#: ../../library/enum.rst:1004 +#: ../../library/enum.rst:1019 msgid "" "A decorator to change the :class:`str() ` and :func:`repr` of an enum " "to show its members as belonging to the module instead of its class. Should " @@ -1800,19 +1822,19 @@ msgstr "" "組而不是其類別。應該只有當列舉成員被匯出到模組的全域命名空間才使用(範例請參" "考 :class:`re.RegexFlag`)。" -#: ../../library/enum.rst:1014 +#: ../../library/enum.rst:1029 msgid "Return a list of all power-of-two integers contained in a flag *value*." msgstr "回傳在旗標\\ *值*\\ 中包含的所有 2 的次方的整數串列。" -#: ../../library/enum.rst:1021 +#: ../../library/enum.rst:1036 msgid "Notes" msgstr "備註" -#: ../../library/enum.rst:1023 +#: ../../library/enum.rst:1038 msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" msgstr ":class:`IntEnum`、:class:`StrEnum` 及 :class:`IntFlag`" -#: ../../library/enum.rst:1025 +#: ../../library/enum.rst:1040 msgid "" "These three enum types are designed to be drop-in replacements for existing " "integer- and string-based values; as such, they have extra limitations:" @@ -1820,17 +1842,17 @@ msgstr "" "這三種列舉型別是設計來直接取代現有以整數及字串為基底的值;因此它們有額外的限" "制:" -#: ../../library/enum.rst:1028 +#: ../../library/enum.rst:1043 msgid "``__str__`` uses the value and not the name of the enum member" msgstr "``__str__`` 使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:1030 +#: ../../library/enum.rst:1045 msgid "" "``__format__``, because it uses ``__str__``, will also use the value of the " "enum member instead of its name" msgstr "``__format__`` 因為使用 ``__str__``,也會使用值而不是列舉成員的名稱" -#: ../../library/enum.rst:1033 +#: ../../library/enum.rst:1048 msgid "" "If you do not need/want those limitations, you can either create your own " "base class by mixing in the ``int`` or ``str`` type yourself::" @@ -1838,7 +1860,7 @@ msgstr "" "如果你不需要或不想要這些限制,你可以透過混合 ``int`` 或 ``str`` 型別來建立自" "己的基礎類別: ::" -#: ../../library/enum.rst:1036 +#: ../../library/enum.rst:1051 msgid "" ">>> from enum import Enum\n" ">>> class MyIntEnum(int, Enum):\n" @@ -1848,11 +1870,11 @@ msgstr "" ">>> class MyIntEnum(int, Enum):\n" "... pass" -#: ../../library/enum.rst:1040 +#: ../../library/enum.rst:1055 msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" msgstr "或者你也可以在你的列舉重新給定合適的 :meth:`str`: ::" -#: ../../library/enum.rst:1042 +#: ../../library/enum.rst:1057 msgid "" ">>> from enum import Enum, IntEnum\n" ">>> class MyIntEnum(IntEnum):\n" @@ -1861,27 +1883,3 @@ msgstr "" ">>> from enum import Enum, IntEnum\n" ">>> class MyIntEnum(IntEnum):\n" "... __str__ = Enum.__str__" - -#~ msgid "Adds a new name as an alias to an existing member::" -#~ msgstr "新增一個名稱作為現有成員的別名: ::" - -#~ msgid "" -#~ ">>> Color.RED._add_alias_(\"ERROR\")\n" -#~ ">>> Color.ERROR\n" -#~ "" -#~ msgstr "" -#~ ">>> Color.RED._add_alias_(\"ERROR\")\n" -#~ ">>> Color.ERROR\n" -#~ "" - -#~ msgid "Adds a new value as an alias to an existing member::" -#~ msgstr "新增一個值作為現有成員的別名: ::" - -#~ msgid "" -#~ ">>> Color.RED._add_value_alias_(42)\n" -#~ ">>> Color(42)\n" -#~ "" -#~ msgstr "" -#~ ">>> Color.RED._add_value_alias_(42)\n" -#~ ">>> Color(42)\n" -#~ "" diff --git a/library/getpass.po b/library/getpass.po index 706e6b8c26..93118b2782 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-10 20:44+0800\n" +"POT-Creation-Date: 2025-09-18 00:15+0000\n" "PO-Revision-Date: 2022-02-11 12:04+0800\n" "Last-Translator: Weilin Du\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -62,16 +62,16 @@ msgstr "" msgid "" "The *echo_char* argument controls how user input is displayed while typing. " "If *echo_char* is ``None`` (default), input remains hidden. Otherwise, " -"*echo_char* must be a printable ASCII string and each typed character is " -"replaced by it. For example, ``echo_char='*'`` will display asterisks " -"instead of the actual input." +"*echo_char* must be a single printable ASCII character and each typed " +"character is replaced by it. For example, ``echo_char='*'`` will display " +"asterisks instead of the actual input." msgstr "" #: ../../library/getpass.rst:34 msgid "" "If echo free input is unavailable getpass() falls back to printing a warning " -"message to *stream* and reading from ``sys.stdin`` and issuing " -"a :exc:`GetPassWarning`." +"message to *stream* and reading from ``sys.stdin`` and issuing a :exc:" +"`GetPassWarning`." msgstr "" "如果無回音輸入 (echo-free input) 無法使用則 getpass() 將回退為印出一條警告訊" "息到 *stream*,並從 ``sys.stdin`` 讀取且同時發出 :exc:`GetPassWarning`。" @@ -107,12 +107,11 @@ msgstr "回傳使用者的\"登入名稱\"。" #: ../../library/getpass.rst:62 msgid "" -"This function checks the environment " -"variables :envvar:`LOGNAME`, :envvar:`USER`, :envvar:`!LNAME` " -"and :envvar:`USERNAME`, in order, and returns the value of the first one " -"which is set to a non-empty string. If none are set, the login name from " -"the password database is returned on systems which support the :mod:`pwd` " -"module, otherwise, an :exc:`OSError` is raised." +"This function checks the environment variables :envvar:`LOGNAME`, :envvar:" +"`USER`, :envvar:`!LNAME` and :envvar:`USERNAME`, in order, and returns the " +"value of the first one which is set to a non-empty string. If none are set, " +"the login name from the password database is returned on systems which " +"support the :mod:`pwd` module, otherwise, an :exc:`OSError` is raised." msgstr "" "此函式會按順序檢查環境變數 :envvar:`LOGNAME`、:envvar:`USER`、:envvar:`!" "LNAME` 和 :envvar:`USERNAME`,並回傳其中第一個被設定成非空字串的值。如果均未" diff --git a/library/html.po b/library/html.po index 52907a6a55..8fae0bf234 100644 --- a/library/html.po +++ b/library/html.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-09 00:03+0000\n" +"POT-Creation-Date: 2025-09-18 00:15+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,36 +33,39 @@ msgstr "此模組定義了操作 HTML 的工具。" msgid "" "Convert the characters ``&``, ``<`` and ``>`` in string *s* to HTML-safe " "sequences. Use this if you need to display text that might contain such " -"characters in HTML. If the optional flag *quote* is true, the characters " -"(``\"``) and (``'``) are also translated; this helps for inclusion in an " -"HTML attribute value delimited by quotes, as in ````." +"characters in HTML. If the optional flag *quote* is true (the default), the " +"characters (``\"``) and (``'``) are also translated; this helps for " +"inclusion in an HTML attribute value delimited by quotes, as in ````. If *quote* is set to false, the characters (``\"``) and " +"(``'``) are not translated." msgstr "" "將字串 *s* 中的 ``&``、``<`` 和 ``>`` 字元轉換為在 HTML 中安全的序列 " "(sequence)。如果你需要在 HTML 中顯示可能包含這些字元的文字,可以使用這個函" -"式。如果選擇性的旗標 *quote* 為 true,則 (``\"``) 與 (``'``) 字元也會被轉換;" -"這樣能包含在 HTML 中,被引號分隔的屬性值,如 ```` 。" +"式。如果選擇性的旗標 *quote* 為 true(預設),則 (``\"``) 與 (``'``) 字元也會被轉換;" +"這樣能包含在 HTML 中,被引號分隔的屬性值,如 ```` 。如果 *quote* 設" +"為 false,則 (``\"``) 與 (``'``) 字元不會被轉換。" -#: ../../library/html.rst:26 +#: ../../library/html.rst:29 msgid "" -"Convert all named and numeric character references (e.g. ``>``, " -"``>``, ``>``) in the string *s* to the corresponding Unicode " -"characters. This function uses the rules defined by the HTML 5 standard for " -"both valid and invalid character references, and the :data:`list of HTML 5 " -"named character references `." +"Convert all named and numeric character references (e.g. ``>``, ``>" +"``, ``>``) in the string *s* to the corresponding Unicode characters. " +"This function uses the rules defined by the HTML 5 standard for both valid " +"and invalid character references, and the :data:`list of HTML 5 named " +"character references `." msgstr "" "將字串 *s* 中所有附名 (named) 且為數值的 (numeric) 字元參照(如: ``>``、 " "``>``、``>`` )轉換為對應的 Unicode 字元。此函式針對有效及無效的字元" "參照,皆使用 HTML 5 標準所定義的規則,以及 :data:`HTML 5 附名字元參照清單 " "` 。" -#: ../../library/html.rst:36 +#: ../../library/html.rst:39 msgid "Submodules in the ``html`` package are:" msgstr "``html`` 套件中的子模組為:" -#: ../../library/html.rst:38 +#: ../../library/html.rst:41 msgid ":mod:`html.parser` -- HTML/XHTML parser with lenient parsing mode" msgstr ":mod:`html.parser` -- 帶有寬鬆剖析模式的 HTML/XHTML 剖析器" -#: ../../library/html.rst:39 +#: ../../library/html.rst:42 msgid ":mod:`html.entities` -- HTML entity definitions" msgstr ":mod:`html.entities` -- HTML 實體的定義" diff --git a/library/inspect.po b/library/inspect.po index fa571e5425..093377a4d2 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-10 20:44+0800\n" +"POT-Creation-Date: 2025-09-18 00:15+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -51,10 +51,10 @@ msgstr "" msgid "" "The :func:`getmembers` function retrieves the members of an object such as a " "class or module. The functions whose names begin with \"is\" are mainly " -"provided as convenient choices for the second argument " -"to :func:`getmembers`. They also help you determine when you can expect to " -"find the following special attributes (see :ref:`import-mod-attrs` for " -"module attributes):" +"provided as convenient choices for the second argument to :func:" +"`getmembers`. They also help you determine when you can expect to find the " +"following special attributes (see :ref:`import-mod-attrs` for module " +"attributes):" msgstr "" #: ../../library/inspect.rst:46 @@ -74,19 +74,19 @@ msgid "class" msgstr "" #: ../../library/inspect.rst:48 ../../library/inspect.rst:63 -#: ../../library/inspect.rst:81 ../../library/inspect.rst:292 +#: ../../library/inspect.rst:81 ../../library/inspect.rst:295 msgid "__doc__" msgstr "__doc__" #: ../../library/inspect.rst:48 ../../library/inspect.rst:63 -#: ../../library/inspect.rst:81 ../../library/inspect.rst:292 +#: ../../library/inspect.rst:81 ../../library/inspect.rst:295 msgid "documentation string" msgstr "" #: ../../library/inspect.rst:50 ../../library/inspect.rst:65 #: ../../library/inspect.rst:83 ../../library/inspect.rst:248 -#: ../../library/inspect.rst:262 ../../library/inspect.rst:275 -#: ../../library/inspect.rst:294 +#: ../../library/inspect.rst:265 ../../library/inspect.rst:278 +#: ../../library/inspect.rst:297 msgid "__name__" msgstr "__name__" @@ -96,15 +96,15 @@ msgstr "" #: ../../library/inspect.rst:53 ../../library/inspect.rst:68 #: ../../library/inspect.rst:86 ../../library/inspect.rst:250 -#: ../../library/inspect.rst:264 ../../library/inspect.rst:277 -#: ../../library/inspect.rst:297 +#: ../../library/inspect.rst:267 ../../library/inspect.rst:280 +#: ../../library/inspect.rst:300 msgid "__qualname__" msgstr "__qualname__" #: ../../library/inspect.rst:53 ../../library/inspect.rst:68 #: ../../library/inspect.rst:86 ../../library/inspect.rst:250 -#: ../../library/inspect.rst:264 ../../library/inspect.rst:277 -#: ../../library/inspect.rst:297 +#: ../../library/inspect.rst:267 ../../library/inspect.rst:280 +#: ../../library/inspect.rst:300 msgid "qualified name" msgstr "" @@ -143,7 +143,7 @@ msgstr "__func__" msgid "function object containing implementation of method" msgstr "" -#: ../../library/inspect.rst:74 ../../library/inspect.rst:299 +#: ../../library/inspect.rst:74 ../../library/inspect.rst:302 msgid "__self__" msgstr "__self__" @@ -260,7 +260,7 @@ msgid "next inner traceback object (called by this level)" msgstr "" #: ../../library/inspect.rst:132 ../../library/inspect.rst:252 -#: ../../library/inspect.rst:269 ../../library/inspect.rst:282 +#: ../../library/inspect.rst:272 ../../library/inspect.rst:285 msgid "frame" msgstr "" @@ -355,8 +355,8 @@ msgstr "" msgid "used to clear all references to local variables" msgstr "" -#: ../../library/inspect.rst:175 ../../library/inspect.rst:256 -#: ../../library/inspect.rst:273 ../../library/inspect.rst:286 +#: ../../library/inspect.rst:175 ../../library/inspect.rst:259 +#: ../../library/inspect.rst:276 ../../library/inspect.rst:289 msgid "code" msgstr "code(程式碼)" @@ -528,8 +528,8 @@ msgstr "" msgid "generator" msgstr "" -#: ../../library/inspect.rst:248 ../../library/inspect.rst:262 -#: ../../library/inspect.rst:275 +#: ../../library/inspect.rst:248 ../../library/inspect.rst:265 +#: ../../library/inspect.rst:278 msgid "name" msgstr "" @@ -541,113 +541,121 @@ msgstr "gi_frame" msgid "gi_running" msgstr "gi_running" -#: ../../library/inspect.rst:254 ../../library/inspect.rst:271 +#: ../../library/inspect.rst:254 ../../library/inspect.rst:274 msgid "is the generator running?" msgstr "" #: ../../library/inspect.rst:256 +msgid "gi_suspended" +msgstr "" + +#: ../../library/inspect.rst:256 +msgid "is the generator suspended?" +msgstr "" + +#: ../../library/inspect.rst:259 msgid "gi_code" msgstr "gi_code" -#: ../../library/inspect.rst:258 +#: ../../library/inspect.rst:261 msgid "gi_yieldfrom" msgstr "gi_yieldfrom" -#: ../../library/inspect.rst:258 +#: ../../library/inspect.rst:261 msgid "object being iterated by ``yield from``, or ``None``" msgstr "" -#: ../../library/inspect.rst:262 +#: ../../library/inspect.rst:265 msgid "async generator" msgstr "" -#: ../../library/inspect.rst:266 +#: ../../library/inspect.rst:269 msgid "ag_await" msgstr "ag_await" -#: ../../library/inspect.rst:266 ../../library/inspect.rst:279 +#: ../../library/inspect.rst:269 ../../library/inspect.rst:282 msgid "object being awaited on, or ``None``" msgstr "" -#: ../../library/inspect.rst:269 +#: ../../library/inspect.rst:272 msgid "ag_frame" msgstr "ag_frame" -#: ../../library/inspect.rst:271 +#: ../../library/inspect.rst:274 msgid "ag_running" msgstr "ag_running" -#: ../../library/inspect.rst:273 +#: ../../library/inspect.rst:276 msgid "ag_code" msgstr "ag_code" -#: ../../library/inspect.rst:275 +#: ../../library/inspect.rst:278 msgid "coroutine" msgstr "coroutine" -#: ../../library/inspect.rst:279 +#: ../../library/inspect.rst:282 msgid "cr_await" msgstr "cr_await" -#: ../../library/inspect.rst:282 +#: ../../library/inspect.rst:285 msgid "cr_frame" msgstr "cr_frame" -#: ../../library/inspect.rst:284 +#: ../../library/inspect.rst:287 msgid "cr_running" msgstr "cr_running" -#: ../../library/inspect.rst:284 +#: ../../library/inspect.rst:287 msgid "is the coroutine running?" msgstr "" -#: ../../library/inspect.rst:286 +#: ../../library/inspect.rst:289 msgid "cr_code" msgstr "cr_code" -#: ../../library/inspect.rst:288 +#: ../../library/inspect.rst:291 msgid "cr_origin" msgstr "cr_origin" -#: ../../library/inspect.rst:288 +#: ../../library/inspect.rst:291 msgid "where coroutine was created, or ``None``. See |coroutine-origin-link|" msgstr "" -#: ../../library/inspect.rst:292 +#: ../../library/inspect.rst:295 msgid "builtin" msgstr "" -#: ../../library/inspect.rst:294 +#: ../../library/inspect.rst:297 msgid "original name of this function or method" msgstr "" -#: ../../library/inspect.rst:299 +#: ../../library/inspect.rst:302 msgid "instance to which a method is bound, or ``None``" msgstr "" -#: ../../library/inspect.rst:306 +#: ../../library/inspect.rst:309 msgid "Add ``__qualname__`` and ``gi_yieldfrom`` attributes to generators." msgstr "將 ``__qualname__`` 和 ``gi_yieldfrom`` 屬性加到產生器。" -#: ../../library/inspect.rst:308 +#: ../../library/inspect.rst:311 msgid "" "The ``__name__`` attribute of generators is now set from the function name, " "instead of the code name, and it can now be modified." msgstr "" -#: ../../library/inspect.rst:313 +#: ../../library/inspect.rst:316 msgid "Add ``cr_origin`` attribute to coroutines." msgstr "新增協程的 ``cr_origin`` 屬性。" -#: ../../library/inspect.rst:317 +#: ../../library/inspect.rst:320 msgid "Add ``__builtins__`` attribute to functions." msgstr "新增函式的 ``__builtins__`` 屬性。" -#: ../../library/inspect.rst:321 +#: ../../library/inspect.rst:324 msgid "Add ``f_generator`` attribute to frames." msgstr "新增 ``f_generator`` 屬性到 frame。" -#: ../../library/inspect.rst:325 +#: ../../library/inspect.rst:328 msgid "" "Return all the members of an object in a list of ``(name, value)`` pairs " "sorted by name. If the optional *predicate* argument—which will be called " @@ -655,14 +663,14 @@ msgid "" "the predicate returns a true value are included." msgstr "" -#: ../../library/inspect.rst:332 +#: ../../library/inspect.rst:335 msgid "" ":func:`getmembers` will only return class attributes defined in the " "metaclass when the argument is a class and those attributes have been listed " "in the metaclass' custom :meth:`~object.__dir__`." msgstr "" -#: ../../library/inspect.rst:339 +#: ../../library/inspect.rst:342 msgid "" "Return all the members of an object in a list of ``(name, value)`` pairs " "sorted by name without triggering dynamic lookup via the descriptor " @@ -670,7 +678,7 @@ msgid "" "that satisfy a given predicate." msgstr "" -#: ../../library/inspect.rst:346 +#: ../../library/inspect.rst:349 msgid "" ":func:`getmembers_static` may not be able to retrieve all members that " "getmembers can fetch (like dynamically created attributes) and may find " @@ -679,7 +687,7 @@ msgid "" "cases." msgstr "" -#: ../../library/inspect.rst:357 +#: ../../library/inspect.rst:360 msgid "" "Return the name of the module named by the file *path*, without including " "the names of enclosing packages. The file extension is checked against all " @@ -688,123 +696,123 @@ msgid "" "``None`` is returned." msgstr "" -#: ../../library/inspect.rst:363 +#: ../../library/inspect.rst:366 msgid "" "Note that this function *only* returns a meaningful name for actual Python " "modules - paths that potentially refer to Python packages will still return " "``None``." msgstr "" -#: ../../library/inspect.rst:367 +#: ../../library/inspect.rst:370 msgid "The function is based directly on :mod:`importlib`." msgstr "此函式直接基於 :mod:`importlib`。" -#: ../../library/inspect.rst:373 +#: ../../library/inspect.rst:376 msgid "Return ``True`` if the object is a module." msgstr "如果物件是模組,則回傳 ``True``。" -#: ../../library/inspect.rst:378 +#: ../../library/inspect.rst:381 msgid "" "Return ``True`` if the object is a class, whether built-in or created in " "Python code." msgstr "" -#: ../../library/inspect.rst:384 +#: ../../library/inspect.rst:387 msgid "Return ``True`` if the object is a bound method written in Python." msgstr "" -#: ../../library/inspect.rst:389 +#: ../../library/inspect.rst:392 msgid "Return ``True`` if the object is a :term:`package`." msgstr "如果物件是 :term:`package`,則回傳 ``True``。" -#: ../../library/inspect.rst:396 +#: ../../library/inspect.rst:399 msgid "" "Return ``True`` if the object is a Python function, which includes functions " "created by a :term:`lambda` expression." msgstr "" -#: ../../library/inspect.rst:402 +#: ../../library/inspect.rst:405 msgid "Return ``True`` if the object is a Python generator function." msgstr "如果物件是 Python 產生器函式,則回傳 ``True``。" -#: ../../library/inspect.rst:404 +#: ../../library/inspect.rst:407 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is a Python generator function." msgstr "" -#: ../../library/inspect.rst:408 +#: ../../library/inspect.rst:411 msgid "" "Functions wrapped in :func:`functools.partialmethod` now return ``True`` if " "the wrapped function is a Python generator function." msgstr "" -#: ../../library/inspect.rst:414 +#: ../../library/inspect.rst:417 msgid "Return ``True`` if the object is a generator." msgstr "如果物件是產生器,則回傳 ``True``。" -#: ../../library/inspect.rst:419 +#: ../../library/inspect.rst:422 msgid "" "Return ``True`` if the object is a :term:`coroutine function` (a function " "defined with an :keyword:`async def` syntax), a :func:`functools.partial` " -"wrapping a :term:`coroutine function`, or a sync function marked " -"with :func:`markcoroutinefunction`." +"wrapping a :term:`coroutine function`, or a sync function marked with :func:" +"`markcoroutinefunction`." msgstr "" -#: ../../library/inspect.rst:426 +#: ../../library/inspect.rst:429 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is a :term:`coroutine function`." msgstr "" -#: ../../library/inspect.rst:430 +#: ../../library/inspect.rst:433 msgid "" "Sync functions marked with :func:`markcoroutinefunction` now return ``True``." msgstr "" -#: ../../library/inspect.rst:434 ../../library/inspect.rst:504 +#: ../../library/inspect.rst:437 ../../library/inspect.rst:507 msgid "" "Functions wrapped in :func:`functools.partialmethod` now return ``True`` if " "the wrapped function is a :term:`coroutine function`." msgstr "" -#: ../../library/inspect.rst:441 +#: ../../library/inspect.rst:444 msgid "" "Decorator to mark a callable as a :term:`coroutine function` if it would not " "otherwise be detected by :func:`iscoroutinefunction`." msgstr "" -#: ../../library/inspect.rst:444 +#: ../../library/inspect.rst:447 msgid "" "This may be of use for sync functions that return a :term:`coroutine`, if " "the function is passed to an API that requires :func:`iscoroutinefunction`." msgstr "" -#: ../../library/inspect.rst:447 +#: ../../library/inspect.rst:450 msgid "" "When possible, using an :keyword:`async def` function is preferred. Also " -"acceptable is calling the function and testing the return " -"with :func:`iscoroutine`." +"acceptable is calling the function and testing the return with :func:" +"`iscoroutine`." msgstr "" -#: ../../library/inspect.rst:456 +#: ../../library/inspect.rst:459 msgid "" -"Return ``True`` if the object is a :term:`coroutine` created by " -"an :keyword:`async def` function." +"Return ``True`` if the object is a :term:`coroutine` created by an :keyword:" +"`async def` function." msgstr "" -#: ../../library/inspect.rst:464 +#: ../../library/inspect.rst:467 msgid "" "Return ``True`` if the object can be used in :keyword:`await` expression." msgstr "" -#: ../../library/inspect.rst:466 +#: ../../library/inspect.rst:469 msgid "" "Can also be used to distinguish generator-based coroutines from regular " "generators:" msgstr "" -#: ../../library/inspect.rst:469 +#: ../../library/inspect.rst:472 msgid "" "import types\n" "\n" @@ -828,13 +836,13 @@ msgstr "" "assert not isawaitable(gen())\n" "assert isawaitable(gen_coro())" -#: ../../library/inspect.rst:487 +#: ../../library/inspect.rst:490 msgid "" "Return ``True`` if the object is an :term:`asynchronous generator` function, " "for example:" msgstr "" -#: ../../library/inspect.rst:490 +#: ../../library/inspect.rst:493 msgid "" ">>> async def agen():\n" "... yield 1\n" @@ -843,66 +851,65 @@ msgid "" "True" msgstr "" -#: ../../library/inspect.rst:500 +#: ../../library/inspect.rst:503 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is an :term:`asynchronous generator` function." msgstr "" -#: ../../library/inspect.rst:510 +#: ../../library/inspect.rst:513 msgid "" "Return ``True`` if the object is an :term:`asynchronous generator iterator` " "created by an :term:`asynchronous generator` function." msgstr "" -#: ../../library/inspect.rst:517 +#: ../../library/inspect.rst:520 msgid "Return ``True`` if the object is a traceback." msgstr "" -#: ../../library/inspect.rst:522 +#: ../../library/inspect.rst:525 msgid "Return ``True`` if the object is a frame." msgstr "" -#: ../../library/inspect.rst:527 +#: ../../library/inspect.rst:530 msgid "Return ``True`` if the object is a code." msgstr "如果物件是程式碼,則回傳 ``True``。" -#: ../../library/inspect.rst:532 +#: ../../library/inspect.rst:535 msgid "" "Return ``True`` if the object is a built-in function or a bound built-in " "method." msgstr "" -#: ../../library/inspect.rst:537 +#: ../../library/inspect.rst:540 msgid "" "Return ``True`` if the type of object is a :class:`~types.MethodWrapperType`." msgstr "" -#: ../../library/inspect.rst:539 +#: ../../library/inspect.rst:542 msgid "" -"These are instances of :class:`~types.MethodWrapperType`, such " -"as :meth:`~object.__str__`, :meth:`~object.__eq__` " -"and :meth:`~object.__repr__`." +"These are instances of :class:`~types.MethodWrapperType`, such as :meth:" +"`~object.__str__`, :meth:`~object.__eq__` and :meth:`~object.__repr__`." msgstr "" -#: ../../library/inspect.rst:547 +#: ../../library/inspect.rst:550 msgid "" "Return ``True`` if the object is a user-defined or built-in function or " "method." msgstr "如果物件是使用者定義或內建的函式或方法,則回傳 ``True``。" -#: ../../library/inspect.rst:552 +#: ../../library/inspect.rst:555 msgid "Return ``True`` if the object is an abstract base class." msgstr "如果物件是抽象基底類別,則回傳 ``True``。" -#: ../../library/inspect.rst:557 +#: ../../library/inspect.rst:560 msgid "" -"Return ``True`` if the object is a method descriptor, but not " -"if :func:`ismethod`, :func:`isclass`, :func:`isfunction` " -"or :func:`isbuiltin` are true." +"Return ``True`` if the object is a method descriptor, but not if :func:" +"`ismethod`, :func:`isclass`, :func:`isfunction` or :func:`isbuiltin` are " +"true." msgstr "" -#: ../../library/inspect.rst:561 +#: ../../library/inspect.rst:564 msgid "" "This, for example, is true of ``int.__add__``. An object passing this test " "has a :meth:`~object.__get__` method, but not a :meth:`~object.__set__` " @@ -911,79 +918,77 @@ msgid "" "sensible, and :attr:`~definition.__doc__` often is." msgstr "" -#: ../../library/inspect.rst:567 +#: ../../library/inspect.rst:570 msgid "" "Methods implemented via descriptors that also pass one of the other tests " "return ``False`` from the :func:`ismethoddescriptor` test, simply because " -"the other tests promise more -- you can, e.g., count on having " -"the :attr:`~method.__func__` attribute (etc) when an object " -"passes :func:`ismethod`." +"the other tests promise more -- you can, e.g., count on having the :attr:" +"`~method.__func__` attribute (etc) when an object passes :func:`ismethod`." msgstr "" -#: ../../library/inspect.rst:573 +#: ../../library/inspect.rst:576 msgid "" -"This function no longer incorrectly reports objects " -"with :meth:`~object.__get__` and :meth:`~object.__delete__`, but " -"not :meth:`~object.__set__`, as being method descriptors (such objects are " -"data descriptors, not method descriptors)." +"This function no longer incorrectly reports objects with :meth:`~object." +"__get__` and :meth:`~object.__delete__`, but not :meth:`~object.__set__`, as " +"being method descriptors (such objects are data descriptors, not method " +"descriptors)." msgstr "" -#: ../../library/inspect.rst:581 +#: ../../library/inspect.rst:584 msgid "Return ``True`` if the object is a data descriptor." msgstr "如果物件是資料描述器,則回傳 ``True``。" -#: ../../library/inspect.rst:583 +#: ../../library/inspect.rst:586 msgid "" -"Data descriptors have a :attr:`~object.__set__` or " -"a :attr:`~object.__delete__` method. Examples are properties (defined in " -"Python), getsets, and members. The latter two are defined in C and there " -"are more specific tests available for those types, which is robust across " -"Python implementations. Typically, data descriptors will also " -"have :attr:`~definition.__name__` and :attr:`!__doc__` attributes " -"(properties, getsets, and members have both of these attributes), but this " -"is not guaranteed." +"Data descriptors have a :attr:`~object.__set__` or a :attr:`~object." +"__delete__` method. Examples are properties (defined in Python), getsets, " +"and members. The latter two are defined in C and there are more specific " +"tests available for those types, which is robust across Python " +"implementations. Typically, data descriptors will also have :attr:" +"`~definition.__name__` and :attr:`!__doc__` attributes (properties, getsets, " +"and members have both of these attributes), but this is not guaranteed." msgstr "" -#: ../../library/inspect.rst:594 +#: ../../library/inspect.rst:597 msgid "Return ``True`` if the object is a getset descriptor." msgstr "" -#: ../../library/inspect.rst:598 +#: ../../library/inspect.rst:601 msgid "" -"getsets are attributes defined in extension modules " -"via :c:type:`PyGetSetDef` structures. For Python implementations without " -"such types, this method will always return ``False``." +"getsets are attributes defined in extension modules via :c:type:" +"`PyGetSetDef` structures. For Python implementations without such types, " +"this method will always return ``False``." msgstr "" -#: ../../library/inspect.rst:605 +#: ../../library/inspect.rst:608 msgid "Return ``True`` if the object is a member descriptor." msgstr "如果物件是成員描述器,則回傳 ``True``。" -#: ../../library/inspect.rst:609 +#: ../../library/inspect.rst:612 msgid "" -"Member descriptors are attributes defined in extension modules " -"via :c:type:`PyMemberDef` structures. For Python implementations without " -"such types, this method will always return ``False``." +"Member descriptors are attributes defined in extension modules via :c:type:" +"`PyMemberDef` structures. For Python implementations without such types, " +"this method will always return ``False``." msgstr "" -#: ../../library/inspect.rst:617 +#: ../../library/inspect.rst:620 msgid "Retrieving source code" msgstr "取得原始碼" -#: ../../library/inspect.rst:621 +#: ../../library/inspect.rst:624 msgid "" -"Get the documentation string for an object, cleaned up " -"with :func:`cleandoc`. If the documentation string for an object is not " -"provided and the object is a class, a method, a property or a descriptor, " -"retrieve the documentation string from the inheritance hierarchy. Return " -"``None`` if the documentation string is invalid or missing." +"Get the documentation string for an object, cleaned up with :func:" +"`cleandoc`. If the documentation string for an object is not provided and " +"the object is a class, a method, a property or a descriptor, retrieve the " +"documentation string from the inheritance hierarchy. Return ``None`` if the " +"documentation string is invalid or missing." msgstr "" -#: ../../library/inspect.rst:627 +#: ../../library/inspect.rst:630 msgid "Documentation strings are now inherited if not overridden." msgstr "" -#: ../../library/inspect.rst:633 +#: ../../library/inspect.rst:636 msgid "" "Return in a single string any lines of comments immediately preceding the " "object's source code (for a class, function, or method), or at the top of " @@ -992,27 +997,27 @@ msgid "" "been defined in C or the interactive shell." msgstr "" -#: ../../library/inspect.rst:642 +#: ../../library/inspect.rst:645 msgid "" "Return the name of the (text or binary) file in which an object was defined. " "This will fail with a :exc:`TypeError` if the object is a built-in module, " "class, or function." msgstr "" -#: ../../library/inspect.rst:649 +#: ../../library/inspect.rst:652 msgid "" "Try to guess which module an object was defined in. Return ``None`` if the " "module cannot be determined." msgstr "" -#: ../../library/inspect.rst:655 +#: ../../library/inspect.rst:658 msgid "" "Return the name of the Python source file in which an object was defined or " "``None`` if no way can be identified to get the source. This will fail with " "a :exc:`TypeError` if the object is a built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:663 +#: ../../library/inspect.rst:666 msgid "" "Return a list of source lines and starting line number for an object. The " "argument may be a module, class, method, function, traceback, frame, or code " @@ -1023,13 +1028,13 @@ msgid "" "built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:672 ../../library/inspect.rst:686 +#: ../../library/inspect.rst:675 ../../library/inspect.rst:689 msgid "" ":exc:`OSError` is raised instead of :exc:`IOError`, now an alias of the " "former." msgstr "" -#: ../../library/inspect.rst:679 +#: ../../library/inspect.rst:682 msgid "" "Return the text of the source code for an object. The argument may be a " "module, class, method, function, traceback, frame, or code object. The " @@ -1038,13 +1043,13 @@ msgid "" "object is a built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:693 +#: ../../library/inspect.rst:696 msgid "" "Clean up indentation from docstrings that are indented to line up with " "blocks of code." msgstr "" -#: ../../library/inspect.rst:696 +#: ../../library/inspect.rst:699 msgid "" "All leading whitespace is removed from the first line. Any leading " "whitespace that can be uniformly removed from the second line onwards is " @@ -1052,22 +1057,22 @@ msgid "" "Also, all tabs are expanded to spaces." msgstr "" -#: ../../library/inspect.rst:705 +#: ../../library/inspect.rst:708 msgid "Introspecting callables with the Signature object" msgstr "" -#: ../../library/inspect.rst:709 +#: ../../library/inspect.rst:712 msgid "" "The :class:`Signature` object represents the call signature of a callable " "object and its return annotation. To retrieve a :class:`!Signature` object, " "use the :func:`!signature` function." msgstr "" -#: ../../library/inspect.rst:716 +#: ../../library/inspect.rst:719 msgid "Return a :class:`Signature` object for the given *callable*:" msgstr "" -#: ../../library/inspect.rst:718 +#: ../../library/inspect.rst:721 msgid "" ">>> from inspect import signature\n" ">>> def foo(a, *, b:int, **kwargs):\n" @@ -1099,68 +1104,66 @@ msgstr "" ">>> sig.parameters['b'].annotation\n" "" -#: ../../library/inspect.rst:735 +#: ../../library/inspect.rst:738 msgid "" "Accepts a wide range of Python callables, from plain functions and classes " "to :func:`functools.partial` objects." msgstr "" -#: ../../library/inspect.rst:738 +#: ../../library/inspect.rst:741 msgid "" "If some of the annotations are strings (e.g., because ``from __future__ " "import annotations`` was used), :func:`signature` will attempt to " -"automatically un-stringize the annotations " -"using :func:`annotationlib.get_annotations`. The *globals*, *locals*, and " -"*eval_str* parameters are passed into :func:`!annotationlib.get_annotations` " -"when resolving the annotations; see the documentation for :func:`!" -"annotationlib.get_annotations` for instructions on how to use these " -"parameters. A member of the :class:`annotationlib.Format` enum can be passed " -"to the *annotation_format* parameter to control the format of the returned " -"annotations. For example, use " -"``annotation_format=annotationlib.Format.STRING`` to return annotations in " -"string format." -msgstr "" - -#: ../../library/inspect.rst:752 -msgid "" -"Raises :exc:`ValueError` if no signature can be provided, " -"and :exc:`TypeError` if that type of object is not supported. Also, if the " +"automatically un-stringize the annotations using :func:`annotationlib." +"get_annotations`. The *globals*, *locals*, and *eval_str* parameters are " +"passed into :func:`!annotationlib.get_annotations` when resolving the " +"annotations; see the documentation for :func:`!annotationlib." +"get_annotations` for instructions on how to use these parameters. A member " +"of the :class:`annotationlib.Format` enum can be passed to the " +"*annotation_format* parameter to control the format of the returned " +"annotations. For example, use ``annotation_format=annotationlib.Format." +"STRING`` to return annotations in string format." +msgstr "" + +#: ../../library/inspect.rst:755 +msgid "" +"Raises :exc:`ValueError` if no signature can be provided, and :exc:" +"`TypeError` if that type of object is not supported. Also, if the " "annotations are stringized, and *eval_str* is not false, the ``eval()`` " -"call(s) to un-stringize the annotations " -"in :func:`annotationlib.get_annotations` could potentially raise any kind of " -"exception." +"call(s) to un-stringize the annotations in :func:`annotationlib." +"get_annotations` could potentially raise any kind of exception." msgstr "" -#: ../../library/inspect.rst:758 +#: ../../library/inspect.rst:761 msgid "" "A slash (/) in the signature of a function denotes that the parameters prior " "to it are positional-only. For more info, see :ref:`the FAQ entry on " "positional-only parameters `." msgstr "" -#: ../../library/inspect.rst:762 +#: ../../library/inspect.rst:765 msgid "" "The *follow_wrapped* parameter was added. Pass ``False`` to get a signature " "of *callable* specifically (``callable.__wrapped__`` will not be used to " "unwrap decorated callables.)" msgstr "" -#: ../../library/inspect.rst:768 ../../library/inspect.rst:904 +#: ../../library/inspect.rst:771 ../../library/inspect.rst:907 msgid "The *globals*, *locals*, and *eval_str* parameters were added." msgstr "" -#: ../../library/inspect.rst:771 +#: ../../library/inspect.rst:774 msgid "The *annotation_format* parameter was added." msgstr "" -#: ../../library/inspect.rst:776 +#: ../../library/inspect.rst:779 msgid "" "Some callables may not be introspectable in certain implementations of " "Python. For example, in CPython, some built-in functions defined in C " "provide no metadata about their arguments." msgstr "" -#: ../../library/inspect.rst:782 +#: ../../library/inspect.rst:785 msgid "" "If the passed object has a :attr:`!__signature__` attribute, we may use it " "to create the signature. The exact semantics are an implementation detail " @@ -1168,14 +1171,14 @@ msgid "" "semantics." msgstr "" -#: ../../library/inspect.rst:790 +#: ../../library/inspect.rst:793 msgid "" "A :class:`!Signature` object represents the call signature of a function and " "its return annotation. For each parameter accepted by the function it " "stores a :class:`Parameter` object in its :attr:`parameters` collection." msgstr "" -#: ../../library/inspect.rst:795 +#: ../../library/inspect.rst:798 msgid "" "The optional *parameters* argument is a sequence of :class:`Parameter` " "objects, which is validated to check that there are no parameters with " @@ -1184,54 +1187,54 @@ msgid "" "defaults follow parameters without defaults." msgstr "" -#: ../../library/inspect.rst:801 +#: ../../library/inspect.rst:804 msgid "" "The optional *return_annotation* argument can be an arbitrary Python object. " "It represents the \"return\" annotation of the callable." msgstr "" -#: ../../library/inspect.rst:804 +#: ../../library/inspect.rst:807 msgid "" ":class:`!Signature` objects are *immutable*. Use :meth:`Signature.replace` " "or :func:`copy.replace` to make a modified copy." msgstr "" -#: ../../library/inspect.rst:807 +#: ../../library/inspect.rst:810 msgid ":class:`!Signature` objects are now picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:812 +#: ../../library/inspect.rst:815 msgid "A special class-level marker to specify absence of a return annotation." msgstr "" -#: ../../library/inspect.rst:816 +#: ../../library/inspect.rst:819 msgid "" -"An ordered mapping of parameters' names to the " -"corresponding :class:`Parameter` objects. Parameters appear in strict " -"definition order, including keyword-only parameters." +"An ordered mapping of parameters' names to the corresponding :class:" +"`Parameter` objects. Parameters appear in strict definition order, " +"including keyword-only parameters." msgstr "" -#: ../../library/inspect.rst:820 ../../library/inspect.rst:1184 +#: ../../library/inspect.rst:823 ../../library/inspect.rst:1187 msgid "" "Python only explicitly guaranteed that it preserved the declaration order of " "keyword-only parameters as of version 3.7, although in practice this order " "had always been preserved in Python 3." msgstr "" -#: ../../library/inspect.rst:827 +#: ../../library/inspect.rst:830 msgid "" "The \"return\" annotation for the callable. If the callable has no " "\"return\" annotation, this attribute is set to :attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:832 +#: ../../library/inspect.rst:835 msgid "" "Create a mapping from positional and keyword arguments to parameters. " "Returns :class:`BoundArguments` if ``*args`` and ``**kwargs`` match the " "signature, or raises a :exc:`TypeError`." msgstr "" -#: ../../library/inspect.rst:838 +#: ../../library/inspect.rst:841 msgid "" "Works the same way as :meth:`Signature.bind`, but allows the omission of " "some required arguments (mimics :func:`functools.partial` behavior.) " @@ -1239,16 +1242,16 @@ msgid "" "arguments do not match the signature." msgstr "" -#: ../../library/inspect.rst:845 +#: ../../library/inspect.rst:848 msgid "" -"Create a new :class:`Signature` instance based on the " -"instance :meth:`replace` was invoked on. It is possible to pass different " -"*parameters* and/or *return_annotation* to override the corresponding " -"properties of the base signature. To remove ``return_annotation`` from the " -"copied :class:`!Signature`, pass in :attr:`Signature.empty`." +"Create a new :class:`Signature` instance based on the instance :meth:" +"`replace` was invoked on. It is possible to pass different *parameters* and/" +"or *return_annotation* to override the corresponding properties of the base " +"signature. To remove ``return_annotation`` from the copied :class:`!" +"Signature`, pass in :attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:853 +#: ../../library/inspect.rst:856 msgid "" ">>> def test(a, b):\n" "... pass\n" @@ -1266,47 +1269,47 @@ msgstr "" ">>> str(new_sig)\n" "\"(a, b) -> 'new return anno'\"" -#: ../../library/inspect.rst:863 +#: ../../library/inspect.rst:866 msgid "" -":class:`Signature` objects are also supported by the generic " -"function :func:`copy.replace`." +":class:`Signature` objects are also supported by the generic function :func:" +"`copy.replace`." msgstr "" -#: ../../library/inspect.rst:868 +#: ../../library/inspect.rst:871 msgid "Create a string representation of the :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:870 +#: ../../library/inspect.rst:873 msgid "" "If *max_width* is passed, the method will attempt to fit the signature into " "lines of at most *max_width* characters. If the signature is longer than " "*max_width*, all parameters will be on separate lines." msgstr "" -#: ../../library/inspect.rst:875 +#: ../../library/inspect.rst:878 msgid "" "If *quote_annotation_strings* is False, :term:`annotations ` in " "the signature are displayed without opening and closing quotation marks if " -"they are strings. This is useful if the signature was created with " -"the :attr:`~annotationlib.Format.STRING` format or if ``from __future__ " -"import annotations`` was used." +"they are strings. This is useful if the signature was created with the :attr:" +"`~annotationlib.Format.STRING` format or if ``from __future__ import " +"annotations`` was used." msgstr "" -#: ../../library/inspect.rst:883 +#: ../../library/inspect.rst:886 msgid "The *unquote_annotations* parameter was added." msgstr "" -#: ../../library/inspect.rst:888 +#: ../../library/inspect.rst:891 msgid "" "Return a :class:`Signature` (or its subclass) object for a given callable " "*obj*." msgstr "" -#: ../../library/inspect.rst:891 +#: ../../library/inspect.rst:894 msgid "This method simplifies subclassing of :class:`Signature`:" msgstr "" -#: ../../library/inspect.rst:893 +#: ../../library/inspect.rst:896 msgid "" "class MySignature(Signature):\n" " pass\n" @@ -1318,130 +1321,129 @@ msgstr "" "sig = MySignature.from_callable(sum)\n" "assert isinstance(sig, MySignature)" -#: ../../library/inspect.rst:900 +#: ../../library/inspect.rst:903 msgid "Its behavior is otherwise identical to that of :func:`signature`." msgstr "" -#: ../../library/inspect.rst:910 +#: ../../library/inspect.rst:913 msgid "" ":class:`!Parameter` objects are *immutable*. Instead of modifying a :class:`!" -"Parameter` object, you can use :meth:`Parameter.replace` " -"or :func:`copy.replace` to create a modified copy." +"Parameter` object, you can use :meth:`Parameter.replace` or :func:`copy." +"replace` to create a modified copy." msgstr "" -#: ../../library/inspect.rst:914 +#: ../../library/inspect.rst:917 msgid "Parameter objects are now picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:919 +#: ../../library/inspect.rst:922 msgid "" "A special class-level marker to specify absence of default values and " "annotations." msgstr "" -#: ../../library/inspect.rst:924 +#: ../../library/inspect.rst:927 msgid "" "The name of the parameter as a string. The name must be a valid Python " "identifier." msgstr "" -#: ../../library/inspect.rst:929 +#: ../../library/inspect.rst:932 msgid "" "CPython generates implicit parameter names of the form ``.0`` on the code " "objects used to implement comprehensions and generator expressions." msgstr "" -#: ../../library/inspect.rst:933 +#: ../../library/inspect.rst:936 msgid "" "These parameter names are now exposed by this module as names like " "``implicit0``." msgstr "" -#: ../../library/inspect.rst:939 +#: ../../library/inspect.rst:942 msgid "" "The default value for the parameter. If the parameter has no default value, " "this attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:944 +#: ../../library/inspect.rst:947 msgid "" "The annotation for the parameter. If the parameter has no annotation, this " "attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:949 +#: ../../library/inspect.rst:952 msgid "" "Describes how argument values are bound to the parameter. The possible " -"values are accessible via :class:`Parameter` (like " -"``Parameter.KEYWORD_ONLY``), and support comparison and ordering, in the " -"following order:" +"values are accessible via :class:`Parameter` (like ``Parameter." +"KEYWORD_ONLY``), and support comparison and ordering, in the following order:" msgstr "" -#: ../../library/inspect.rst:956 +#: ../../library/inspect.rst:959 msgid "Name" msgstr "名稱" -#: ../../library/inspect.rst:956 +#: ../../library/inspect.rst:959 msgid "Meaning" msgstr "意義" -#: ../../library/inspect.rst:958 +#: ../../library/inspect.rst:961 msgid "*POSITIONAL_ONLY*" msgstr "*POSITIONAL_ONLY*" -#: ../../library/inspect.rst:958 +#: ../../library/inspect.rst:961 msgid "" "Value must be supplied as a positional argument. Positional only parameters " "are those which appear before a ``/`` entry (if present) in a Python " "function definition." msgstr "" -#: ../../library/inspect.rst:963 +#: ../../library/inspect.rst:966 msgid "*POSITIONAL_OR_KEYWORD*" msgstr "*POSITIONAL_OR_KEYWORD*" -#: ../../library/inspect.rst:963 +#: ../../library/inspect.rst:966 msgid "" "Value may be supplied as either a keyword or positional argument (this is " "the standard binding behaviour for functions implemented in Python.)" msgstr "" -#: ../../library/inspect.rst:968 +#: ../../library/inspect.rst:971 msgid "*VAR_POSITIONAL*" msgstr "*VAR_POSITIONAL*" -#: ../../library/inspect.rst:968 +#: ../../library/inspect.rst:971 msgid "" "A tuple of positional arguments that aren't bound to any other parameter. " "This corresponds to a ``*args`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:973 +#: ../../library/inspect.rst:976 msgid "*KEYWORD_ONLY*" msgstr "*KEYWORD_ONLY*" -#: ../../library/inspect.rst:973 +#: ../../library/inspect.rst:976 msgid "" "Value must be supplied as a keyword argument. Keyword only parameters are " "those which appear after a ``*`` or ``*args`` entry in a Python function " "definition." msgstr "" -#: ../../library/inspect.rst:978 +#: ../../library/inspect.rst:981 msgid "*VAR_KEYWORD*" msgstr "*VAR_KEYWORD*" -#: ../../library/inspect.rst:978 +#: ../../library/inspect.rst:981 msgid "" "A dict of keyword arguments that aren't bound to any other parameter. This " "corresponds to a ``**kwargs`` parameter in a Python function definition." msgstr "" -#: ../../library/inspect.rst:984 +#: ../../library/inspect.rst:987 msgid "Example: print all keyword-only arguments without default values:" msgstr "" -#: ../../library/inspect.rst:986 +#: ../../library/inspect.rst:989 msgid "" ">>> def foo(a, b, *, c, d=10):\n" "... pass\n" @@ -1463,15 +1465,15 @@ msgstr "" "... print('Parameter:', param)\n" "Parameter: c" -#: ../../library/inspect.rst:1000 +#: ../../library/inspect.rst:1003 msgid "Describes an enum value of :attr:`Parameter.kind`." msgstr "" -#: ../../library/inspect.rst:1004 +#: ../../library/inspect.rst:1007 msgid "Example: print all descriptions of arguments:" msgstr "範例:列印所有引數的描述:" -#: ../../library/inspect.rst:1006 +#: ../../library/inspect.rst:1009 msgid "" ">>> def foo(a, b, *, c, d=10):\n" "... pass\n" @@ -1495,7 +1497,7 @@ msgstr "" "keyword-only\n" "keyword-only" -#: ../../library/inspect.rst:1021 +#: ../../library/inspect.rst:1024 msgid "" "Create a new :class:`Parameter` instance based on the instance replaced was " "invoked on. To override a :class:`!Parameter` attribute, pass the " @@ -1503,7 +1505,7 @@ msgid "" "a :class:`!Parameter`, pass :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:1026 +#: ../../library/inspect.rst:1029 msgid "" ">>> from inspect import Parameter\n" ">>> param = Parameter('foo', Parameter.KEYWORD_ONLY, default=42)\n" @@ -1527,83 +1529,83 @@ msgstr "" ">>> str(param.replace(default=Parameter.empty, annotation='spam'))\n" "\"foo: 'spam'\"" -#: ../../library/inspect.rst:1039 +#: ../../library/inspect.rst:1042 msgid "" -":class:`Parameter` objects are also supported by the generic " -"function :func:`copy.replace`." +":class:`Parameter` objects are also supported by the generic function :func:" +"`copy.replace`." msgstr "" -#: ../../library/inspect.rst:1042 +#: ../../library/inspect.rst:1045 msgid "" "In Python 3.3 :class:`Parameter` objects were allowed to have ``name`` set " "to ``None`` if their ``kind`` was set to ``POSITIONAL_ONLY``. This is no " "longer permitted." msgstr "" -#: ../../library/inspect.rst:1049 +#: ../../library/inspect.rst:1052 msgid "" "Result of a :meth:`Signature.bind` or :meth:`Signature.bind_partial` call. " "Holds the mapping of arguments to the function's parameters." msgstr "" -#: ../../library/inspect.rst:1054 +#: ../../library/inspect.rst:1057 msgid "" "A mutable mapping of parameters' names to arguments' values. Contains only " -"explicitly bound arguments. Changes in :attr:`arguments` will reflect " -"in :attr:`args` and :attr:`kwargs`." +"explicitly bound arguments. Changes in :attr:`arguments` will reflect in :" +"attr:`args` and :attr:`kwargs`." msgstr "" -#: ../../library/inspect.rst:1058 +#: ../../library/inspect.rst:1061 msgid "" "Should be used in conjunction with :attr:`Signature.parameters` for any " "argument processing purposes." msgstr "" -#: ../../library/inspect.rst:1063 +#: ../../library/inspect.rst:1066 msgid "" "Arguments for which :meth:`Signature.bind` or :meth:`Signature.bind_partial` " -"relied on a default value are skipped. However, if needed, " -"use :meth:`BoundArguments.apply_defaults` to add them." +"relied on a default value are skipped. However, if needed, use :meth:" +"`BoundArguments.apply_defaults` to add them." msgstr "" -#: ../../library/inspect.rst:1068 +#: ../../library/inspect.rst:1071 msgid "" -":attr:`arguments` is now of type :class:`dict`. Formerly, it was of " -"type :class:`collections.OrderedDict`." +":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :" +"class:`collections.OrderedDict`." msgstr "" -#: ../../library/inspect.rst:1074 +#: ../../library/inspect.rst:1077 msgid "" -"A tuple of positional arguments values. Dynamically computed from " -"the :attr:`arguments` attribute." +"A tuple of positional arguments values. Dynamically computed from the :attr:" +"`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:1079 +#: ../../library/inspect.rst:1082 msgid "" -"A dict of keyword arguments values. Dynamically computed from " -"the :attr:`arguments` attribute. Arguments that can be passed positionally " -"are included in :attr:`args` instead." +"A dict of keyword arguments values. Dynamically computed from the :attr:" +"`arguments` attribute. Arguments that can be passed positionally are " +"included in :attr:`args` instead." msgstr "" -#: ../../library/inspect.rst:1085 +#: ../../library/inspect.rst:1088 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:1089 +#: ../../library/inspect.rst:1092 msgid "Set default values for missing arguments." msgstr "為遺漏的引數設定預設值。" -#: ../../library/inspect.rst:1091 +#: ../../library/inspect.rst:1094 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: ../../library/inspect.rst:1094 +#: ../../library/inspect.rst:1097 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: ../../library/inspect.rst:1097 +#: ../../library/inspect.rst:1100 msgid "" ">>> def foo(a, b='ham', *args): pass\n" ">>> ba = inspect.signature(foo).bind('spam')\n" @@ -1617,13 +1619,13 @@ msgstr "" ">>> ba.arguments\n" "{'a': 'spam', 'b': 'ham', 'args': ()}" -#: ../../library/inspect.rst:1107 +#: ../../library/inspect.rst:1110 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " "functions:" msgstr "" -#: ../../library/inspect.rst:1110 +#: ../../library/inspect.rst:1113 msgid "" "def test(a, *, b):\n" " ...\n" @@ -1639,19 +1641,19 @@ msgstr "" "ba = sig.bind(10, b=20)\n" "test(*ba.args, **ba.kwargs)" -#: ../../library/inspect.rst:1122 +#: ../../library/inspect.rst:1125 msgid ":pep:`362` - Function Signature Object." msgstr "" -#: ../../library/inspect.rst:1123 +#: ../../library/inspect.rst:1126 msgid "The detailed specification, implementation details and examples." msgstr "" -#: ../../library/inspect.rst:1129 +#: ../../library/inspect.rst:1132 msgid "Classes and functions" msgstr "類別與函式" -#: ../../library/inspect.rst:1133 +#: ../../library/inspect.rst:1136 msgid "" "Arrange the given list of classes into a hierarchy of nested lists. Where a " "nested list appears, it contains classes derived from the class whose entry " @@ -1662,19 +1664,19 @@ msgid "" "will appear multiple times." msgstr "" -#: ../../library/inspect.rst:1144 +#: ../../library/inspect.rst:1147 msgid "" -"Get the names and default values of a Python function's parameters. " -"A :term:`named tuple` is returned:" +"Get the names and default values of a Python function's parameters. A :term:" +"`named tuple` is returned:" msgstr "" -#: ../../library/inspect.rst:1147 +#: ../../library/inspect.rst:1150 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" msgstr "" -#: ../../library/inspect.rst:1150 +#: ../../library/inspect.rst:1153 msgid "" "*args* is a list of the positional parameter names. *varargs* is the name of " "the ``*`` parameter or ``None`` if arbitrary positional arguments are not " @@ -1689,7 +1691,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: ../../library/inspect.rst:1165 +#: ../../library/inspect.rst:1168 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1699,43 +1701,42 @@ msgid "" "``inspect`` module API." msgstr "" -#: ../../library/inspect.rst:1172 +#: ../../library/inspect.rst:1175 msgid "" "This function is now based on :func:`signature`, but still ignores " "``__wrapped__`` attributes and includes the already bound first parameter in " "the signature output for bound methods." msgstr "" -#: ../../library/inspect.rst:1177 +#: ../../library/inspect.rst:1180 msgid "" -"This method was previously documented as deprecated in favour " -"of :func:`signature` in Python 3.5, but that decision has been reversed in " -"order to restore a clearly supported standard interface for single-source " -"Python 2/3 code migrating away from the legacy :func:`!getargspec` API." +"This method was previously documented as deprecated in favour of :func:" +"`signature` in Python 3.5, but that decision has been reversed in order to " +"restore a clearly supported standard interface for single-source Python 2/3 " +"code migrating away from the legacy :func:`!getargspec` API." msgstr "" -#: ../../library/inspect.rst:1192 +#: ../../library/inspect.rst:1195 msgid "" -"Get information about arguments passed into a particular frame. " -"A :term:`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is " -"returned. *args* is a list of the argument names. *varargs* and *keywords* " -"are the names of the ``*`` and ``**`` arguments or ``None``. *locals* is " -"the locals dictionary of the given frame." +"Get information about arguments passed into a particular frame. A :term:" +"`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " +"*args* is a list of the argument names. *varargs* and *keywords* are the " +"names of the ``*`` and ``**`` arguments or ``None``. *locals* is the locals " +"dictionary of the given frame." msgstr "" -#: ../../library/inspect.rst:1199 ../../library/inspect.rst:1209 +#: ../../library/inspect.rst:1202 ../../library/inspect.rst:1212 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: ../../library/inspect.rst:1204 +#: ../../library/inspect.rst:1207 msgid "" -"Format a pretty argument spec from the four values returned " -"by :func:`getargvalues`. The format\\* arguments are the corresponding " -"optional formatting functions that are called to turn names and values into " -"strings." +"Format a pretty argument spec from the four values returned by :func:" +"`getargvalues`. The format\\* arguments are the corresponding optional " +"formatting functions that are called to turn names and values into strings." msgstr "" -#: ../../library/inspect.rst:1214 +#: ../../library/inspect.rst:1217 msgid "" "Return a tuple of class cls's base classes, including cls, in method " "resolution order. No class appears more than once in this tuple. Note that " @@ -1743,7 +1744,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: ../../library/inspect.rst:1222 +#: ../../library/inspect.rst:1225 msgid "" "Bind the *args* and *kwds* to the argument names of the Python function or " "method *func*, as if it was called with them. For bound methods, bind also " @@ -1756,7 +1757,7 @@ msgid "" "example:" msgstr "" -#: ../../library/inspect.rst:1231 +#: ../../library/inspect.rst:1234 msgid "" ">>> from inspect import getcallargs\n" ">>> def f(a, b=1, *pos, **named):\n" @@ -1786,11 +1787,11 @@ msgstr "" "...\n" "TypeError: f() missing 1 required positional argument: 'a'" -#: ../../library/inspect.rst:1248 +#: ../../library/inspect.rst:1251 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." msgstr "請改用 :meth:`Signature.bind` 與 :meth:`Signature.bind_partial`。" -#: ../../library/inspect.rst:1254 +#: ../../library/inspect.rst:1257 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1802,58 +1803,58 @@ msgid "" "builtins." msgstr "" -#: ../../library/inspect.rst:1263 +#: ../../library/inspect.rst:1266 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." msgstr "如果 *func* 不是 Python 函式或方法,則引發 :exc:`TypeError`。" -#: ../../library/inspect.rst:1270 +#: ../../library/inspect.rst:1273 msgid "" -"Get the object wrapped by *func*. It follows the chain " -"of :attr:`__wrapped__` attributes returning the last object in the chain." +"Get the object wrapped by *func*. It follows the chain of :attr:" +"`__wrapped__` attributes returning the last object in the chain." msgstr "" -#: ../../library/inspect.rst:1273 +#: ../../library/inspect.rst:1276 msgid "" "*stop* is an optional callback accepting an object in the wrapper chain as " "its sole argument that allows the unwrapping to be terminated early if the " "callback returns a true value. If the callback never returns a true value, " -"the last object in the chain is returned as usual. For " -"example, :func:`signature` uses this to stop unwrapping if any object in the " -"chain has a ``__signature__`` attribute defined." +"the last object in the chain is returned as usual. For example, :func:" +"`signature` uses this to stop unwrapping if any object in the chain has a " +"``__signature__`` attribute defined." msgstr "" -#: ../../library/inspect.rst:1280 +#: ../../library/inspect.rst:1283 msgid ":exc:`ValueError` is raised if a cycle is encountered." msgstr "如果遇到循環,則引發 :exc:`ValueError`。" -#: ../../library/inspect.rst:1287 +#: ../../library/inspect.rst:1290 msgid "Compute the annotations dict for an object." msgstr "" -#: ../../library/inspect.rst:1289 +#: ../../library/inspect.rst:1292 msgid "" "This is an alias for :func:`annotationlib.get_annotations`; see the " "documentation of that function for more information." msgstr "" -#: ../../library/inspect.rst:1294 +#: ../../library/inspect.rst:1297 msgid "" -"This function may execute arbitrary code contained in annotations. " -"See :ref:`annotationlib-security` for more information." +"This function may execute arbitrary code contained in annotations. See :ref:" +"`annotationlib-security` for more information." msgstr "" -#: ../../library/inspect.rst:1299 +#: ../../library/inspect.rst:1302 msgid "" "This function is now an alias for :func:`annotationlib.get_annotations`. " "Calling it as ``inspect.get_annotations`` will continue to work." msgstr "" -#: ../../library/inspect.rst:1307 +#: ../../library/inspect.rst:1310 msgid "The interpreter stack" msgstr "直譯器堆疊" -#: ../../library/inspect.rst:1309 +#: ../../library/inspect.rst:1312 msgid "" "Some of the following functions return :class:`FrameInfo` objects. For " "backwards compatibility these objects allow tuple-like operations on all " @@ -1861,95 +1862,95 @@ msgid "" "may be removed in the future." msgstr "" -#: ../../library/inspect.rst:1318 +#: ../../library/inspect.rst:1321 msgid "The :ref:`frame object ` that the record corresponds to." msgstr "" -#: ../../library/inspect.rst:1322 +#: ../../library/inspect.rst:1325 msgid "" "The file name associated with the code being executed by the frame this " "record corresponds to." msgstr "" -#: ../../library/inspect.rst:1327 +#: ../../library/inspect.rst:1330 msgid "" "The line number of the current line associated with the code being executed " "by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1332 +#: ../../library/inspect.rst:1335 msgid "" "The function name that is being executed by the frame this record " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1336 +#: ../../library/inspect.rst:1339 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1341 ../../library/inspect.rst:1380 +#: ../../library/inspect.rst:1344 ../../library/inspect.rst:1383 msgid "" "The index of the current line being executed in the :attr:`code_context` " "list." msgstr "" -#: ../../library/inspect.rst:1345 +#: ../../library/inspect.rst:1348 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this record corresponds to." msgstr "" -#: ../../library/inspect.rst:1349 +#: ../../library/inspect.rst:1352 msgid "Return a :term:`named tuple` instead of a :class:`tuple`." msgstr "" -#: ../../library/inspect.rst:1352 +#: ../../library/inspect.rst:1355 msgid "" ":class:`!FrameInfo` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1361 +#: ../../library/inspect.rst:1364 msgid "" "The file name associated with the code being executed by the frame this " "traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1366 +#: ../../library/inspect.rst:1369 msgid "" "The line number of the current line associated with the code being executed " "by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1371 +#: ../../library/inspect.rst:1374 msgid "" "The function name that is being executed by the frame this traceback " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1375 +#: ../../library/inspect.rst:1378 msgid "" "A list of lines of context from the source code that's being executed by the " "frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1384 +#: ../../library/inspect.rst:1387 msgid "" "A :class:`dis.Positions` object containing the start line number, end line " "number, start column offset, and end column offset associated with the " "instruction being executed by the frame this traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1389 +#: ../../library/inspect.rst:1392 msgid "" ":class:`!Traceback` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1396 +#: ../../library/inspect.rst:1399 msgid "" "Keeping references to frame objects, as found in the first element of the " "frame records these functions return, can cause your program to create " @@ -1961,16 +1962,15 @@ msgid "" "consumption which occurs." msgstr "" -#: ../../library/inspect.rst:1404 +#: ../../library/inspect.rst:1407 msgid "" "Though the cycle detector will catch these, destruction of the frames (and " -"local variables) can be made deterministic by removing the cycle in " -"a :keyword:`finally` clause. This is also important if the cycle detector " -"was disabled when Python was compiled or using :func:`gc.disable`. For " -"example::" +"local variables) can be made deterministic by removing the cycle in a :" +"keyword:`finally` clause. This is also important if the cycle detector was " +"disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: ../../library/inspect.rst:1409 +#: ../../library/inspect.rst:1412 msgid "" "def handle_stackframe_without_leak():\n" " frame = inspect.currentframe()\n" @@ -1980,31 +1980,31 @@ msgid "" " del frame" msgstr "" -#: ../../library/inspect.rst:1416 +#: ../../library/inspect.rst:1419 msgid "" "If you want to keep the frame around (for example to print a traceback " "later), you can also break reference cycles by using the :meth:`frame.clear` " "method." msgstr "" -#: ../../library/inspect.rst:1420 +#: ../../library/inspect.rst:1423 msgid "" "The optional *context* argument supported by most of these functions " "specifies the number of lines of context to return, which are centered " "around the current line." msgstr "" -#: ../../library/inspect.rst:1427 +#: ../../library/inspect.rst:1430 msgid "" "Get information about a frame or traceback object. A :class:`Traceback` " "object is returned." msgstr "" -#: ../../library/inspect.rst:1430 +#: ../../library/inspect.rst:1433 msgid "A :class:`Traceback` object is returned instead of a named tuple." msgstr "" -#: ../../library/inspect.rst:1435 +#: ../../library/inspect.rst:1438 msgid "" "Get a list of :class:`FrameInfo` objects for a frame and all outer frames. " "These frames represent the calls that lead to the creation of *frame*. The " @@ -2012,19 +2012,19 @@ msgid "" "represents the outermost call on *frame*'s stack." msgstr "" -#: ../../library/inspect.rst:1440 ../../library/inspect.rst:1455 -#: ../../library/inspect.rst:1481 ../../library/inspect.rst:1496 +#: ../../library/inspect.rst:1443 ../../library/inspect.rst:1458 +#: ../../library/inspect.rst:1484 ../../library/inspect.rst:1499 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1445 ../../library/inspect.rst:1460 -#: ../../library/inspect.rst:1486 ../../library/inspect.rst:1501 +#: ../../library/inspect.rst:1448 ../../library/inspect.rst:1463 +#: ../../library/inspect.rst:1489 ../../library/inspect.rst:1504 msgid "A list of :class:`FrameInfo` objects is returned." msgstr "回傳一個 :class:`FrameInfo` 物件串列。" -#: ../../library/inspect.rst:1450 +#: ../../library/inspect.rst:1453 msgid "" "Get a list of :class:`FrameInfo` objects for a traceback's frame and all " "inner frames. These frames represent calls made as a consequence of " @@ -2032,11 +2032,11 @@ msgid "" "represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1465 +#: ../../library/inspect.rst:1468 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: ../../library/inspect.rst:1469 +#: ../../library/inspect.rst:1472 msgid "" "This function relies on Python stack frame support in the interpreter, which " "isn't guaranteed to exist in all implementations of Python. If running in " @@ -2044,14 +2044,14 @@ msgid "" "``None``." msgstr "" -#: ../../library/inspect.rst:1477 +#: ../../library/inspect.rst:1480 msgid "" "Return a list of :class:`FrameInfo` objects for the caller's stack. The " "first entry in the returned list represents the caller; the last entry " "represents the outermost call on the stack." msgstr "" -#: ../../library/inspect.rst:1491 +#: ../../library/inspect.rst:1494 msgid "" "Return a list of :class:`FrameInfo` objects for the stack between the " "current frame and the frame in which an exception currently being handled " @@ -2059,32 +2059,32 @@ msgid "" "entry represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1505 +#: ../../library/inspect.rst:1508 msgid "Fetching attributes statically" msgstr "" -#: ../../library/inspect.rst:1507 +#: ../../library/inspect.rst:1510 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " -"properties, will be invoked and :meth:`~object.__getattr__` " -"and :meth:`~object.__getattribute__` may be called." +"properties, will be invoked and :meth:`~object.__getattr__` and :meth:" +"`~object.__getattribute__` may be called." msgstr "" -#: ../../library/inspect.rst:1513 +#: ../../library/inspect.rst:1516 msgid "" "For cases where you want passive introspection, like documentation tools, " -"this can be inconvenient. :func:`getattr_static` has the same signature " -"as :func:`getattr` but avoids executing code when it fetches attributes." +"this can be inconvenient. :func:`getattr_static` has the same signature as :" +"func:`getattr` but avoids executing code when it fetches attributes." msgstr "" -#: ../../library/inspect.rst:1519 +#: ../../library/inspect.rst:1522 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " "protocol, :meth:`~object.__getattr__` or :meth:`~object.__getattribute__`." msgstr "" -#: ../../library/inspect.rst:1523 +#: ../../library/inspect.rst:1526 msgid "" "Note: this function may not be able to retrieve all attributes that getattr " "can fetch (like dynamically created attributes) and may find attributes that " @@ -2092,27 +2092,27 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: ../../library/inspect.rst:1529 +#: ../../library/inspect.rst:1532 msgid "" "If the instance :attr:`~object.__dict__` is shadowed by another member (for " "example a property) then this function will be unable to find instance " "members." msgstr "" -#: ../../library/inspect.rst:1535 +#: ../../library/inspect.rst:1538 msgid "" ":func:`getattr_static` does not resolve descriptors, for example slot " "descriptors or getset descriptors on objects implemented in C. The " "descriptor object is returned instead of the underlying attribute." msgstr "" -#: ../../library/inspect.rst:1539 +#: ../../library/inspect.rst:1542 msgid "" "You can handle these with code like the following. Note that for arbitrary " "getset descriptors invoking these may trigger code execution::" msgstr "" -#: ../../library/inspect.rst:1543 +#: ../../library/inspect.rst:1546 msgid "" "# example code for resolving the builtin descriptor types\n" "class _foo:\n" @@ -2135,11 +2135,11 @@ msgid "" " pass" msgstr "" -#: ../../library/inspect.rst:1565 +#: ../../library/inspect.rst:1568 msgid "Current State of Generators, Coroutines, and Asynchronous Generators" msgstr "" -#: ../../library/inspect.rst:1567 +#: ../../library/inspect.rst:1570 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -2148,32 +2148,32 @@ msgid "" "generator to be determined easily." msgstr "" -#: ../../library/inspect.rst:1575 +#: ../../library/inspect.rst:1578 msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1577 ../../library/inspect.rst:1593 -#: ../../library/inspect.rst:1610 +#: ../../library/inspect.rst:1580 ../../library/inspect.rst:1596 +#: ../../library/inspect.rst:1613 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1579 +#: ../../library/inspect.rst:1582 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1580 +#: ../../library/inspect.rst:1583 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1581 +#: ../../library/inspect.rst:1584 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1582 +#: ../../library/inspect.rst:1585 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1588 +#: ../../library/inspect.rst:1591 msgid "" "Get current state of a coroutine object. The function is intended to be " "used with coroutine objects created by :keyword:`async def` functions, but " @@ -2181,55 +2181,55 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1595 +#: ../../library/inspect.rst:1598 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1596 +#: ../../library/inspect.rst:1599 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1597 +#: ../../library/inspect.rst:1600 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1598 +#: ../../library/inspect.rst:1601 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1604 +#: ../../library/inspect.rst:1607 msgid "" "Get current state of an asynchronous generator object. The function is " -"intended to be used with asynchronous iterator objects created " -"by :keyword:`async def` functions which use the :keyword:`yield` statement, " -"but will accept any asynchronous generator-like object that has " -"``ag_running`` and ``ag_frame`` attributes." +"intended to be used with asynchronous iterator objects created by :keyword:" +"`async def` functions which use the :keyword:`yield` statement, but will " +"accept any asynchronous generator-like object that has ``ag_running`` and " +"``ag_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1612 +#: ../../library/inspect.rst:1615 msgid "AGEN_CREATED: Waiting to start execution." msgstr "AGEN_CREATED: 等待開始執行。" -#: ../../library/inspect.rst:1613 +#: ../../library/inspect.rst:1616 msgid "AGEN_RUNNING: Currently being executed by the interpreter." msgstr "AGEN_RUNNING: 目前正在被直譯器執行。" -#: ../../library/inspect.rst:1614 +#: ../../library/inspect.rst:1617 msgid "AGEN_SUSPENDED: Currently suspended at a yield expression." msgstr "AGEN_SUSPENDED: 目前於 yield 運算式暫停。" -#: ../../library/inspect.rst:1615 +#: ../../library/inspect.rst:1618 msgid "AGEN_CLOSED: Execution has completed." msgstr "AGEN_CLOSED: 執行已完成。" -#: ../../library/inspect.rst:1619 +#: ../../library/inspect.rst:1622 msgid "" "The current internal state of the generator can also be queried. This is " "mostly useful for testing purposes, to ensure that internal state is being " "updated as expected:" msgstr "" -#: ../../library/inspect.rst:1625 +#: ../../library/inspect.rst:1628 msgid "" "Get the mapping of live local variables in *generator* to their current " "values. A dictionary is returned that maps from variable names to values. " @@ -2237,14 +2237,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1630 +#: ../../library/inspect.rst:1633 msgid "" "If *generator* is a :term:`generator` with no currently associated frame, " "then an empty dictionary is returned. :exc:`TypeError` is raised if " "*generator* is not a Python generator object." msgstr "" -#: ../../library/inspect.rst:1636 +#: ../../library/inspect.rst:1639 msgid "" "This function relies on the generator exposing a Python stack frame for " "introspection, which isn't guaranteed to be the case in all implementations " @@ -2252,90 +2252,90 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1645 +#: ../../library/inspect.rst:1648 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1652 +#: ../../library/inspect.rst:1655 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for asynchronous generator objects created by :keyword:`async def` functions " "which use the :keyword:`yield` statement." msgstr "" -#: ../../library/inspect.rst:1662 +#: ../../library/inspect.rst:1665 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1664 +#: ../../library/inspect.rst:1667 msgid "" "Python code objects have a :attr:`~codeobject.co_flags` attribute, which is " "a bitmap of the following flags:" msgstr "" -#: ../../library/inspect.rst:1669 +#: ../../library/inspect.rst:1672 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1673 +#: ../../library/inspect.rst:1676 msgid "" "If set, a new dict will be created for the frame's :attr:`~frame.f_locals` " "when the code object is executed." msgstr "" -#: ../../library/inspect.rst:1678 +#: ../../library/inspect.rst:1681 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1682 +#: ../../library/inspect.rst:1685 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1686 +#: ../../library/inspect.rst:1689 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1690 +#: ../../library/inspect.rst:1693 msgid "" "The flag is set when the code object is a generator function, i.e. a " "generator object is returned when the code object is executed." msgstr "" -#: ../../library/inspect.rst:1695 +#: ../../library/inspect.rst:1698 msgid "" "The flag is set when the code object is a coroutine function. When the code " "object is executed it returns a coroutine object. See :pep:`492` for more " "details." msgstr "" -#: ../../library/inspect.rst:1703 +#: ../../library/inspect.rst:1706 msgid "" "The flag is used to transform generators into generator-based coroutines. " "Generator objects with this flag can be used in ``await`` expression, and " "can ``yield from`` coroutine objects. See :pep:`492` for more details." msgstr "" -#: ../../library/inspect.rst:1712 +#: ../../library/inspect.rst:1715 msgid "" "The flag is set when the code object is an asynchronous generator function. " "When the code object is executed it returns an asynchronous generator " "object. See :pep:`525` for more details." msgstr "" -#: ../../library/inspect.rst:1720 +#: ../../library/inspect.rst:1723 msgid "" "The flag is set when there is a docstring for the code object in the source " "code. If set, it will be the first item in :attr:`~codeobject.co_consts`." msgstr "" -#: ../../library/inspect.rst:1728 +#: ../../library/inspect.rst:1731 msgid "" "The flag is set when the code object is a function defined in class scope." msgstr "" -#: ../../library/inspect.rst:1734 +#: ../../library/inspect.rst:1737 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -2343,39 +2343,39 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1742 +#: ../../library/inspect.rst:1745 msgid "Buffer flags" msgstr "" -#: ../../library/inspect.rst:1746 +#: ../../library/inspect.rst:1749 msgid "" "This is an :class:`enum.IntFlag` that represents the flags that can be " -"passed to the :meth:`~object.__buffer__` method of objects implementing " -"the :ref:`buffer protocol `." +"passed to the :meth:`~object.__buffer__` method of objects implementing the :" +"ref:`buffer protocol `." msgstr "" -#: ../../library/inspect.rst:1750 +#: ../../library/inspect.rst:1753 msgid "The meaning of the flags is explained at :ref:`buffer-request-types`." msgstr "" -#: ../../library/inspect.rst:1777 +#: ../../library/inspect.rst:1780 msgid "Command Line Interface" msgstr "命令列介面" -#: ../../library/inspect.rst:1779 +#: ../../library/inspect.rst:1782 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1784 +#: ../../library/inspect.rst:1787 msgid "" "By default, accepts the name of a module and prints the source of that " "module. A class or function within the module can be printed instead by " "appended a colon and the qualified name of the target object." msgstr "" -#: ../../library/inspect.rst:1790 +#: ../../library/inspect.rst:1793 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/locale.po b/library/locale.po index 03f8db33d2..511cf776da 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: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -53,27 +53,33 @@ msgstr "" msgid "" "If *locale* is given and not ``None``, :func:`setlocale` modifies the locale " "setting for the *category*. The available categories are listed in the data " -"description below. *locale* may be a string, or an iterable of two strings " -"(language code and encoding). If it's an iterable, it's converted to a " -"locale name using the locale aliasing engine. An empty string specifies the " -"user's default settings. If the modification of the locale fails, the " -"exception :exc:`Error` is raised. If successful, the new locale setting is " -"returned." +"description below. *locale* may be a :ref:`string `, or a pair, " +"language code and encoding. An empty string specifies the user's default " +"settings. If the modification of the locale fails, the exception :exc:" +"`Error` is raised. If successful, the new locale setting is returned." +msgstr "" + +#: ../../library/locale.rst:42 +msgid "" +"If *locale* is a pair, it is converted to a locale name using the locale " +"aliasing engine. The language code has the same format as a :ref:`locale " +"name `, but without encoding and ``@``-modifier. The language " +"code and encoding can be ``None``." msgstr "" -#: ../../library/locale.rst:43 +#: ../../library/locale.rst:48 msgid "" "If *locale* is omitted or ``None``, the current setting for *category* is " "returned." msgstr "" -#: ../../library/locale.rst:46 +#: ../../library/locale.rst:51 msgid "" ":func:`setlocale` is not thread-safe on most systems. Applications typically " "start with a call of ::" msgstr "" -#: ../../library/locale.rst:49 +#: ../../library/locale.rst:54 msgid "" "import locale\n" "locale.setlocale(locale.LC_ALL, '')" @@ -81,7 +87,7 @@ msgstr "" "import locale\n" "locale.setlocale(locale.LC_ALL, '')" -#: ../../library/locale.rst:52 +#: ../../library/locale.rst:57 msgid "" "This sets the locale for all categories to the user's default setting " "(typically specified in the :envvar:`LANG` environment variable). If the " @@ -89,246 +95,246 @@ msgid "" "problems." msgstr "" -#: ../../library/locale.rst:59 +#: ../../library/locale.rst:64 msgid "" "Returns the database of the local conventions as a dictionary. This " "dictionary has the following strings as keys:" msgstr "" -#: ../../library/locale.rst:65 +#: ../../library/locale.rst:70 msgid "Category" msgstr "分類" -#: ../../library/locale.rst:65 +#: ../../library/locale.rst:70 msgid "Key" msgstr "" -#: ../../library/locale.rst:65 +#: ../../library/locale.rst:70 msgid "Meaning" msgstr "含義" -#: ../../library/locale.rst:67 +#: ../../library/locale.rst:72 msgid ":const:`LC_NUMERIC`" msgstr ":const:`LC_NUMERIC`" -#: ../../library/locale.rst:67 +#: ../../library/locale.rst:72 msgid "``'decimal_point'``" msgstr "``'decimal_point'``" -#: ../../library/locale.rst:67 +#: ../../library/locale.rst:72 msgid "Decimal point character." msgstr "" -#: ../../library/locale.rst:69 +#: ../../library/locale.rst:74 msgid "``'grouping'``" msgstr "``'grouping'``" -#: ../../library/locale.rst:69 +#: ../../library/locale.rst:74 msgid "" "Sequence of numbers specifying which relative positions the " -"``'thousands_sep'`` is expected. If the sequence is terminated " -"with :const:`CHAR_MAX`, no further grouping is performed. If the sequence " -"terminates with a ``0``, the last group size is repeatedly used." +"``'thousands_sep'`` is expected. If the sequence is terminated with :const:" +"`CHAR_MAX`, no further grouping is performed. If the sequence terminates " +"with a ``0``, the last group size is repeatedly used." msgstr "" -#: ../../library/locale.rst:80 +#: ../../library/locale.rst:85 msgid "``'thousands_sep'``" msgstr "``'thousands_sep'``" -#: ../../library/locale.rst:80 +#: ../../library/locale.rst:85 msgid "Character used between groups." msgstr "" -#: ../../library/locale.rst:82 +#: ../../library/locale.rst:87 msgid ":const:`LC_MONETARY`" msgstr ":const:`LC_MONETARY`" -#: ../../library/locale.rst:82 +#: ../../library/locale.rst:87 msgid "``'int_curr_symbol'``" msgstr "``'int_curr_symbol'``" -#: ../../library/locale.rst:82 +#: ../../library/locale.rst:87 msgid "International currency symbol." msgstr "" -#: ../../library/locale.rst:84 +#: ../../library/locale.rst:89 msgid "``'currency_symbol'``" msgstr "``'currency_symbol'``" -#: ../../library/locale.rst:84 +#: ../../library/locale.rst:89 msgid "Local currency symbol." msgstr "" -#: ../../library/locale.rst:86 +#: ../../library/locale.rst:91 msgid "``'p_cs_precedes/n_cs_precedes'``" msgstr "``'p_cs_precedes/n_cs_precedes'``" -#: ../../library/locale.rst:86 +#: ../../library/locale.rst:91 msgid "" "Whether the currency symbol precedes the value (for positive resp. negative " "values)." msgstr "" -#: ../../library/locale.rst:91 +#: ../../library/locale.rst:96 msgid "``'p_sep_by_space/n_sep_by_space'``" msgstr "``'p_sep_by_space/n_sep_by_space'``" -#: ../../library/locale.rst:91 +#: ../../library/locale.rst:96 msgid "" "Whether the currency symbol is separated from the value by a space (for " "positive resp. negative values)." msgstr "" -#: ../../library/locale.rst:96 +#: ../../library/locale.rst:101 msgid "``'mon_decimal_point'``" msgstr "``'mon_decimal_point'``" -#: ../../library/locale.rst:96 +#: ../../library/locale.rst:101 msgid "Decimal point used for monetary values." msgstr "" -#: ../../library/locale.rst:99 +#: ../../library/locale.rst:104 msgid "``'frac_digits'``" msgstr "``'frac_digits'``" -#: ../../library/locale.rst:99 +#: ../../library/locale.rst:104 msgid "" "Number of fractional digits used in local formatting of monetary values." msgstr "" -#: ../../library/locale.rst:103 +#: ../../library/locale.rst:108 msgid "``'int_frac_digits'``" msgstr "``'int_frac_digits'``" -#: ../../library/locale.rst:103 +#: ../../library/locale.rst:108 msgid "" "Number of fractional digits used in international formatting of monetary " "values." msgstr "" -#: ../../library/locale.rst:107 +#: ../../library/locale.rst:112 msgid "``'mon_thousands_sep'``" msgstr "``'mon_thousands_sep'``" -#: ../../library/locale.rst:107 +#: ../../library/locale.rst:112 msgid "Group separator used for monetary values." msgstr "" -#: ../../library/locale.rst:110 +#: ../../library/locale.rst:115 msgid "``'mon_grouping'``" msgstr "``'mon_grouping'``" -#: ../../library/locale.rst:110 +#: ../../library/locale.rst:115 msgid "Equivalent to ``'grouping'``, used for monetary values." msgstr "" -#: ../../library/locale.rst:113 +#: ../../library/locale.rst:118 msgid "``'positive_sign'``" msgstr "``'positive_sign'``" -#: ../../library/locale.rst:113 +#: ../../library/locale.rst:118 msgid "Symbol used to annotate a positive monetary value." msgstr "" -#: ../../library/locale.rst:116 +#: ../../library/locale.rst:121 msgid "``'negative_sign'``" msgstr "``'negative_sign'``" -#: ../../library/locale.rst:116 +#: ../../library/locale.rst:121 msgid "Symbol used to annotate a negative monetary value." msgstr "" -#: ../../library/locale.rst:119 +#: ../../library/locale.rst:124 msgid "``'p_sign_posn/n_sign_posn'``" msgstr "``'p_sign_posn/n_sign_posn'``" -#: ../../library/locale.rst:119 +#: ../../library/locale.rst:124 msgid "" "The position of the sign (for positive resp. negative values), see below." msgstr "" -#: ../../library/locale.rst:124 +#: ../../library/locale.rst:129 msgid "" "All numeric values can be set to :const:`CHAR_MAX` to indicate that there is " "no value specified in this locale." msgstr "" -#: ../../library/locale.rst:127 +#: ../../library/locale.rst:132 msgid "" "The possible values for ``'p_sign_posn'`` and ``'n_sign_posn'`` are given " "below." msgstr "" -#: ../../library/locale.rst:130 +#: ../../library/locale.rst:135 msgid "Value" msgstr "" -#: ../../library/locale.rst:130 +#: ../../library/locale.rst:135 msgid "Explanation" msgstr "" -#: ../../library/locale.rst:132 +#: ../../library/locale.rst:137 msgid "``0``" msgstr "``0``" -#: ../../library/locale.rst:132 +#: ../../library/locale.rst:137 msgid "Currency and value are surrounded by parentheses." msgstr "" -#: ../../library/locale.rst:135 +#: ../../library/locale.rst:140 msgid "``1``" msgstr "``1``" -#: ../../library/locale.rst:135 +#: ../../library/locale.rst:140 msgid "The sign should precede the value and currency symbol." msgstr "" -#: ../../library/locale.rst:138 +#: ../../library/locale.rst:143 msgid "``2``" msgstr "``2``" -#: ../../library/locale.rst:138 +#: ../../library/locale.rst:143 msgid "The sign should follow the value and currency symbol." msgstr "" -#: ../../library/locale.rst:141 +#: ../../library/locale.rst:146 msgid "``3``" msgstr "``3``" -#: ../../library/locale.rst:141 +#: ../../library/locale.rst:146 msgid "The sign should immediately precede the value." msgstr "" -#: ../../library/locale.rst:144 +#: ../../library/locale.rst:149 msgid "``4``" msgstr "``4``" -#: ../../library/locale.rst:144 +#: ../../library/locale.rst:149 msgid "The sign should immediately follow the value." msgstr "" -#: ../../library/locale.rst:147 +#: ../../library/locale.rst:152 msgid "``CHAR_MAX``" msgstr "``CHAR_MAX``" -#: ../../library/locale.rst:147 +#: ../../library/locale.rst:152 msgid "Nothing is specified in this locale." msgstr "" -#: ../../library/locale.rst:150 +#: ../../library/locale.rst:155 msgid "" "The function temporarily sets the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` " "locale or the ``LC_MONETARY`` locale if locales are different and numeric or " "monetary strings are non-ASCII. This temporary change affects other threads." msgstr "" -#: ../../library/locale.rst:154 +#: ../../library/locale.rst:159 msgid "" "The function now temporarily sets the ``LC_CTYPE`` locale to the " "``LC_NUMERIC`` locale in some cases." msgstr "" -#: ../../library/locale.rst:161 +#: ../../library/locale.rst:166 msgid "" "Return some locale-specific information as a string. This function is not " "available on all systems, and the set of possible options might also vary " @@ -336,106 +342,106 @@ msgid "" "symbolic constants are available in the locale module." msgstr "" -#: ../../library/locale.rst:166 +#: ../../library/locale.rst:171 msgid "" "The :func:`nl_langinfo` function accepts one of the following keys. Most " "descriptions are taken from the corresponding description in the GNU C " "library." msgstr "" -#: ../../library/locale.rst:172 +#: ../../library/locale.rst:177 msgid "" "Get a string with the name of the character encoding used in the selected " "locale." msgstr "" -#: ../../library/locale.rst:177 +#: ../../library/locale.rst:182 msgid "" "Get a string that can be used as a format string for :func:`time.strftime` " "to represent date and time in a locale-specific way." msgstr "" -#: ../../library/locale.rst:182 +#: ../../library/locale.rst:187 msgid "" "Get a string that can be used as a format string for :func:`time.strftime` " "to represent a date in a locale-specific way." msgstr "" -#: ../../library/locale.rst:187 +#: ../../library/locale.rst:192 msgid "" "Get a string that can be used as a format string for :func:`time.strftime` " "to represent a time in a locale-specific way." msgstr "" -#: ../../library/locale.rst:192 +#: ../../library/locale.rst:197 msgid "" "Get a format string for :func:`time.strftime` to represent time in the am/pm " "format." msgstr "" -#: ../../library/locale.rst:203 +#: ../../library/locale.rst:208 msgid "Get the name of the n-th day of the week." msgstr "" -#: ../../library/locale.rst:207 +#: ../../library/locale.rst:212 msgid "" "This follows the US convention of :const:`DAY_1` being Sunday, not the " "international convention (ISO 8601) that Monday is the first day of the week." msgstr "" -#: ../../library/locale.rst:219 +#: ../../library/locale.rst:224 msgid "Get the abbreviated name of the n-th day of the week." msgstr "" -#: ../../library/locale.rst:234 +#: ../../library/locale.rst:239 msgid "Get the name of the n-th month." msgstr "" -#: ../../library/locale.rst:249 +#: ../../library/locale.rst:254 msgid "Get the abbreviated name of the n-th month." msgstr "" -#: ../../library/locale.rst:253 +#: ../../library/locale.rst:258 msgid "Get the radix character (decimal dot, decimal comma, etc.)." msgstr "" -#: ../../library/locale.rst:257 +#: ../../library/locale.rst:262 msgid "Get the separator character for thousands (groups of three digits)." msgstr "" -#: ../../library/locale.rst:261 +#: ../../library/locale.rst:266 msgid "" "Get a regular expression that can be used with the regex function to " "recognize a positive response to a yes/no question." msgstr "" -#: ../../library/locale.rst:266 +#: ../../library/locale.rst:271 msgid "" "Get a regular expression that can be used with the ``regex(3)`` function to " "recognize a negative response to a yes/no question." msgstr "" -#: ../../library/locale.rst:271 +#: ../../library/locale.rst:276 msgid "" "The regular expressions for :const:`YESEXPR` and :const:`NOEXPR` use syntax " "suitable for the ``regex`` function from the C library, which might differ " "from the syntax used in :mod:`re`." msgstr "" -#: ../../library/locale.rst:278 +#: ../../library/locale.rst:283 msgid "" "Get the currency symbol, preceded by \"-\" if the symbol should appear " "before the value, \"+\" if the symbol should appear after the value, or \"." "\" if the symbol should replace the radix character." msgstr "" -#: ../../library/locale.rst:284 +#: ../../library/locale.rst:289 msgid "" "Get a string which describes how years are counted and displayed for each " "era in a locale." msgstr "" -#: ../../library/locale.rst:287 +#: ../../library/locale.rst:292 msgid "" "Most locales do not define this value. An example of a locale which does " "define this value is the Japanese one. In Japan, the traditional " @@ -443,42 +449,42 @@ msgid "" "then-emperor's reign." msgstr "" -#: ../../library/locale.rst:292 +#: ../../library/locale.rst:297 msgid "" "Normally it should not be necessary to use this value directly. Specifying " "the ``E`` modifier in their format strings causes the :func:`time.strftime` " "function to use this information. The format of the returned string is " "specified in *The Open Group Base Specifications Issue 8*, paragraph " -"`7.3.5.2 LC_TIME C-Language Access `_." +"`7.3.5.2 LC_TIME C-Language Access `_." msgstr "" -#: ../../library/locale.rst:301 +#: ../../library/locale.rst:306 msgid "" "Get a format string for :func:`time.strftime` to represent date and time in " "a locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:306 +#: ../../library/locale.rst:311 msgid "" "Get a format string for :func:`time.strftime` to represent a date in a " "locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:311 +#: ../../library/locale.rst:316 msgid "" "Get a format string for :func:`time.strftime` to represent a time in a " "locale-specific era-based way." msgstr "" -#: ../../library/locale.rst:316 +#: ../../library/locale.rst:321 msgid "" "Get a string consisting of up to 100 semicolon-separated symbols used to " "represent the values 0 to 99 in a locale-specific way. In most locales this " "is an empty string." msgstr "" -#: ../../library/locale.rst:320 +#: ../../library/locale.rst:325 msgid "" "The function temporarily sets the ``LC_CTYPE`` locale to the locale of the " "category that determines the requested value (``LC_TIME``, ``LC_NUMERIC``, " @@ -486,18 +492,18 @@ msgid "" "resulting string is non-ASCII. This temporary change affects other threads." msgstr "" -#: ../../library/locale.rst:326 +#: ../../library/locale.rst:331 msgid "" "The function now temporarily sets the ``LC_CTYPE`` locale in some cases." msgstr "" -#: ../../library/locale.rst:332 +#: ../../library/locale.rst:337 msgid "" "Tries to determine the default locale settings and returns them as a tuple " "of the form ``(language code, encoding)``." msgstr "" -#: ../../library/locale.rst:335 +#: ../../library/locale.rst:340 msgid "" "According to POSIX, a program which has not called ``setlocale(LC_ALL, '')`` " "runs using the portable ``'C'`` locale. Calling ``setlocale(LC_ALL, '')`` " @@ -506,7 +512,7 @@ msgid "" "emulate the behavior in the way described above." msgstr "" -#: ../../library/locale.rst:341 +#: ../../library/locale.rst:346 msgid "" "To maintain compatibility with other platforms, not only the :envvar:`LANG` " "variable is tested, but a list of variables given as envvars parameter. The " @@ -516,22 +522,23 @@ msgid "" "``'LC_CTYPE'``, ``'LANG'`` and ``'LANGUAGE'``, in that order." msgstr "" -#: ../../library/locale.rst:348 ../../library/locale.rst:361 +#: ../../library/locale.rst:353 ../../library/locale.rst:368 msgid "" -"Except for the code ``'C'``, the language code corresponds to :rfc:`1766`. " -"*language code* and *encoding* may be ``None`` if their values cannot be " -"determined." +"The language code has the same format as a :ref:`locale name `, " +"but without encoding and ``@``-modifier. The language code and encoding may " +"be ``None`` if their values cannot be determined. The \"C\" locale is " +"represented as ``(None, None)``." msgstr "" -#: ../../library/locale.rst:357 +#: ../../library/locale.rst:364 msgid "" -"Returns the current setting for the given locale category as sequence " -"containing *language code*, *encoding*. *category* may be one of " -"the :const:`!LC_\\*` values except :const:`LC_ALL`. It defaults " -"to :const:`LC_CTYPE`." +"Returns the current setting for the given locale category as a tuple " +"containing the language code and encoding. *category* may be one of the :" +"const:`!LC_\\*` values except :const:`LC_ALL`. It defaults to :const:" +"`LC_CTYPE`." msgstr "" -#: ../../library/locale.rst:368 +#: ../../library/locale.rst:377 msgid "" "Return the :term:`locale encoding` used for text data, according to user " "preferences. User preferences are expressed differently on different " @@ -539,72 +546,72 @@ msgid "" "this function only returns a guess." msgstr "" -#: ../../library/locale.rst:373 +#: ../../library/locale.rst:382 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:377 +#: ../../library/locale.rst:386 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:381 ../../library/locale.rst:399 +#: ../../library/locale.rst:390 ../../library/locale.rst:408 msgid "" "The :ref:`Python preinitialization ` configures the LC_CTYPE " "locale. See also the :term:`filesystem encoding and error handler`." msgstr "" -#: ../../library/locale.rst:384 +#: ../../library/locale.rst:393 msgid "" -"The function now always returns ``\"utf-8\"`` on Android or if " -"the :ref:`Python UTF-8 Mode ` is enabled." +"The function now always returns ``\"utf-8\"`` on Android or if the :ref:" +"`Python UTF-8 Mode ` is enabled." msgstr "" -#: ../../library/locale.rst:391 +#: ../../library/locale.rst:400 msgid "Get the current :term:`locale encoding`:" msgstr "" -#: ../../library/locale.rst:393 +#: ../../library/locale.rst:402 msgid "On Android and VxWorks, return ``\"utf-8\"``." msgstr "" -#: ../../library/locale.rst:394 +#: ../../library/locale.rst:403 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:397 +#: ../../library/locale.rst:406 msgid "On Windows, return the ANSI code page." msgstr "" -#: ../../library/locale.rst:402 +#: ../../library/locale.rst:411 msgid "" "This function is similar to :func:`getpreferredencoding(False) " "` except this function ignores the :ref:`Python UTF-8 " "Mode `." msgstr "" -#: ../../library/locale.rst:411 +#: ../../library/locale.rst:420 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:415 +#: ../../library/locale.rst:424 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:421 +#: ../../library/locale.rst:430 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 " @@ -612,7 +619,7 @@ msgid "" "is equal to it." msgstr "" -#: ../../library/locale.rst:429 +#: ../../library/locale.rst:438 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, " @@ -620,7 +627,7 @@ msgid "" "repeatedly, e.g. when collating a sequence of strings." msgstr "" -#: ../../library/locale.rst:438 +#: ../../library/locale.rst:447 msgid "" "Formats a number *val* according to the current :const:`LC_NUMERIC` setting. " "The format follows the conventions of the ``%`` operator. For floating-" @@ -628,29 +635,29 @@ msgid "" "is ``True``, also takes the grouping into account." msgstr "" -#: ../../library/locale.rst:443 +#: ../../library/locale.rst:452 msgid "" "If *monetary* is true, the conversion uses monetary thousands separator and " "grouping strings." msgstr "" -#: ../../library/locale.rst:446 +#: ../../library/locale.rst:455 msgid "" "Processes formatting specifiers as in ``format % val``, but takes the " "current locale settings into account." msgstr "" -#: ../../library/locale.rst:449 +#: ../../library/locale.rst:458 msgid "The *monetary* keyword parameter was added." msgstr "" -#: ../../library/locale.rst:455 +#: ../../library/locale.rst:464 msgid "" "Formats a number *val* according to the current :const:`LC_MONETARY` " "settings." msgstr "" -#: ../../library/locale.rst:457 +#: ../../library/locale.rst:466 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), " @@ -658,43 +665,43 @@ msgid "" "not the default), the international currency symbol is used." msgstr "" -#: ../../library/locale.rst:464 +#: ../../library/locale.rst:473 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:470 +#: ../../library/locale.rst:479 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:476 +#: ../../library/locale.rst:485 msgid "" -"Converts a string into a normalized number string, following " -"the :const:`LC_NUMERIC` settings." +"Converts a string into a normalized number string, following the :const:" +"`LC_NUMERIC` settings." msgstr "" -#: ../../library/locale.rst:484 +#: ../../library/locale.rst:493 msgid "" -"Converts a normalized number string into a formatted string following " -"the :const:`LC_NUMERIC` settings." +"Converts a normalized number string into a formatted string following the :" +"const:`LC_NUMERIC` settings." msgstr "" -#: ../../library/locale.rst:492 +#: ../../library/locale.rst:501 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:498 +#: ../../library/locale.rst:507 msgid "" "Converts a string to an integer, following the :const:`LC_NUMERIC` " "conventions." msgstr "" -#: ../../library/locale.rst:503 +#: ../../library/locale.rst:512 msgid "" "Locale category for the character type functions. Most importantly, this " "category defines the text encoding, i.e. how bytes are interpreted as " @@ -704,32 +711,32 @@ msgid "" "SSH connections." msgstr "" -#: ../../library/locale.rst:510 +#: ../../library/locale.rst:519 msgid "" "Python doesn't internally use locale-dependent character transformation " "functions from ``ctype.h``. Instead, an internal ``pyctype.h`` provides " "locale-independent equivalents like :c:macro:`!Py_TOLOWER`." msgstr "" -#: ../../library/locale.rst:517 +#: ../../library/locale.rst:526 msgid "" -"Locale category for sorting strings. The functions :func:`strcoll` " -"and :func:`strxfrm` of the :mod:`locale` module are affected." +"Locale category for sorting strings. The functions :func:`strcoll` and :" +"func:`strxfrm` of the :mod:`locale` module are affected." msgstr "" -#: ../../library/locale.rst:523 +#: ../../library/locale.rst:532 msgid "" -"Locale category for the formatting of time. The " -"function :func:`time.strftime` follows these conventions." +"Locale category for the formatting of time. The function :func:`time." +"strftime` follows these conventions." msgstr "" -#: ../../library/locale.rst:529 +#: ../../library/locale.rst:538 msgid "" "Locale category for formatting of monetary values. The available options " "are available from the :func:`localeconv` function." msgstr "" -#: ../../library/locale.rst:535 +#: ../../library/locale.rst:544 msgid "" "Locale category for message display. Python currently does not support " "application specific locale-aware messages. Messages displayed by the " @@ -737,21 +744,21 @@ msgid "" "affected by this category." msgstr "" -#: ../../library/locale.rst:540 +#: ../../library/locale.rst:549 msgid "" "This value may not be available on operating systems not conforming to the " "POSIX standard, most notably Windows." msgstr "" -#: ../../library/locale.rst:546 +#: ../../library/locale.rst:555 msgid "" -"Locale category for formatting numbers. The " -"functions :func:`format_string`, :func:`atoi`, :func:`atof` and :func:`.str` " -"of the :mod:`locale` module are affected by that category. All other " -"numeric formatting operations are not affected." +"Locale category for formatting numbers. The functions :func:" +"`format_string`, :func:`atoi`, :func:`atof` and :func:`.str` of the :mod:" +"`locale` module are affected by that category. All other numeric formatting " +"operations are not affected." msgstr "" -#: ../../library/locale.rst:554 +#: ../../library/locale.rst:563 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 " @@ -761,17 +768,17 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:563 +#: ../../library/locale.rst:572 msgid "" -"This is a symbolic constant used for different values returned " -"by :func:`localeconv`." +"This is a symbolic constant used for different values returned by :func:" +"`localeconv`." msgstr "" -#: ../../library/locale.rst:567 +#: ../../library/locale.rst:576 msgid "Example::" msgstr "範例: ::" -#: ../../library/locale.rst:569 +#: ../../library/locale.rst:578 msgid "" ">>> import locale\n" ">>> loc = locale.getlocale() # get current locale\n" @@ -784,11 +791,11 @@ msgid "" ">>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale" msgstr "" -#: ../../library/locale.rst:580 +#: ../../library/locale.rst:589 msgid "Background, details, hints, tips and caveats" msgstr "" -#: ../../library/locale.rst:582 +#: ../../library/locale.rst:591 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 " @@ -796,17 +803,17 @@ msgid "" "This makes the locale somewhat painful to use correctly." msgstr "" -#: ../../library/locale.rst:587 +#: ../../library/locale.rst:596 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 :data:`LC_CTYPE` category is changed at startup to set the current " -"locale encoding to the user's preferred locale encoding. The program must " +"matter what the user's preferred locale is. There is one exception: the :" +"data:`LC_CTYPE` category is changed at startup to set the current locale " +"encoding to the user's preferred locale encoding. The program must " "explicitly say that it wants the user's preferred locale settings for other " "categories by calling ``setlocale(LC_ALL, '')``." msgstr "" -#: ../../library/locale.rst:594 +#: ../../library/locale.rst:603 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 " @@ -814,7 +821,7 @@ msgid "" "that happen to run before the settings have been restored." msgstr "" -#: ../../library/locale.rst:599 +#: ../../library/locale.rst:608 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 " @@ -825,14 +832,14 @@ msgid "" "settings." msgstr "" -#: ../../library/locale.rst:606 +#: ../../library/locale.rst:615 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`." +"the special functions defined by this module: :func:`atof`, :func:`atoi`, :" +"func:`format_string`, :func:`.str`." msgstr "" -#: ../../library/locale.rst:610 +#: ../../library/locale.rst:619 msgid "" "There is no way to perform case conversions and character classifications " "according to the locale. For (Unicode) text strings these are done " @@ -843,11 +850,85 @@ msgid "" "whitespace." msgstr "" -#: ../../library/locale.rst:621 +#: ../../library/locale.rst:630 +msgid "Locale names" +msgstr "" + +#: ../../library/locale.rst:632 +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:635 +msgid "On Posix platforms, it usually has the format [1]_:" +msgstr "" + +#: ../../library/locale.rst:640 +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`_, " +"*charset* is a locale encoding, and *modifier* is a script name, a language " +"subtag, a sort order identifier, or other locale modifier (for example, " +"\"latin\", \"valencia\", \"stroke\" and \"euro\")." +msgstr "" + +#: ../../library/locale.rst:646 +msgid "" +"On Windows, several formats are supported. [2]_ [3]_ A subset of `IETF BCP " +"47`_ tags:" +msgstr "" + +#: ../../library/locale.rst:653 +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 " +"subtag, a sort order identifier or custom modifier (for example, " +"\"valencia\", \"stroke\" or \"x-python\"). Both hyphen (``'-'``) and " +"underscore (``'_'``) separators are supported. Only UTF-8 encoding is " +"allowed for BCP 47 tags." +msgstr "" + +#: ../../library/locale.rst:660 +msgid "Windows also supports locale names in the format:" +msgstr "" + +#: ../../library/locale.rst:665 +msgid "" +"where *language* and *territory* are full names, such as \"English\" and " +"\"United States\", and *charset* is either a code page number (for example, " +"\"1252\") or UTF-8. Only the underscore separator is supported in this " +"format." +msgstr "" + +#: ../../library/locale.rst:670 +msgid "The \"C\" locale is supported on all platforms." +msgstr "" + +#: ../../library/locale.rst:677 +msgid "" +"`IEEE Std 1003.1-2024; 8.2 Internationalization Variables `_" +msgstr "" + +#: ../../library/locale.rst:678 +msgid "" +"`UCRT Locale names, Languages, and Country/Region strings `_" +msgstr "" + +#: ../../library/locale.rst:679 +msgid "" +"`Locale Names `_" +msgstr "" + +#: ../../library/locale.rst:685 msgid "For extension writers and programs that embed Python" msgstr "" -#: ../../library/locale.rst:623 +#: ../../library/locale.rst:687 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 " @@ -855,32 +936,32 @@ msgid "" "whether or not the locale is ``C``)." msgstr "" -#: ../../library/locale.rst:628 +#: ../../library/locale.rst:692 msgid "" "When Python code uses the :mod:`locale` module to change the locale, this " "also affects the embedding application. If the embedding application " "doesn't want this to happen, it should remove the :mod:`!_locale` extension " -"module (which does all the work) from the table of built-in modules in " -"the :file:`config.c` file, and make sure that the :mod:`!_locale` module is " -"not accessible as a shared library." +"module (which does all the work) from the table of built-in modules in the :" +"file:`config.c` file, and make sure that the :mod:`!_locale` module is not " +"accessible as a shared library." msgstr "" -#: ../../library/locale.rst:639 +#: ../../library/locale.rst:703 msgid "Access to message catalogs" msgstr "" -#: ../../library/locale.rst:648 +#: ../../library/locale.rst:712 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:`dgettext`, :func:`dcgettext`, :func:`textdomain`, :func:`bindtextdomain`, " +"provide this interface. It consists of the functions :func:`gettext`, :func:" +"`dgettext`, :func:`dcgettext`, :func:`textdomain`, :func:`bindtextdomain`, " "and :func:`bind_textdomain_codeset`. These are similar to the same " "functions in the :mod:`gettext` module, but use the C library's binary " "format for message catalogs, and the C library's search algorithms for " "locating message catalogs." msgstr "" -#: ../../library/locale.rst:655 +#: ../../library/locale.rst:719 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/logging.po b/library/logging.po index 03043fcd0e..93e609050e 100644 --- a/library/logging.po +++ b/library/logging.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-17 00:13+0000\n" "PO-Revision-Date: 2024-03-28 22:40+0800\n" "Last-Translator: RockLeon \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -206,15 +206,15 @@ msgid "" "are all descendants of ``foo``. In addition, all loggers are descendants of " "the root logger. The logger name hierarchy is analogous to the Python " "package hierarchy, and identical to it if you organise your loggers on a per-" -"module basis using the recommended construction " -"``logging.getLogger(__name__)``. That's because in a module, ``__name__`` " -"is the module's name in the Python package namespace." +"module basis using the recommended construction ``logging." +"getLogger(__name__)``. That's because in a module, ``__name__`` is the " +"module's name in the Python package namespace." msgstr "" #: ../../library/logging.rst:123 msgid "" -"This is the logger's name, and is the value that was passed " -"to :func:`getLogger` to obtain the logger." +"This is the logger's name, and is the value that was passed to :func:" +"`getLogger` to obtain the logger." msgstr "" #: ../../library/logging.rst:126 ../../library/logging.rst:186 @@ -362,29 +362,27 @@ msgstr "" #: ../../library/logging.rst:223 msgid "" "Indicates if a message of severity *level* would be processed by this " -"logger. This method checks first the module-level level set by " -"``logging.disable(level)`` and then the logger's effective level as " -"determined by :meth:`getEffectiveLevel`." +"logger. This method checks first the module-level level set by ``logging." +"disable(level)`` and then the logger's effective level as determined by :" +"meth:`getEffectiveLevel`." msgstr "" #: ../../library/logging.rst:231 msgid "" -"Indicates the effective level for this logger. If a value other " -"than :const:`NOTSET` has been set using :meth:`setLevel`, it is returned. " -"Otherwise, the hierarchy is traversed towards the root until a value other " -"than :const:`NOTSET` is found, and that value is returned. The value " -"returned is an integer, typically one " -"of :const:`logging.DEBUG`, :const:`logging.INFO` etc." +"Indicates the effective level for this logger. If a value other than :const:" +"`NOTSET` has been set using :meth:`setLevel`, it is returned. Otherwise, the " +"hierarchy is traversed towards the root until a value other than :const:" +"`NOTSET` is found, and that value is returned. The value returned is an " +"integer, typically one of :const:`logging.DEBUG`, :const:`logging.INFO` etc." msgstr "" #: ../../library/logging.rst:241 msgid "" "Returns a logger which is a descendant to this logger, as determined by the " "suffix. Thus, ``logging.getLogger('abc').getChild('def.ghi')`` would return " -"the same logger as would be returned by " -"``logging.getLogger('abc.def.ghi')``. This is a convenience method, useful " -"when the parent logger is named using e.g. ``__name__`` rather than a " -"literal string." +"the same logger as would be returned by ``logging.getLogger('abc.def." +"ghi')``. This is a convenience method, useful when the parent logger is " +"named using e.g. ``__name__`` rather than a literal string." msgstr "" #: ../../library/logging.rst:252 @@ -455,19 +453,19 @@ msgstr "" msgid "" "The third optional keyword argument is *stacklevel*, which defaults to " "``1``. If greater than 1, the corresponding number of stack frames are " -"skipped when computing the line number and function name set in " -"the :class:`LogRecord` created for the logging event. This can be used in " -"logging helpers so that the function name, filename and line number recorded " -"are not the information for the helper function/method, but rather its " -"caller. The name of this parameter mirrors the equivalent one in " -"the :mod:`warnings` module." +"skipped when computing the line number and function name set in the :class:" +"`LogRecord` created for the logging event. This can be used in logging " +"helpers so that the function name, filename and line number recorded are not " +"the information for the helper function/method, but rather its caller. The " +"name of this parameter mirrors the equivalent one in the :mod:`warnings` " +"module." msgstr "" #: ../../library/logging.rst:306 msgid "" "The fourth keyword argument is *extra* which can be used to pass a " -"dictionary which is used to populate the :attr:`~object.__dict__` of " -"the :class:`LogRecord` created for the logging event with user-defined " +"dictionary which is used to populate the :attr:`~object.__dict__` of the :" +"class:`LogRecord` created for the logging event with user-defined " "attributes. These custom attributes can then be used as you like. For " "example, they could be incorporated into logged messages. For example::" msgstr "" @@ -506,12 +504,12 @@ msgstr "" #: ../../library/logging.rst:329 msgid "" "If you choose to use these attributes in logged messages, you need to " -"exercise some care. In the above example, for instance, " -"the :class:`Formatter` has been set up with a format string which expects " -"'clientip' and 'user' in the attribute dictionary of the :class:`LogRecord`. " -"If these are missing, the message will not be logged because a string " -"formatting exception will occur. So in this case, you always need to pass " -"the *extra* dictionary with these keys." +"exercise some care. In the above example, for instance, the :class:" +"`Formatter` has been set up with a format string which expects 'clientip' " +"and 'user' in the attribute dictionary of the :class:`LogRecord`. If these " +"are missing, the message will not be logged because a string formatting " +"exception will occur. So in this case, you always need to pass the *extra* " +"dictionary with these keys." msgstr "" #: ../../library/logging.rst:336 @@ -555,8 +553,8 @@ msgid "" "Logs a message with level :const:`WARNING` on this logger. The arguments are " "interpreted as for :meth:`debug`." msgstr "" -"在此記錄器上記錄一條層級為 :const:`WARNING` 的訊息。這些引數被直譯的方式" -"與 :meth:`debug` 相同。" +"在此記錄器上記錄一條層級為 :const:`WARNING` 的訊息。這些引數被直譯的方式與 :" +"meth:`debug` 相同。" #: ../../library/logging.rst:368 msgid "" @@ -637,8 +635,8 @@ msgid "" "Handles a record by passing it to all handlers associated with this logger " "and its ancestors (until a false value of *propagate* is found). This method " "is used for unpickled records received from a socket, as well as those " -"created locally. Logger-level filtering is applied " -"using :meth:`~Logger.filter`." +"created locally. Logger-level filtering is applied using :meth:`~Logger." +"filter`." msgstr "" #: ../../library/logging.rst:450 @@ -752,17 +750,17 @@ msgstr "" #: ../../library/logging.rst:518 msgid "" -"Handlers have the following attributes and methods. Note " -"that :class:`Handler` is never instantiated directly; this class acts as a " -"base for more useful subclasses. However, the :meth:`!__init__` method in " -"subclasses needs to call :meth:`Handler.__init__`." +"Handlers have the following attributes and methods. Note that :class:" +"`Handler` is never instantiated directly; this class acts as a base for more " +"useful subclasses. However, the :meth:`!__init__` method in subclasses needs " +"to call :meth:`Handler.__init__`." msgstr "" #: ../../library/logging.rst:527 msgid "" "Initializes the :class:`Handler` instance by setting its level, setting the " -"list of filters to the empty list and creating a lock " -"(using :meth:`createLock`) for serializing access to an I/O mechanism." +"list of filters to the empty list and creating a lock (using :meth:" +"`createLock`) for serializing access to an I/O mechanism." msgstr "" #: ../../library/logging.rst:534 @@ -794,8 +792,8 @@ msgstr "" #: ../../library/logging.rst:565 msgid "" -"Sets the formatter for this handler to *fmt*. The *fmt* argument must be " -"a :class:`Formatter` instance or ``None``." +"Sets the formatter for this handler to *fmt*. The *fmt* argument must be a :" +"class:`Formatter` instance or ``None``." msgstr "" #: ../../library/logging.rst:571 @@ -844,15 +842,14 @@ msgstr "" #: ../../library/logging.rst:613 msgid "" "This method should be called from handlers when an exception is encountered " -"during an :meth:`emit` call. If the module-level " -"attribute :data:`raiseExceptions` is ``False``, exceptions get silently " -"ignored. This is what is mostly wanted for a logging system - most users " -"will not care about errors in the logging system, they are more interested " -"in application errors. You could, however, replace this with a custom " -"handler if you wish. The specified record is the one which was being " -"processed when the exception occurred. (The default value " -"of :data:`raiseExceptions` is ``True``, as that is more useful during " -"development)." +"during an :meth:`emit` call. If the module-level attribute :data:" +"`raiseExceptions` is ``False``, exceptions get silently ignored. This is " +"what is mostly wanted for a logging system - most users will not care about " +"errors in the logging system, they are more interested in application " +"errors. You could, however, replace this with a custom handler if you wish. " +"The specified record is the one which was being processed when the exception " +"occurred. (The default value of :data:`raiseExceptions` is ``True``, as that " +"is more useful during development)." msgstr "" #: ../../library/logging.rst:626 @@ -864,8 +861,8 @@ msgstr "" #: ../../library/logging.rst:632 msgid "" "Do whatever it takes to actually log the specified logging record. This " -"version is intended to be implemented by subclasses and so raises " -"a :exc:`NotImplementedError`." +"version is intended to be implemented by subclasses and so raises a :exc:" +"`NotImplementedError`." msgstr "" #: ../../library/logging.rst:636 @@ -915,66 +912,65 @@ msgstr "" #: ../../library/logging.rst:666 msgid "" "A format string in the given *style* for the logged output as a whole. The " -"possible mapping keys are drawn from the :class:`LogRecord` " -"object's :ref:`logrecord-attributes`. If not specified, ``'%(message)s'`` is " -"used, which is just the logged message." +"possible mapping keys are drawn from the :class:`LogRecord` object's :ref:" +"`logrecord-attributes`. If not specified, ``'%(message)s'`` is used, which " +"is just the logged message." msgstr "" #: ../../library/logging.rst:674 msgid "" -"A format string in the given *style* for the date/time portion of the logged " -"output. If not specified, the default described in :meth:`formatTime` is " -"used." +"A format string for the date/time portion of the logged output. If not " +"specified, the default described in :meth:`formatTime` is used." msgstr "" -#: ../../library/logging.rst:679 +#: ../../library/logging.rst:678 msgid "" "Can be one of ``'%'``, ``'{'`` or ``'$'`` and determines how the format " "string will be merged with its data: using one of :ref:`old-string-" "formatting` (``%``), :meth:`str.format` (``{``) or :class:`string.Template` " -"(``$``). This only applies to *fmt* and *datefmt* (e.g. ``'%(message)s'`` " -"versus ``'{message}'``), not to the actual log messages passed to the " -"logging methods. However, there are :ref:`other ways ` to " -"use ``{``- and ``$``-formatting for log messages." +"(``$``). This only applies to *fmt* (e.g. ``'%(message)s'`` versus " +"``'{message}'``), not to the actual log messages passed to the logging " +"methods. However, there are :ref:`other ways ` to use " +"``{``- and ``$``-formatting for log messages." msgstr "" -#: ../../library/logging.rst:689 +#: ../../library/logging.rst:688 msgid "" "If ``True`` (the default), incorrect or mismatched *fmt* and *style* will " -"raise a :exc:`ValueError`; for example, ``logging.Formatter('%(asctime)s - %" -"(message)s', style='{')``." +"raise a :exc:`ValueError`; for example, ``logging.Formatter('%(asctime)s - " +"%(message)s', style='{')``." msgstr "" -#: ../../library/logging.rst:694 +#: ../../library/logging.rst:693 msgid "" "A dictionary with default values to use in custom fields. For example, " "``logging.Formatter('%(ip)s %(message)s', defaults={\"ip\": None})``" msgstr "" -#: ../../library/logging.rst:699 +#: ../../library/logging.rst:698 msgid "Added the *style* parameter." msgstr "新增 *style* 參數。" -#: ../../library/logging.rst:702 +#: ../../library/logging.rst:701 msgid "Added the *validate* parameter." msgstr "新增 *validate* 參數。" -#: ../../library/logging.rst:705 +#: ../../library/logging.rst:704 msgid "Added the *defaults* parameter." msgstr "新增 *defaults* 參數。" -#: ../../library/logging.rst:711 +#: ../../library/logging.rst:710 msgid "" "The record's attribute dictionary is used as the operand to a string " "formatting operation. Returns the resulting string. Before formatting the " "dictionary, a couple of preparatory steps are carried out. The *message* " "attribute of the record is computed using *msg* % *args*. If the formatting " "string contains ``'(asctime)'``, :meth:`formatTime` is called to format the " -"event time. If there is exception information, it is formatted " -"using :meth:`formatException` and appended to the message. Note that the " -"formatted exception information is cached in attribute *exc_text*. This is " -"useful because the exception information can be pickled and sent across the " -"wire, but you should be careful if you have more than one :class:`Formatter` " +"event time. If there is exception information, it is formatted using :meth:" +"`formatException` and appended to the message. Note that the formatted " +"exception information is cached in attribute *exc_text*. This is useful " +"because the exception information can be pickled and sent across the wire, " +"but you should be careful if you have more than one :class:`Formatter` " "subclass which customizes the formatting of exception information. In this " "case, you will have to clear the cached value (by setting the *exc_text* " "attribute to ``None``) after a formatter has done its formatting, so that " @@ -982,26 +978,26 @@ msgid "" "recalculates it afresh." msgstr "" -#: ../../library/logging.rst:727 +#: ../../library/logging.rst:726 msgid "" "If stack information is available, it's appended after the exception " "information, using :meth:`formatStack` to transform it if necessary." msgstr "" -#: ../../library/logging.rst:733 +#: ../../library/logging.rst:732 msgid "" "This method should be called from :meth:`format` by a formatter which wants " "to make use of a formatted time. This method can be overridden in formatters " "to provide for any specific requirement, but the basic behavior is as " -"follows: if *datefmt* (a string) is specified, it is used " -"with :func:`time.strftime` to format the creation time of the record. " -"Otherwise, the format '%Y-%m-%d %H:%M:%S,uuu' is used, where the uuu part is " -"a millisecond value and the other letters are as per " -"the :func:`time.strftime` documentation. An example time in this format is " -"``2003-01-23 00:29:50,411``. The resulting string is returned." +"follows: if *datefmt* (a string) is specified, it is used with :func:`time." +"strftime` to format the creation time of the record. Otherwise, the format " +"'%Y-%m-%d %H:%M:%S,uuu' is used, where the uuu part is a millisecond value " +"and the other letters are as per the :func:`time.strftime` documentation. " +"An example time in this format is ``2003-01-23 00:29:50,411``. The " +"resulting string is returned." msgstr "" -#: ../../library/logging.rst:743 +#: ../../library/logging.rst:742 msgid "" "This function uses a user-configurable function to convert the creation time " "to a tuple. By default, :func:`time.localtime` is used; to change this for a " @@ -1011,7 +1007,7 @@ msgid "" "be shown in GMT, set the ``converter`` attribute in the ``Formatter`` class." msgstr "" -#: ../../library/logging.rst:751 +#: ../../library/logging.rst:750 msgid "" "Previously, the default format was hard-coded as in this example: " "``2010-09-06 22:38:15,292`` where the part before the comma is handled by a " @@ -1026,11 +1022,11 @@ msgid "" "the millisecond value)." msgstr "" -#: ../../library/logging.rst:764 +#: ../../library/logging.rst:763 msgid "The ``default_msec_format`` can be ``None``." msgstr "" -#: ../../library/logging.rst:769 +#: ../../library/logging.rst:768 msgid "" "Formats the specified exception information (a standard exception tuple as " "returned by :func:`sys.exc_info`) as a string. This default implementation " @@ -1038,14 +1034,14 @@ msgid "" "returned." msgstr "" -#: ../../library/logging.rst:776 +#: ../../library/logging.rst:775 msgid "" -"Formats the specified stack information (a string as returned " -"by :func:`traceback.print_stack`, but with the last newline removed) as a " -"string. This default implementation just returns the input value." +"Formats the specified stack information (a string as returned by :func:" +"`traceback.print_stack`, but with the last newline removed) as a string. " +"This default implementation just returns the input value." msgstr "" -#: ../../library/logging.rst:782 +#: ../../library/logging.rst:781 msgid "" "A base formatter class suitable for subclassing when you want to format a " "number of records. You can pass a :class:`Formatter` instance which you want " @@ -1054,7 +1050,7 @@ msgid "" "used as the line formatter." msgstr "" -#: ../../library/logging.rst:790 +#: ../../library/logging.rst:789 msgid "" "Return a header for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " @@ -1062,14 +1058,14 @@ msgid "" "separator line." msgstr "" -#: ../../library/logging.rst:797 +#: ../../library/logging.rst:796 msgid "" "Return a footer for a list of *records*. The base implementation just " "returns the empty string. You will need to override this method if you want " "specific behaviour, e.g. to show the count of records or a separator line." msgstr "" -#: ../../library/logging.rst:804 +#: ../../library/logging.rst:803 msgid "" "Return formatted text for a list of *records*. The base implementation just " "returns the empty string if there are no records; otherwise, it returns the " @@ -1077,11 +1073,11 @@ msgid "" "and the footer." msgstr "" -#: ../../library/logging.rst:812 +#: ../../library/logging.rst:811 msgid "Filter Objects" msgstr "" -#: ../../library/logging.rst:814 +#: ../../library/logging.rst:813 msgid "" "``Filters`` can be used by ``Handlers`` and ``Loggers`` for more " "sophisticated filtering than is provided by levels. The base filter class " @@ -1091,7 +1087,7 @@ msgid "" "If initialized with the empty string, all events are passed." msgstr "" -#: ../../library/logging.rst:824 +#: ../../library/logging.rst:823 msgid "" "Returns an instance of the :class:`Filter` class. If *name* is specified, it " "names a logger which, together with its children, will have its events " @@ -1099,7 +1095,7 @@ msgid "" "event." msgstr "" -#: ../../library/logging.rst:831 +#: ../../library/logging.rst:830 msgid "" "Is the specified record to be logged? Returns false for no, true for yes. " "Filters can either modify log records in-place or return a completely " @@ -1107,7 +1103,7 @@ msgid "" "future processing of the event." msgstr "" -#: ../../library/logging.rst:836 +#: ../../library/logging.rst:835 msgid "" "Note that filters attached to handlers are consulted before an event is " "emitted by the handler, whereas filters attached to loggers are consulted " @@ -1117,24 +1113,24 @@ msgid "" "setting, unless the filter has also been applied to those descendant loggers." msgstr "" -#: ../../library/logging.rst:843 +#: ../../library/logging.rst:842 msgid "" "You don't actually need to subclass ``Filter``: you can pass any instance " "which has a ``filter`` method with the same semantics." msgstr "" -#: ../../library/logging.rst:846 +#: ../../library/logging.rst:845 msgid "" "You don't need to create specialized ``Filter`` classes, or use other " "classes with a ``filter`` method: you can use a function (or other callable) " "as a filter. The filtering logic will check to see if the filter object has " -"a ``filter`` attribute: if it does, it's assumed to be a ``Filter`` and " -"its :meth:`~Filter.filter` method is called. Otherwise, it's assumed to be a " +"a ``filter`` attribute: if it does, it's assumed to be a ``Filter`` and its :" +"meth:`~Filter.filter` method is called. Otherwise, it's assumed to be a " "callable and called with the record as the single parameter. The returned " "value should conform to that returned by :meth:`~Filter.filter`." msgstr "" -#: ../../library/logging.rst:856 +#: ../../library/logging.rst:855 msgid "" "You can now return a :class:`LogRecord` instance from filters to replace the " "log record rather than modifying it in place. This allows filters attached " @@ -1142,7 +1138,7 @@ msgid "" "having side effects on other handlers." msgstr "" -#: ../../library/logging.rst:862 +#: ../../library/logging.rst:861 msgid "" "Although filters are used primarily to filter records based on more " "sophisticated criteria than levels, they get to see every record which is " @@ -1154,29 +1150,29 @@ msgid "" "contextual information into logs (see :ref:`filters-contextual`)." msgstr "" -#: ../../library/logging.rst:875 +#: ../../library/logging.rst:874 msgid "LogRecord Objects" msgstr "LogRecord 物件" -#: ../../library/logging.rst:877 +#: ../../library/logging.rst:876 msgid "" -":class:`LogRecord` instances are created automatically by " -"the :class:`Logger` every time something is logged, and can be created " -"manually via :func:`makeLogRecord` (for example, from a pickled event " -"received over the wire)." +":class:`LogRecord` instances are created automatically by the :class:" +"`Logger` every time something is logged, and can be created manually via :" +"func:`makeLogRecord` (for example, from a pickled event received over the " +"wire)." msgstr "" -#: ../../library/logging.rst:885 +#: ../../library/logging.rst:884 msgid "Contains all the information pertinent to the event being logged." msgstr "" -#: ../../library/logging.rst:887 +#: ../../library/logging.rst:886 msgid "" "The primary information is passed in *msg* and *args*, which are combined " "using ``msg % args`` to create the :attr:`!message` attribute of the record." msgstr "" -#: ../../library/logging.rst:891 +#: ../../library/logging.rst:890 msgid "" "The name of the logger used to log the event represented by this :class:`!" "LogRecord`. Note that the logger name in the :class:`!LogRecord` will always " @@ -1184,55 +1180,54 @@ msgid "" "different (ancestor) logger." msgstr "" -#: ../../library/logging.rst:899 +#: ../../library/logging.rst:898 msgid "" "The :ref:`numeric level ` of the logging event (such as ``10`` for " "``DEBUG``, ``20`` for ``INFO``, etc). Note that this is converted to *two* " -"attributes of the LogRecord: :attr:`!levelno` for the numeric value " -"and :attr:`!levelname` for the corresponding level name." +"attributes of the LogRecord: :attr:`!levelno` for the numeric value and :" +"attr:`!levelname` for the corresponding level name." msgstr "" -#: ../../library/logging.rst:906 +#: ../../library/logging.rst:905 msgid "" "The full string path of the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:910 +#: ../../library/logging.rst:909 msgid "The line number in the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:914 +#: ../../library/logging.rst:913 msgid "" "The event description message, which can be a %-format string with " "placeholders for variable data, or an arbitrary object (see :ref:`arbitrary-" "object-messages`)." msgstr "" -#: ../../library/logging.rst:919 +#: ../../library/logging.rst:918 msgid "" "Variable data to merge into the *msg* argument to obtain the event " "description." msgstr "" -#: ../../library/logging.rst:923 +#: ../../library/logging.rst:922 msgid "" -"An exception tuple with the current exception information, as returned " -"by :func:`sys.exc_info`, or ``None`` if no exception information is " -"available." +"An exception tuple with the current exception information, as returned by :" +"func:`sys.exc_info`, or ``None`` if no exception information is available." msgstr "" -#: ../../library/logging.rst:928 +#: ../../library/logging.rst:927 msgid "" "The name of the function or method from which the logging call was invoked." msgstr "" -#: ../../library/logging.rst:932 +#: ../../library/logging.rst:931 msgid "" "A text string representing stack information from the base of the stack in " "the current thread, up to the logging call." msgstr "" -#: ../../library/logging.rst:939 +#: ../../library/logging.rst:938 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -1241,7 +1236,7 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" -#: ../../library/logging.rst:946 +#: ../../library/logging.rst:945 msgid "" "The creation of a :class:`LogRecord` has been made more configurable by " "providing a factory which is used to create the record. The factory can be " @@ -1249,13 +1244,13 @@ msgid "" "this for the factory's signature)." msgstr "" -#: ../../library/logging.rst:952 +#: ../../library/logging.rst:951 msgid "" -"This functionality can be used to inject your own values into " -"a :class:`LogRecord` at creation time. You can use the following pattern::" +"This functionality can be used to inject your own values into a :class:" +"`LogRecord` at creation time. You can use the following pattern::" msgstr "" -#: ../../library/logging.rst:955 +#: ../../library/logging.rst:954 msgid "" "old_factory = logging.getLogRecordFactory()\n" "\n" @@ -1275,18 +1270,18 @@ msgstr "" "\n" "logging.setLogRecordFactory(record_factory)" -#: ../../library/logging.rst:964 +#: ../../library/logging.rst:963 msgid "" "With this pattern, multiple factories could be chained, and as long as they " "don't overwrite each other's attributes or unintentionally overwrite the " "standard attributes listed above, there should be no surprises." msgstr "" -#: ../../library/logging.rst:973 +#: ../../library/logging.rst:972 msgid "LogRecord attributes" msgstr "LogRecord 屬性" -#: ../../library/logging.rst:975 +#: ../../library/logging.rst:974 msgid "" "The LogRecord has a number of attributes, most of which are derived from the " "parameters to the constructor. (Note that the names do not always correspond " @@ -1297,15 +1292,15 @@ msgid "" "style format string." msgstr "" -#: ../../library/logging.rst:983 +#: ../../library/logging.rst:982 msgid "" "If you are using {}-formatting (:func:`str.format`), you can use ``{attrname}" -"`` as the placeholder in the format string. If you are using $-formatting " -"(:class:`string.Template`), use the form ``${attrname}``. In both cases, of " +"`` as the placeholder in the format string. If you are using $-formatting (:" +"class:`string.Template`), use the form ``${attrname}``. In both cases, of " "course, replace ``attrname`` with the actual attribute name you want to use." msgstr "" -#: ../../library/logging.rst:989 +#: ../../library/logging.rst:988 msgid "" "In the case of {}-formatting, you can specify formatting flags by placing " "them after the attribute name, separated from it with a colon. For example: " @@ -1314,319 +1309,318 @@ msgid "" "on the options available to you." msgstr "" -#: ../../library/logging.rst:996 +#: ../../library/logging.rst:995 msgid "Attribute name" msgstr "屬性名稱" -#: ../../library/logging.rst:996 ../../library/logging.rst:1366 +#: ../../library/logging.rst:995 ../../library/logging.rst:1365 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:996 ../../library/logging.rst:1366 +#: ../../library/logging.rst:995 ../../library/logging.rst:1365 msgid "Description" msgstr "描述" -#: ../../library/logging.rst:0 ../../library/logging.rst:998 +#: ../../library/logging.rst:0 ../../library/logging.rst:997 msgid "args" msgstr "args" -#: ../../library/logging.rst:998 ../../library/logging.rst:1012 -#: ../../library/logging.rst:1040 ../../library/logging.rst:1058 +#: ../../library/logging.rst:997 ../../library/logging.rst:1011 +#: ../../library/logging.rst:1039 ../../library/logging.rst:1057 msgid "You shouldn't need to format this yourself." msgstr "你不應該需要自己格式化它。" -#: ../../library/logging.rst:998 +#: ../../library/logging.rst:997 msgid "" "The tuple of arguments merged into ``msg`` to produce ``message``, or a dict " "whose values are used for the merge (when there is only one argument, and it " "is a dictionary)." msgstr "" -#: ../../library/logging.rst:1003 +#: ../../library/logging.rst:1002 msgid "asctime" msgstr "asctime" -#: ../../library/logging.rst:1003 +#: ../../library/logging.rst:1002 msgid "``%(asctime)s``" msgstr "``%(asctime)s``" -#: ../../library/logging.rst:1003 +#: ../../library/logging.rst:1002 msgid "" "Human-readable time when the :class:`LogRecord` was created. By default " "this is of the form '2003-07-08 16:49:45,896' (the numbers after the comma " "are millisecond portion of the time)." msgstr "" -#: ../../library/logging.rst:1009 +#: ../../library/logging.rst:1008 msgid "created" msgstr "created" -#: ../../library/logging.rst:1009 +#: ../../library/logging.rst:1008 msgid "``%(created)f``" msgstr "``%(created)f``" -#: ../../library/logging.rst:1009 +#: ../../library/logging.rst:1008 msgid "" -"Time when the :class:`LogRecord` was created (as returned " -"by :func:`time.time_ns` / 1e9)." +"Time when the :class:`LogRecord` was created (as returned by :func:`time." +"time_ns` / 1e9)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:1012 +#: ../../library/logging.rst:0 ../../library/logging.rst:1011 msgid "exc_info" msgstr "exc_info" -#: ../../library/logging.rst:1012 +#: ../../library/logging.rst:1011 msgid "" "Exception tuple (à la ``sys.exc_info``) or, if no exception has occurred, " "``None``." msgstr "" -#: ../../library/logging.rst:1015 +#: ../../library/logging.rst:1014 msgid "filename" msgstr "filename" -#: ../../library/logging.rst:1015 +#: ../../library/logging.rst:1014 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:1015 +#: ../../library/logging.rst:1014 msgid "Filename portion of ``pathname``." msgstr "``pathname`` 的檔案名稱部分。" -#: ../../library/logging.rst:1017 +#: ../../library/logging.rst:1016 msgid "funcName" msgstr "funcName" -#: ../../library/logging.rst:1017 +#: ../../library/logging.rst:1016 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:1017 +#: ../../library/logging.rst:1016 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:1019 +#: ../../library/logging.rst:1018 msgid "levelname" msgstr "levelname" -#: ../../library/logging.rst:1019 +#: ../../library/logging.rst:1018 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:1019 +#: ../../library/logging.rst:1018 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:1023 +#: ../../library/logging.rst:1022 msgid "levelno" msgstr "levelno" -#: ../../library/logging.rst:1023 +#: ../../library/logging.rst:1022 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:1023 +#: ../../library/logging.rst:1022 msgid "" -"Numeric logging level for the message " -"(:const:`DEBUG`, :const:`INFO`, :const:`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." +"Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" +"`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:1028 +#: ../../library/logging.rst:1027 msgid "lineno" msgstr "lineno" -#: ../../library/logging.rst:1028 +#: ../../library/logging.rst:1027 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:1028 +#: ../../library/logging.rst:1027 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:1031 +#: ../../library/logging.rst:1030 msgid "message" msgstr "message" -#: ../../library/logging.rst:1031 +#: ../../library/logging.rst:1030 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:1031 +#: ../../library/logging.rst:1030 msgid "" -"The logged message, computed as ``msg % args``. This is set " -"when :meth:`Formatter.format` is invoked." +"The logged message, computed as ``msg % args``. This is set when :meth:" +"`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:1035 +#: ../../library/logging.rst:1034 msgid "module" msgstr "模組" -#: ../../library/logging.rst:1035 +#: ../../library/logging.rst:1034 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:1035 +#: ../../library/logging.rst:1034 msgid "Module (name portion of ``filename``)." msgstr "模組(``filename`` 的名稱部分)。" -#: ../../library/logging.rst:1037 +#: ../../library/logging.rst:1036 msgid "msecs" msgstr "msecs" -#: ../../library/logging.rst:1037 +#: ../../library/logging.rst:1036 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:1037 +#: ../../library/logging.rst:1036 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:1040 +#: ../../library/logging.rst:0 ../../library/logging.rst:1039 msgid "msg" msgstr "msg" -#: ../../library/logging.rst:1040 +#: ../../library/logging.rst:1039 msgid "" "The format string passed in the original logging call. Merged with ``args`` " "to produce ``message``, or an arbitrary object (see :ref:`arbitrary-object-" "messages`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:1045 +#: ../../library/logging.rst:0 ../../library/logging.rst:1044 msgid "name" msgstr "name" -#: ../../library/logging.rst:1045 +#: ../../library/logging.rst:1044 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:1045 +#: ../../library/logging.rst:1044 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:1047 +#: ../../library/logging.rst:1046 msgid "pathname" msgstr "pathname" -#: ../../library/logging.rst:1047 +#: ../../library/logging.rst:1046 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:1047 +#: ../../library/logging.rst:1046 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:1050 +#: ../../library/logging.rst:1049 msgid "process" msgstr "process" -#: ../../library/logging.rst:1050 +#: ../../library/logging.rst:1049 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:1050 +#: ../../library/logging.rst:1049 msgid "Process ID (if available)." msgstr "行程 ID(如果可用)。" -#: ../../library/logging.rst:1052 +#: ../../library/logging.rst:1051 msgid "processName" msgstr "processName" -#: ../../library/logging.rst:1052 +#: ../../library/logging.rst:1051 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:1052 +#: ../../library/logging.rst:1051 msgid "Process name (if available)." msgstr "行程名稱(如果可用)。" -#: ../../library/logging.rst:1054 +#: ../../library/logging.rst:1053 msgid "relativeCreated" msgstr "relativeCreated" -#: ../../library/logging.rst:1054 +#: ../../library/logging.rst:1053 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:1054 +#: ../../library/logging.rst:1053 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:1058 +#: ../../library/logging.rst:1057 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:1058 +#: ../../library/logging.rst:1057 msgid "" "Stack frame information (where available) from the bottom of the stack in " "the current thread, up to and including the stack frame of the logging call " "which resulted in the creation of this record." msgstr "" -#: ../../library/logging.rst:1064 +#: ../../library/logging.rst:1063 msgid "thread" msgstr "thread" -#: ../../library/logging.rst:1064 +#: ../../library/logging.rst:1063 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:1064 +#: ../../library/logging.rst:1063 msgid "Thread ID (if available)." msgstr "執行緒 ID(如果可用)。" -#: ../../library/logging.rst:1066 +#: ../../library/logging.rst:1065 msgid "threadName" msgstr "threadName" -#: ../../library/logging.rst:1066 +#: ../../library/logging.rst:1065 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:1066 +#: ../../library/logging.rst:1065 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:1068 +#: ../../library/logging.rst:1067 msgid "taskName" msgstr "taskName" -#: ../../library/logging.rst:1068 +#: ../../library/logging.rst:1067 msgid "``%(taskName)s``" msgstr "``%(taskName)s``" -#: ../../library/logging.rst:1068 +#: ../../library/logging.rst:1067 msgid ":class:`asyncio.Task` name (if available)." msgstr "" -#: ../../library/logging.rst:1071 +#: ../../library/logging.rst:1070 msgid "*processName* was added." msgstr "新增 *processName*。" -#: ../../library/logging.rst:1074 +#: ../../library/logging.rst:1073 msgid "*taskName* was added." msgstr "新增 *taskName*。" -#: ../../library/logging.rst:1080 +#: ../../library/logging.rst:1079 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:1082 +#: ../../library/logging.rst:1081 msgid "" ":class:`LoggerAdapter` instances are used to conveniently pass contextual " -"information into logging calls. For a usage example, see the section " -"on :ref:`adding contextual information to your logging output `." +"information into logging calls. For a usage example, see the section on :ref:" +"`adding contextual information to your logging output `." msgstr "" -#: ../../library/logging.rst:1088 +#: ../../library/logging.rst:1087 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance, a dict-like object (*extra*), and a " @@ -1636,7 +1630,7 @@ msgid "" "calls and only use the one of the :class:`LoggerAdapter` instance" msgstr "" -#: ../../library/logging.rst:1097 +#: ../../library/logging.rst:1096 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1645,55 +1639,57 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:1105 +#: ../../library/logging.rst:1104 msgid "Delegates to the underlying :attr:`!manager` on *logger*." msgstr "" -#: ../../library/logging.rst:1109 +#: ../../library/logging.rst:1108 msgid "Delegates to the underlying :meth:`!_log` method on *logger*." msgstr "" -#: ../../library/logging.rst:1111 +#: ../../library/logging.rst:1110 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " -"methods " -"of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :meth:`~Logger.warning`, :meth:`~Logger.error`, :meth:`~Logger.exception`, :meth:`~Logger.critical`, :meth:`~Logger.log`, :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:`~Logger.setLevel` " -"and :meth:`~Logger.hasHandlers`. These methods have the same signatures as " -"their counterparts in :class:`Logger`, so you can use the two types of " -"instances interchangeably." +"methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" +"meth:`~Logger.warning`, :meth:`~Logger.error`, :meth:`~Logger.exception`, :" +"meth:`~Logger.critical`, :meth:`~Logger.log`, :meth:`~Logger.isEnabledFor`, :" +"meth:`~Logger.getEffectiveLevel`, :meth:`~Logger.setLevel` and :meth:" +"`~Logger.hasHandlers`. These methods have the same signatures as their " +"counterparts in :class:`Logger`, so you can use the two types of instances " +"interchangeably." msgstr "" -#: ../../library/logging.rst:1122 +#: ../../library/logging.rst:1121 msgid "" -"The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:`~Logger.setLevel` " -"and :meth:`~Logger.hasHandlers` methods were added " -"to :class:`LoggerAdapter`. These methods delegate to the underlying logger." +"The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:" +"`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added to :" +"class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: ../../library/logging.rst:1128 +#: ../../library/logging.rst:1127 msgid "" "Attribute :attr:`!manager` and method :meth:`!_log` were added, which " "delegate to the underlying logger and allow adapters to be nested." msgstr "" -#: ../../library/logging.rst:1133 +#: ../../library/logging.rst:1132 msgid "The *merge_extra* argument was added." msgstr "新增 *merge_extra* 引數。" -#: ../../library/logging.rst:1137 +#: ../../library/logging.rst:1136 msgid "Thread Safety" msgstr "執行緒安全" -#: ../../library/logging.rst:1139 +#: ../../library/logging.rst:1138 msgid "" "The logging module is intended to be thread-safe without any special work " -"needing to be done by its clients. It achieves this though using threading " +"needing to be done by its clients. It achieves this through using threading " "locks; there is one lock to serialize access to the module's shared data, " "and each handler also creates a lock to serialize access to its underlying I/" "O." msgstr "" -#: ../../library/logging.rst:1144 +#: ../../library/logging.rst:1143 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1701,17 +1697,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:1151 +#: ../../library/logging.rst:1150 msgid "Module-Level Functions" msgstr "模組層級函式" -#: ../../library/logging.rst:1153 +#: ../../library/logging.rst:1152 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1159 +#: ../../library/logging.rst:1158 msgid "" "Return a logger with the specified name or, if name is ``None``, return the " "root logger of the hierarchy. If specified, the name is typically a dot-" @@ -1721,14 +1717,14 @@ msgid "" "for not doing that, as mentioned in :ref:`logger`." msgstr "" -#: ../../library/logging.rst:1166 +#: ../../library/logging.rst:1165 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: ../../library/logging.rst:1173 +#: ../../library/logging.rst:1172 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1737,7 +1733,7 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1178 +#: ../../library/logging.rst:1177 msgid "" "class MyLogger(logging.getLoggerClass()):\n" " # ... override behaviour here" @@ -1745,38 +1741,37 @@ msgstr "" "class MyLogger(logging.getLoggerClass()):\n" " # ... 在這裡覆蓋其行為" -#: ../../library/logging.rst:1184 +#: ../../library/logging.rst:1183 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1186 +#: ../../library/logging.rst:1185 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1191 +#: ../../library/logging.rst:1190 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1196 +#: ../../library/logging.rst:1195 msgid "" "This is a convenience function that calls :meth:`Logger.debug`, on the root " "logger. The handling of the arguments is in every way identical to what is " "described in that method." msgstr "" -#: ../../library/logging.rst:1200 +#: ../../library/logging.rst:1199 msgid "" -"The only difference is that if the root logger has no handlers, " -"then :func:`basicConfig` is called, prior to calling ``debug`` on the root " -"logger." +"The only difference is that if the root logger has no handlers, then :func:" +"`basicConfig` is called, prior to calling ``debug`` on the root logger." msgstr "" -#: ../../library/logging.rst:1203 +#: ../../library/logging.rst:1202 msgid "" "For very short scripts or quick demonstrations of ``logging`` facilities, " "``debug`` and the other module-level functions may be convenient. However, " @@ -1786,38 +1781,38 @@ msgid "" "described at the beginning of this documentation." msgstr "" -#: ../../library/logging.rst:1213 +#: ../../library/logging.rst:1212 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1219 +#: ../../library/logging.rst:1218 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1222 +#: ../../library/logging.rst:1221 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:1229 +#: ../../library/logging.rst:1228 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1235 +#: ../../library/logging.rst:1234 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments and behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1241 +#: ../../library/logging.rst:1240 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "and behavior are otherwise the same as for :func:`debug`. Exception info is " @@ -1825,13 +1820,13 @@ msgid "" "exception handler." msgstr "" -#: ../../library/logging.rst:1247 +#: ../../library/logging.rst:1246 msgid "" "Logs a message with level *level* on the root logger. The arguments and " "behavior are otherwise the same as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1252 +#: ../../library/logging.rst:1251 msgid "" "Provides an overriding level *level* for all loggers which takes precedence " "over the logger's own level. When the need arises to temporarily throttle " @@ -1839,13 +1834,13 @@ msgid "" "useful. Its effect is to disable all logging calls of severity *level* and " "below, so that if you call it with a value of INFO, then all INFO and DEBUG " "events would be discarded, whereas those of severity WARNING and above would " -"be processed according to the logger's effective level. If " -"``logging.disable(logging.NOTSET)`` is called, it effectively removes this " -"overriding level, so that logging output again depends on the effective " -"levels of individual loggers." +"be processed according to the logger's effective level. If ``logging." +"disable(logging.NOTSET)`` is called, it effectively removes this overriding " +"level, so that logging output again depends on the effective levels of " +"individual loggers." msgstr "" -#: ../../library/logging.rst:1263 +#: ../../library/logging.rst:1262 msgid "" "Note that if you have defined any custom logging level higher than " "``CRITICAL`` (this is not recommended), you won't be able to rely on the " @@ -1853,13 +1848,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1268 +#: ../../library/logging.rst:1267 msgid "" -"The *level* parameter was defaulted to level ``CRITICAL``. " -"See :issue:`28524` for more information about this change." +"The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" +"`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1274 +#: ../../library/logging.rst:1273 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1869,57 +1864,56 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1281 +#: ../../library/logging.rst:1280 msgid "" -"If you are thinking of defining your own levels, please see the section " -"on :ref:`custom-levels`." +"If you are thinking of defining your own levels, please see the section on :" +"ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1286 +#: ../../library/logging.rst:1285 msgid "" "Returns a mapping from level names to their corresponding logging levels. " "For example, the string \"CRITICAL\" maps to :const:`CRITICAL`. The returned " "mapping is copied from an internal mapping on each call to this function." msgstr "" -#: ../../library/logging.rst:1294 +#: ../../library/logging.rst:1293 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1296 +#: ../../library/logging.rst:1295 msgid "" -"If *level* is one of the predefined " -"levels :const:`CRITICAL`, :const:`ERROR`, :const:`WARNING`, :const:`INFO` " -"or :const:`DEBUG` then you get the corresponding string. If you have " -"associated levels with names using :func:`addLevelName` then the name you " -"have associated with *level* is returned. If a numeric value corresponding " -"to one of the defined levels is passed in, the corresponding string " -"representation is returned." +"If *level* is one of the predefined levels :const:`CRITICAL`, :const:" +"`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " +"corresponding string. If you have associated levels with names using :func:" +"`addLevelName` then the name you have associated with *level* is returned. " +"If a numeric value corresponding to one of the defined levels is passed in, " +"the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1303 +#: ../../library/logging.rst:1302 msgid "" "The *level* parameter also accepts a string representation of the level such " "as 'INFO'. In such cases, this functions returns the corresponding numeric " "value of the level." msgstr "" -#: ../../library/logging.rst:1307 +#: ../../library/logging.rst:1306 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1310 +#: ../../library/logging.rst:1309 msgid "" "Levels are internally integers (as they need to be compared in the logging " "logic). This function is used to convert between an integer level and the " -"level name displayed in the formatted log output by means of the ``%" -"(levelname)s`` format specifier (see :ref:`logrecord-attributes`), and vice " -"versa." +"level name displayed in the formatted log output by means of the " +"``%(levelname)s`` format specifier (see :ref:`logrecord-attributes`), and " +"vice versa." msgstr "" -#: ../../library/logging.rst:1316 +#: ../../library/logging.rst:1315 msgid "" "In Python versions earlier than 3.4, this function could also be passed a " "text level, and would return the corresponding numeric value of the level. " @@ -1927,41 +1921,40 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1324 +#: ../../library/logging.rst:1323 msgid "" "Returns a handler with the specified *name*, or ``None`` if there is no " "handler with that name." msgstr "" -#: ../../library/logging.rst:1331 +#: ../../library/logging.rst:1330 msgid "Returns an immutable set of all known handler names." msgstr "" -#: ../../library/logging.rst:1337 +#: ../../library/logging.rst:1336 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " -"defined by *attrdict*. This function is useful for taking a " -"pickled :class:`LogRecord` attribute dictionary, sent over a socket, and " -"reconstituting it as a :class:`LogRecord` instance at the receiving end." +"defined by *attrdict*. This function is useful for taking a pickled :class:" +"`LogRecord` attribute dictionary, sent over a socket, and reconstituting it " +"as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1345 +#: ../../library/logging.rst:1344 msgid "" -"Does basic configuration for the logging system by creating " -"a :class:`StreamHandler` with a default :class:`Formatter` and adding it to " -"the root logger. The " -"functions :func:`debug`, :func:`info`, :func:`warning`, :func:`error` " -"and :func:`critical` will call :func:`basicConfig` automatically if no " -"handlers are defined for the root logger." +"Does basic configuration for the logging system by creating a :class:" +"`StreamHandler` with a default :class:`Formatter` and adding it to the root " +"logger. The functions :func:`debug`, :func:`info`, :func:`warning`, :func:" +"`error` and :func:`critical` will call :func:`basicConfig` automatically if " +"no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1351 +#: ../../library/logging.rst:1350 msgid "" "This function does nothing if the root logger already has handlers " "configured, unless the keyword argument *force* is set to ``True``." msgstr "" -#: ../../library/logging.rst:1354 +#: ../../library/logging.rst:1353 msgid "" "This function should be called from the main thread before other threads are " "started. In versions of Python prior to 2.7.1 and 3.2, if this function is " @@ -1970,54 +1963,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1361 +#: ../../library/logging.rst:1360 msgid "The following keyword arguments are supported." msgstr "支援以下的關鍵字引數。" -#: ../../library/logging.rst:1368 +#: ../../library/logging.rst:1367 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1368 +#: ../../library/logging.rst:1367 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1372 +#: ../../library/logging.rst:1371 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1372 +#: ../../library/logging.rst:1371 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1376 +#: ../../library/logging.rst:1375 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1376 +#: ../../library/logging.rst:1375 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1381 +#: ../../library/logging.rst:1380 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1381 +#: ../../library/logging.rst:1380 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1384 +#: ../../library/logging.rst:1383 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1384 +#: ../../library/logging.rst:1383 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1395 +#: ../../library/logging.rst:1394 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1395 +#: ../../library/logging.rst:1394 msgid "" "Use the specified stream to initialize the :class:`StreamHandler`. Note that " "this argument is incompatible with *filename* - if both are present, a " "``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1401 +#: ../../library/logging.rst:1400 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1401 +#: ../../library/logging.rst:1400 msgid "" "If specified, this should be an iterable of already created handlers to add " "to the root logger. Any handlers which don't already have a formatter set " @@ -2057,112 +2050,111 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1410 +#: ../../library/logging.rst:1409 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1410 +#: ../../library/logging.rst:1409 msgid "" "If this keyword argument is specified as true, any existing handlers " "attached to the root logger are removed and closed, before carrying out the " "configuration as specified by the other arguments." msgstr "" -#: ../../library/logging.rst:1416 +#: ../../library/logging.rst:1415 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1416 +#: ../../library/logging.rst:1415 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " "the output file." msgstr "" -#: ../../library/logging.rst:1421 +#: ../../library/logging.rst:1420 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1421 +#: ../../library/logging.rst:1420 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " "the output file. If not specified, the value 'backslashreplace' is used. " -"Note that if ``None`` is specified, it will be passed as such " -"to :func:`open`, which means that it will be treated the same as passing " -"'errors'." +"Note that if ``None`` is specified, it will be passed as such to :func:" +"`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1432 +#: ../../library/logging.rst:1431 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1435 +#: ../../library/logging.rst:1434 msgid "" "The *handlers* argument was added. Additional checks were added to catch " "situations where incompatible arguments are specified (e.g. *handlers* " "together with *stream* or *filename*, or *stream* together with *filename*)." msgstr "" -#: ../../library/logging.rst:1441 +#: ../../library/logging.rst:1440 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1444 +#: ../../library/logging.rst:1443 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1449 +#: ../../library/logging.rst:1448 msgid "" "Informs the logging system to perform an orderly shutdown by flushing and " "closing all handlers. This should be called at application exit and no " "further use of the logging system should be made after this call." msgstr "" -#: ../../library/logging.rst:1453 +#: ../../library/logging.rst:1452 msgid "" "When the logging module is imported, it registers this function as an exit " "handler (see :mod:`atexit`), so normally there's no need to do that manually." msgstr "" -#: ../../library/logging.rst:1460 +#: ../../library/logging.rst:1459 msgid "" "Tells the logging system to use the class *klass* when instantiating a " "logger. The class should define :meth:`!__init__` such that only a name " -"argument is required, and the :meth:`!__init__` should call :meth:`!" -"Logger.__init__`. This function is typically called before any loggers are " +"argument is required, and the :meth:`!__init__` should call :meth:`!Logger." +"__init__`. This function is typically called before any loggers are " "instantiated by applications which need to use custom logger behavior. After " "this call, as at any other time, do not instantiate loggers directly using " "the subclass: continue to use the :func:`logging.getLogger` API to get your " "loggers." msgstr "" -#: ../../library/logging.rst:1471 +#: ../../library/logging.rst:1470 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1473 +#: ../../library/logging.rst:1472 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1475 +#: ../../library/logging.rst:1474 msgid "" "This function has been provided, along with :func:`getLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1480 +#: ../../library/logging.rst:1479 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1482 +#: ../../library/logging.rst:1481 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1484 +#: ../../library/logging.rst:1483 msgid "The logger name." msgstr "" @@ -2170,7 +2162,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1485 +#: ../../library/logging.rst:1484 msgid "The logging level (numeric)." msgstr "" @@ -2178,7 +2170,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1486 +#: ../../library/logging.rst:1485 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -2186,19 +2178,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1487 +#: ../../library/logging.rst:1486 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1488 +#: ../../library/logging.rst:1487 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1489 +#: ../../library/logging.rst:1488 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1490 +#: ../../library/logging.rst:1489 msgid "An exception tuple, or ``None``." msgstr "" @@ -2206,7 +2198,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1491 +#: ../../library/logging.rst:1490 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -2214,7 +2206,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1493 +#: ../../library/logging.rst:1492 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -2224,34 +2216,34 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1495 +#: ../../library/logging.rst:1494 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1499 +#: ../../library/logging.rst:1498 msgid "Module-Level Attributes" msgstr "模組層級屬性" -#: ../../library/logging.rst:1503 +#: ../../library/logging.rst:1502 msgid "" -"A \"handler of last resort\" is available through this attribute. This is " -"a :class:`StreamHandler` writing to ``sys.stderr`` with a level of " -"``WARNING``, and is used to handle logging events in the absence of any " -"logging configuration. The end result is to just print the message to " -"``sys.stderr``. This replaces the earlier error message saying that \"no " -"handlers could be found for logger XYZ\". If you need the earlier behaviour " -"for some reason, ``lastResort`` can be set to ``None``." +"A \"handler of last resort\" is available through this attribute. This is a :" +"class:`StreamHandler` writing to ``sys.stderr`` with a level of ``WARNING``, " +"and is used to handle logging events in the absence of any logging " +"configuration. The end result is to just print the message to ``sys." +"stderr``. This replaces the earlier error message saying that \"no handlers " +"could be found for logger XYZ\". If you need the earlier behaviour for some " +"reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1515 +#: ../../library/logging.rst:1514 msgid "Used to see if exceptions during handling should be propagated." msgstr "" -#: ../../library/logging.rst:1517 +#: ../../library/logging.rst:1516 msgid "Default: ``True``." msgstr "" -#: ../../library/logging.rst:1519 +#: ../../library/logging.rst:1518 msgid "" "If :data:`raiseExceptions` is ``False``, exceptions get silently ignored. " "This is what is mostly wanted for a logging system - most users will not " @@ -2259,70 +2251,70 @@ msgid "" "application errors." msgstr "" -#: ../../library/logging.rst:1526 +#: ../../library/logging.rst:1525 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1528 +#: ../../library/logging.rst:1527 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1533 +#: ../../library/logging.rst:1532 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1536 +#: ../../library/logging.rst:1535 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " "formatted using :func:`warnings.formatwarning` and the resulting string " -"logged to a logger named ``'py.warnings'`` with a severity " -"of :const:`WARNING`." +"logged to a logger named ``'py.warnings'`` with a severity of :const:" +"`WARNING`." msgstr "" -#: ../../library/logging.rst:1541 +#: ../../library/logging.rst:1540 msgid "" "If *capture* is ``False``, the redirection of warnings to the logging system " -"will stop, and warnings will be redirected to their original destinations " -"(i.e. those in effect before ``captureWarnings(True)`` was called)." +"will stop, and warnings will be redirected to their original destinations (i." +"e. those in effect before ``captureWarnings(True)`` was called)." msgstr "" -#: ../../library/logging.rst:1548 +#: ../../library/logging.rst:1547 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../library/logging.rst:1549 +#: ../../library/logging.rst:1548 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1551 +#: ../../library/logging.rst:1550 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../library/logging.rst:1552 +#: ../../library/logging.rst:1551 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1554 +#: ../../library/logging.rst:1553 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1555 +#: ../../library/logging.rst:1554 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1558 +#: ../../library/logging.rst:1557 msgid "" -"`Original Python logging package `_" +"`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1559 +#: ../../library/logging.rst:1558 msgid "" "This is the original source for the :mod:`logging` package. The version of " "the package available from this site is suitable for use with Python 1.5.2, " diff --git a/library/os.po b/library/os.po index b9c13b0f20..a882bc46b5 100644 --- a/library/os.po +++ b/library/os.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2024-04-29 15:24+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,10 +31,10 @@ msgid "" "This module provides a portable way of using operating system dependent " "functionality. If you just want to read or write a file see :func:`open`, " "if you want to manipulate paths, see the :mod:`os.path` module, and if you " -"want to read all the lines in all the files on the command line see " -"the :mod:`fileinput` module. For creating temporary files and directories " -"see the :mod:`tempfile` module, and for high-level file and directory " -"handling see the :mod:`shutil` module." +"want to read all the lines in all the files on the command line see the :mod:" +"`fileinput` module. For creating temporary files and directories see the :" +"mod:`tempfile` module, and for high-level file and directory handling see " +"the :mod:`shutil` module." msgstr "" "該模組提供了一種便利的方式來操作與作業系統相關的功能。如果你想讀取或寫入檔" "案,請參閱 :func:`open` ,如果你想操作檔案路徑,請參閱 :mod:`os.path` 模組," @@ -84,11 +84,11 @@ msgstr "在 VxWorks, 不支援 os.popen、os.fork、os.execv 和 os.spawn*p*。" #: ../../library/os.rst:37 msgid "" "On WebAssembly platforms, Android and iOS, large parts of the :mod:`os` " -"module are not available or behave differently. APIs related to processes " -"(e.g. :func:`~os.fork`, :func:`~os.execve`) and resources " -"(e.g. :func:`~os.nice`) are not available. Others like :func:`~os.getuid` " -"and :func:`~os.getpid` are emulated or stubs. WebAssembly platforms also " -"lack support for signals (e.g. :func:`~os.kill`, :func:`~os.wait`)." +"module are not available or behave differently. APIs related to processes (e." +"g. :func:`~os.fork`, :func:`~os.execve`) and resources (e.g. :func:`~os." +"nice`) are not available. Others like :func:`~os.getuid` and :func:`~os." +"getpid` are emulated or stubs. WebAssembly platforms also lack support for " +"signals (e.g. :func:`~os.kill`, :func:`~os.wait`)." msgstr "" "在 WebAssembly 平台和 Android 與 iOS 上,大部分 :mod:`os` 模組無法使用或行為" "不同。與行程 (process)(例如 :func:`~os.fork`、:func:`~os.execve`\\ )與資源" @@ -143,9 +143,9 @@ msgstr "" #: ../../library/os.rst:82 msgid "" "The :term:`filesystem encoding and error handler` are configured at Python " -"startup by the :c:func:`PyConfig_Read` function: " -"see :c:member:`~PyConfig.filesystem_encoding` " -"and :c:member:`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." +"startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." +"filesystem_encoding` and :c:member:`~PyConfig.filesystem_errors` members of :" +"c:type:`PyConfig`." msgstr "" #: ../../library/os.rst:87 @@ -161,8 +161,8 @@ msgstr "" msgid "" "The :term:`file system encoding ` " "must guarantee to successfully decode all bytes below 128. If the file " -"system encoding fails to provide this guarantee, API functions can " -"raise :exc:`UnicodeError`." +"system encoding fails to provide this guarantee, API functions can raise :" +"exc:`UnicodeError`." msgstr "" #: ../../library/os.rst:100 @@ -220,9 +220,9 @@ msgstr "在 Unix 中,:func:`os.device_encoding` 回傳 ``'utf-8'`` 而非裝 #: ../../library/os.rst:127 msgid "" -"Note that the standard stream settings in UTF-8 mode can be overridden " -"by :envvar:`PYTHONIOENCODING` (just as they can be in the default locale-" -"aware mode)." +"Note that the standard stream settings in UTF-8 mode can be overridden by :" +"envvar:`PYTHONIOENCODING` (just as they can be in the default locale-aware " +"mode)." msgstr "" "請注意,在 UTF-8 模式中,標準的串流設定會被 :envvar:`PYTHONIOENCODING` 覆蓋" "(如同在預設在地化覺察 模式一樣)。" @@ -282,8 +282,8 @@ msgstr "" #: ../../library/os.rst:159 msgid "" -"See also the :ref:`UTF-8 mode on Windows ` and " -"the :term:`filesystem encoding and error handler`." +"See also the :ref:`UTF-8 mode on Windows ` and the :term:" +"`filesystem encoding and error handler`." msgstr "" #: ../../library/os.rst:164 @@ -411,9 +411,9 @@ msgstr "" msgid "" "This mapping is captured the first time the :mod:`os` module is imported, " "typically during Python startup as part of processing :file:`site.py`. " -"Changes to the environment made after this time are not reflected " -"in :data:`os.environ`, except for changes made by " -"modifying :data:`os.environ` directly." +"Changes to the environment made after this time are not reflected in :data:" +"`os.environ`, except for changes made by modifying :data:`os.environ` " +"directly." msgstr "" #: ../../library/os.rst:196 @@ -442,8 +442,8 @@ msgid "" "Calling :func:`putenv` directly does not change :data:`os.environ`, so it's " "better to modify :data:`os.environ`." msgstr "" -"呼叫 :func:`putenv` 並不會改變 :data:`os.environ`,所以建議直接修" -"改 :data:`os.environ`。" +"呼叫 :func:`putenv` 並不會改變 :data:`os.environ`,所以建議直接修改 :data:" +"`os.environ`。" #: ../../library/os.rst:216 msgid "" @@ -453,10 +453,10 @@ msgstr "" #: ../../library/os.rst:220 msgid "" -"You can delete items in this mapping to unset environment " -"variables. :func:`unsetenv` will be called automatically when an item is " -"deleted from :data:`os.environ`, and when one of the :meth:`pop` " -"or :meth:`clear` methods is called." +"You can delete items in this mapping to unset environment variables. :func:" +"`unsetenv` will be called automatically when an item is deleted from :data:" +"`os.environ`, and when one of the :meth:`pop` or :meth:`clear` methods is " +"called." msgstr "" #: ../../library/os.rst:227 @@ -471,9 +471,9 @@ msgstr "" #: ../../library/os.rst:235 msgid "" "Bytes version of :data:`environ`: a :term:`mapping` object where both keys " -"and values are :class:`bytes` objects representing the process " -"environment. :data:`environ` and :data:`environb` are synchronized " -"(modifying :data:`environb` updates :data:`environ`, and vice versa)." +"and values are :class:`bytes` objects representing the process environment. :" +"data:`environ` and :data:`environb` are synchronized (modifying :data:" +"`environb` updates :data:`environ`, and vice versa)." msgstr "" #: ../../library/os.rst:240 @@ -495,9 +495,9 @@ msgstr "" #: ../../library/os.rst:259 msgid "" "This function is not thread-safe. Calling it while the environment is being " -"modified in an other thread is an undefined behavior. Reading " -"from :data:`os.environ` or :data:`os.environb`, or calling :func:`os.getenv` " -"while reloading, may return an empty result." +"modified in an other thread is an undefined behavior. Reading from :data:`os." +"environ` or :data:`os.environb`, or calling :func:`os.getenv` while " +"reloading, may return an empty result." msgstr "" #: ../../library/os.rst:272 @@ -506,9 +506,8 @@ msgstr "" #: ../../library/os.rst:277 msgid "" -"Encode :term:`path-like ` *filename* to " -"the :term:`filesystem encoding and error handler`; return :class:`bytes` " -"unchanged." +"Encode :term:`path-like ` *filename* to the :term:" +"`filesystem encoding and error handler`; return :class:`bytes` unchanged." msgstr "" #: ../../library/os.rst:281 @@ -523,9 +522,8 @@ msgstr "" #: ../../library/os.rst:292 msgid "" -"Decode the :term:`path-like ` *filename* from " -"the :term:`filesystem encoding and error handler`; return :class:`str` " -"unchanged." +"Decode the :term:`path-like ` *filename* from the :term:" +"`filesystem encoding and error handler`; return :class:`str` unchanged." msgstr "" #: ../../library/os.rst:296 @@ -563,10 +561,10 @@ msgstr "" #: ../../library/os.rst:335 msgid "" "Return the value of the environment variable *key* as a string if it exists, " -"or *default* if it doesn't. *key* is a string. Note that " -"since :func:`getenv` uses :data:`os.environ`, the mapping of :func:`getenv` " -"is similarly also captured on import, and the function may not reflect " -"future environment changes." +"or *default* if it doesn't. *key* is a string. Note that since :func:" +"`getenv` uses :data:`os.environ`, the mapping of :func:`getenv` is similarly " +"also captured on import, and the function may not reflect future environment " +"changes." msgstr "" #: ../../library/os.rst:341 @@ -579,10 +577,10 @@ msgstr "" #: ../../library/os.rst:350 msgid "" "Return the value of the environment variable *key* as bytes if it exists, or " -"*default* if it doesn't. *key* must be bytes. Note that " -"since :func:`getenvb` uses :data:`os.environb`, the mapping " -"of :func:`getenvb` is similarly also captured on import, and the function " -"may not reflect future environment changes." +"*default* if it doesn't. *key* must be bytes. Note that since :func:" +"`getenvb` uses :data:`os.environb`, the mapping of :func:`getenvb` is " +"similarly also captured on import, and the function may not reflect future " +"environment changes." msgstr "" #: ../../library/os.rst:357 @@ -645,19 +643,18 @@ msgid "" "access list for the user associated with the effective user id of the " "process; the group access list may change over the lifetime of the process, " "it is not affected by calls to :func:`setgroups`, and its length is not " -"limited to 16. The deployment target " -"value, :const:`MACOSX_DEPLOYMENT_TARGET`, can be obtained " -"with :func:`sysconfig.get_config_var`." +"limited to 16. The deployment target value, :const:" +"`MACOSX_DEPLOYMENT_TARGET`, can be obtained with :func:`sysconfig." +"get_config_var`." msgstr "" #: ../../library/os.rst:442 msgid "" "Return the name of the user logged in on the controlling terminal of the " -"process. For most purposes, it is more useful to " -"use :func:`getpass.getuser` since the latter checks the environment " -"variables :envvar:`LOGNAME` or :envvar:`USERNAME` to find out who the user " -"is, and falls back to ``pwd.getpwuid(os.getuid())[0]`` to get the login name " -"of the current real user id." +"process. For most purposes, it is more useful to use :func:`getpass." +"getuser` since the latter checks the environment variables :envvar:`LOGNAME` " +"or :envvar:`USERNAME` to find out who the user is, and falls back to ``pwd." +"getpwuid(os.getuid())[0]`` to get the login name of the current real user id." msgstr "" #: ../../library/os.rst:454 @@ -687,13 +684,13 @@ msgstr "新增對 Windows 的支援。" #: ../../library/os.rst:495 msgid "" -"Get program scheduling priority. The value *which* is one " -"of :const:`PRIO_PROCESS`, :const:`PRIO_PGRP`, or :const:`PRIO_USER`, and " -"*who* is interpreted relative to *which* (a process identifier " -"for :const:`PRIO_PROCESS`, process group identifier for :const:`PRIO_PGRP`, " -"and a user ID for :const:`PRIO_USER`). A zero value for *who* denotes " -"(respectively) the calling process, the process group of the calling " -"process, or the real user ID of the calling process." +"Get program scheduling priority. The value *which* is one of :const:" +"`PRIO_PROCESS`, :const:`PRIO_PGRP`, or :const:`PRIO_USER`, and *who* is " +"interpreted relative to *which* (a process identifier for :const:" +"`PRIO_PROCESS`, process group identifier for :const:`PRIO_PGRP`, and a user " +"ID for :const:`PRIO_USER`). A zero value for *who* denotes (respectively) " +"the calling process, the process group of the calling process, or the real " +"user ID of the calling process." msgstr "" #: ../../library/os.rst:512 ../../library/os.rst:524 @@ -727,8 +724,8 @@ msgstr "" #: ../../library/os.rst:577 msgid "" "Set the environment variable named *key* to the string *value*. Such " -"changes to the environment affect subprocesses started " -"with :func:`os.system`, :func:`popen` or :func:`fork` and :func:`execv`." +"changes to the environment affect subprocesses started with :func:`os." +"system`, :func:`popen` or :func:`fork` and :func:`execv`." msgstr "" #: ../../library/os.rst:581 @@ -736,9 +733,9 @@ msgid "" "Assignments to items in :data:`os.environ` are automatically translated into " "corresponding calls to :func:`putenv`; however, calls to :func:`putenv` " "don't update :data:`os.environ`, so it is actually preferable to assign to " -"items of :data:`os.environ`. This also applies to :func:`getenv` " -"and :func:`getenvb`, which respectively use :data:`os.environ` " -"and :data:`os.environb` in their implementations." +"items of :data:`os.environ`. This also applies to :func:`getenv` and :func:" +"`getenvb`, which respectively use :data:`os.environ` and :data:`os.environb` " +"in their implementations." msgstr "" #: ../../library/os.rst:587 ../../library/os.rst:837 @@ -756,8 +753,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.putenv`` with arguments " "``key``, ``value``." msgstr "" -"引發一個附帶引數 ``key``、``value`` 的\\ :ref:`稽核事件 ` " -"``os.putenv``。" +"引發一個附帶引數 ``key``、``value`` 的\\ :ref:`稽核事件 ` ``os." +"putenv``。" #: ../../library/os.rst:596 msgid "The function is now always available." @@ -786,16 +783,15 @@ msgstr "" #: ../../library/os.rst:629 msgid "" "On macOS, the length of *groups* may not exceed the system-defined maximum " -"number of effective group ids, typically 16. See the documentation " -"for :func:`getgroups` for cases where it may not return the same group list " -"set by calling setgroups()." +"number of effective group ids, typically 16. See the documentation for :func:" +"`getgroups` for cases where it may not return the same group list set by " +"calling setgroups()." msgstr "" #: ../../library/os.rst:636 msgid "" -"Reassociate the current thread with a Linux namespace. See " -"the :manpage:`setns(2)` and :manpage:`namespaces(7)` man pages for more " -"details." +"Reassociate the current thread with a Linux namespace. See the :manpage:" +"`setns(2)` and :manpage:`namespaces(7)` man pages for more details." msgstr "" #: ../../library/os.rst:640 @@ -809,14 +805,13 @@ msgstr "" #: ../../library/os.rst:647 msgid "" -"Since Linux 5.8, *fd* may refer to a PID file descriptor obtained " -"from :func:`~os.pidfd_open`. In this case, ``setns()`` reassociates the " -"calling thread into one or more of the same namespaces as the thread " -"referred to by *fd*. This is subject to any constraints imposed by *nstype*, " -"which is a bit mask combining one or more of the :ref:`CLONE_NEW* constants " -"`, e.g. ``setns(fd, os.CLONE_NEWUTS | " -"os.CLONE_NEWPID)``. The caller's memberships in unspecified namespaces are " -"left unchanged." +"Since Linux 5.8, *fd* may refer to a PID file descriptor obtained from :func:" +"`~os.pidfd_open`. In this case, ``setns()`` reassociates the calling thread " +"into one or more of the same namespaces as the thread referred to by *fd*. " +"This is subject to any constraints imposed by *nstype*, which is a bit mask " +"combining one or more of the :ref:`CLONE_NEW* constants `, e.g. ``setns(fd, os.CLONE_NEWUTS | os.CLONE_NEWPID)``. The caller's " +"memberships in unspecified namespaces are left unchanged." msgstr "" #: ../../library/os.rst:656 @@ -861,15 +856,15 @@ msgstr "" #: ../../library/os.rst:693 msgid "" -"Set program scheduling priority. The value *which* is one " -"of :const:`PRIO_PROCESS`, :const:`PRIO_PGRP`, or :const:`PRIO_USER`, and " -"*who* is interpreted relative to *which* (a process identifier " -"for :const:`PRIO_PROCESS`, process group identifier for :const:`PRIO_PGRP`, " -"and a user ID for :const:`PRIO_USER`). A zero value for *who* denotes " -"(respectively) the calling process, the process group of the calling " -"process, or the real user ID of the calling process. *priority* is a value " -"in the range -20 to 19. The default priority is 0; lower priorities cause " -"more favorable scheduling." +"Set program scheduling priority. The value *which* is one of :const:" +"`PRIO_PROCESS`, :const:`PRIO_PGRP`, or :const:`PRIO_USER`, and *who* is " +"interpreted relative to *which* (a process identifier for :const:" +"`PRIO_PROCESS`, process group identifier for :const:`PRIO_PGRP`, and a user " +"ID for :const:`PRIO_USER`). A zero value for *who* denotes (respectively) " +"the calling process, the process group of the calling process, or the real " +"user ID of the calling process. *priority* is a value in the range -20 to " +"19. The default priority is 0; lower priorities cause more favorable " +"scheduling." msgstr "" #: ../../library/os.rst:710 @@ -950,9 +945,8 @@ msgstr "" #: ../../library/os.rst:802 msgid "" "For backwards compatibility, this object is also iterable, behaving like a " -"five-tuple " -"containing :attr:`sysname`, :attr:`nodename`, :attr:`release`, :attr:`version`, " -"and :attr:`machine` in that order." +"five-tuple containing :attr:`sysname`, :attr:`nodename`, :attr:`release`, :" +"attr:`version`, and :attr:`machine` in that order." msgstr "" #: ../../library/os.rst:807 @@ -965,9 +959,9 @@ msgstr "" #: ../../library/os.rst:812 msgid "" "On macOS, iOS and Android, this returns the *kernel* name and version (i.e., " -"``'Darwin'`` on macOS and iOS; ``'Linux'`` on " -"Android). :func:`platform.uname` can be used to get the user-facing " -"operating system name and version on iOS and Android." +"``'Darwin'`` on macOS and iOS; ``'Linux'`` on Android). :func:`platform." +"uname` can be used to get the user-facing operating system name and version " +"on iOS and Android." msgstr "" #: ../../library/os.rst:819 ../../library/os.rst:5083 @@ -979,8 +973,8 @@ msgstr "" #: ../../library/os.rst:828 msgid "" "Unset (delete) the environment variable named *key*. Such changes to the " -"environment affect subprocesses started " -"with :func:`os.system`, :func:`popen` or :func:`fork` and :func:`execv`." +"environment affect subprocesses started with :func:`os.system`, :func:" +"`popen` or :func:`fork` and :func:`execv`." msgstr "" #: ../../library/os.rst:832 @@ -1006,11 +1000,11 @@ msgstr "" msgid "" "Disassociate parts of the process execution context, and move them into a " "newly created namespace. See the :manpage:`unshare(2)` man page for more " -"details. The *flags* argument is a bit mask, combining zero or more of " -"the :ref:`CLONE_* constants `, that specifies which " -"parts of the execution context should be unshared from their existing " -"associations and moved to a new namespace. If the *flags* argument is ``0``, " -"no changes are made to the calling process's execution context." +"details. The *flags* argument is a bit mask, combining zero or more of the :" +"ref:`CLONE_* constants `, that specifies which parts " +"of the execution context should be unshared from their existing associations " +"and moved to a new namespace. If the *flags* argument is ``0``, no changes " +"are made to the calling process's execution context." msgstr "" #: ../../library/os.rst:864 @@ -1030,8 +1024,8 @@ msgstr "" #: ../../library/os.rst:893 msgid "" -"These functions create new :term:`file objects `. (See " -"also :func:`~os.open` for opening file descriptors.)" +"These functions create new :term:`file objects `. (See also :" +"func:`~os.open` for opening file descriptors.)" msgstr "" #: ../../library/os.rst:899 @@ -1077,8 +1071,8 @@ msgstr "" msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To close a " -"\"file object\" returned by the built-in function :func:`open` or " -"by :func:`popen` or :func:`fdopen`, use its :meth:`~io.IOBase.close` method." +"\"file object\" returned by the built-in function :func:`open` or by :func:" +"`popen` or :func:`fdopen`, use its :meth:`~io.IOBase.close` method." msgstr "" #: ../../library/os.rst:939 @@ -1112,8 +1106,8 @@ msgstr "" #: ../../library/os.rst:956 msgid "" "In Linux kernel older than 5.3, the files pointed to by *src* and *dst* must " -"reside in the same filesystem, otherwise an :exc:`OSError` is raised " -"with :attr:`~OSError.errno` set to :const:`errno.EXDEV`." +"reside in the same filesystem, otherwise an :exc:`OSError` is raised with :" +"attr:`~OSError.errno` set to :const:`errno.EXDEV`." msgstr "" #: ../../library/os.rst:960 @@ -1164,8 +1158,8 @@ msgstr "" #: ../../library/os.rst:999 msgid "" -"Return a duplicate of file descriptor *fd*. The new file descriptor " -"is :ref:`non-inheritable `." +"Return a duplicate of file descriptor *fd*. The new file descriptor is :ref:" +"`non-inheritable `." msgstr "" #: ../../library/os.rst:1002 @@ -1226,9 +1220,8 @@ msgstr "新增對 Windows 的支援。" #: ../../library/os.rst:1047 msgid "" "Change the owner and group id of the file given by *fd* to the numeric *uid* " -"and *gid*. To leave one of the ids unchanged, set it to -1. " -"See :func:`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, " -"uid, gid)``." +"and *gid*. To leave one of the ids unchanged, set it to -1. See :func:" +"`chown`. As of Python 3.3, this is equivalent to ``os.chown(fd, uid, gid)``." msgstr "" #: ../../library/os.rst:1052 ../../library/os.rst:2235 @@ -1265,8 +1258,8 @@ msgstr "" msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " -"included in ``pathconf_names``, an :exc:`OSError` is raised " -"with :const:`errno.EINVAL` for the error number." +"included in ``pathconf_names``, an :exc:`OSError` is raised with :const:" +"`errno.EINVAL` for the error number." msgstr "" #: ../../library/os.rst:1086 @@ -1311,8 +1304,8 @@ msgstr "" #: ../../library/os.rst:1126 msgid "" "Truncate the file corresponding to file descriptor *fd*, so that it is at " -"most *length* bytes in size. As of Python 3.3, this is equivalent to " -"``os.truncate(fd, length)``." +"most *length* bytes in size. As of Python 3.3, this is equivalent to ``os." +"truncate(fd, length)``." msgstr "" #: ../../library/os.rst:1130 @@ -1320,8 +1313,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``fd``, ``length``." msgstr "" -"引發一個附帶引數 ``fd``、``length`` 的\\ :ref:`稽核事件 ` " -"``os.truncate``。" +"引發一個附帶引數 ``fd``、``length`` 的\\ :ref:`稽核事件 ` ``os." +"truncate``。" #: ../../library/os.rst:1134 ../../library/os.rst:3571 msgid "Added support for Windows" @@ -1329,8 +1322,8 @@ msgstr "新增對 Windows 的支援" #: ../../library/os.rst:1140 msgid "" -"Get the blocking mode of the file descriptor: ``False`` if " -"the :data:`O_NONBLOCK` flag is set, ``True`` if the flag is cleared." +"Get the blocking mode of the file descriptor: ``False`` if the :data:" +"`O_NONBLOCK` flag is set, ``True`` if the flag is cleared." msgstr "" #: ../../library/os.rst:1143 @@ -1365,8 +1358,8 @@ msgstr "" #: ../../library/os.rst:1179 msgid "" "Apply, test or remove a POSIX lock on an open file descriptor. *fd* is an " -"open file descriptor. *cmd* specifies the command to use - one " -"of :data:`F_LOCK`, :data:`F_TLOCK`, :data:`F_ULOCK` or :data:`F_TEST`. *len* " +"open file descriptor. *cmd* specifies the command to use - one of :data:" +"`F_LOCK`, :data:`F_TLOCK`, :data:`F_ULOCK` or :data:`F_TEST`. *len* " "specifies the section of the file to lock." msgstr "" @@ -1502,8 +1495,8 @@ msgstr "" msgid "" "For a description of the flag and mode values, see the C run-time " "documentation; flag constants (like :const:`O_RDONLY` and :const:`O_WRONLY`) " -"are defined in the :mod:`os` module. In particular, on Windows " -"adding :const:`O_BINARY` is needed to open files in binary mode." +"are defined in the :mod:`os` module. In particular, on Windows adding :" +"const:`O_BINARY` is needed to open files in binary mode." msgstr "" #: ../../library/os.rst:1288 @@ -1523,9 +1516,9 @@ msgstr "" #: ../../library/os.rst:1298 msgid "" "This function is intended for low-level I/O. For normal usage, use the " -"built-in function :func:`open`, which returns a :term:`file object` " -"with :meth:`~file.read` and :meth:`~file.write` methods (and many more). To " -"wrap a file descriptor in a file object, use :func:`fdopen`." +"built-in function :func:`open`, which returns a :term:`file object` with :" +"meth:`~file.read` and :meth:`~file.write` methods (and many more). To wrap " +"a file descriptor in a file object, use :func:`fdopen`." msgstr "" #: ../../library/os.rst:1303 ../../library/os.rst:2479 @@ -1540,8 +1533,8 @@ msgstr "新增 *dir_fd* 參數。" #: ../../library/os.rst:1892 ../../library/os.rst:5179 msgid "" "If the system call is interrupted and the signal handler does not raise an " -"exception, the function now retries the system call instead of raising " -"an :exc:`InterruptedError` exception (see :pep:`475` for the rationale)." +"exception, the function now retries the system call instead of raising an :" +"exc:`InterruptedError` exception (see :pep:`475` for the rationale)." msgstr "" #: ../../library/os.rst:1311 ../../library/os.rst:2102 @@ -1564,12 +1557,12 @@ msgstr "" #: ../../library/os.rst:1314 msgid "" -"The following constants are options for the *flags* parameter to " -"the :func:`~os.open` function. They can be combined using the bitwise OR " -"operator ``|``. Some of them are not available on all platforms. For " -"descriptions of their availability and use, consult the :manpage:`open(2)` " -"manual page on Unix or `the MSDN `_ on Windows." +"The following constants are options for the *flags* parameter to the :func:" +"`~os.open` function. They can be combined using the bitwise OR operator ``|" +"``. Some of them are not available on all platforms. For descriptions of " +"their availability and use, consult the :manpage:`open(2)` manual page on " +"Unix or `the MSDN `_ " +"on Windows." msgstr "" #: ../../library/os.rst:1329 @@ -1594,8 +1587,8 @@ msgstr "" #: ../../library/os.rst:1362 msgid "" -"Add :data:`O_EVTONLY`, :data:`O_FSYNC`, :data:`O_SYMLINK` " -"and :data:`O_NOFOLLOW_ANY` constants." +"Add :data:`O_EVTONLY`, :data:`O_FSYNC`, :data:`O_SYMLINK` and :data:" +"`O_NOFOLLOW_ANY` constants." msgstr "" #: ../../library/os.rst:1376 @@ -1632,9 +1625,9 @@ msgstr "" #: ../../library/os.rst:1414 msgid "" "Create a pipe with *flags* set atomically. *flags* can be constructed by " -"ORing together one or more of these " -"values: :data:`O_NONBLOCK`, :data:`O_CLOEXEC`. Return a pair of file " -"descriptors ``(r, w)`` usable for reading and writing, respectively." +"ORing together one or more of these values: :data:`O_NONBLOCK`, :data:" +"`O_CLOEXEC`. Return a pair of file descriptors ``(r, w)`` usable for reading " +"and writing, respectively." msgstr "" #: ../../library/os.rst:1427 @@ -1648,9 +1641,10 @@ msgid "" "Announces an intention to access data in a specific pattern thus allowing " "the kernel to make optimizations. The advice applies to the region of the " "file specified by *fd* starting at *offset* and continuing for *len* bytes. " -"*advice* is one " -"of :data:`POSIX_FADV_NORMAL`, :data:`POSIX_FADV_SEQUENTIAL`, :data:`POSIX_FADV_RANDOM`, :data:`POSIX_FADV_NOREUSE`, :data:`POSIX_FADV_WILLNEED` " -"or :data:`POSIX_FADV_DONTNEED`." +"*advice* is one of :data:`POSIX_FADV_NORMAL`, :data:" +"`POSIX_FADV_SEQUENTIAL`, :data:`POSIX_FADV_RANDOM`, :data:" +"`POSIX_FADV_NOREUSE`, :data:`POSIX_FADV_WILLNEED` or :data:" +"`POSIX_FADV_DONTNEED`." msgstr "" #: ../../library/os.rst:1457 @@ -1691,11 +1685,10 @@ msgstr "" #: ../../library/os.rst:1497 msgid "" -"Read from a file descriptor *fd* at a position of *offset* into " -"mutable :term:`bytes-like objects ` *buffers*, leaving " -"the file offset unchanged. Transfer data into each buffer until it is full " -"and then move on to the next buffer in the sequence to hold the rest of the " -"data." +"Read from a file descriptor *fd* at a position of *offset* into mutable :" +"term:`bytes-like objects ` *buffers*, leaving the file " +"offset unchanged. Transfer data into each buffer until it is full and then " +"move on to the next buffer in the sequence to hold the rest of the data." msgstr "" #: ../../library/os.rst:1502 ../../library/os.rst:1587 @@ -1743,8 +1736,8 @@ msgstr "" #: ../../library/os.rst:1529 msgid "" "If some data was successfully read, it will return the number of bytes read. " -"If no bytes were read, it will return ``-1`` and set errno " -"to :const:`errno.EAGAIN`." +"If no bytes were read, it will return ``-1`` and set errno to :const:`errno." +"EAGAIN`." msgstr "" #: ../../library/os.rst:1540 @@ -1786,10 +1779,10 @@ msgstr "" #: ../../library/os.rst:1581 msgid "" "Write the *buffers* contents to file descriptor *fd* at an offset *offset*, " -"leaving the file offset unchanged. *buffers* must be a sequence " -"of :term:`bytes-like objects `. Buffers are processed in " -"array order. Entire contents of the first buffer is written before " -"proceeding to the second, and so on." +"leaving the file offset unchanged. *buffers* must be a sequence of :term:" +"`bytes-like objects `. Buffers are processed in array " +"order. Entire contents of the first buffer is written before proceeding to " +"the second, and so on." msgstr "" #: ../../library/os.rst:1590 @@ -1843,8 +1836,8 @@ msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To read a \"file " "object\" returned by the built-in function :func:`open` or by :func:`popen` " -"or :func:`fdopen`, or :data:`sys.stdin`, use its :meth:`~file.read` " -"or :meth:`~file.readline` methods." +"or :func:`fdopen`, or :data:`sys.stdin`, use its :meth:`~file.read` or :meth:" +"`~file.readline` methods." msgstr "" #: ../../library/os.rst:1665 @@ -1873,10 +1866,9 @@ msgstr "" msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`os.pipe`. To read a " -"\"file object\" returned by the built-in function :func:`open`, " -"or :data:`sys.stdin`, use its member functions, for " -"example :meth:`io.BufferedIOBase.readinto`, :meth:`io.BufferedIOBase.read`, " -"or :meth:`io.TextIOBase.read`" +"\"file object\" returned by the built-in function :func:`open`, or :data:" +"`sys.stdin`, use its member functions, for example :meth:`io.BufferedIOBase." +"readinto`, :meth:`io.BufferedIOBase.read`, or :meth:`io.TextIOBase.read`" msgstr "" #: ../../library/os.rst:1693 @@ -1888,8 +1880,8 @@ msgstr "" #: ../../library/os.rst:1697 msgid "" -"The first function notation is supported by all platforms that " -"define :func:`sendfile`." +"The first function notation is supported by all platforms that define :func:" +"`sendfile`." msgstr "" #: ../../library/os.rst:1700 @@ -1926,8 +1918,8 @@ msgstr "" #: ../../library/os.rst:1720 msgid "" -"For a higher-level wrapper of :func:`sendfile`, " -"see :meth:`socket.socket.sendfile`." +"For a higher-level wrapper of :func:`sendfile`, see :meth:`socket.socket." +"sendfile`." msgstr "" #: ../../library/os.rst:1725 @@ -1949,9 +1941,8 @@ msgstr "" #: ../../library/os.rst:1752 msgid "" -"Set the blocking mode of the specified file descriptor. Set " -"the :data:`O_NONBLOCK` flag if blocking is ``False``, clear the flag " -"otherwise." +"Set the blocking mode of the specified file descriptor. Set the :data:" +"`O_NONBLOCK` flag if blocking is ``False``, clear the flag otherwise." msgstr "" #: ../../library/os.rst:1755 @@ -1997,8 +1988,8 @@ msgid "" "is ``None``, then *src* is read from the current position; respectively for " "*offset_dst*. The offset associated to the file descriptor that refers to a " "pipe must be ``None``. The files pointed to by *src* and *dst* must reside " -"in the same filesystem, otherwise an :exc:`OSError` is raised " -"with :attr:`~OSError.errno` set to :const:`errno.EXDEV`." +"in the same filesystem, otherwise an :exc:`OSError` is raised with :attr:" +"`~OSError.errno` set to :const:`errno.EXDEV`." msgstr "" #: ../../library/os.rst:1798 @@ -2068,9 +2059,9 @@ msgstr "" msgid "" "This function is intended for low-level I/O and must be applied to a file " "descriptor as returned by :func:`os.open` or :func:`pipe`. To write a " -"\"file object\" returned by the built-in function :func:`open` or " -"by :func:`popen` or :func:`fdopen`, or :data:`sys.stdout` " -"or :data:`sys.stderr`, use its :meth:`~file.write` method." +"\"file object\" returned by the built-in function :func:`open` or by :func:" +"`popen` or :func:`fdopen`, or :data:`sys.stdout` or :data:`sys.stderr`, use " +"its :meth:`~file.write` method." msgstr "" #: ../../library/os.rst:1900 @@ -2201,8 +2192,8 @@ msgstr "" msgid "" "You can check whether or not *path* can be specified as a file descriptor " "for a particular function on your platform using :data:`os.supports_fd`. If " -"this functionality is unavailable, using it will raise " -"a :exc:`NotImplementedError`." +"this functionality is unavailable, using it will raise a :exc:" +"`NotImplementedError`." msgstr "" #: ../../library/os.rst:2020 @@ -2251,10 +2242,10 @@ msgid "" "operations will use the effective uid/gid, therefore this routine can be " "used in a suid/sgid environment to test if the invoking user has the " "specified access to *path*. *mode* should be :const:`F_OK` to test the " -"existence of *path*, or it can be the inclusive OR of one or more " -"of :const:`R_OK`, :const:`W_OK`, and :const:`X_OK` to test permissions. " -"Return :const:`True` if access is allowed, :const:`False` if not. See the " -"Unix man page :manpage:`access(2)` for more information." +"existence of *path*, or it can be the inclusive OR of one or more of :const:" +"`R_OK`, :const:`W_OK`, and :const:`X_OK` to test permissions. Return :const:" +"`True` if access is allowed, :const:`False` if not. See the Unix man page :" +"manpage:`access(2)` for more information." msgstr "" #: ../../library/os.rst:2061 @@ -2345,9 +2336,8 @@ msgstr "" #: ../../library/os.rst:2125 msgid "" -"This function can raise :exc:`OSError` and subclasses such " -"as :exc:`FileNotFoundError`, :exc:`PermissionError`, " -"and :exc:`NotADirectoryError`." +"This function can raise :exc:`OSError` and subclasses such as :exc:" +"`FileNotFoundError`, :exc:`PermissionError`, and :exc:`NotADirectoryError`." msgstr "" #: ../../library/os.rst:2128 ../../library/os.rst:2266 @@ -2365,8 +2355,8 @@ msgstr "" #: ../../library/os.rst:2140 msgid "" "Set the flags of *path* to the numeric *flags*. *flags* may take a " -"combination (bitwise OR) of the following values (as defined in " -"the :mod:`stat` module):" +"combination (bitwise OR) of the following values (as defined in the :mod:" +"`stat` module):" msgstr "" #: ../../library/os.rst:2143 @@ -2427,8 +2417,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.chflags`` with arguments " "``path``, ``flags``." msgstr "" -"引發一個附帶引數 ``path``、``flags`` 的\\ :ref:`稽核事件 ` " -"``os.chflags``。" +"引發一個附帶引數 ``path``、``flags`` 的\\ :ref:`稽核事件 ` ``os." +"chflags``。" #: ../../library/os.rst:2162 msgid "Added the *follow_symlinks* parameter." @@ -2520,9 +2510,9 @@ msgstr ":const:`stat.S_IXOTH`" #: ../../library/os.rst:2195 ../../library/os.rst:2228 #: ../../library/os.rst:3620 msgid "" -"This function can support :ref:`specifying a file descriptor " -"`, :ref:`paths relative to directory descriptors ` " -"and :ref:`not following symlinks `." +"This function can support :ref:`specifying a file descriptor `, :" +"ref:`paths relative to directory descriptors ` and :ref:`not " +"following symlinks `." msgstr "" #: ../../library/os.rst:2201 @@ -2590,16 +2580,16 @@ msgstr "" #: ../../library/os.rst:2288 msgid "" "Set the flags of *path* to the numeric *flags*, like :func:`chflags`, but do " -"not follow symbolic links. As of Python 3.3, this is equivalent to " -"``os.chflags(path, flags, follow_symlinks=False)``." +"not follow symbolic links. As of Python 3.3, this is equivalent to ``os." +"chflags(path, flags, follow_symlinks=False)``." msgstr "" #: ../../library/os.rst:2302 msgid "" "Change the mode of *path* to the numeric *mode*. If path is a symlink, this " "affects the symlink rather than the target. See the docs for :func:`chmod` " -"for possible values of *mode*. As of Python 3.3, this is equivalent to " -"``os.chmod(path, mode, follow_symlinks=False)``." +"for possible values of *mode*. As of Python 3.3, this is equivalent to ``os." +"chmod(path, mode, follow_symlinks=False)``." msgstr "" #: ../../library/os.rst:2307 @@ -2622,8 +2612,8 @@ msgstr "" #: ../../library/os.rst:2338 msgid "" "This function can support specifying *src_dir_fd* and/or *dst_dir_fd* to " -"supply :ref:`paths relative to directory descriptors `, " -"and :ref:`not following symlinks `. The default value of " +"supply :ref:`paths relative to directory descriptors `, and :ref:" +"`not following symlinks `. The default value of " "*follow_symlinks* is ``False`` on Windows." msgstr "" @@ -2725,10 +2715,10 @@ msgstr "" #: ../../library/os.rst:2418 msgid "" -"*volume* must be represented as a GUID path, like those returned " -"by :func:`os.listvolumes`. Volumes may be mounted in multiple locations or " -"not at all. In the latter case, the list will be empty. Mount points that " -"are not associated with a volume will not be returned by this function." +"*volume* must be represented as a GUID path, like those returned by :func:" +"`os.listvolumes`. Volumes may be mounted in multiple locations or not at " +"all. In the latter case, the list will be empty. Mount points that are not " +"associated with a volume will not be returned by this function." msgstr "" #: ../../library/os.rst:2424 @@ -2748,8 +2738,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.listmounts`` with argument " "``volume``." msgstr "" -"引發一個附帶引數 ``volume`` 的\\ :ref:`稽核事件 ` " -"``os.listmounts``。" +"引發一個附帶引數 ``volume`` 的\\ :ref:`稽核事件 ` ``os." +"listmounts``。" #: ../../library/os.rst:2439 msgid "Return a list containing the volumes in the system." @@ -2777,14 +2767,14 @@ msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.lis #: ../../library/os.rst:2459 msgid "" "Perform the equivalent of an :c:func:`!lstat` system call on the given path. " -"Similar to :func:`~os.stat`, but does not follow symbolic links. Return " -"a :class:`stat_result` object." +"Similar to :func:`~os.stat`, but does not follow symbolic links. Return a :" +"class:`stat_result` object." msgstr "" #: ../../library/os.rst:2463 msgid "" -"On platforms that do not support symbolic links, this is an alias " -"for :func:`~os.stat`." +"On platforms that do not support symbolic links, this is an alias for :func:" +"`~os.stat`." msgstr "" #: ../../library/os.rst:2466 @@ -2810,8 +2800,8 @@ msgstr "" msgid "" "On Windows, now opens reparse points that represent another path (name " "surrogates), including symbolic links and directory junctions. Other kinds " -"of reparse points are resolved by the operating system as " -"for :func:`~os.stat`." +"of reparse points are resolved by the operating system as for :func:`~os." +"stat`." msgstr "" #: ../../library/os.rst:2494 @@ -2896,10 +2886,10 @@ msgstr "新增 *exist_ok* 參數。" #: ../../library/os.rst:2561 msgid "" -"Before Python 3.4.1, if *exist_ok* was ``True`` and the directory " -"existed, :func:`makedirs` would still raise an error if *mode* did not match " -"the mode of the existing directory. Since this behavior was impossible to " -"implement safely, it was removed in Python 3.4.1. See :issue:`21082`." +"Before Python 3.4.1, if *exist_ok* was ``True`` and the directory existed, :" +"func:`makedirs` would still raise an error if *mode* did not match the mode " +"of the existing directory. Since this behavior was impossible to implement " +"safely, it was removed in Python 3.4.1. See :issue:`21082`." msgstr "" #: ../../library/os.rst:2569 @@ -2928,23 +2918,23 @@ msgstr "" msgid "" "Create a filesystem node (file, device special file or named pipe) named " "*path*. *mode* specifies both the permissions to use and the type of node to " -"be created, being combined (bitwise OR) with one of ``stat.S_IFREG``, " -"``stat.S_IFCHR``, ``stat.S_IFBLK``, and ``stat.S_IFIFO`` (those constants " -"are available in :mod:`stat`). For ``stat.S_IFCHR`` and ``stat.S_IFBLK``, " -"*device* defines the newly created device special file (probably " -"using :func:`os.makedev`), otherwise it is ignored." +"be created, being combined (bitwise OR) with one of ``stat.S_IFREG``, ``stat." +"S_IFCHR``, ``stat.S_IFBLK``, and ``stat.S_IFIFO`` (those constants are " +"available in :mod:`stat`). For ``stat.S_IFCHR`` and ``stat.S_IFBLK``, " +"*device* defines the newly created device special file (probably using :func:" +"`os.makedev`), otherwise it is ignored." msgstr "" #: ../../library/os.rst:2621 msgid "" -"Extract the device major number from a raw device number (usually " -"the :attr:`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." +"Extract the device major number from a raw device number (usually the :attr:" +"`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" #: ../../library/os.rst:2627 msgid "" -"Extract the device minor number from a raw device number (usually " -"the :attr:`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." +"Extract the device minor number from a raw device number (usually the :attr:" +"`st_dev` or :attr:`st_rdev` field from :c:struct:`stat`)." msgstr "" #: ../../library/os.rst:2633 @@ -2979,23 +2969,22 @@ msgstr "" msgid "" "Return a string representing the path to which the symbolic link points. " "The result may be either an absolute or relative pathname; if it is " -"relative, it may be converted to an absolute pathname using " -"``os.path.join(os.path.dirname(path), result)``." +"relative, it may be converted to an absolute pathname using ``os.path." +"join(os.path.dirname(path), result)``." msgstr "" #: ../../library/os.rst:2676 msgid "" -"If the *path* is a string object (directly or indirectly through " -"a :class:`PathLike` interface), the result will also be a string object, and " -"the call may raise a UnicodeDecodeError. If the *path* is a bytes object " -"(direct or indirectly), the result will be a bytes object." +"If the *path* is a string object (directly or indirectly through a :class:" +"`PathLike` interface), the result will also be a string object, and the call " +"may raise a UnicodeDecodeError. If the *path* is a bytes object (direct or " +"indirectly), the result will be a bytes object." msgstr "" #: ../../library/os.rst:2684 msgid "" -"When trying to resolve a path that may contain links, " -"use :func:`~os.path.realpath` to properly handle recursion and platform " -"differences." +"When trying to resolve a path that may contain links, use :func:`~os.path." +"realpath` to properly handle recursion and platform differences." msgstr "" #: ../../library/os.rst:2696 @@ -3015,9 +3004,9 @@ msgstr "" #: ../../library/os.rst:2708 msgid "" -"Remove (delete) the file *path*. If *path* is a directory, " -"an :exc:`OSError` is raised. Use :func:`rmdir` to remove directories. If " -"the file does not exist, a :exc:`FileNotFoundError` is raised." +"Remove (delete) the file *path*. If *path* is a directory, an :exc:" +"`OSError` is raised. Use :func:`rmdir` to remove directories. If the file " +"does not exist, a :exc:`FileNotFoundError` is raised." msgstr "" #: ../../library/os.rst:2712 ../../library/os.rst:2825 @@ -3045,8 +3034,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.remove`` with arguments " "``path``, ``dir_fd``." msgstr "" -"引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` " -"``os.remove``。" +"引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." +"remove``。" #: ../../library/os.rst:2734 msgid "" @@ -3069,14 +3058,14 @@ msgstr "" #: ../../library/os.rst:2754 msgid "" "On Windows, if *dst* exists a :exc:`FileExistsError` is always raised. The " -"operation may fail if *src* and *dst* are on different filesystems. " -"Use :func:`shutil.move` to support moves to a different filesystem." +"operation may fail if *src* and *dst* are on different filesystems. Use :" +"func:`shutil.move` to support moves to a different filesystem." msgstr "" #: ../../library/os.rst:2758 msgid "" -"On Unix, if *src* is a file and *dst* is a directory or vice-versa, " -"an :exc:`IsADirectoryError` or a :exc:`NotADirectoryError` will be raised " +"On Unix, if *src* is a file and *dst* is a directory or vice-versa, an :exc:" +"`IsADirectoryError` or a :exc:`NotADirectoryError` will be raised " "respectively. If both are directories and *dst* is empty, *dst* will be " "silently replaced. If *dst* is a non-empty directory, an :exc:`OSError` is " "raised. If both are files, *dst* will be replaced silently if the user has " @@ -3093,8 +3082,8 @@ msgstr "" #: ../../library/os.rst:2770 msgid "" -"If you want cross-platform overwriting of the destination, " -"use :func:`replace`." +"If you want cross-platform overwriting of the destination, use :func:" +"`replace`." msgstr "" #: ../../library/os.rst:2772 ../../library/os.rst:2793 @@ -3142,8 +3131,8 @@ msgstr "" msgid "" "Remove (delete) the directory *path*. If the directory does not exist or is " "not empty, a :exc:`FileNotFoundError` or an :exc:`OSError` is raised " -"respectively. In order to remove whole directory " -"trees, :func:`shutil.rmtree` can be used." +"respectively. In order to remove whole directory trees, :func:`shutil." +"rmtree` can be used." msgstr "" #: ../../library/os.rst:2828 @@ -3151,8 +3140,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.rmdir`` with arguments " "``path``, ``dir_fd``." msgstr "" -"引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` " -"``os.rmdir``。" +"引發一個附帶引數 ``path``、``dir_fd`` 的\\ :ref:`稽核事件 ` ``os." +"rmdir``。" #: ../../library/os.rst:2839 msgid "" @@ -3169,12 +3158,11 @@ msgid "" "Using :func:`scandir` instead of :func:`listdir` can significantly increase " "the performance of code that also needs file type or file attribute " "information, because :class:`os.DirEntry` objects expose this information if " -"the operating system provides it when scanning a directory. " -"All :class:`os.DirEntry` methods may perform a system call, " -"but :func:`~os.DirEntry.is_dir` and :func:`~os.DirEntry.is_file` usually " -"only require a system call for symbolic links; :func:`os.DirEntry.stat` " -"always requires a system call on Unix but only requires one for symbolic " -"links on Windows." +"the operating system provides it when scanning a directory. All :class:`os." +"DirEntry` methods may perform a system call, but :func:`~os.DirEntry.is_dir` " +"and :func:`~os.DirEntry.is_file` usually only require a system call for " +"symbolic links; :func:`os.DirEntry.stat` always requires a system call on " +"Unix but only requires one for symbolic links on Windows." msgstr "" #: ../../library/os.rst:2856 @@ -3237,17 +3225,17 @@ msgid "" "pubs.opengroup.org/onlinepubs/009695399/functions/opendir.html>`_ and " "`readdir() `_ functions. On Windows, it uses the Win32 `FindFirstFileW " -"`_ and `FindNextFileW `_ functions." +"`_ and `FindNextFileW `_ functions." msgstr "" #: ../../library/os.rst:2905 msgid "" -"Added support for the :term:`context manager` protocol and " -"the :func:`~scandir.close` method. If a :func:`scandir` iterator is neither " -"exhausted nor explicitly closed a :exc:`ResourceWarning` will be emitted in " -"its destructor." +"Added support for the :term:`context manager` protocol and the :func:" +"`~scandir.close` method. If a :func:`scandir` iterator is neither exhausted " +"nor explicitly closed a :exc:`ResourceWarning` will be emitted in its " +"destructor." msgstr "" #: ../../library/os.rst:2911 @@ -3305,25 +3293,25 @@ msgstr "" #: ../../library/os.rst:2946 msgid "" "The :attr:`name` attribute will be ``bytes`` if the :func:`scandir` *path* " -"argument is of type ``bytes`` and ``str`` otherwise. " -"Use :func:`~os.fsdecode` to decode byte filenames." +"argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." +"fsdecode` to decode byte filenames." msgstr "" #: ../../library/os.rst:2952 msgid "" -"The entry's full path name: equivalent to ``os.path.join(scandir_path, " -"entry.name)`` where *scandir_path* is the :func:`scandir` *path* argument. " -"The path is only absolute if the :func:`scandir` *path* argument was " -"absolute. If the :func:`scandir` *path* argument was a :ref:`file " -"descriptor `, the :attr:`path` attribute is the same as " -"the :attr:`name` attribute." +"The entry's full path name: equivalent to ``os.path.join(scandir_path, entry." +"name)`` where *scandir_path* is the :func:`scandir` *path* argument. The " +"path is only absolute if the :func:`scandir` *path* argument was absolute. " +"If the :func:`scandir` *path* argument was a :ref:`file descriptor " +"`, the :attr:`path` attribute is the same as the :attr:`name` " +"attribute." msgstr "" #: ../../library/os.rst:2959 msgid "" "The :attr:`path` attribute will be ``bytes`` if the :func:`scandir` *path* " -"argument is of type ``bytes`` and ``str`` otherwise. " -"Use :func:`~os.fsdecode` to decode byte filenames." +"argument is of type ``bytes`` and ``str`` otherwise. Use :func:`~os." +"fsdecode` to decode byte filenames." msgstr "" #: ../../library/os.rst:2965 @@ -3332,9 +3320,8 @@ msgstr "" #: ../../library/os.rst:2967 msgid "" -"The result is cached on the ``os.DirEntry`` object. Use " -"``os.stat(entry.path, follow_symlinks=False).st_ino`` to fetch up-to-date " -"information." +"The result is cached on the ``os.DirEntry`` object. Use ``os.stat(entry." +"path, follow_symlinks=False).st_ino`` to fetch up-to-date information." msgstr "" #: ../../library/os.rst:2971 @@ -3376,8 +3363,8 @@ msgstr "" #: ../../library/os.rst:2995 ../../library/os.rst:3025 msgid "" -"This method can raise :exc:`OSError`, such as :exc:`PermissionError`, " -"but :exc:`FileNotFoundError` is caught and not raised." +"This method can raise :exc:`OSError`, such as :exc:`PermissionError`, but :" +"exc:`FileNotFoundError` is caught and not raised." msgstr "" #: ../../library/os.rst:3000 @@ -3409,8 +3396,8 @@ msgstr "" #: ../../library/os.rst:3017 msgid "" -"The result is cached on the ``os.DirEntry`` object. " -"Call :func:`os.path.islink` to fetch up-to-date information." +"The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." +"islink` to fetch up-to-date information." msgstr "" #: ../../library/os.rst:3020 @@ -3430,8 +3417,8 @@ msgstr "" #: ../../library/os.rst:3034 msgid "" -"The result is cached on the ``os.DirEntry`` object. " -"Call :func:`os.path.isjunction` to fetch up-to-date information." +"The result is cached on the ``os.DirEntry`` object. Call :func:`os.path." +"isjunction` to fetch up-to-date information." msgstr "" #: ../../library/os.rst:3041 @@ -3450,8 +3437,8 @@ msgstr "" #: ../../library/os.rst:3050 msgid "" -"On Windows, the ``st_ino``, ``st_dev`` and ``st_nlink`` attributes of " -"the :class:`stat_result` are always set to zero. Call :func:`os.stat` to get " +"On Windows, the ``st_ino``, ``st_dev`` and ``st_nlink`` attributes of the :" +"class:`stat_result` are always set to zero. Call :func:`os.stat` to get " "these attributes." msgstr "" @@ -3472,8 +3459,8 @@ msgstr "" #: ../../library/os.rst:3066 msgid "" -"Added support for the :class:`~os.PathLike` interface. Added support " -"for :class:`bytes` paths on Windows." +"Added support for the :class:`~os.PathLike` interface. Added support for :" +"class:`bytes` paths on Windows." msgstr "" #: ../../library/os.rst:3070 @@ -3486,11 +3473,11 @@ msgstr "" #: ../../library/os.rst:3079 msgid "" -"Get the status of a file or a file descriptor. Perform the equivalent of " -"a :c:func:`stat` system call on the given path. *path* may be specified as " -"either a string or bytes -- directly or indirectly through " -"the :class:`PathLike` interface -- or as an open file descriptor. Return " -"a :class:`stat_result` object." +"Get the status of a file or a file descriptor. Perform the equivalent of a :" +"c:func:`stat` system call on the given path. *path* may be specified as " +"either a string or bytes -- directly or indirectly through the :class:" +"`PathLike` interface -- or as an open file descriptor. Return a :class:" +"`stat_result` object." msgstr "" #: ../../library/os.rst:3085 @@ -3503,8 +3490,8 @@ msgstr "" #: ../../library/os.rst:4183 ../../library/os.rst:4199 #: ../../library/os.rst:4219 msgid "" -"This function can support :ref:`specifying a file descriptor ` " -"and :ref:`not following symlinks `." +"This function can support :ref:`specifying a file descriptor ` and :" +"ref:`not following symlinks `." msgstr "" #: ../../library/os.rst:3091 @@ -3515,10 +3502,10 @@ msgid "" "the operating system is unable to follow will be opened directly. When " "following a chain of multiple links, this may result in the original link " "being returned instead of the non-link that prevented full traversal. To " -"obtain stat results for the final path in this case, use " -"the :func:`os.path.realpath` function to resolve the path name as far as " -"possible and call :func:`lstat` on the result. This does not apply to " -"dangling symlinks or junction points, which will raise the usual exceptions." +"obtain stat results for the final path in this case, use the :func:`os.path." +"realpath` function to resolve the path name as far as possible and call :" +"func:`lstat` on the result. This does not apply to dangling symlinks or " +"junction points, which will raise the usual exceptions." msgstr "" #: ../../library/os.rst:3104 ../../library/os.rst:3874 @@ -3567,9 +3554,9 @@ msgstr "" #: ../../library/os.rst:3137 msgid "" -"Object whose attributes correspond roughly to the members of " -"the :c:struct:`stat` structure. It is used for the result " -"of :func:`os.stat`, :func:`os.fstat` and :func:`os.lstat`." +"Object whose attributes correspond roughly to the members of the :c:struct:" +"`stat` structure. It is used for the result of :func:`os.stat`, :func:`os." +"fstat` and :func:`os.lstat`." msgstr "" #: ../../library/os.rst:3141 @@ -3682,26 +3669,25 @@ msgstr "" #: ../../library/os.rst:3241 msgid "" -"The exact meaning and resolution of " -"the :attr:`st_atime`, :attr:`st_mtime`, :attr:`st_ctime` " -"and :attr:`st_birthtime` attributes depend on the operating system and the " -"file system. For example, on Windows systems using the FAT32 file " -"systems, :attr:`st_mtime` has 2-second resolution, and :attr:`st_atime` has " -"only 1-day resolution. See your operating system documentation for details." +"The exact meaning and resolution of the :attr:`st_atime`, :attr:`st_mtime`, :" +"attr:`st_ctime` and :attr:`st_birthtime` attributes depend on the operating " +"system and the file system. For example, on Windows systems using the FAT32 " +"file systems, :attr:`st_mtime` has 2-second resolution, and :attr:`st_atime` " +"has only 1-day resolution. See your operating system documentation for " +"details." msgstr "" #: ../../library/os.rst:3248 msgid "" -"Similarly, " -"although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, :attr:`st_ctime_ns` " -"and :attr:`st_birthtime_ns` are always expressed in nanoseconds, many " -"systems do not provide nanosecond precision. On systems that do provide " -"nanosecond precision, the floating-point object used to " -"store :attr:`st_atime`, :attr:`st_mtime`, :attr:`st_ctime` " -"and :attr:`st_birthtime` cannot preserve all of it, and as such will be " -"slightly inexact. If you need the exact timestamps you should always " -"use :attr:`st_atime_ns`, :attr:`st_mtime_ns`, :attr:`st_ctime_ns` " -"and :attr:`st_birthtime_ns`." +"Similarly, although :attr:`st_atime_ns`, :attr:`st_mtime_ns`, :attr:" +"`st_ctime_ns` and :attr:`st_birthtime_ns` are always expressed in " +"nanoseconds, many systems do not provide nanosecond precision. On systems " +"that do provide nanosecond precision, the floating-point object used to " +"store :attr:`st_atime`, :attr:`st_mtime`, :attr:`st_ctime` and :attr:" +"`st_birthtime` cannot preserve all of it, and as such will be slightly " +"inexact. If you need the exact timestamps you should always use :attr:" +"`st_atime_ns`, :attr:`st_mtime_ns`, :attr:`st_ctime_ns` and :attr:" +"`st_birthtime_ns`." msgstr "" #: ../../library/os.rst:3258 @@ -3712,8 +3698,8 @@ msgstr "" #: ../../library/os.rst:3263 msgid "" -"Number of 512-byte blocks allocated for file. This may be smaller " -"than :attr:`st_size`/512 when the file has holes." +"Number of 512-byte blocks allocated for file. This may be smaller than :attr:" +"`st_size`/512 when the file has holes." msgstr "" #: ../../library/os.rst:3268 @@ -3775,16 +3761,16 @@ msgstr "" msgid "" "Windows file attributes: ``dwFileAttributes`` member of the " "``BY_HANDLE_FILE_INFORMATION`` structure returned by :c:func:`!" -"GetFileInformationByHandle`. See the :const:`!FILE_ATTRIBUTE_* " -"` constants in the :mod:`stat` module." +"GetFileInformationByHandle`. See the :const:`!FILE_ATTRIBUTE_* ` constants in the :mod:`stat` module." msgstr "" #: ../../library/os.rst:3322 msgid "" -"When :attr:`st_file_attributes` has " -"the :const:`~stat.FILE_ATTRIBUTE_REPARSE_POINT` set, this field contains the " -"tag identifying the type of reparse point. See the :const:`IO_REPARSE_TAG_* " -"` constants in the :mod:`stat` module." +"When :attr:`st_file_attributes` has the :const:`~stat." +"FILE_ATTRIBUTE_REPARSE_POINT` set, this field contains the tag identifying " +"the type of reparse point. See the :const:`IO_REPARSE_TAG_* ` constants in the :mod:`stat` module." msgstr "" #: ../../library/os.rst:3327 @@ -3798,11 +3784,12 @@ msgstr "" msgid "" "For backward compatibility, a :class:`stat_result` instance is also " "accessible as a tuple of at least 10 integers giving the most important (and " -"portable) members of the :c:struct:`stat` structure, in the " -"order :attr:`st_mode`, :attr:`st_ino`, :attr:`st_dev`, :attr:`st_nlink`, :attr:`st_uid`, :attr:`st_gid`, :attr:`st_size`, :attr:`st_atime`, :attr:`st_mtime`, :attr:`st_ctime`. " -"More items may be added at the end by some implementations. For " -"compatibility with older Python versions, accessing :class:`stat_result` as " -"a tuple always returns integers." +"portable) members of the :c:struct:`stat` structure, in the order :attr:" +"`st_mode`, :attr:`st_ino`, :attr:`st_dev`, :attr:`st_nlink`, :attr:" +"`st_uid`, :attr:`st_gid`, :attr:`st_size`, :attr:`st_atime`, :attr:" +"`st_mtime`, :attr:`st_ctime`. More items may be added at the end by some " +"implementations. For compatibility with older Python versions, accessing :" +"class:`stat_result` as a tuple always returns integers." msgstr "" #: ../../library/os.rst:3340 @@ -3819,8 +3806,8 @@ msgstr "在 Windows 上新增 :attr:`st_reparse_tag` 成員。" #: ../../library/os.rst:3350 msgid "" -"On Windows, the :attr:`st_mode` member now identifies special files " -"as :const:`S_IFCHR`, :const:`S_IFIFO` or :const:`S_IFBLK` as appropriate." +"On Windows, the :attr:`st_mode` member now identifies special files as :" +"const:`S_IFCHR`, :const:`S_IFIFO` or :const:`S_IFBLK` as appropriate." msgstr "" #: ../../library/os.rst:3355 @@ -3852,7 +3839,9 @@ msgid "" "Perform a :c:func:`!statvfs` system call on the given path. The return " "value is an object whose attributes describe the filesystem on the given " "path, and correspond to the members of the :c:struct:`statvfs` structure, " -"namely: :attr:`f_bsize`, :attr:`f_frsize`, :attr:`f_blocks`, :attr:`f_bfree`, :attr:`f_bavail`, :attr:`f_files`, :attr:`f_ffree`, :attr:`f_favail`, :attr:`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." +"namely: :attr:`f_bsize`, :attr:`f_frsize`, :attr:`f_blocks`, :attr:" +"`f_bfree`, :attr:`f_bavail`, :attr:`f_files`, :attr:`f_ffree`, :attr:" +"`f_favail`, :attr:`f_flag`, :attr:`f_namemax`, :attr:`f_fsid`." msgstr "" #: ../../library/os.rst:3380 @@ -3866,15 +3855,14 @@ msgstr "" #: ../../library/os.rst:3385 msgid "" "Additional module-level constants are defined for GNU/glibc based systems. " -"These are :const:`ST_NODEV` (disallow access to device special " -"files), :const:`ST_NOEXEC` (disallow program " -"execution), :const:`ST_SYNCHRONOUS` (writes are synced at " -"once), :const:`ST_MANDLOCK` (allow mandatory locks on an " -"FS), :const:`ST_WRITE` (write on file/directory/symlink), :const:`ST_APPEND` " -"(append-only file), :const:`ST_IMMUTABLE` (immutable " -"file), :const:`ST_NOATIME` (do not update access " -"times), :const:`ST_NODIRATIME` (do not update directory access " -"times), :const:`ST_RELATIME` (update atime relative to mtime/ctime)." +"These are :const:`ST_NODEV` (disallow access to device special files), :" +"const:`ST_NOEXEC` (disallow program execution), :const:`ST_SYNCHRONOUS` " +"(writes are synced at once), :const:`ST_MANDLOCK` (allow mandatory locks on " +"an FS), :const:`ST_WRITE` (write on file/directory/symlink), :const:" +"`ST_APPEND` (append-only file), :const:`ST_IMMUTABLE` (immutable file), :" +"const:`ST_NOATIME` (do not update access times), :const:`ST_NODIRATIME` (do " +"not update directory access times), :const:`ST_RELATIME` (update atime " +"relative to mtime/ctime)." msgstr "" #: ../../library/os.rst:3398 @@ -3883,8 +3871,10 @@ msgstr "新增 :const:`ST_RDONLY` 與 :const:`ST_NOSUID` 常數。" #: ../../library/os.rst:3404 msgid "" -"The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:`ST_IMMUTABLE`, :const:`ST_NOATIME`, :const:`ST_NODIRATIME`, " -"and :const:`ST_RELATIME` constants were added." +"The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, :const:" +"`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, :const:" +"`ST_IMMUTABLE`, :const:`ST_NOATIME`, :const:`ST_NODIRATIME`, and :const:" +"`ST_RELATIME` constants were added." msgstr "" #: ../../library/os.rst:3413 @@ -3926,8 +3916,8 @@ msgid "" "A :class:`set` object indicating whether :func:`os.access` permits " "specifying ``True`` for its *effective_ids* parameter on the local platform. " "(Specifying ``False`` for *effective_ids* is always supported on all " -"platforms.) If the local platform supports it, the collection will " -"contain :func:`os.access`; otherwise it will be empty." +"platforms.) If the local platform supports it, the collection will contain :" +"func:`os.access`; otherwise it will be empty." msgstr "" #: ../../library/os.rst:3450 @@ -3959,8 +3949,8 @@ msgstr "" msgid "" "To determine whether a particular function permits specifying an open file " "descriptor for its *path* parameter, use the ``in`` operator on " -"``supports_fd``. As an example, this expression evaluates to ``True`` " -"if :func:`os.chdir` accepts open file descriptors for *path* on your local " +"``supports_fd``. As an example, this expression evaluates to ``True`` if :" +"func:`os.chdir` accepts open file descriptors for *path* on your local " "platform::" msgstr "" @@ -3986,8 +3976,8 @@ msgid "" "To check whether a particular function accepts ``False`` for its " "*follow_symlinks* parameter, use the ``in`` operator on " "``supports_follow_symlinks``. As an example, this expression evaluates to " -"``True`` if you may specify ``follow_symlinks=False`` when " -"calling :func:`os.stat` on the local platform::" +"``True`` if you may specify ``follow_symlinks=False`` when calling :func:`os." +"stat` on the local platform::" msgstr "" #: ../../library/os.rst:3499 @@ -4054,8 +4044,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.truncate`` with arguments " "``path``, ``length``." msgstr "" -"引發一個附帶引數 ``path``、``length`` 的\\ :ref:`稽核事件 ` " -"``os.truncate``。" +"引發一個附帶引數 ``path``、``length`` 的\\ :ref:`稽核事件 ` ``os." +"truncate``。" #: ../../library/os.rst:3580 msgid "" @@ -4098,12 +4088,12 @@ msgstr "" #: ../../library/os.rst:3613 msgid "" -"Note that the exact times you set here may not be returned by a " -"subsequent :func:`~os.stat` call, depending on the resolution with which " -"your operating system records access and modification times; " -"see :func:`~os.stat`. The best way to preserve exact times is to use the " -"*st_atime_ns* and *st_mtime_ns* fields from the :func:`os.stat` result " -"object with the *ns* parameter to :func:`utime`." +"Note that the exact times you set here may not be returned by a subsequent :" +"func:`~os.stat` call, depending on the resolution with which your operating " +"system records access and modification times; see :func:`~os.stat`. The best " +"way to preserve exact times is to use the *st_atime_ns* and *st_mtime_ns* " +"fields from the :func:`os.stat` result object with the *ns* parameter to :" +"func:`utime`." msgstr "" #: ../../library/os.rst:3624 @@ -4243,8 +4233,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.walk`` with arguments " "``top``, ``topdown``, ``onerror``, ``followlinks``." msgstr "" -"引發一個附帶引數 ``top``、``topdown``、``onerror``、``followlinks`` 的" -"\\ :ref:`稽核事件 ` ``os.walk``。" +"引發一個附帶引數 ``top``、``topdown``、``onerror``、``followlinks`` 的\\ :" +"ref:`稽核事件 ` ``os.walk``。" #: ../../library/os.rst:3726 msgid "" @@ -4283,9 +4273,9 @@ msgstr "" msgid "" "import os\n" "for root, dirs, files, rootfd in os.fwalk('python/Lib/xml'):\n" -" print(root, \"consumes\", end=\"\")\n" +" print(root, \"consumes\", end=\" \")\n" " print(sum([os.stat(name, dir_fd=rootfd).st_size for name in files]),\n" -" end=\"\")\n" +" end=\" \")\n" " print(\"bytes in\", len(files), \"non-directory files\")\n" " if '__pycache__' in dirs:\n" " dirs.remove('__pycache__') # don't visit __pycache__ directories" @@ -4352,10 +4342,10 @@ msgstr "``MFD_HUGE*`` 旗標僅在 Linux 4.14 以上可用。" #: ../../library/os.rst:3846 msgid "" "Create and return an event file descriptor. The file descriptors supports " -"raw :func:`read` and :func:`write` with a buffer size of " -"8, :func:`~select.select`, :func:`~select.poll` and similar. See man " -"page :manpage:`eventfd(2)` for more information. By default, the new file " -"descriptor is :ref:`non-inheritable `." +"raw :func:`read` and :func:`write` with a buffer size of 8, :func:`~select." +"select`, :func:`~select.poll` and similar. See man page :manpage:" +"`eventfd(2)` for more information. By default, the new file descriptor is :" +"ref:`non-inheritable `." msgstr "" #: ../../library/os.rst:3852 @@ -4374,8 +4364,8 @@ msgstr "" #: ../../library/os.rst:3860 msgid "" -"If :const:`EFD_SEMAPHORE` is specified and the event counter is non-" -"zero, :func:`eventfd_read` returns 1 and decrements the counter by one." +"If :const:`EFD_SEMAPHORE` is specified and the event counter is non-zero, :" +"func:`eventfd_read` returns 1 and decrements the counter by one." msgstr "" #: ../../library/os.rst:3863 @@ -4387,15 +4377,15 @@ msgstr "" #: ../../library/os.rst:3867 msgid "" -"If the event counter is zero and :const:`EFD_NONBLOCK` is not " -"specified, :func:`eventfd_read` blocks." +"If the event counter is zero and :const:`EFD_NONBLOCK` is not specified, :" +"func:`eventfd_read` blocks." msgstr "" #: ../../library/os.rst:3870 msgid "" ":func:`eventfd_write` increments the event counter. Write blocks if the " -"write operation would increment the counter to a value larger than " -"2\\ :sup:`64`\\ -\\ 2." +"write operation would increment the counter to a value larger than 2\\ :sup:" +"`64`\\ -\\ 2." msgstr "" #: ../../library/os.rst:3876 @@ -4445,7 +4435,7 @@ msgstr "" #: ../../library/os.rst:3943 msgid "Timer File Descriptors" -msgstr "" +msgstr "計時器檔案描述器" #: ../../library/os.rst:3947 msgid "" @@ -4478,8 +4468,8 @@ msgid "" "The file descriptor's :func:`read` method can be called with a buffer size " "of 8. If the timer has already expired one or more times, :func:`read` " "returns the number of expirations with the host's endianness, which may be " -"converted to an :class:`int` by ``int.from_bytes(x, " -"byteorder=sys.byteorder)``." +"converted to an :class:`int` by ``int.from_bytes(x, byteorder=sys." +"byteorder)``." msgstr "" #: ../../library/os.rst:3965 @@ -4510,8 +4500,8 @@ msgstr "" msgid "" "If *clockid* is :const:`time.CLOCK_REALTIME`, a settable system-wide real-" "time clock is used. If system clock is changed, timer setting need to be " -"updated. To cancel timer when system clock is changed, " -"see :const:`TFD_TIMER_CANCEL_ON_SET`." +"updated. To cancel timer when system clock is changed, see :const:" +"`TFD_TIMER_CANCEL_ON_SET`." msgstr "" #: ../../library/os.rst:3980 @@ -4523,9 +4513,8 @@ msgstr "" #: ../../library/os.rst:3984 msgid "" -"If *clockid* is :const:`time.CLOCK_BOOTTIME`, same " -"as :const:`time.CLOCK_MONOTONIC` except it includes any time that the system " -"is suspended." +"If *clockid* is :const:`time.CLOCK_BOOTTIME`, same as :const:`time." +"CLOCK_MONOTONIC` except it includes any time that the system is suspended." msgstr "" #: ../../library/os.rst:3987 @@ -4553,7 +4542,7 @@ msgstr "" #: ../../library/os.rst:4000 msgid ":const:`TFD_CLOEXEC` is always set by Python automatically." -msgstr "" +msgstr ":const:`TFD_CLOEXEC` 總是由 Python 自動設定。" #: ../../library/os.rst:4002 msgid "" @@ -4573,7 +4562,7 @@ msgstr "" #: ../../library/os.rst:4017 msgid "*fd* must be a valid timer file descriptor." -msgstr "" +msgstr "*fd* 必須是有效的計時器檔案描述器。" #: ../../library/os.rst:4019 msgid "" @@ -4594,8 +4583,8 @@ msgstr ":const:`TFD_TIMER_CANCEL_ON_SET`" msgid "" "The timer is disabled by setting *initial* to zero (``0``). If *initial* is " "equal to or greater than zero, the timer is enabled. If *initial* is less " -"than zero, it raises an :class:`OSError` exception with ``errno`` set " -"to :const:`errno.EINVAL`" +"than zero, it raises an :class:`OSError` exception with ``errno`` set to :" +"const:`errno.EINVAL`" msgstr "" #: ../../library/os.rst:4031 @@ -4617,17 +4606,17 @@ msgid "" "*interval* is zero, the timer only fires once, on the initial expiration. If " "*interval* is greater than zero, the timer fires every time *interval* " "seconds have elapsed since the previous expiration. If *interval* is less " -"than zero, it raises :class:`OSError` with ``errno`` set " -"to :const:`errno.EINVAL`" +"than zero, it raises :class:`OSError` with ``errno`` set to :const:`errno." +"EINVAL`" msgstr "" #: ../../library/os.rst:4045 msgid "" -"If the :const:`TFD_TIMER_CANCEL_ON_SET` flag is set along " -"with :const:`TFD_TIMER_ABSTIME` and the clock for this timer " -"is :const:`time.CLOCK_REALTIME`, the timer is marked as cancelable if the " -"real-time clock is changed discontinuously. Reading the descriptor is " -"aborted with the error ECANCELED." +"If the :const:`TFD_TIMER_CANCEL_ON_SET` flag is set along with :const:" +"`TFD_TIMER_ABSTIME` and the clock for this timer is :const:`time." +"CLOCK_REALTIME`, the timer is marked as cancelable if the real-time clock is " +"changed discontinuously. Reading the descriptor is aborted with the error " +"ECANCELED." msgstr "" #: ../../library/os.rst:4051 @@ -4662,8 +4651,8 @@ msgstr "" #: ../../library/os.rst:4066 msgid "" -":manpage:`timerfd_create(2)`, :manpage:`timerfd_settime(2)`, :manpage:`settimeofday(2)`, :manpage:`clock_settime(2)`, " -"and :manpage:`date(1)`." +":manpage:`timerfd_create(2)`, :manpage:`timerfd_settime(2)`, :manpage:" +"`settimeofday(2)`, :manpage:`clock_settime(2)`, and :manpage:`date(1)`." msgstr "" #: ../../library/os.rst:4077 @@ -4698,9 +4687,9 @@ msgstr "" #: ../../library/os.rst:4113 msgid "" -"A flag for the :func:`timerfd_create` function, which sets " -"the :const:`O_NONBLOCK` status flag for the new timer file descriptor. " -"If :const:`TFD_NONBLOCK` is not set as a flag, :func:`read` blocks." +"A flag for the :func:`timerfd_create` function, which sets the :const:" +"`O_NONBLOCK` status flag for the new timer file descriptor. If :const:" +"`TFD_NONBLOCK` is not set as a flag, :func:`read` blocks." msgstr "" #: ../../library/os.rst:4123 @@ -4735,9 +4724,9 @@ msgstr "" #: ../../library/os.rst:4162 msgid "" "Return the value of the extended filesystem attribute *attribute* for " -"*path*. *attribute* can be bytes or str (directly or indirectly through " -"the :class:`PathLike` interface). If it is str, it is encoded with the " -"filesystem encoding." +"*path*. *attribute* can be bytes or str (directly or indirectly through the :" +"class:`PathLike` interface). If it is str, it is encoded with the filesystem " +"encoding." msgstr "" #: ../../library/os.rst:4170 @@ -4771,9 +4760,9 @@ msgstr "" #: ../../library/os.rst:4194 msgid "" "Removes the extended filesystem attribute *attribute* from *path*. " -"*attribute* should be bytes or str (directly or indirectly through " -"the :class:`PathLike` interface). If it is a string, it is encoded with " -"the :term:`filesystem encoding and error handler`." +"*attribute* should be bytes or str (directly or indirectly through the :" +"class:`PathLike` interface). If it is a string, it is encoded with the :term:" +"`filesystem encoding and error handler`." msgstr "" #: ../../library/os.rst:4202 @@ -4791,9 +4780,9 @@ msgid "" "indirectly through the :class:`PathLike` interface). If it is a str, it is " "encoded with the :term:`filesystem encoding and error handler`. *flags* may " "be :data:`XATTR_REPLACE` or :data:`XATTR_CREATE`. If :data:`XATTR_REPLACE` " -"is given and the attribute does not exist, ``ENODATA`` will be raised. " -"If :data:`XATTR_CREATE` is given and the attribute already exists, the " -"attribute will not be created and ``EEXISTS`` will be raised." +"is given and the attribute does not exist, ``ENODATA`` will be raised. If :" +"data:`XATTR_CREATE` is given and the attribute already exists, the attribute " +"will not be created and ``EEXISTS`` will be raised." msgstr "" #: ../../library/os.rst:4224 @@ -4852,8 +4841,8 @@ msgid "" "Generate a :const:`SIGABRT` signal to the current process. On Unix, the " "default behavior is to produce a core dump; on Windows, the process " "immediately returns an exit code of ``3``. Be aware that calling this " -"function will not call the Python signal handler registered " -"for :const:`SIGABRT` with :func:`signal.signal`." +"function will not call the Python signal handler registered for :const:" +"`SIGABRT` with :func:`signal.signal`." msgstr "" #: ../../library/os.rst:4278 @@ -4875,9 +4864,9 @@ msgstr "" #: ../../library/os.rst:4287 msgid "" -"See the `Microsoft documentation `_ for more information about how DLLs " -"are loaded." +"See the `Microsoft documentation `_ for more information about how " +"DLLs are loaded." msgstr "" #: ../../library/os.rst:4291 @@ -4885,8 +4874,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.add_dll_directory`` with " "argument ``path``." msgstr "" -"引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` " -"``os.add_dll_directory``。" +"引發一個附帶引數 ``path`` 的\\ :ref:`稽核事件 ` ``os." +"add_dll_directory``。" #: ../../library/os.rst:4295 msgid "" @@ -4915,8 +4904,8 @@ msgstr "" msgid "" "The current process is replaced immediately. Open file objects and " "descriptors are not flushed, so if there may be data buffered on these open " -"files, you should flush them using :func:`sys.stdout.flush` " -"or :func:`os.fsync` before calling an :func:`exec\\* ` function." +"files, you should flush them using :func:`sys.stdout.flush` or :func:`os." +"fsync` before calling an :func:`exec\\* ` function." msgstr "" #: ../../library/os.rst:4328 @@ -4934,17 +4923,16 @@ msgstr "" #: ../../library/os.rst:4337 msgid "" -"The variants which include a \"p\" near the end " -"(:func:`execlp`, :func:`execlpe`, :func:`execvp`, and :func:`execvpe`) will " -"use the :envvar:`PATH` environment variable to locate the program *file*. " -"When the environment is being replaced (using one of the :func:`exec\\*e " -"` variants, discussed in the next paragraph), the new environment is " -"used as the source of the :envvar:`PATH` variable. The other " -"variants, :func:`execl`, :func:`execle`, :func:`execv`, and :func:`execve`, " -"will not use the :envvar:`PATH` variable to locate the executable; *path* " -"must contain an appropriate absolute or relative path. Relative paths must " -"include at least one slash, even on Windows, as plain names will not be " -"resolved." +"The variants which include a \"p\" near the end (:func:`execlp`, :func:" +"`execlpe`, :func:`execvp`, and :func:`execvpe`) will use the :envvar:`PATH` " +"environment variable to locate the program *file*. When the environment is " +"being replaced (using one of the :func:`exec\\*e ` variants, " +"discussed in the next paragraph), the new environment is used as the source " +"of the :envvar:`PATH` variable. The other variants, :func:`execl`, :func:" +"`execle`, :func:`execv`, and :func:`execve`, will not use the :envvar:`PATH` " +"variable to locate the executable; *path* must contain an appropriate " +"absolute or relative path. Relative paths must include at least one slash, " +"even on Windows, as plain names will not be resolved." msgstr "" #: ../../library/os.rst:4348 @@ -4952,18 +4940,18 @@ msgid "" "For :func:`execle`, :func:`execlpe`, :func:`execve`, and :func:`execvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " "which is used to define the environment variables for the new process (these " -"are used instead of the current process' environment); the " -"functions :func:`execl`, :func:`execlp`, :func:`execv`, and :func:`execvp` " -"all cause the new process to inherit the environment of the current process." +"are used instead of the current process' environment); the functions :func:" +"`execl`, :func:`execlp`, :func:`execv`, and :func:`execvp` all cause the new " +"process to inherit the environment of the current process." msgstr "" #: ../../library/os.rst:4355 msgid "" "For :func:`execve` on some platforms, *path* may also be specified as an " "open file descriptor. This functionality may not be supported on your " -"platform; you can check whether or not it is available " -"using :data:`os.supports_fd`. If it is unavailable, using it will raise " -"a :exc:`NotImplementedError`." +"platform; you can check whether or not it is available using :data:`os." +"supports_fd`. If it is unavailable, using it will raise a :exc:" +"`NotImplementedError`." msgstr "" #: ../../library/os.rst:4360 @@ -4976,8 +4964,8 @@ msgstr "" #: ../../library/os.rst:4364 msgid "" -"Added support for specifying *path* as an open file descriptor " -"for :func:`execve`." +"Added support for specifying *path* as an open file descriptor for :func:" +"`execve`." msgstr "" #: ../../library/os.rst:4373 @@ -5122,14 +5110,14 @@ msgstr "" #: ../../library/os.rst:4539 msgid "" -"Calling ``fork()`` in a subinterpreter is no longer supported " -"(:exc:`RuntimeError` is raised)." +"Calling ``fork()`` in a subinterpreter is no longer supported (:exc:" +"`RuntimeError` is raised)." msgstr "" #: ../../library/os.rst:4543 msgid "" -"If Python is able to detect that your process has multiple " -"threads, :func:`os.fork` now raises a :exc:`DeprecationWarning`." +"If Python is able to detect that your process has multiple threads, :func:" +"`os.fork` now raises a :exc:`DeprecationWarning`." msgstr "" #: ../../library/os.rst:4547 @@ -5173,15 +5161,15 @@ msgstr "引發一個不附帶引數的\\ :ref:`稽核事件 ` ``os.for #: ../../library/os.rst:4583 msgid "" -"Calling ``forkpty()`` in a subinterpreter is no longer supported " -"(:exc:`RuntimeError` is raised)." +"Calling ``forkpty()`` in a subinterpreter is no longer supported (:exc:" +"`RuntimeError` is raised)." msgstr "" #: ../../library/os.rst:4587 msgid "" "If Python is able to detect that your process has multiple threads, this now " -"raises a :exc:`DeprecationWarning`. See the longer explanation " -"on :func:`os.fork`." +"raises a :exc:`DeprecationWarning`. See the longer explanation on :func:`os." +"fork`." msgstr "" #: ../../library/os.rst:4601 @@ -5192,10 +5180,10 @@ msgstr "" #: ../../library/os.rst:4604 msgid "" -"Windows: The :const:`signal.CTRL_C_EVENT` " -"and :const:`signal.CTRL_BREAK_EVENT` signals are special signals which can " -"only be sent to console processes which share a common console window, e.g., " -"some subprocesses. Any other value for *sig* will cause the process to be " +"Windows: The :const:`signal.CTRL_C_EVENT` and :const:`signal." +"CTRL_BREAK_EVENT` signals are special signals which can only be sent to " +"console processes which share a common console window, e.g., some " +"subprocesses. Any other value for *sig* will cause the process to be " "unconditionally killed by the TerminateProcess API, and the exit code will " "be set to *sig*." msgstr "" @@ -5209,8 +5197,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.kill`` with arguments " "``pid``, ``sig``." msgstr "" -"引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` " -"``os.kill``。" +"引發一個附帶引數 ``pid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." +"kill``。" #: ../../library/os.rst:4627 msgid "Send the signal *sig* to the process group *pgid*." @@ -5221,8 +5209,8 @@ msgid "" "Raises an :ref:`auditing event ` ``os.killpg`` with arguments " "``pgid``, ``sig``." msgstr "" -"引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` " -"``os.killpg``。" +"引發一個附帶引數 ``pgid``、``sig`` 的\\ :ref:`稽核事件 ` ``os." +"killpg``。" #: ../../library/os.rst:4636 msgid "" @@ -5259,9 +5247,9 @@ msgid "" "Open a pipe to or from command *cmd*. The return value is an open file " "object connected to the pipe, which can be read or written depending on " "whether *mode* is ``'r'`` (default) or ``'w'``. The *buffering* argument " -"have the same meaning as the corresponding argument to the built-" -"in :func:`open` function. The returned file object reads or writes text " -"strings rather than bytes." +"have the same meaning as the corresponding argument to the built-in :func:" +"`open` function. The returned file object reads or writes text strings " +"rather than bytes." msgstr "" #: ../../library/os.rst:4681 @@ -5298,9 +5286,9 @@ msgstr "" #: ../../library/os.rst:4706 msgid "" -":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. " -"Use :class:`subprocess.Popen` or :func:`subprocess.run` to control options " -"like encodings." +":func:`popen` is a simple wrapper around :class:`subprocess.Popen`. Use :" +"class:`subprocess.Popen` or :func:`subprocess.run` to control options like " +"encodings." msgstr "" #: ../../library/os.rst:4710 @@ -5320,9 +5308,9 @@ msgstr "" #: ../../library/os.rst:4723 msgid "" -"The positional-only arguments *path*, *args*, and *env* are similar " -"to :func:`execve`. *env* is allowed to be ``None``, in which case current " -"process' environment is used." +"The positional-only arguments *path*, *args*, and *env* are similar to :func:" +"`execve`. *env* is allowed to be ``None``, in which case current process' " +"environment is used." msgstr "" #: ../../library/os.rst:4727 @@ -5379,8 +5367,8 @@ msgid "" "posix_spawn_file_actions_addopen`, :c:func:`!" "posix_spawn_file_actions_addclose`, :c:func:`!" "posix_spawn_file_actions_adddup2`, and :c:func:`!" -"posix_spawn_file_actions_addclosefrom_np` API calls used to prepare for " -"the :c:func:`!posix_spawn` call itself." +"posix_spawn_file_actions_addclosefrom_np` API calls used to prepare for the :" +"c:func:`!posix_spawn` call itself." msgstr "" #: ../../library/os.rst:4768 @@ -5406,9 +5394,9 @@ msgstr "" #: ../../library/os.rst:4782 msgid "" "If the *setsid* argument is ``True``, it will create a new session ID for " -"``posix_spawn``. *setsid* requires :c:macro:`!POSIX_SPAWN_SETSID` " -"or :c:macro:`!POSIX_SPAWN_SETSID_NP` flag. " -"Otherwise, :exc:`NotImplementedError` is raised." +"``posix_spawn``. *setsid* requires :c:macro:`!POSIX_SPAWN_SETSID` or :c:" +"macro:`!POSIX_SPAWN_SETSID_NP` flag. Otherwise, :exc:`NotImplementedError` " +"is raised." msgstr "" #: ../../library/os.rst:4787 @@ -5468,9 +5456,9 @@ msgstr "見 :func:`posix_spawn` 文件。" #: ../../library/os.rst:4836 msgid "" -"Register callables to be executed when a new child process is forked " -"using :func:`os.fork` or similar process cloning APIs. The parameters are " -"optional and keyword-only. Each specifies a different call point." +"Register callables to be executed when a new child process is forked using :" +"func:`os.fork` or similar process cloning APIs. The parameters are optional " +"and keyword-only. Each specifies a different call point." msgstr "" #: ../../library/os.rst:4841 @@ -5504,9 +5492,8 @@ msgstr "" #: ../../library/os.rst:4855 msgid "" "Note that :c:func:`fork` calls made by third-party C code may not call those " -"functions, unless it explicitly " -"calls :c:func:`PyOS_BeforeFork`, :c:func:`PyOS_AfterFork_Parent` " -"and :c:func:`PyOS_AfterFork_Child`." +"functions, unless it explicitly calls :c:func:`PyOS_BeforeFork`, :c:func:" +"`PyOS_AfterFork_Parent` and :c:func:`PyOS_AfterFork_Child`." msgstr "" #: ../../library/os.rst:4859 @@ -5521,8 +5508,8 @@ msgstr "" msgid "" "(Note that the :mod:`subprocess` module provides more powerful facilities " "for spawning new processes and retrieving their results; using that module " -"is preferable to using these functions. Check especially " -"the :ref:`subprocess-replacements` section.)" +"is preferable to using these functions. Check especially the :ref:" +"`subprocess-replacements` section.)" msgstr "" #: ../../library/os.rst:4882 @@ -5554,15 +5541,15 @@ msgstr "" #: ../../library/os.rst:4900 msgid "" -"The variants which include a second \"p\" near the end " -"(:func:`spawnlp`, :func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) " -"will use the :envvar:`PATH` environment variable to locate the program " -"*file*. When the environment is being replaced (using one of " -"the :func:`spawn\\*e ` variants, discussed in the next paragraph), " -"the new environment is used as the source of the :envvar:`PATH` variable. " -"The other variants, :func:`spawnl`, :func:`spawnle`, :func:`spawnv`, " -"and :func:`spawnve`, will not use the :envvar:`PATH` variable to locate the " -"executable; *path* must contain an appropriate absolute or relative path." +"The variants which include a second \"p\" near the end (:func:`spawnlp`, :" +"func:`spawnlpe`, :func:`spawnvp`, and :func:`spawnvpe`) will use the :envvar:" +"`PATH` environment variable to locate the program *file*. When the " +"environment is being replaced (using one of the :func:`spawn\\*e ` " +"variants, discussed in the next paragraph), the new environment is used as " +"the source of the :envvar:`PATH` variable. The other variants, :func:" +"`spawnl`, :func:`spawnle`, :func:`spawnv`, and :func:`spawnve`, will not use " +"the :envvar:`PATH` variable to locate the executable; *path* must contain an " +"appropriate absolute or relative path." msgstr "" #: ../../library/os.rst:4910 @@ -5570,12 +5557,11 @@ msgid "" "For :func:`spawnle`, :func:`spawnlpe`, :func:`spawnve`, and :func:`spawnvpe` " "(note that these all end in \"e\"), the *env* parameter must be a mapping " "which is used to define the environment variables for the new process (they " -"are used instead of the current process' environment); the " -"functions :func:`spawnl`, :func:`spawnlp`, :func:`spawnv`, " -"and :func:`spawnvp` all cause the new process to inherit the environment of " -"the current process. Note that keys and values in the *env* dictionary must " -"be strings; invalid keys or values will cause the function to fail, with a " -"return value of ``127``." +"are used instead of the current process' environment); the functions :func:" +"`spawnl`, :func:`spawnlp`, :func:`spawnv`, and :func:`spawnvp` all cause the " +"new process to inherit the environment of the current process. Note that " +"keys and values in the *env* dictionary must be strings; invalid keys or " +"values will cause the function to fail, with a return value of ``127``." msgstr "" #: ../../library/os.rst:4919 @@ -5623,9 +5609,9 @@ msgstr "" #: ../../library/os.rst:4948 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " -"family of functions. If either of these values is given, " -"the :func:`spawn\\* ` functions will return as soon as the new " -"process has been created, with the process id as the return value." +"family of functions. If either of these values is given, the :func:" +"`spawn\\* ` functions will return as soon as the new process has " +"been created, with the process id as the return value." msgstr "" #: ../../library/os.rst:4958 @@ -5640,11 +5626,11 @@ msgstr "" #: ../../library/os.rst:4970 msgid "" "Possible values for the *mode* parameter to the :func:`spawn\\* ` " -"family of functions. These are less portable than those listed " -"above. :const:`P_DETACH` is similar to :const:`P_NOWAIT`, but the new " -"process is detached from the console of the calling process. " -"If :const:`P_OVERLAY` is used, the current process will be replaced; " -"the :func:`spawn\\* ` function will not return." +"family of functions. These are less portable than those listed above. :" +"const:`P_DETACH` is similar to :const:`P_NOWAIT`, but the new process is " +"detached from the console of the calling process. If :const:`P_OVERLAY` is " +"used, the current process will be replaced; the :func:`spawn\\* ` " +"function will not return." msgstr "" #: ../../library/os.rst:4981 @@ -5654,9 +5640,9 @@ msgstr "" #: ../../library/os.rst:4983 msgid "" "When *operation* is not specified, this acts like double-clicking the file " -"in Windows Explorer, or giving the file name as an argument to " -"the :program:`start` command from the interactive command shell: the file is " -"opened with whatever application (if any) its extension is associated." +"in Windows Explorer, or giving the file name as an argument to the :program:" +"`start` command from the interactive command shell: the file is opened with " +"whatever application (if any) its extension is associated." msgstr "" #: ../../library/os.rst:4988 @@ -5724,8 +5710,8 @@ msgstr "" #: ../../library/os.rst:5023 msgid "" -"Added the *arguments*, *cwd* and *show_cmd* arguments, and the " -"``os.startfile/2`` audit event." +"Added the *arguments*, *cwd* and *show_cmd* arguments, and the ``os." +"startfile/2`` audit event." msgstr "" #: ../../library/os.rst:5030 @@ -5748,10 +5734,10 @@ msgstr "" #: ../../library/os.rst:5041 msgid "" "On Windows, the return value is that returned by the system shell after " -"running *command*. The shell is given by the Windows environment " -"variable :envvar:`COMSPEC`: it is usually :program:`cmd.exe`, which returns " -"the exit status of the command run; on systems using a non-native shell, " -"consult your shell documentation." +"running *command*. The shell is given by the Windows environment variable :" +"envvar:`COMSPEC`: it is usually :program:`cmd.exe`, which returns the exit " +"status of the command run; on systems using a non-native shell, consult your " +"shell documentation." msgstr "" #: ../../library/os.rst:5047 @@ -5811,8 +5797,8 @@ msgstr "" #: ../../library/os.rst:5076 msgid "" -"See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " +"See the Unix manual page :manpage:`times(2)` and `times(3) `_ manual page on Unix or `the " "GetProcessTimes MSDN `_ on Windows. On " "Windows, only :attr:`!user` and :attr:`!system` are known; the other " @@ -5843,8 +5829,8 @@ msgstr "" #: ../../library/os.rst:5106 msgid "" "The other :func:`!wait*` functions documented below can be used to wait for " -"the completion of a specific child process and have more " -"options. :func:`waitpid` is the only one also available on Windows." +"the completion of a specific child process and have more options. :func:" +"`waitpid` is the only one also available on Windows." msgstr "" #: ../../library/os.rst:5113 @@ -5853,22 +5839,22 @@ msgstr "" #: ../../library/os.rst:5115 msgid "" -"*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on " -"Linux) :data:`P_PIDFD`. The interpretation of *id* depends on it; see their " +"*idtype* can be :data:`P_PID`, :data:`P_PGID`, :data:`P_ALL`, or (on Linux) :" +"data:`P_PIDFD`. The interpretation of *id* depends on it; see their " "individual descriptions." msgstr "" #: ../../library/os.rst:5118 msgid "" -"*options* is an OR combination of flags. At least one " -"of :data:`WEXITED`, :data:`WSTOPPED` or :data:`WCONTINUED` is " -"required; :data:`WNOHANG` and :data:`WNOWAIT` are additional optional flags." +"*options* is an OR combination of flags. At least one of :data:`WEXITED`, :" +"data:`WSTOPPED` or :data:`WCONTINUED` is required; :data:`WNOHANG` and :data:" +"`WNOWAIT` are additional optional flags." msgstr "" #: ../../library/os.rst:5122 msgid "" -"The return value is an object representing the data contained in " -"the :c:type:`siginfo_t` structure with the following attributes:" +"The return value is an object representing the data contained in the :c:type:" +"`siginfo_t` structure with the following attributes:" msgstr "" #: ../../library/os.rst:5125 @@ -5943,9 +5929,9 @@ msgid "" "bits (shifting makes cross-platform use of the function easier). A *pid* " "less than or equal to ``0`` has no special meaning on Windows, and raises an " "exception. The value of integer *options* has no effect. *pid* can refer to " -"any process whose id is known, not necessarily a child process. " -"The :func:`spawn\\* ` functions called with :const:`P_NOWAIT` return " -"suitable process handles." +"any process whose id is known, not necessarily a child process. The :func:" +"`spawn\\* ` functions called with :const:`P_NOWAIT` return suitable " +"process handles." msgstr "" #: ../../library/os.rst:5187 @@ -6006,8 +5992,8 @@ msgstr "" #: ../../library/os.rst:5239 msgid "" -"This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, " -"and :func:`waitid` causes child processes to be reported if they have been " +"This *options* flag for :func:`waitpid`, :func:`wait3`, :func:`wait4`, and :" +"func:`waitid` causes child processes to be reported if they have been " "continued from a job control stop since they were last reported." msgstr "" @@ -6109,15 +6095,15 @@ msgstr "" #: ../../library/os.rst:5343 msgid "" -":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` " -"functions." +":func:`WIFEXITED`, :func:`WEXITSTATUS`, :func:`WIFSIGNALED`, :func:" +"`WTERMSIG`, :func:`WIFSTOPPED`, :func:`WSTOPSIG` functions." msgstr "" #: ../../library/os.rst:5351 msgid "" -"The following functions take a process status code as returned " -"by :func:`system`, :func:`wait`, or :func:`waitpid` as a parameter. They " -"may be used to determine the disposition of a process." +"The following functions take a process status code as returned by :func:" +"`system`, :func:`wait`, or :func:`waitpid` as a parameter. They may be used " +"to determine the disposition of a process." msgstr "" #: ../../library/os.rst:5357 @@ -6132,9 +6118,9 @@ msgstr "" #: ../../library/os.rst:5367 msgid "" -"Return ``True`` if a stopped child has been resumed by delivery " -"of :const:`~signal.SIGCONT` (if the process has been continued from a job " -"control stop), otherwise return ``False``." +"Return ``True`` if a stopped child has been resumed by delivery of :const:" +"`~signal.SIGCONT` (if the process has been continued from a job control " +"stop), otherwise return ``False``." msgstr "" #: ../../library/os.rst:5371 @@ -6247,9 +6233,9 @@ msgstr "" #: ../../library/os.rst:5491 msgid "" -"This class represents tunable scheduling parameters used " -"in :func:`sched_setparam`, :func:`sched_setscheduler`, " -"and :func:`sched_getparam`. It is immutable." +"This class represents tunable scheduling parameters used in :func:" +"`sched_setparam`, :func:`sched_setscheduler`, and :func:`sched_getparam`. It " +"is immutable." msgstr "" #: ../../library/os.rst:5495 @@ -6355,8 +6341,8 @@ msgstr "" msgid "" "If *name* is a string and is not known, :exc:`ValueError` is raised. If a " "specific value for *name* is not supported by the host system, even if it is " -"included in ``confstr_names``, an :exc:`OSError` is raised " -"with :const:`errno.EINVAL` for the error number." +"included in ``confstr_names``, an :exc:`OSError` is raised with :const:" +"`errno.EINVAL` for the error number." msgstr "" #: ../../library/os.rst:5597 @@ -6394,8 +6380,8 @@ msgstr "" #: ../../library/os.rst:5630 msgid "" "Get the number of logical CPUs usable by the calling thread of the **current " -"process**. Returns ``None`` if undetermined. It can be less " -"than :func:`cpu_count` depending on the CPU affinity." +"process**. Returns ``None`` if undetermined. It can be less than :func:" +"`cpu_count` depending on the CPU affinity." msgstr "" #: ../../library/os.rst:5634 @@ -6449,24 +6435,24 @@ msgstr "" #: ../../library/os.rst:5675 msgid "" "The constant string used by the operating system to refer to the current " -"directory. This is ``'.'`` for Windows and POSIX. Also available " -"via :mod:`os.path`." +"directory. This is ``'.'`` for Windows and POSIX. Also available via :mod:" +"`os.path`." msgstr "" #: ../../library/os.rst:5683 msgid "" "The constant string used by the operating system to refer to the parent " -"directory. This is ``'..'`` for Windows and POSIX. Also available " -"via :mod:`os.path`." +"directory. This is ``'..'`` for Windows and POSIX. Also available via :mod:" +"`os.path`." msgstr "" #: ../../library/os.rst:5692 msgid "" "The character used by the operating system to separate pathname components. " "This is ``'/'`` for POSIX and ``'\\\\'`` for Windows. Note that knowing " -"this is not sufficient to be able to parse or concatenate pathnames --- " -"use :func:`os.path.split` and :func:`os.path.join` --- but it is " -"occasionally useful. Also available via :mod:`os.path`." +"this is not sufficient to be able to parse or concatenate pathnames --- use :" +"func:`os.path.split` and :func:`os.path.join` --- but it is occasionally " +"useful. Also available via :mod:`os.path`." msgstr "" #: ../../library/os.rst:5702 @@ -6492,18 +6478,18 @@ msgstr "" #: ../../library/os.rst:5726 msgid "" -"The default search path used by :func:`exec\\*p\\* ` " -"and :func:`spawn\\*p\\* ` if the environment doesn't have a " -"``'PATH'`` key. Also available via :mod:`os.path`." +"The default search path used by :func:`exec\\*p\\* ` and :func:" +"`spawn\\*p\\* ` if the environment doesn't have a ``'PATH'`` key. " +"Also available via :mod:`os.path`." msgstr "" #: ../../library/os.rst:5733 msgid "" "The string used to separate (or, rather, terminate) lines on the current " "platform. This may be a single character, such as ``'\\n'`` for POSIX, or " -"multiple characters, for example, ``'\\r\\n'`` for Windows. Do not use " -"*os.linesep* as a line terminator when writing files opened in text mode " -"(the default); use a single ``'\\n'`` instead, on all platforms." +"multiple characters, for example, ``'\\r\\n'`` for Windows. Do not use *os." +"linesep* as a line terminator when writing files opened in text mode (the " +"default); use a single ``'\\n'`` instead, on all platforms." msgstr "" #: ../../library/os.rst:5742 @@ -6514,9 +6500,9 @@ msgstr "" #: ../../library/os.rst:5753 msgid "" -"Flags for use with the :func:`~sys.setdlopenflags` " -"and :func:`~sys.getdlopenflags` functions. See the Unix manual " -"page :manpage:`dlopen(3)` for what the different flags mean." +"Flags for use with the :func:`~sys.setdlopenflags` and :func:`~sys." +"getdlopenflags` functions. See the Unix manual page :manpage:`dlopen(3)` " +"for what the different flags mean." msgstr "" #: ../../library/os.rst:5761 @@ -6546,8 +6532,8 @@ msgstr "" #: ../../library/os.rst:5777 msgid "" "The flags argument is a bit mask that can contain zero or more of the " -"following values ORed together: :py:const:`os.GRND_RANDOM` " -"and :py:data:`GRND_NONBLOCK`." +"following values ORed together: :py:const:`os.GRND_RANDOM` and :py:data:" +"`GRND_NONBLOCK`." msgstr "" #: ../../library/os.rst:5781 diff --git a/library/shutil.po b/library/shutil.po index c50c958d1c..415d7fb6dd 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: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -35,8 +35,8 @@ msgstr "" #: ../../library/shutil.rst:25 msgid "" -"Even the higher-level file copying functions " -"(:func:`shutil.copy`, :func:`shutil.copy2`) cannot copy all file metadata." +"Even the higher-level file copying functions (:func:`shutil.copy`, :func:" +"`shutil.copy2`) cannot copy all file metadata." msgstr "" #: ../../library/shutil.rst:28 @@ -50,7 +50,7 @@ msgstr "" #: ../../library/shutil.rst:38 msgid "Directory and files operations" -msgstr "" +msgstr "目錄和檔案操作" #: ../../library/shutil.rst:42 msgid "" @@ -69,9 +69,9 @@ msgid "" "been flushed on completion of the copy. If you want to read from the " "destination at the completion of the copy operation (for example, reading " "the contents of a temporary file that has been copied from a HTTP stream), " -"you must ensure that you have called :func:`~io.IOBase.flush` " -"or :func:`~io.IOBase.close` on the file-like object before attempting to " -"read the destination file." +"you must ensure that you have called :func:`~io.IOBase.flush` or :func:`~io." +"IOBase.close` on the file-like object before attempting to read the " +"destination file." msgstr "" #: ../../library/shutil.rst:60 @@ -109,8 +109,8 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.copyfile`` with " "arguments ``src``, ``dst``." msgstr "" -"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` " -"``shutil.copyfile``。" +"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` ``shutil." +"copyfile``。" #: ../../library/shutil.rst:79 msgid "" @@ -152,10 +152,10 @@ msgid "" "like object>` or path names given as strings. If *follow_symlinks* is false, " "and both *src* and *dst* are symbolic links, :func:`copymode` will attempt " "to modify the mode of *dst* itself (rather than the file it points to). " -"This functionality is not available on every platform; please " -"see :func:`copystat` for more information. If :func:`copymode` cannot " -"modify symbolic links on the local platform, and it is asked to do so, it " -"will do nothing and return." +"This functionality is not available on every platform; please see :func:" +"`copystat` for more information. If :func:`copymode` cannot modify symbolic " +"links on the local platform, and it is asked to do so, it will do nothing " +"and return." msgstr "" #: ../../library/shutil.rst:120 ../../library/shutil.rst:193 @@ -163,8 +163,8 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.copymode`` with " "arguments ``src``, ``dst``." msgstr "" -"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` " -"``shutil.copymode``。" +"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` ``shutil." +"copymode``。" #: ../../library/shutil.rst:122 msgid "Added *follow_symlinks* argument." @@ -207,9 +207,9 @@ msgstr "" #: ../../library/shutil.rst:154 msgid "" -"If ``os.chflags in os.supports_follow_symlinks`` is " -"``True``, :func:`copystat` can modify the flags of a symbolic link. " -"(``os.chflags`` is not available on all platforms.)" +"If ``os.chflags in os.supports_follow_symlinks`` is ``True``, :func:" +"`copystat` can modify the flags of a symbolic link. (``os.chflags`` is not " +"available on all platforms.)" msgstr "" #: ../../library/shutil.rst:159 @@ -228,8 +228,8 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.copystat`` with " "arguments ``src``, ``dst``." msgstr "" -"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` " -"``shutil.copystat``。" +"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` ``shutil." +"copystat``。" #: ../../library/shutil.rst:169 msgid "" @@ -277,16 +277,15 @@ msgid "" "attempts to copy all metadata from the *src* symbolic link to the newly " "created *dst* symbolic link. However, this functionality is not available on " "all platforms. On platforms where some or all of this functionality is " -"unavailable, :func:`copy2` will preserve all the metadata it " -"can; :func:`copy2` never raises an exception because it cannot preserve file " -"metadata." +"unavailable, :func:`copy2` will preserve all the metadata it can; :func:" +"`copy2` never raises an exception because it cannot preserve file metadata." msgstr "" #: ../../library/shutil.rst:218 msgid "" -":func:`copy2` uses :func:`copystat` to copy the file metadata. Please " -"see :func:`copystat` for more information about platform support for " -"modifying symbolic link metadata." +":func:`copy2` uses :func:`copystat` to copy the file metadata. Please see :" +"func:`copystat` for more information about platform support for modifying " +"symbolic link metadata." msgstr "" #: ../../library/shutil.rst:226 @@ -298,9 +297,9 @@ msgstr "" #: ../../library/shutil.rst:238 msgid "" -"This factory function creates a function that can be used as a callable " -"for :func:`copytree`\\'s *ignore* argument, ignoring files and directories " -"that match one of the glob-style *patterns* provided. See the example below." +"This factory function creates a function that can be used as a callable for :" +"func:`copytree`\\'s *ignore* argument, ignoring files and directories that " +"match one of the glob-style *patterns* provided. See the example below." msgstr "" #: ../../library/shutil.rst:247 @@ -327,9 +326,9 @@ msgstr "" #: ../../library/shutil.rst:259 msgid "" "When *symlinks* is false, if the file pointed to by the symlink doesn't " -"exist, an exception will be added in the list of errors raised in " -"an :exc:`Error` exception at the end of the copy process. You can set the " -"optional *ignore_dangling_symlinks* flag to true if you want to silence this " +"exist, an exception will be added in the list of errors raised in an :exc:" +"`Error` exception at the end of the copy process. You can set the optional " +"*ignore_dangling_symlinks* flag to true if you want to silence this " "exception. Notice that this option has no effect on platforms that don't " "support :func:`os.symlink`." msgstr "" @@ -362,8 +361,8 @@ msgstr "" #: ../../library/shutil.rst:283 msgid "" -"If *dirs_exist_ok* is false (the default) and *dst* already exists, " -"a :exc:`FileExistsError` is raised. If *dirs_exist_ok* is true, the copying " +"If *dirs_exist_ok* is false (the default) and *dst* already exists, a :exc:" +"`FileExistsError` is raised. If *dirs_exist_ok* is true, the copying " "operation will continue if it encounters existing directories, and files " "within the *dst* tree will be overwritten by corresponding files from the " "*src* tree." @@ -374,8 +373,8 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.copytree`` with " "arguments ``src``, ``dst``." msgstr "" -"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` " -"``shutil.copytree``。" +"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` ``shutil." +"copytree``。" #: ../../library/shutil.rst:291 msgid "" @@ -476,8 +475,8 @@ msgstr "新增 *onexc* 參數並棄用 *onerror*。" #: ../../library/shutil.rst:364 msgid "" ":func:`!rmtree` now ignores :exc:`FileNotFoundError` exceptions for all but " -"the top-level path. Exceptions other than :exc:`OSError` and subclasses " -"of :exc:`!OSError` are now always propagated to the caller." +"the top-level path. Exceptions other than :exc:`OSError` and subclasses of :" +"exc:`!OSError` are now always propagated to the caller." msgstr "" #: ../../library/shutil.rst:372 @@ -518,9 +517,9 @@ msgstr "" 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 " -"if :func:`os.rename` cannot be used. If the source is a " -"directory, :func:`copytree` is called, passing it the *copy_function*. The " -"default *copy_function* is :func:`copy2`. Using :func:`~shutil.copy` as the " +"if :func:`os.rename` cannot be used. If the source is a directory, :func:" +"`copytree` is called, passing it the *copy_function*. The default " +"*copy_function* is :func:`copy2`. Using :func:`~shutil.copy` as the " "*copy_function* allows the move to succeed when it is not possible to also " "copy the metadata, at the expense of not copying any of the metadata." msgstr "" @@ -530,8 +529,8 @@ msgid "" "Raises an :ref:`auditing event ` ``shutil.move`` with arguments " "``src``, ``dst``." msgstr "" -"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` " -"``shutil.move``。" +"引發一個附帶引數 ``src``、``dst`` 的\\ :ref:`稽核事件 ` ``shutil." +"move``。" #: ../../library/shutil.rst:406 msgid "" @@ -610,9 +609,9 @@ msgstr "" #: ../../library/shutil.rst:470 msgid "" "*path* is a \"``PATH`` string\" specifying the directories to look in, " -"delimited by :data:`os.pathsep`. When no *path* is specified, " -"the :envvar:`PATH` environment variable is read from :data:`os.environ`, " -"falling back to :data:`os.defpath` if it is not set." +"delimited by :data:`os.pathsep`. When no *path* is specified, the :envvar:" +"`PATH` environment variable is read from :data:`os.environ`, falling back " +"to :data:`os.defpath` if it is not set." msgstr "" #: ../../library/shutil.rst:475 @@ -693,12 +692,12 @@ msgstr "" #: ../../library/shutil.rst:527 msgid "" -"Starting from Python 3.8, all functions involving a file copy " -"(:func:`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, " -"and :func:`move`) may use platform-specific \"fast-copy\" syscalls in order " -"to copy the file more efficiently (see :issue:`33671`). \"fast-copy\" means " -"that the copying operation occurs within the kernel, avoiding the use of " -"userspace buffers in Python as in \"``outfd.write(infd.read())``\"." +"Starting from Python 3.8, all functions involving a file copy (:func:" +"`copyfile`, :func:`~shutil.copy`, :func:`copy2`, :func:`copytree`, and :func:" +"`move`) may use platform-specific \"fast-copy\" syscalls in order to copy " +"the file more efficiently (see :issue:`33671`). \"fast-copy\" means that the " +"copying operation occurs within the kernel, avoiding the use of userspace " +"buffers in Python as in \"``outfd.write(infd.read())``\"." msgstr "" #: ../../library/shutil.rst:535 @@ -707,24 +706,24 @@ msgstr "" #: ../../library/shutil.rst:537 msgid "On Linux :func:`os.copy_file_range` or :func:`os.sendfile` is used." -msgstr "" +msgstr "Linux 上會使用 :func:`os.copy_file_range` 或 :func:`os.sendfile`。" #: ../../library/shutil.rst:539 msgid "On Solaris :func:`os.sendfile` is used." -msgstr "" +msgstr "Solaris 上會使用 :func:`os.sendfile`。" #: ../../library/shutil.rst:541 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." +"instead of 64 KiB) and a :func:`memoryview`-based variant of :func:`shutil." +"copyfileobj` is used." msgstr "" #: ../../library/shutil.rst:545 msgid "" "If the fast-copy operation fails and no data was written in the destination " -"file then shutil will silently fallback on using less " -"efficient :func:`copyfileobj` function internally." +"file then shutil will silently fallback on using less efficient :func:" +"`copyfileobj` function internally." msgstr "" #: ../../library/shutil.rst:551 @@ -733,8 +732,8 @@ msgstr "" #: ../../library/shutil.rst:554 msgid "" -"Copy-on-write or server-side copy may be used internally " -"via :func:`os.copy_file_range` on supported Linux filesystems." +"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 @@ -776,6 +775,14 @@ msgid "" "\n" "copytree(source, destination, ignore=_logpath)" msgstr "" +"from shutil import copytree\n" +"import logging\n" +"\n" +"def _logpath(path, names):\n" +" logging.info('Working in %s', path)\n" +" return [] # 沒有東西被忽略\n" +"\n" +"copytree(source, destination, ignore=_logpath)" #: ../../library/shutil.rst:587 msgid "rmtree example" @@ -830,9 +837,9 @@ msgstr "" 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), " -"\"bztar\" (if the :mod:`bz2` module is available), \"xztar\" (if " -"the :mod:`lzma` module is available), or \"zstdtar\" (if " -"the :mod:`compression.zstd` module is available)." +"\"bztar\" (if the :mod:`bz2` module is available), \"xztar\" (if the :mod:" +"`lzma` module is available), or \"zstdtar\" (if the :mod:`compression.zstd` " +"module is available)." msgstr "" #: ../../library/shutil.rst:631 @@ -870,26 +877,26 @@ msgstr "" msgid "" "*logger* must be an object compatible with :pep:`282`, usually an instance " "of :class:`logging.Logger`." -msgstr "" +msgstr "*logger* 必須是與 :pep:`282` 相容的物件,通常是 :class:`logging.Logger` 的實例。" #: ../../library/shutil.rst:652 msgid "The *verbose* argument is unused and deprecated." -msgstr "" +msgstr "*verbose* 引數未被使用且已棄用。" #: ../../library/shutil.rst:654 msgid "" "Raises an :ref:`auditing event ` ``shutil.make_archive`` with " "arguments ``base_name``, ``format``, ``root_dir``, ``base_dir``." msgstr "" -"引發一個附帶引數 ``base_name``、``format``、``root_dir``、``base_dir`` 的" -"\\ :ref:`稽核事件 ` ``shutil.make_archive``。" +"引發一個附帶引數 ``base_name``、``format``、``root_dir``、``base_dir`` 的\\ :" +"ref:`稽核事件 ` ``shutil.make_archive``。" #: ../../library/shutil.rst:658 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 case it temporarily changes the current working directory " -"of the process to *root_dir* to perform archiving." +"This function is not thread-safe when custom archivers registered with :func:" +"`register_archive_format` do not support the *root_dir* argument. In this " +"case it temporarily changes the current working directory of the process to " +"*root_dir* to perform archiving." msgstr "" #: ../../library/shutil.rst:664 @@ -912,7 +919,7 @@ msgstr "" #: ../../library/shutil.rst:677 ../../library/shutil.rst:794 msgid "By default :mod:`shutil` provides these formats:" -msgstr "" +msgstr "預設情況下 :mod:`shutil` 提供這些格式:" #: ../../library/shutil.rst:679 msgid "*zip*: ZIP file (if the :mod:`zlib` module is available)." @@ -1002,11 +1009,10 @@ msgstr "" #: ../../library/shutil.rst:729 msgid "" "*format* is the archive format: one of \"zip\", \"tar\", \"gztar\", " -"\"bztar\", \"xztar\", or \"zstdtar\". Or any other format registered " -"with :func:`register_unpack_format`. If not " -"provided, :func:`unpack_archive` will use the archive file name extension " -"and see if an unpacker was registered for that extension. In case none is " -"found, a :exc:`ValueError` is raised." +"\"bztar\", \"xztar\", or \"zstdtar\". Or any other format registered with :" +"func:`register_unpack_format`. If not provided, :func:`unpack_archive` will " +"use the archive file name extension and see if an unpacker was registered " +"for that extension. In case none is found, a :exc:`ValueError` is raised." msgstr "" #: ../../library/shutil.rst:736 @@ -1053,8 +1059,8 @@ msgstr "新增 *filter* 引數。" #: ../../library/shutil.rst:765 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." +"*extensions* is a list of extensions corresponding to the format, like ``." +"zip`` for Zip files." msgstr "" #: ../../library/shutil.rst:769 @@ -1074,8 +1080,8 @@ msgstr "" #: ../../library/shutil.rst:774 msgid "" -"possibly a *filter* keyword argument, if it was given " -"to :func:`unpack_archive`;" +"possibly a *filter* keyword argument, if it was given to :func:" +"`unpack_archive`;" msgstr "" #: ../../library/shutil.rst:776 @@ -1193,8 +1199,8 @@ msgstr "" #: ../../library/shutil.rst:858 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::" +"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 @@ -1208,7 +1214,7 @@ msgid "" "... root_dir='tmp/root',\n" "... base_dir='structure/content',\n" "... )\n" -"'/Users/tarek/my_archive.tar'" +"'/Users/tarek/myarchive.tar'" msgstr "" ">>> from shutil import make_archive\n" ">>> import os\n" @@ -1219,7 +1225,7 @@ msgstr "" "... root_dir='tmp/root',\n" "... base_dir='structure/content',\n" "... )\n" -"'/Users/tarek/my_archive.tar'" +"'/Users/tarek/myarchive.tar'" #: ../../library/shutil.rst:872 msgid "Listing the files in the resulting archive gives us:" @@ -1253,8 +1259,8 @@ msgstr "" #: ../../library/shutil.rst:892 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`." +"terminal connected to :data:`sys.__stdout__` is queried by invoking :func:" +"`os.get_terminal_size`." msgstr "" #: ../../library/shutil.rst:896 diff --git a/library/ssl.po b/library/ssl.po index ed5e9b6933..5939b968db 100644 --- a/library/ssl.po +++ b/library/ssl.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2024-08-28 00:43+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -88,8 +88,8 @@ msgid "" "also encrypts and decrypts the data going over the socket with SSL. It " "supports additional methods such as :meth:`getpeercert`, which retrieves the " "certificate of the other side of the connection, :meth:`cipher`, which " -"retrieves the cipher being used for the secure connection " -"or :meth:`get_verified_chain`, :meth:`get_unverified_chain` which retrieves " +"retrieves the cipher being used for the secure connection or :meth:" +"`get_verified_chain`, :meth:`get_unverified_chain` which retrieves " "certificate chain." msgstr "" "此模組提供了一個 :class:`ssl.SSLSocket` 類別,它是從 :class:`socket.socket` " @@ -142,10 +142,9 @@ msgstr "Socket 建立" #: ../../library/ssl.rst:79 msgid "" -"Instances of :class:`SSLSocket` must be created using " -"the :meth:`SSLContext.wrap_socket` method. The helper " -"function :func:`create_default_context` returns a new context with secure " -"default settings." +"Instances of :class:`SSLSocket` must be created using the :meth:`SSLContext." +"wrap_socket` method. The helper function :func:`create_default_context` " +"returns a new context with secure default settings." msgstr "" ":class:`SSLSocket` 實例必須使用 :meth:`SSLContext.wrap_socket` 方法來建立。輔" "助函式 :func:`create_default_context` 會回傳有安全預設設定的新語境 " @@ -246,31 +245,31 @@ msgid "" "If all three are :const:`None`, this function can choose to trust the " "system's default CA certificates instead." msgstr "" -"*cafile*, *capath*, *cadata* 是用來選擇用於憑證認證的 CA 憑證,就" -"像 :meth:`SSLContext.load_verify_locations` 一樣。如果三個值都" -"是 :const:`None`,此函式會自動選擇系統預設的 CA 憑證。" +"*cafile*, *capath*, *cadata* 是用來選擇用於憑證認證的 CA 憑證,就像 :meth:" +"`SSLContext.load_verify_locations` 一樣。如果三個值都是 :const:`None`,此函式" +"會自動選擇系統預設的 CA 憑證。" # Skylull: `high encryption cipher` 可能是指 https://superuser.com/questions/1751902/how-to-check-which-ciphers-are-included-in-high-ciphers-constant # 其文中表示可能是指 128bit 以上 key length 的加密算法,需要其他來源佐證。 # 或是 https://help.fortinet.com/fweb/582/Content/FortiWeb/fortiweb-admin/supported_cipher_suites.htm#ssl_414712646_1189301 #: ../../library/ssl.rst:141 msgid "" -"The settings are: :data:`PROTOCOL_TLS_CLIENT` " -"or :data:`PROTOCOL_TLS_SERVER`, :data:`OP_NO_SSLv2`, and :data:`OP_NO_SSLv3` " -"with high encryption cipher suites without RC4 and without unauthenticated " -"cipher suites. Passing :const:`~Purpose.SERVER_AUTH` as *purpose* " -"sets :data:`~SSLContext.verify_mode` to :data:`CERT_REQUIRED` and either " -"loads CA certificates (when at least one of *cafile*, *capath* or *cadata* " -"is given) or uses :meth:`SSLContext.load_default_certs` to load default CA " +"The settings are: :data:`PROTOCOL_TLS_CLIENT` or :data:" +"`PROTOCOL_TLS_SERVER`, :data:`OP_NO_SSLv2`, and :data:`OP_NO_SSLv3` with " +"high encryption cipher suites without RC4 and without unauthenticated cipher " +"suites. Passing :const:`~Purpose.SERVER_AUTH` as *purpose* sets :data:" +"`~SSLContext.verify_mode` to :data:`CERT_REQUIRED` and either loads CA " +"certificates (when at least one of *cafile*, *capath* or *cadata* is given) " +"or uses :meth:`SSLContext.load_default_certs` to load default CA " "certificates." msgstr "" -"這些設定包含::data:`PROTOCOL_TLS_CLIENT` " -"或 :data:`PROTOCOL_TLS_SERVER`、:data:`OP_NO_SSLv2`、以" -"及 :data:`OP_NO_SSLv3`,使用高等加密套件但不包含 RC4 和未經身份驗證的加密套" -"件。如果將 *purpose* 設定為 :const:`~Purpose.SERVER_AUTH`,則會" -"把 :data:`~SSLContext.verify_mode` 設為 :data:`CERT_REQUIRED` 並使用設定的 " -"CA 憑證(當 *cafile*、*capath* 或 *cadata* 其中一個值有被設定時) 或使用預設的 " -"CA 憑證 :meth:`SSLContext.load_default_certs` 。" +"這些設定包含::data:`PROTOCOL_TLS_CLIENT` 或 :data:`PROTOCOL_TLS_SERVER`、:" +"data:`OP_NO_SSLv2`、以及 :data:`OP_NO_SSLv3`,使用高等加密套件但不包含 RC4 和" +"未經身份驗證的加密套件。如果將 *purpose* 設定為 :const:`~Purpose." +"SERVER_AUTH`,則會把 :data:`~SSLContext.verify_mode` 設為 :data:" +"`CERT_REQUIRED` 並使用設定的 CA 憑證(當 *cafile*、*capath* 或 *cadata* 其中一" +"個值有被設定時) 或使用預設的 CA 憑證 :meth:`SSLContext." +"load_default_certs` 。" #: ../../library/ssl.rst:150 msgid "" @@ -278,16 +277,16 @@ msgid "" "variable :envvar:`SSLKEYLOGFILE` is set, :func:`create_default_context` " "enables key logging." msgstr "" -"當系統有支援 :attr:`~SSLContext.keylog_filename` 並且有設定環境變" -"數 :envvar:`SSLKEYLOGFILE` 時 :func:`create_default_context` 會啟用密鑰日誌記" -"錄 (logging)。" +"當系統有支援 :attr:`~SSLContext.keylog_filename` 並且有設定環境變數 :envvar:" +"`SSLKEYLOGFILE` 時 :func:`create_default_context` 會啟用密鑰日誌記錄 " +"(logging)。" #: ../../library/ssl.rst:154 msgid "" -"The default settings for this context " -"include :data:`VERIFY_X509_PARTIAL_CHAIN` and :data:`VERIFY_X509_STRICT`. " -"These make the underlying OpenSSL implementation behave more like a " -"conforming implementation of :rfc:`5280`, in exchange for a small amount of " +"The default settings for this context include :data:" +"`VERIFY_X509_PARTIAL_CHAIN` and :data:`VERIFY_X509_STRICT`. These make the " +"underlying OpenSSL implementation behave more like a conforming " +"implementation of :rfc:`5280`, in exchange for a small amount of " "incompatibility with older X.509 certificates." msgstr "" @@ -302,8 +301,8 @@ msgstr "" #: ../../library/ssl.rst:165 msgid "" -"If your application needs specific settings, you should create " -"a :class:`SSLContext` and apply the settings yourself." +"If your application needs specific settings, you should create a :class:" +"`SSLContext` and apply the settings yourself." msgstr "" "如果你的應用程式需要特殊的設定,你應該要自行建立一個 :class:`SSLContext` 並自" "行調整設定。" @@ -314,9 +313,9 @@ msgid "" "with a :class:`SSLContext` created by this function that they get an error " "stating \"Protocol or cipher suite mismatch\", it may be that they only " "support SSL3.0 which this function excludes using the :data:`OP_NO_SSLv3`. " -"SSL3.0 is widely considered to be `completely broken `_. If you still wish to continue to use this " -"function but still allow SSL 3.0 connections you can re-enable them using::" +"SSL3.0 is widely considered to be `completely broken `_. If you still wish to continue to use this function but " +"still allow SSL 3.0 connections you can re-enable them using::" msgstr "" "如果你發現某些舊的用戶端或伺服器常適用此函式建立的 :class:`SSLContext` 連線" "時,收到 \"Protocol or cipher suite mismatch\" 錯誤,這可能是因為他們的系統僅" @@ -366,17 +365,16 @@ msgstr "增加了 :envvar:`SSLKEYLOGFILE` 對密鑰日誌記錄 (logging) 的支 #: ../../library/ssl.rst:208 msgid "" -"The context now uses :data:`PROTOCOL_TLS_CLIENT` " -"or :data:`PROTOCOL_TLS_SERVER` protocol instead of " -"generic :data:`PROTOCOL_TLS`." +"The context now uses :data:`PROTOCOL_TLS_CLIENT` or :data:" +"`PROTOCOL_TLS_SERVER` protocol instead of generic :data:`PROTOCOL_TLS`." msgstr "" "目前語境使用 :data:`PROTOCOL_TLS_CLIENT` 協定或 :data:`PROTOCOL_TLS_SERVER` " "協定而非通用的 :data:`PROTOCOL_TLS`。" #: ../../library/ssl.rst:214 msgid "" -"The context now uses :data:`VERIFY_X509_PARTIAL_CHAIN` " -"and :data:`VERIFY_X509_STRICT` in its default verify flags." +"The context now uses :data:`VERIFY_X509_PARTIAL_CHAIN` and :data:" +"`VERIFY_X509_STRICT` in its default verify flags." msgstr "" #: ../../library/ssl.rst:219 @@ -393,9 +391,9 @@ msgid "" "OpenSSL library." msgstr "" "引發由底層 SSL 實作(目前由 OpenSSL 函式庫提供)所引發的錯誤訊息。這表示在覆" -"蓋底層網路連線的高階加密和身份驗證層中存在一些問題。這項錯誤" -"是 :exc:`OSError` 的一個子型別。:exc:`SSLError` 實例的錯誤程式代碼和訊息是由 " -"OpenSSL 函式庫提供。" +"蓋底層網路連線的高階加密和身份驗證層中存在一些問題。這項錯誤是 :exc:" +"`OSError` 的一個子型別。:exc:`SSLError` 實例的錯誤程式代碼和訊息是由 OpenSSL " +"函式庫提供。" #: ../../library/ssl.rst:230 msgid ":exc:`SSLError` used to be a subtype of :exc:`socket.error`." @@ -491,16 +489,16 @@ msgstr "隨機產生" #: ../../library/ssl.rst:319 msgid "" -"Return *num* cryptographically strong pseudo-random bytes. Raises " -"an :class:`SSLError` if the PRNG has not been seeded with enough data or if " -"the operation is not supported by the current RAND " -"method. :func:`RAND_status` can be used to check the status of the PRNG " -"and :func:`RAND_add` can be used to seed the PRNG." +"Return *num* cryptographically strong pseudo-random bytes. Raises an :class:" +"`SSLError` if the PRNG has not been seeded with enough data or if the " +"operation is not supported by the current RAND method. :func:`RAND_status` " +"can be used to check the status of the PRNG and :func:`RAND_add` can be used " +"to seed the PRNG." msgstr "" "回傳 *num* 個加密性強的偽隨機位元組。如果 PRNG 未使用足夠的資料做為隨機種子 " -"(seed) 或是目前的 RAND 方法不支持該操作則會導致 :class:`SSLError` 錯" -"誤。:func:`RAND_status` 函式可以用來檢查 PRNG 函式,而 :func:`RAND_add` 則可" -"以用來為 PRNG 設定隨機種子。" +"(seed) 或是目前的 RAND 方法不支持該操作則會導致 :class:`SSLError` 錯誤。:" +"func:`RAND_status` 函式可以用來檢查 PRNG 函式,而 :func:`RAND_add` 則可以用來" +"為 PRNG 設定隨機種子。" #: ../../library/ssl.rst:325 msgid "For almost all applications :func:`os.urandom` is preferable." @@ -513,21 +511,20 @@ msgid "" "Cryptographically_secure_pseudorandom_number_generator>`_, to get the " "requirements of a cryptographically strong generator." msgstr "" -"請閱讀維基百科的\\ `密碼學安全偽隨機數產生器 (CSPRNG) `_\\ 文章來了解密碼學" -"安全偽隨機數產生器的需求。" +"請閱讀維基百科的\\ `密碼學安全偽隨機數產生器 (CSPRNG) `_\\ 文章來了" +"解密碼學安全偽隨機數產生器的需求。" #: ../../library/ssl.rst:336 msgid "" "Return ``True`` if the SSL pseudo-random number generator has been seeded " -"with 'enough' randomness, and ``False`` otherwise. You can " -"use :func:`ssl.RAND_egd` and :func:`ssl.RAND_add` to increase the randomness " -"of the pseudo-random number generator." +"with 'enough' randomness, and ``False`` otherwise. You can use :func:`ssl." +"RAND_egd` and :func:`ssl.RAND_add` to increase the randomness of the pseudo-" +"random number generator." msgstr "" "如果 SSL 偽隨機數產生器已經使用「足夠的」隨機性進行隨機種子生成,則回傳 " -"``True`` ,否則回傳 ``False``。你可以使用 :func:`ssl.RAND_egd` 函式" -"和 :func:`ssl.RAND_add` 函式來增加偽隨機數產生器的隨機性。" +"``True`` ,否則回傳 ``False``。你可以使用 :func:`ssl.RAND_egd` 函式和 :func:" +"`ssl.RAND_add` 函式來增加偽隨機數產生器的隨機性。" #: ../../library/ssl.rst:343 msgid "" @@ -600,19 +597,19 @@ msgid "" "PEM-encoded string. If ``ssl_version`` is specified, uses that version of " "the SSL protocol to attempt to connect to the server. If *ca_certs* is " "specified, it should be a file containing a list of root certificates, the " -"same format as used for the *cafile* parameter " -"in :meth:`SSLContext.load_verify_locations`. The call will attempt to " -"validate the server certificate against that set of root certificates, and " -"will fail if the validation attempt fails. A timeout can be specified with " -"the ``timeout`` parameter." +"same format as used for the *cafile* parameter in :meth:`SSLContext." +"load_verify_locations`. The call will attempt to validate the server " +"certificate against that set of root certificates, and will fail if the " +"validation attempt fails. A timeout can be specified with the ``timeout`` " +"parameter." msgstr "" "輸入使用 SSL 保護的伺服器的地址 ``addr``,輸入形式為一個 pair (*hostname*, " "*port-number*),取得該伺服器的憑證,並以 PEM 編碼字串的形式回傳。如果指定了 " "``ssl_version``,則使用指定的 SSL 協定來嘗試與伺服器連線。如果指定 " -"*ca_certs*,則它應該是一個包含根憑證列表的檔案,並" -"與 :meth:`SSLContext.load_verify_locations` 中的參數 *cafile* 所使用的格式相" -"同。此呼叫將嘗試使用該組根憑證對伺服器憑證進行驗證,如果驗證失敗,呼叫將失" -"敗。可以使用 ``timeout`` 參數指定超時時間。" +"*ca_certs*,則它應該是一個包含根憑證列表的檔案,並與 :meth:`SSLContext." +"load_verify_locations` 中的參數 *cafile* 所使用的格式相同。此呼叫將嘗試使用該" +"組根憑證對伺服器憑證進行驗證,如果驗證失敗,呼叫將失敗。可以使用 ``timeout`` " +"參數指定超時時間。" #: ../../library/ssl.rst:399 msgid "This function is now IPv6-compatible." @@ -620,11 +617,11 @@ msgstr "此函式現在是與 IPv6 相容的。" #: ../../library/ssl.rst:402 msgid "" -"The default *ssl_version* is changed from :data:`PROTOCOL_SSLv3` " -"to :data:`PROTOCOL_TLS` for maximum compatibility with modern servers." +"The default *ssl_version* is changed from :data:`PROTOCOL_SSLv3` to :data:" +"`PROTOCOL_TLS` for maximum compatibility with modern servers." msgstr "" -"預設的 *ssl_version* 已經從 :data:`PROTOCOL_SSLv3` 改" -"為 :data:`PROTOCOL_TLS`,已確保與現今的伺服器有最大的相容性。" +"預設的 *ssl_version* 已經從 :data:`PROTOCOL_SSLv3` 改為 :data:" +"`PROTOCOL_TLS`,已確保與現今的伺服器有最大的相容性。" #: ../../library/ssl.rst:406 msgid "The *timeout* parameter was added." @@ -651,9 +648,9 @@ msgid "" "paths are the same as used by :meth:`SSLContext.set_default_verify_paths`. " "The return value is a :term:`named tuple` ``DefaultVerifyPaths``:" msgstr "" -"回傳一個具有 OpenSSL 的預設 cafile 和 capath 路徑的附名元組。這些路徑" -"與 :meth:`SSLContext.set_default_verify_paths` 使用的相同。回傳值是一" -"個 :term:`named tuple` ``DefaultVerifyPaths``:" +"回傳一個具有 OpenSSL 的預設 cafile 和 capath 路徑的附名元組。這些路徑與 :" +"meth:`SSLContext.set_default_verify_paths` 使用的相同。回傳值是一個 :term:" +"`named tuple` ``DefaultVerifyPaths``:" #: ../../library/ssl.rst:426 msgid "" @@ -699,20 +696,18 @@ msgstr "" #: ../../library/ssl.rst:441 msgid "" "The function returns a list of (cert_bytes, encoding_type, trust) tuples. " -"The encoding_type specifies the encoding of cert_bytes. It is " -"either :const:`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for " -"PKCS#7 ASN.1 data. Trust specifies the purpose of the certificate as a set " -"of OIDS or exactly ``True`` if the certificate is trustworthy for all " -"purposes." +"The encoding_type specifies the encoding of cert_bytes. It is either :const:" +"`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for PKCS#7 ASN.1 " +"data. Trust specifies the purpose of the certificate as a set of OIDS or " +"exactly ``True`` if the certificate is trustworthy for all purposes." msgstr "" "此函式會回傳一個元組 (cert_bytes, encoding_type, trust) 串列。encoding_type " -"指定了 cert_bytes 的編碼格式。它可以是用來表示 X.509 ASN.1 資料" -"的 :const:`x509_asn` 或是用來表示 PKCS#7 ASN.1 資料的 :const:`pkcs_7_asn`。" -"Trust 通過一組 OIDS 來指定憑證的用途,或是如果憑證對所有用途都可以使用則回傳 " -"``True``。" +"指定了 cert_bytes 的編碼格式。它可以是用來表示 X.509 ASN.1 資料的 :const:" +"`x509_asn` 或是用來表示 PKCS#7 ASN.1 資料的 :const:`pkcs_7_asn`。Trust 通過一" +"組 OIDS 來指定憑證的用途,或是如果憑證對所有用途都可以使用則回傳 ``True``。" #: ../../library/ssl.rst:448 ../../library/ssl.rst:1605 -#: ../../library/ssl.rst:1904 +#: ../../library/ssl.rst:1905 msgid "Example::" msgstr "範例: ::" @@ -737,13 +732,12 @@ msgstr "" #: ../../library/ssl.rst:464 msgid "" "The function returns a list of (cert_bytes, encoding_type, trust) tuples. " -"The encoding_type specifies the encoding of cert_bytes. It is " -"either :const:`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for " -"PKCS#7 ASN.1 data." +"The encoding_type specifies the encoding of cert_bytes. It is either :const:" +"`x509_asn` for X.509 ASN.1 data or :const:`pkcs_7_asn` for PKCS#7 ASN.1 data." msgstr "" "此函式會回傳一個元組 (cert_bytes, encoding_type, trust) 串列。encoding_type " -"指定了 cert_bytes 的編碼格式。它可以是用來表示 X.509 ASN.1 資料" -"的 :const:`x509_asn` 或是用來表示 PKCS#7 ASN.1 資料的 :const:`pkcs_7_asn`。" +"指定了 cert_bytes 的編碼格式。它可以是用來表示 X.509 ASN.1 資料的 :const:" +"`x509_asn` 或是用來表示 PKCS#7 ASN.1 資料的 :const:`pkcs_7_asn`。" #: ../../library/ssl.rst:475 msgid "Constants" @@ -758,11 +752,10 @@ msgstr "" #: ../../library/ssl.rst:483 msgid "" -"Possible value for :attr:`SSLContext.verify_mode`. Except " -"for :const:`PROTOCOL_TLS_CLIENT`, it is the default mode. With client-side " -"sockets, just about any cert is accepted. Validation errors, such as " -"untrusted or expired cert, are ignored and do not abort the TLS/SSL " -"handshake." +"Possible value for :attr:`SSLContext.verify_mode`. Except for :const:" +"`PROTOCOL_TLS_CLIENT`, it is the default mode. With client-side sockets, " +"just about any cert is accepted. Validation errors, such as untrusted or " +"expired cert, are ignored and do not abort the TLS/SSL handshake." msgstr "" ":attr:`SSLContext.verify_mode` 可能的值。除了 :attr:`SSLContext.verify_mode` " "外,這是預設的模式。對於用戶端的 sockets,幾乎任何憑證都能被允許。驗證錯誤," @@ -776,20 +769,19 @@ msgstr "" "在伺服器模式下,不會從用戶端請求任何憑證,所以用戶端不用發送任何用於用戶端憑" "證身分驗證的憑證。" -#: ../../library/ssl.rst:492 ../../library/ssl.rst:2406 +#: ../../library/ssl.rst:492 ../../library/ssl.rst:2407 msgid "See the discussion of :ref:`ssl-security` below." msgstr "參閱下方 :ref:`ssl-security` 的討論。" #: ../../library/ssl.rst:496 msgid "" -"Possible value for :attr:`SSLContext.verify_mode`. In client " -"mode, :const:`CERT_OPTIONAL` has the same meaning as :const:`CERT_REQUIRED`. " -"It is recommended to use :const:`CERT_REQUIRED` for client-side sockets " -"instead." +"Possible value for :attr:`SSLContext.verify_mode`. In client mode, :const:" +"`CERT_OPTIONAL` has the same meaning as :const:`CERT_REQUIRED`. It is " +"recommended to use :const:`CERT_REQUIRED` for client-side sockets instead." msgstr "" -":attr:`SSLContext.verify_mode` 可能的值。在用戶端模式" -"下,:const:`CERT_OPTIONAL` 具有與 :const:`CERT_REQUIRED` 相同的含意。對於客戶" -"端 sockets 推薦改用 :const:`CERT_REQUIRED`。" +":attr:`SSLContext.verify_mode` 可能的值。在用戶端模式下,:const:" +"`CERT_OPTIONAL` 具有與 :const:`CERT_REQUIRED` 相同的含意。對於客戶端 sockets " +"推薦改用 :const:`CERT_REQUIRED`。" #: ../../library/ssl.rst:501 msgid "" @@ -805,30 +797,29 @@ msgstr "" #: ../../library/ssl.rst:507 ../../library/ssl.rst:526 msgid "" -"Use of this setting requires a valid set of CA certificates to be passed " -"to :meth:`SSLContext.load_verify_locations`." +"Use of this setting requires a valid set of CA certificates to be passed to :" +"meth:`SSLContext.load_verify_locations`." msgstr "" -"使用此設定需要將一組有效的 CA 憑證傳送" -"給 :meth:`SSLContext.load_verify_locations`。" +"使用此設定需要將一組有效的 CA 憑證傳送給 :meth:`SSLContext." +"load_verify_locations`。" #: ../../library/ssl.rst:512 msgid "" "Possible value for :attr:`SSLContext.verify_mode`. In this mode, " -"certificates are required from the other side of the socket connection; " -"an :class:`SSLError` will be raised if no certificate is provided, or if its " +"certificates are required from the other side of the socket connection; an :" +"class:`SSLError` will be raised if no certificate is provided, or if its " "validation fails. This mode is **not** sufficient to verify a certificate in " -"client mode as it does not match " -"hostnames. :attr:`~SSLContext.check_hostname` must be enabled as well to " -"verify the authenticity of a cert. :const:`PROTOCOL_TLS_CLIENT` " -"uses :const:`CERT_REQUIRED` and enables :attr:`~SSLContext.check_hostname` " -"by default." +"client mode as it does not match hostnames. :attr:`~SSLContext." +"check_hostname` must be enabled as well to verify the authenticity of a " +"cert. :const:`PROTOCOL_TLS_CLIENT` uses :const:`CERT_REQUIRED` and enables :" +"attr:`~SSLContext.check_hostname` by default." msgstr "" ":attr:`SSLContext.verify_mode` 可能的值。在這個模式下,需要從 socket 連線的另" "一端取得憑證;如果未提供憑證或是驗證失敗,則將會導致 :class:`SSLError`。此模" -"式\\ **不能**\\ 在用戶端模式下對憑證進行驗證,因為它無法去配對主機名" -"稱。:attr:`~SSLContext.check_hostname` 也必須被開起來來驗證憑證的真實" -"性。:const:`PROTOCOL_TLS_CLIENT` 會使用 :const:`CERT_REQUIRED` 並預設開" -"啟 :attr:`~SSLContext.check_hostname`。" +"式\\ **不能**\\ 在用戶端模式下對憑證進行驗證,因為它無法去配對主機名稱。:" +"attr:`~SSLContext.check_hostname` 也必須被開起來來驗證憑證的真實性。:const:" +"`PROTOCOL_TLS_CLIENT` 會使用 :const:`CERT_REQUIRED` 並預設開啟 :attr:" +"`~SSLContext.check_hostname`。" #: ../../library/ssl.rst:522 msgid "" @@ -857,8 +848,8 @@ msgid "" "Possible value for :attr:`SSLContext.verify_flags`. In this mode, only the " "peer cert is checked but none of the intermediate CA certificates. The mode " "requires a valid CRL that is signed by the peer cert's issuer (its direct " -"ancestor CA). If no proper CRL has been loaded " -"with :attr:`SSLContext.load_verify_locations`, validation will fail." +"ancestor CA). If no proper CRL has been loaded with :attr:`SSLContext." +"load_verify_locations`, validation will fail." msgstr "" ":attr:`SSLContext.verify_flags` 可能的值。在此模式下,只會檢查同等的憑證而不" "會去檢查中間的 CA 憑證。此模式需要提供由對等憑證發行者 (它的直接上級 CA) 的有" @@ -924,8 +915,8 @@ msgstr "" #: ../../library/ssl.rst:608 msgid "" "TLS clients and servers require different default settings for secure " -"communication. The generic TLS protocol constant is deprecated in favor " -"of :data:`PROTOCOL_TLS_CLIENT` and :data:`PROTOCOL_TLS_SERVER`." +"communication. The generic TLS protocol constant is deprecated in favor of :" +"data:`PROTOCOL_TLS_CLIENT` and :data:`PROTOCOL_TLS_SERVER`." msgstr "" "TLS 的用戶端及伺服器端需要不同的預設值來實現安全通訊。通用的 TLS 協定常數已被" "廢除,並改用 :data:`PROTOCOL_TLS_CLIENT` 和 :data:`PROTOCOL_TLS_SERVER`。" @@ -971,13 +962,13 @@ msgstr "第三版的 SSL 是不安全的,強烈建議不要使用。" #: ../../library/ssl.rst:649 msgid "" "OpenSSL has deprecated all version specific protocols. Use the default " -"protocol :data:`PROTOCOL_TLS_SERVER` or :data:`PROTOCOL_TLS_CLIENT` " -"with :attr:`SSLContext.minimum_version` " -"and :attr:`SSLContext.maximum_version` instead." +"protocol :data:`PROTOCOL_TLS_SERVER` or :data:`PROTOCOL_TLS_CLIENT` with :" +"attr:`SSLContext.minimum_version` and :attr:`SSLContext.maximum_version` " +"instead." msgstr "" -"OpenSSL 已經終止了所有特定版本的協定。請改用預設" -"的 :data:`PROTOCOL_TLS_SERVER` 協定或帶有 :attr:`SSLContext.minimum_version` " -"和 :attr:`SSLContext.maximum_version` 的 :data:`PROTOCOL_TLS_CLIENT`。" +"OpenSSL 已經終止了所有特定版本的協定。請改用預設的 :data:" +"`PROTOCOL_TLS_SERVER` 協定或帶有 :attr:`SSLContext.minimum_version` 和 :attr:" +"`SSLContext.maximum_version` 的 :data:`PROTOCOL_TLS_CLIENT`。" #: ../../library/ssl.rst:657 msgid "Selects TLS version 1.0 as the channel encryption protocol." @@ -1050,13 +1041,11 @@ msgstr "" #: ../../library/ssl.rst:725 msgid "" -"The option is deprecated since OpenSSL 1.1.0, use the " -"new :attr:`SSLContext.minimum_version` " -"and :attr:`SSLContext.maximum_version` instead." +"The option is deprecated since OpenSSL 1.1.0, use the new :attr:`SSLContext." +"minimum_version` and :attr:`SSLContext.maximum_version` instead." msgstr "" -"該選項自從 OpenSSL 1.1.0 以後已被棄用,請改用新" -"的 :attr:`SSLContext.minimum_version` 及 :attr:`SSLContext.maximum_version` " -"代替。" +"該選項自從 OpenSSL 1.1.0 以後已被棄用,請改用新的 :attr:`SSLContext." +"minimum_version` 及 :attr:`SSLContext.maximum_version` 代替。" #: ../../library/ssl.rst:732 msgid "" @@ -1206,16 +1195,16 @@ msgid "" "Whether the OpenSSL library has built-in support for the *Application-Layer " "Protocol Negotiation* TLS extension as described in :rfc:`7301`." msgstr "" -"OpenSSL 函式庫是否內建支援 *應用層協定協商* TLS 擴充套件,該擴充套件描述" -"在 :rfc:`7301` 中。" +"OpenSSL 函式庫是否內建支援 *應用層協定協商* TLS 擴充套件,該擴充套件描述在 :" +"rfc:`7301` 中。" #: ../../library/ssl.rst:864 msgid "" "Whether the OpenSSL library has built-in support not checking subject common " "name and :attr:`SSLContext.hostname_checks_common_name` is writeable." msgstr "" -"OpenSSL 函式庫是否內建支援不檢查主題通用名稱" -"及 :attr:`SSLContext.hostname_checks_common_name` 是否可寫。" +"OpenSSL 函式庫是否內建支援不檢查主題通用名稱及 :attr:`SSLContext." +"hostname_checks_common_name` 是否可寫。" #: ../../library/ssl.rst:872 msgid "" @@ -1290,8 +1279,8 @@ msgid "" "List of supported TLS channel binding types. Strings in this list can be " "used as arguments to :meth:`SSLSocket.get_channel_binding`." msgstr "" -"支援的 TLS 通道綁定類型列表。列表中的字串可以作" -"為 :meth:`SSLSocket.get_channel_binding` 的參數。" +"支援的 TLS 通道綁定類型列表。列表中的字串可以作為 :meth:`SSLSocket." +"get_channel_binding` 的參數。" #: ../../library/ssl.rst:952 msgid "The version string of the OpenSSL library loaded by the interpreter::" @@ -1342,14 +1331,14 @@ msgid "" "parameters-6>`_ contains this list and references to the RFCs where their " "meaning is defined." msgstr "" -"來自 :rfc:`5246` 和其他文件的警報描述。`IANA TLS Alert Registry `_ 包含了此列表以及其含義定義所在的 RFC 的引用。" +"來自 :rfc:`5246` 和其他文件的警報描述。`IANA TLS Alert Registry `_ 包" +"含了此列表以及其含義定義所在的 RFC 的引用。" #: ../../library/ssl.rst:988 msgid "" -"Used as the return value of the callback function " -"in :meth:`SSLContext.set_servername_callback`." +"Used as the return value of the callback function in :meth:`SSLContext." +"set_servername_callback`." msgstr "" "被用來做為 :meth:`SSLContext.set_servername_callback` 中回呼函式的回傳值。" @@ -1359,20 +1348,20 @@ msgstr ":class:`enum.IntEnum` 為 ALERT_DESCRIPTION_* 常數中的一個集合 #: ../../library/ssl.rst:1001 msgid "" -"Option for :func:`create_default_context` " -"and :meth:`SSLContext.load_default_certs`. This value indicates that the " -"context may be used to authenticate web servers (therefore, it will be used " -"to create client-side sockets)." +"Option for :func:`create_default_context` and :meth:`SSLContext." +"load_default_certs`. This value indicates that the context may be used to " +"authenticate web servers (therefore, it will be used to create client-side " +"sockets)." msgstr "" ":func:`create_default_context` 和 :meth:`SSLContext.load_default_certs` 的選" "項。此值表示該語境可能會用於驗證網頁伺服器 (因此它將用於建立用戶端 socket)。" #: ../../library/ssl.rst:1010 msgid "" -"Option for :func:`create_default_context` " -"and :meth:`SSLContext.load_default_certs`. This value indicates that the " -"context may be used to authenticate web clients (therefore, it will be used " -"to create server-side sockets)." +"Option for :func:`create_default_context` and :meth:`SSLContext." +"load_default_certs`. This value indicates that the context may be used to " +"authenticate web clients (therefore, it will be used to create server-side " +"sockets)." msgstr "" ":func:`create_default_context` 和 :meth:`SSLContext.load_default_certs` 的選" "項。此值表示該語境可能會用於驗證網頁用戶端 (因此,它將用於建立伺服器端的 " @@ -1384,13 +1373,11 @@ msgstr ":class:`enum.IntEnum` 為 SSL_ERROR_* 常數中的一個集合。" #: ../../library/ssl.rst:1025 msgid "" -":class:`enum.IntEnum` collection of SSL and TLS versions " -"for :attr:`SSLContext.maximum_version` " -"and :attr:`SSLContext.minimum_version`." +":class:`enum.IntEnum` collection of SSL and TLS versions for :attr:" +"`SSLContext.maximum_version` and :attr:`SSLContext.minimum_version`." msgstr "" -"用於 :attr:`SSLContext.maximum_version` " -"和 :attr:`SSLContext.minimum_version` 的 SSL 和 TLS 版" -"本 :class:`enum.IntEnum` 集合。" +"用於 :attr:`SSLContext.maximum_version` 和 :attr:`SSLContext." +"minimum_version` 的 SSL 和 TLS 版本 :class:`enum.IntEnum` 集合。" #: ../../library/ssl.rst:1033 msgid "" @@ -1407,11 +1394,11 @@ msgstr "SSL 3.0 到 TLS 1.3。" #: ../../library/ssl.rst:1047 msgid "" -"All :class:`TLSVersion` members except :attr:`TLSVersion.TLSv1_2` " -"and :attr:`TLSVersion.TLSv1_3` are deprecated." +"All :class:`TLSVersion` members except :attr:`TLSVersion.TLSv1_2` and :attr:" +"`TLSVersion.TLSv1_3` are deprecated." msgstr "" -"除了 :attr:`TLSVersion.TLSv1_2` 和 :attr:`TLSVersion.TLSv1_3` 之外,所有" -"的 :class:`TLSVersion` 成員都已被棄用。" +"除了 :attr:`TLSVersion.TLSv1_2` 和 :attr:`TLSVersion.TLSv1_3` 之外,所有的 :" +"class:`TLSVersion` 成員都已被棄用。" #: ../../library/ssl.rst:1052 msgid "SSL Sockets" @@ -1454,8 +1441,12 @@ msgid ":meth:`~socket.socket.getsockopt`, :meth:`~socket.socket.setsockopt`" msgstr ":meth:`~socket.socket.getsockopt`、:meth:`~socket.socket.setsockopt`" #: ../../library/ssl.rst:1066 -msgid ":meth:`~socket.socket.gettimeout`, :meth:`~socket.socket.settimeout`, :meth:`~socket.socket.setblocking`" -msgstr ":meth:`~socket.socket.gettimeout`、:meth:`~socket.socket.settimeout`、:meth:`~socket.socket.setblocking`" +msgid "" +":meth:`~socket.socket.gettimeout`, :meth:`~socket.socket.settimeout`, :meth:" +"`~socket.socket.setblocking`" +msgstr "" +":meth:`~socket.socket.gettimeout`、:meth:`~socket.socket.settimeout`、:meth:" +"`~socket.socket.setblocking`" #: ../../library/ssl.rst:1068 msgid ":meth:`~socket.socket.listen`" @@ -1506,8 +1497,8 @@ msgstr "" #: ../../library/ssl.rst:1083 msgid "" -"Instances of :class:`SSLSocket` must be created using " -"the :meth:`SSLContext.wrap_socket` method." +"Instances of :class:`SSLSocket` must be created using the :meth:`SSLContext." +"wrap_socket` method." msgstr "" ":class:`SSLSocket` 的實例必須使用 :meth:`SSLContext.wrap_socket` 方法建立。" @@ -1526,18 +1517,17 @@ msgstr "" #: ../../library/ssl.rst:1094 msgid "" -"It is deprecated to create a :class:`SSLSocket` instance directly, " -"use :meth:`SSLContext.wrap_socket` to wrap a socket." +"It is deprecated to create a :class:`SSLSocket` instance directly, use :meth:" +"`SSLContext.wrap_socket` to wrap a socket." msgstr "" -"直接建立 :class:`SSLSocket` 實例的方式已被棄用,請使" -"用 :meth:`SSLContext.wrap_socket` 來包裝 socket。" +"直接建立 :class:`SSLSocket` 實例的方式已被棄用,請使用 :meth:`SSLContext." +"wrap_socket` 來包裝 socket。" #: ../../library/ssl.rst:1098 msgid "" -":class:`SSLSocket` instances must to created " -"with :meth:`~SSLContext.wrap_socket`. In earlier versions, it was possible " -"to create instances directly. This was never documented or officially " -"supported." +":class:`SSLSocket` instances must to created with :meth:`~SSLContext." +"wrap_socket`. In earlier versions, it was possible to create instances " +"directly. This was never documented or officially supported." msgstr "" ":class:`SSLSocket` 實例必須使用 :meth:`~SSLContext.wrap_socket` 建立。在較早" "的版本中可以直接建立實例,但這從未被記錄或正式支援。" @@ -1566,12 +1556,11 @@ msgstr "" #: ../../library/ssl.rst:1117 msgid "" -"Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket " -"is :ref:`non-blocking ` and the read would block." +"Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is :" +"ref:`non-blocking ` and the read would block." msgstr "" -"如果 socket 是\\ :ref:`非阻塞的 `\\ 則會引" -"發 :exc:`SSLWantReadError` 或 :exc:`SSLWantWriteError` 並且讀取操作將會被阻" -"塞。" +"如果 socket 是\\ :ref:`非阻塞的 `\\ 則會引發 :exc:" +"`SSLWantReadError` 或 :exc:`SSLWantWriteError` 並且讀取操作將會被阻塞。" #: ../../library/ssl.rst:1120 msgid "" @@ -1603,12 +1592,11 @@ msgstr "" #: ../../library/ssl.rst:1136 msgid "" -"Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket " -"is :ref:`non-blocking ` and the write would block." +"Raise :exc:`SSLWantReadError` or :exc:`SSLWantWriteError` if the socket is :" +"ref:`non-blocking ` and the write would block." msgstr "" -"如果 socket 是\\ :ref:`非阻塞的 `\\ 則會引" -"發 :exc:`SSLWantReadError` 或 :exc:`SSLWantWriteError` 並且寫入操作將會被阻" -"塞。" +"如果 socket 是\\ :ref:`非阻塞的 `\\ 則會引發 :exc:" +"`SSLWantReadError` 或 :exc:`SSLWantWriteError` 並且寫入操作將會被阻塞。" #: ../../library/ssl.rst:1139 msgid "" @@ -1634,8 +1622,8 @@ msgid "" "The :meth:`~SSLSocket.read` and :meth:`~SSLSocket.write` methods are the low-" "level methods that read and write unencrypted, application-level data and " "decrypt/encrypt it to encrypted, wire-level data. These methods require an " -"active SSL connection, i.e. the handshake was completed " -"and :meth:`SSLSocket.unwrap` was not called." +"active SSL connection, i.e. the handshake was completed and :meth:`SSLSocket." +"unwrap` was not called." msgstr "" ":meth:`~SSLSocket.read` 和 :meth:`~SSLSocket.write` 方法為低階層的方法,負責" "讀取和寫入未加密的應用層資料,並將其加密/解密為加密的寫入層資料。這些方法需要" @@ -1643,9 +1631,8 @@ msgstr "" #: ../../library/ssl.rst:1157 msgid "" -"Normally you should use the socket API methods " -"like :meth:`~socket.socket.recv` and :meth:`~socket.socket.send` instead of " -"these methods." +"Normally you should use the socket API methods like :meth:`~socket.socket." +"recv` and :meth:`~socket.socket.send` instead of these methods." msgstr "" "通常你應該使用像 :meth:`~socket.socket.recv` 和 :meth:`~socket.socket.send` " "這樣的 socket API 方法,而不是直接使用這些方法。" @@ -1656,13 +1643,12 @@ msgstr "執行 SSL 設定握手。" #: ../../library/ssl.rst:1165 msgid "" -"The handshake method also performs :func:`match_hostname` when " -"the :attr:`~SSLContext.check_hostname` attribute of the " -"socket's :attr:`~SSLSocket.context` is true." +"The handshake method also performs :func:`match_hostname` when the :attr:" +"`~SSLContext.check_hostname` attribute of the socket's :attr:`~SSLSocket." +"context` is true." msgstr "" -"當 socket 的 :attr:`~SSLSocket.context` " -"的 :attr:`~SSLContext.check_hostname` 屬性質為 true 時,握手方法也會執" -"行 :func:`match_hostname`。" +"當 socket 的 :attr:`~SSLSocket.context` 的 :attr:`~SSLContext." +"check_hostname` 屬性質為 true 時,握手方法也會執行 :func:`match_hostname`。" #: ../../library/ssl.rst:1170 msgid "" @@ -1674,23 +1660,23 @@ msgstr "" #: ../../library/ssl.rst:1174 msgid "" -"Hostname or IP address is matched by OpenSSL during handshake. The " -"function :func:`match_hostname` is no longer used. In case OpenSSL refuses a " -"hostname or IP address, the handshake is aborted early and a TLS alert " -"message is sent to the peer." +"Hostname or IP address is matched by OpenSSL during handshake. The function :" +"func:`match_hostname` is no longer used. In case OpenSSL refuses a hostname " +"or IP address, the handshake is aborted early and a TLS alert message is " +"sent to the peer." msgstr "" -"在握手過程中,OpenSSL 會去配對主機名稱或 IP 地址。已不再使" -"用 :func:`match_hostname` 函式。如果 OpenSSL 拒絕某個主機名稱或 IP 地址,握手" -"將會提前中止,並向對方發送 TLS 警報訊息。" +"在握手過程中,OpenSSL 會去配對主機名稱或 IP 地址。已不再使用 :func:" +"`match_hostname` 函式。如果 OpenSSL 拒絕某個主機名稱或 IP 地址,握手將會提前" +"中止,並向對方發送 TLS 警報訊息。" #: ../../library/ssl.rst:1182 msgid "" "If there is no certificate for the peer on the other end of the connection, " -"return ``None``. If the SSL handshake hasn't been done yet, " -"raise :exc:`ValueError`." +"return ``None``. If the SSL handshake hasn't been done yet, raise :exc:" +"`ValueError`." msgstr "" -"如果連線端沒有證書,則回傳 ``None``。如果 SSL 握手尚未完成,則引" -"發 :exc:`ValueError`。" +"如果連線端沒有證書,則回傳 ``None``。如果 SSL 握手尚未完成,則引發 :exc:" +"`ValueError`。" #: ../../library/ssl.rst:1186 msgid "" @@ -1771,8 +1757,8 @@ msgid "" "socket's role:" msgstr "" "如果 ``binary_form`` 參數設定為 :const:`True`,且對等提供了證書,則該方法會" -"以 DER 編碼形式 將整個證書以位元組序列形式回傳。如果對等未提供證書,則回" -"傳 :const:`None`。對等是否提供證書取決於 SSL socket 的腳色:" +"以 DER 編碼形式 將整個證書以位元組序列形式回傳。如果對等未提供證書,則回傳 :" +"const:`None`。對等是否提供證書取決於 SSL socket 的腳色:" #: ../../library/ssl.rst:1225 msgid "" @@ -1783,13 +1769,13 @@ msgstr "對於用戶端 SSL socket,伺服器將永遠提供證書,無論是 #: ../../library/ssl.rst:1228 msgid "" "for a server SSL socket, the client will only provide a certificate when " -"requested by the server; therefore :meth:`getpeercert` will " -"return :const:`None` if you used :const:`CERT_NONE` (rather " -"than :const:`CERT_OPTIONAL` or :const:`CERT_REQUIRED`)." +"requested by the server; therefore :meth:`getpeercert` will return :const:" +"`None` if you used :const:`CERT_NONE` (rather than :const:`CERT_OPTIONAL` " +"or :const:`CERT_REQUIRED`)." msgstr "" "對於伺服器 SSL socket,用戶端僅在伺服器要求時才會提供證書;因此,如果你使用的" -"是 :const:`CERT_NONE` (而非 :const:`CERT_OPTIONAL` " -"或 :const:`CERT_REQUIRED`),則 :meth:`getpeercert` 會回傳 :const:`None`。" +"是 :const:`CERT_NONE` (而非 :const:`CERT_OPTIONAL` 或 :const:" +"`CERT_REQUIRED`),則 :meth:`getpeercert` 會回傳 :const:`None`。" #: ../../library/ssl.rst:1233 msgid "See also :attr:`SSLContext.check_hostname`." @@ -1865,18 +1851,17 @@ msgstr "" msgid "" "The *cb_type* parameter allow selection of the desired channel binding type. " "Valid channel binding types are listed in the :data:`CHANNEL_BINDING_TYPES` " -"list. Currently only the 'tls-unique' channel binding, defined " -"by :rfc:`5929`, is supported. :exc:`ValueError` will be raised if an " -"unsupported channel binding type is requested." +"list. Currently only the 'tls-unique' channel binding, defined by :rfc:" +"`5929`, is supported. :exc:`ValueError` will be raised if an unsupported " +"channel binding type is requested." msgstr "" #: ../../library/ssl.rst:1305 msgid "" -"Return the protocol that was selected during the TLS handshake. " -"If :meth:`SSLContext.set_alpn_protocols` was not called, if the other party " -"does not support ALPN, if this socket does not support any of the client's " -"proposed protocols, or if the handshake has not happened yet, ``None`` is " -"returned." +"Return the protocol that was selected during the TLS handshake. If :meth:" +"`SSLContext.set_alpn_protocols` was not called, if the other party does not " +"support ALPN, if this socket does not support any of the client's proposed " +"protocols, or if the handshake has not happened yet, ``None`` is returned." msgstr "" #: ../../library/ssl.rst:1315 @@ -1904,8 +1889,8 @@ msgstr "" msgid "" "Requests post-handshake authentication (PHA) from a TLS 1.3 client. PHA can " "only be initiated for a TLS 1.3 connection from a server-side socket, after " -"the initial TLS handshake and with PHA enabled on both sides, " -"see :attr:`SSLContext.post_handshake_auth`." +"the initial TLS handshake and with PHA enabled on both sides, see :attr:" +"`SSLContext.post_handshake_auth`." msgstr "" #: ../../library/ssl.rst:1341 @@ -1917,8 +1902,8 @@ msgstr "" #: ../../library/ssl.rst:1345 msgid "" -"If any precondition isn't met (e.g. not TLS 1.3, PHA not enabled), " -"an :exc:`SSLError` is raised." +"If any precondition isn't met (e.g. not TLS 1.3, PHA not enabled), an :exc:" +"`SSLError` is raised." msgstr "" #: ../../library/ssl.rst:1349 @@ -1962,16 +1947,16 @@ msgstr "" msgid "" "The attribute is now always ASCII text. When ``server_hostname`` is an " "internationalized domain name (IDN), this attribute now stores the A-label " -"form (``\"xn--pythn-mua.org\"``), rather than the U-label form " -"(``\"pythön.org\"``)." +"form (``\"xn--pythn-mua.org\"``), rather than the U-label form (``\"pythön." +"org\"``)." msgstr "" #: ../../library/ssl.rst:1397 msgid "" "The :class:`SSLSession` for this SSL connection. The session is available " "for client and server side sockets after the TLS handshake has been " -"performed. For client sockets the session can be set " -"before :meth:`~SSLSocket.do_handshake` has been called to reuse a session." +"performed. For client sockets the session can be set before :meth:" +"`~SSLSocket.do_handshake` has been called to reuse a session." msgstr "" #: ../../library/ssl.rst:1410 @@ -2077,7 +2062,7 @@ msgstr "*TLSv1.2*" #: ../../library/ssl.rst:1446 msgid "Footnotes" -msgstr "註解" +msgstr "註腳" #: ../../library/ssl.rst:1447 msgid ":class:`SSLContext` disables SSLv2 with :data:`OP_NO_SSLv2` by default." @@ -2101,27 +2086,28 @@ msgstr "" #: ../../library/ssl.rst:1459 msgid "" -"The context is created with secure default values. The " -"options :data:`OP_NO_COMPRESSION`, :data:`OP_CIPHER_SERVER_PREFERENCE`, :data:`OP_SINGLE_DH_USE`, :data:`OP_SINGLE_ECDH_USE`, :data:`OP_NO_SSLv2`, " -"and :data:`OP_NO_SSLv3` (except for :data:`PROTOCOL_SSLv3`) are set by " -"default. The initial cipher suite list contains only ``HIGH`` ciphers, no " -"``NULL`` ciphers and no ``MD5`` ciphers." +"The context is created with secure default values. The options :data:" +"`OP_NO_COMPRESSION`, :data:`OP_CIPHER_SERVER_PREFERENCE`, :data:" +"`OP_SINGLE_DH_USE`, :data:`OP_SINGLE_ECDH_USE`, :data:`OP_NO_SSLv2`, and :" +"data:`OP_NO_SSLv3` (except for :data:`PROTOCOL_SSLv3`) are set by default. " +"The initial cipher suite list contains only ``HIGH`` ciphers, no ``NULL`` " +"ciphers and no ``MD5`` ciphers." msgstr "" #: ../../library/ssl.rst:1469 msgid "" ":class:`SSLContext` without protocol argument is deprecated. The context " -"class will either require :data:`PROTOCOL_TLS_CLIENT` " -"or :data:`PROTOCOL_TLS_SERVER` protocol in the future." +"class will either require :data:`PROTOCOL_TLS_CLIENT` or :data:" +"`PROTOCOL_TLS_SERVER` protocol in the future." msgstr "" #: ../../library/ssl.rst:1475 msgid "" "The default cipher suites now include only secure AES and ChaCha20 ciphers " "with forward secrecy and security level 2. RSA and DH keys with less than " -"2048 bits and ECC keys with less than 224 bits are " -"prohibited. :data:`PROTOCOL_TLS`, :data:`PROTOCOL_TLS_CLIENT`, " -"and :data:`PROTOCOL_TLS_SERVER` use TLS 1.2 as minimum TLS version." +"2048 bits and ECC keys with less than 224 bits are prohibited. :data:" +"`PROTOCOL_TLS`, :data:`PROTOCOL_TLS_CLIENT`, and :data:`PROTOCOL_TLS_SERVER` " +"use TLS 1.2 as minimum TLS version." msgstr "" #: ../../library/ssl.rst:1483 @@ -2141,7 +2127,7 @@ msgstr "" #: ../../library/ssl.rst:1495 msgid ":class:`SSLContext` objects have the following methods and attributes:" -msgstr "" +msgstr ":class:`SSLContext` 物件具有以下方法和屬性:" #: ../../library/ssl.rst:1499 msgid "" @@ -2206,9 +2192,9 @@ msgstr "新增可選引數 *password*。" msgid "" "Load a set of default \"certification authority\" (CA) certificates from " "default locations. On Windows it loads CA certs from the ``CA`` and ``ROOT`` " -"system stores. On all systems it " -"calls :meth:`SSLContext.set_default_verify_paths`. In the future the method " -"may load CA certificates from other locations, too." +"system stores. On all systems it calls :meth:`SSLContext." +"set_default_verify_paths`. In the future the method may load CA certificates " +"from other locations, too." msgstr "" #: ../../library/ssl.rst:1549 @@ -2223,9 +2209,8 @@ msgstr "" #: ../../library/ssl.rst:1559 msgid "" "Load a set of \"certification authority\" (CA) certificates used to validate " -"other peers' certificates when :data:`verify_mode` is other " -"than :data:`CERT_NONE`. At least one of *cafile* or *capath* must be " -"specified." +"other peers' certificates when :data:`verify_mode` is other than :data:" +"`CERT_NONE`. At least one of *cafile* or *capath* must be specified." msgstr "" #: ../../library/ssl.rst:1563 @@ -2279,8 +2264,8 @@ msgstr "" #: ../../library/ssl.rst:1602 msgid "" -"Get a list of enabled ciphers. The list is in order of cipher priority. " -"See :meth:`SSLContext.set_ciphers`." +"Get a list of enabled ciphers. The list is in order of cipher priority. See :" +"meth:`SSLContext.set_ciphers`." msgstr "" #: ../../library/ssl.rst:1607 @@ -2368,16 +2353,16 @@ msgstr "" #: ../../library/ssl.rst:1659 msgid "" -"TLS 1.3 cipher suites cannot be disabled " -"with :meth:`~SSLContext.set_ciphers`." +"TLS 1.3 cipher suites cannot be disabled with :meth:`~SSLContext." +"set_ciphers`." msgstr "" #: ../../library/ssl.rst:1664 msgid "" "Specify which protocols the socket should advertise during the SSL/TLS " -"handshake. It should be a list of ASCII strings, like ``['http/1.1', 'spdy/" -"2']``, ordered by preference. The selection of a protocol will happen during " -"the handshake, and will play out according to :rfc:`7301`. After a " +"handshake. It should be a list of ASCII strings, like ``['http/1.1', " +"'spdy/2']``, ordered by preference. The selection of a protocol will happen " +"during the handshake, and will play out according to :rfc:`7301`. After a " "successful handshake, the :meth:`SSLSocket.selected_alpn_protocol` method " "will return the agreed-upon protocol." msgstr "" @@ -2386,7 +2371,7 @@ msgstr "" msgid "" "This method will raise :exc:`NotImplementedError` if :data:`HAS_ALPN` is " "``False``." -msgstr "" +msgstr "此方法會在 :data:`HAS_ALPN` 為 ``False`` 時引發 :exc:`NotImplementedError`。" #: ../../library/ssl.rst:1678 msgid "" @@ -2395,16 +2380,16 @@ msgid "" "ordered by preference. The selection of a protocol will happen during the " "handshake, and will play out according to the `Application Layer Protocol " "Negotiation `_. After a successful handshake, " -"the :meth:`SSLSocket.selected_npn_protocol` method will return the agreed-" -"upon protocol." +"Layer_Protocol_Negotiation>`_. After a successful handshake, the :meth:" +"`SSLSocket.selected_npn_protocol` method will return the agreed-upon " +"protocol." msgstr "" #: ../../library/ssl.rst:1686 msgid "" "This method will raise :exc:`NotImplementedError` if :data:`HAS_NPN` is " "``False``." -msgstr "" +msgstr "此方法會在 :data:`HAS_NPN` 為 ``False`` 時引發 :exc:`NotImplementedError`。" #: ../../library/ssl.rst:1697 msgid "" @@ -2434,37 +2419,37 @@ msgstr "" #: ../../library/ssl.rst:1714 msgid "" -"A typical use of this callback is to change " -"the :class:`ssl.SSLSocket`'s :attr:`SSLSocket.context` attribute to a new " -"object of type :class:`SSLContext` representing a certificate chain that " -"matches the server name." +"A typical use of this callback is to change the :class:`ssl.SSLSocket`'s :" +"attr:`SSLSocket.context` attribute to a new object of type :class:" +"`SSLContext` representing a certificate chain that matches the server name." msgstr "" #: ../../library/ssl.rst:1719 msgid "" "Due to the early negotiation phase of the TLS connection, only limited " -"methods and attributes are usable " -"like :meth:`SSLSocket.selected_alpn_protocol` and :attr:`SSLSocket.context`. " -"The :meth:`SSLSocket.getpeercert`, :meth:`SSLSocket.get_verified_chain`, :meth:`SSLSocket.get_unverified_chain` :meth:`SSLSocket.cipher` " -"and :meth:`SSLSocket.compression` methods require that the TLS connection " -"has progressed beyond the TLS Client Hello and therefore will not return " -"meaningful values nor can they be called safely." +"methods and attributes are usable like :meth:`SSLSocket." +"selected_alpn_protocol` and :attr:`SSLSocket.context`. The :meth:`SSLSocket." +"getpeercert`, :meth:`SSLSocket.get_verified_chain`, :meth:`SSLSocket." +"get_unverified_chain` :meth:`SSLSocket.cipher` and :meth:`SSLSocket." +"compression` methods require that the TLS connection has progressed beyond " +"the TLS Client Hello and therefore will not return meaningful values nor can " +"they be called safely." msgstr "" #: ../../library/ssl.rst:1728 msgid "" "The *sni_callback* function must return ``None`` to allow the TLS " -"negotiation to continue. If a TLS failure is required, a " -"constant :const:`ALERT_DESCRIPTION_* ` can " -"be returned. Other return values will result in a TLS fatal error " -"with :const:`ALERT_DESCRIPTION_INTERNAL_ERROR`." +"negotiation to continue. If a TLS failure is required, a constant :const:" +"`ALERT_DESCRIPTION_* ` can be returned. " +"Other return values will result in a TLS fatal error with :const:" +"`ALERT_DESCRIPTION_INTERNAL_ERROR`." msgstr "" #: ../../library/ssl.rst:1734 msgid "" "If an exception is raised from the *sni_callback* function the TLS " -"connection will terminate with a fatal TLS alert " -"message :const:`ALERT_DESCRIPTION_HANDSHAKE_FAILURE`." +"connection will terminate with a fatal TLS alert message :const:" +"`ALERT_DESCRIPTION_HANDSHAKE_FAILURE`." msgstr "" #: ../../library/ssl.rst:1738 @@ -2500,8 +2485,8 @@ msgstr "" #: ../../library/ssl.rst:1765 msgid "" -"This setting doesn't apply to client sockets. You can also use " -"the :data:`OP_SINGLE_DH_USE` option to further improve security." +"This setting doesn't apply to client sockets. You can also use the :data:" +"`OP_SINGLE_DH_USE` option to further improve security." msgstr "" #: ../../library/ssl.rst:1772 @@ -2515,13 +2500,13 @@ msgstr "" #: ../../library/ssl.rst:1778 msgid "" -"This setting doesn't apply to client sockets. You can also use " -"the :data:`OP_SINGLE_ECDH_USE` option to further improve security." +"This setting doesn't apply to client sockets. You can also use the :data:" +"`OP_SINGLE_ECDH_USE` option to further improve security." msgstr "" #: ../../library/ssl.rst:1781 msgid "This method is not available if :data:`HAS_ECDH` is ``False``." -msgstr "" +msgstr "此方法在 :data:`HAS_ECDH` 為 ``False`` 時不可用。" #: ../../library/ssl.rst:1786 msgid "" @@ -2535,11 +2520,10 @@ msgstr "" #: ../../library/ssl.rst:1793 msgid "" -"Wrap an existing Python socket *sock* and return an instance " -"of :attr:`SSLContext.sslsocket_class` (default :class:`SSLSocket`). The " -"returned SSL socket is tied to the context, its settings and certificates. " -"*sock* must be a :const:`~socket.SOCK_STREAM` socket; other socket types are " -"unsupported." +"Wrap an existing Python socket *sock* and return an instance of :attr:" +"`SSLContext.sslsocket_class` (default :class:`SSLSocket`). The returned SSL " +"socket is tied to the context, its settings and certificates. *sock* must be " +"a :const:`~socket.SOCK_STREAM` socket; other socket types are unsupported." msgstr "" #: ../../library/ssl.rst:1799 @@ -2555,8 +2539,8 @@ msgid "" "after :meth:`connect` is called on the socket. For server-side sockets, if " "the socket has no remote peer, it is assumed to be a listening socket, and " "the server-side SSL wrapping is automatically performed on client " -"connections accepted via the :meth:`accept` method. The method may " -"raise :exc:`SSLError`." +"connections accepted via the :meth:`accept` method. The method may raise :" +"exc:`SSLError`." msgstr "" #: ../../library/ssl.rst:1810 @@ -2572,20 +2556,20 @@ msgstr "" msgid "" "The parameter ``do_handshake_on_connect`` specifies whether to do the SSL " "handshake automatically after doing a :meth:`socket.connect`, or whether the " -"application program will call it explicitly, by invoking " -"the :meth:`SSLSocket.do_handshake` method. " -"Calling :meth:`SSLSocket.do_handshake` explicitly gives the program control " -"over the blocking behavior of the socket I/O involved in the handshake." +"application program will call it explicitly, by invoking the :meth:" +"`SSLSocket.do_handshake` method. Calling :meth:`SSLSocket.do_handshake` " +"explicitly gives the program control over the blocking behavior of the " +"socket I/O involved in the handshake." msgstr "" #: ../../library/ssl.rst:1823 msgid "" -"The parameter ``suppress_ragged_eofs`` specifies how " -"the :meth:`SSLSocket.recv` method should signal unexpected EOF from the " -"other end of the connection. If specified as :const:`True` (the default), " -"it returns a normal EOF (an empty bytes object) in response to unexpected " -"EOF errors raised from the underlying socket; if :const:`False`, it will " -"raise the exceptions back to the caller." +"The parameter ``suppress_ragged_eofs`` specifies how the :meth:`SSLSocket." +"recv` method should signal unexpected EOF from the other end of the " +"connection. If specified as :const:`True` (the default), it returns a " +"normal EOF (an empty bytes object) in response to unexpected EOF errors " +"raised from the underlying socket; if :const:`False`, it will raise the " +"exceptions back to the caller." msgstr "" #: ../../library/ssl.rst:1830 @@ -2594,8 +2578,8 @@ msgstr "" #: ../../library/ssl.rst:1832 msgid "" -"To wrap an :class:`SSLSocket` in another :class:`SSLSocket`, " -"use :meth:`SSLContext.wrap_bio`." +"To wrap an :class:`SSLSocket` in another :class:`SSLSocket`, use :meth:" +"`SSLContext.wrap_bio`." msgstr "" #: ../../library/ssl.rst:1835 @@ -2604,7 +2588,7 @@ msgid "" "SNI." msgstr "" -#: ../../library/ssl.rst:1839 ../../library/ssl.rst:1865 +#: ../../library/ssl.rst:1839 ../../library/ssl.rst:1866 msgid "*session* argument was added." msgstr "新增 *session* 引數。" @@ -2616,39 +2600,39 @@ msgstr "" #: ../../library/ssl.rst:1848 msgid "" -"The return type of :meth:`SSLContext.wrap_socket`, defaults " -"to :class:`SSLSocket`. The attribute can be overridden on instance of class " -"in order to return a custom subclass of :class:`SSLSocket`." +"The return type of :meth:`SSLContext.wrap_socket`, defaults to :class:" +"`SSLSocket`. The attribute can be assigned to on instances of :class:" +"`SSLContext` in order to return a custom subclass of :class:`SSLSocket`." msgstr "" -#: ../../library/ssl.rst:1857 +#: ../../library/ssl.rst:1858 msgid "" -"Wrap the BIO objects *incoming* and *outgoing* and return an instance " -"of :attr:`SSLContext.sslobject_class` (default :class:`SSLObject`). The SSL " +"Wrap the BIO objects *incoming* and *outgoing* and return an instance of :" +"attr:`SSLContext.sslobject_class` (default :class:`SSLObject`). The SSL " "routines will read input data from the incoming BIO and write data to the " "outgoing BIO." msgstr "" -#: ../../library/ssl.rst:1862 +#: ../../library/ssl.rst:1863 msgid "" "The *server_side*, *server_hostname* and *session* parameters have the same " "meaning as in :meth:`SSLContext.wrap_socket`." msgstr "" -#: ../../library/ssl.rst:1868 +#: ../../library/ssl.rst:1869 msgid "" "The method returns an instance of :attr:`SSLContext.sslobject_class` instead " "of hard-coded :class:`SSLObject`." msgstr "" -#: ../../library/ssl.rst:1874 +#: ../../library/ssl.rst:1875 msgid "" -"The return type of :meth:`SSLContext.wrap_bio`, defaults " -"to :class:`SSLObject`. The attribute can be overridden on instance of class " -"in order to return a custom subclass of :class:`SSLObject`." +"The return type of :meth:`SSLContext.wrap_bio`, defaults to :class:" +"`SSLObject`. The attribute can be overridden on instance of class in order " +"to return a custom subclass of :class:`SSLObject`." msgstr "" -#: ../../library/ssl.rst:1882 +#: ../../library/ssl.rst:1883 msgid "" "Get statistics about the SSL sessions created or managed by this context. A " "dictionary is returned which maps the names of each `piece of information " @@ -2657,7 +2641,7 @@ msgid "" "the session cache since the context was created::" msgstr "" -#: ../../library/ssl.rst:1887 +#: ../../library/ssl.rst:1888 msgid "" ">>> stats = context.session_stats()\n" ">>> stats['hits'], stats['misses']\n" @@ -2667,21 +2651,20 @@ msgstr "" ">>> stats['hits'], stats['misses']\n" "(0, 0)" -#: ../../library/ssl.rst:1893 +#: ../../library/ssl.rst:1894 msgid "" "Whether to match the peer cert's hostname in :meth:`SSLSocket.do_handshake`. " -"The context's :attr:`~SSLContext.verify_mode` must be set " -"to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, and you must pass " +"The context's :attr:`~SSLContext.verify_mode` must be set to :data:" +"`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, and you must pass " "*server_hostname* to :meth:`~SSLContext.wrap_socket` in order to match the " -"hostname. Enabling hostname checking automatically " -"sets :attr:`~SSLContext.verify_mode` from :data:`CERT_NONE` " -"to :data:`CERT_REQUIRED`. It cannot be set back to :data:`CERT_NONE` as " -"long as hostname checking is enabled. The :data:`PROTOCOL_TLS_CLIENT` " -"protocol enables hostname checking by default. With other protocols, " -"hostname checking must be enabled explicitly." +"hostname. Enabling hostname checking automatically sets :attr:`~SSLContext." +"verify_mode` from :data:`CERT_NONE` to :data:`CERT_REQUIRED`. It cannot be " +"set back to :data:`CERT_NONE` as long as hostname checking is enabled. The :" +"data:`PROTOCOL_TLS_CLIENT` protocol enables hostname checking by default. " +"With other protocols, hostname checking must be enabled explicitly." msgstr "" -#: ../../library/ssl.rst:1906 +#: ../../library/ssl.rst:1907 msgid "" "import socket, ssl\n" "\n" @@ -2705,15 +2688,15 @@ msgstr "" "ssl_sock = context.wrap_socket(s, server_hostname='www.verisign.com')\n" "ssl_sock.connect(('www.verisign.com', 443))" -#: ../../library/ssl.rst:1921 +#: ../../library/ssl.rst:1922 msgid "" -":attr:`~SSLContext.verify_mode` is now automatically changed " -"to :data:`CERT_REQUIRED` when hostname checking is enabled " -"and :attr:`~SSLContext.verify_mode` is :data:`CERT_NONE`. Previously the " -"same operation would have failed with a :exc:`ValueError`." +":attr:`~SSLContext.verify_mode` is now automatically changed to :data:" +"`CERT_REQUIRED` when hostname checking is enabled and :attr:`~SSLContext." +"verify_mode` is :data:`CERT_NONE`. Previously the same operation would have " +"failed with a :exc:`ValueError`." msgstr "" -#: ../../library/ssl.rst:1928 +#: ../../library/ssl.rst:1929 msgid "" "Write TLS keys to a keylog file, whenever key material is generated or " "received. The keylog file is designed for debugging purposes only. The file " @@ -2722,58 +2705,56 @@ msgid "" "synchronized between threads, but not between processes." msgstr "" -#: ../../library/ssl.rst:1938 +#: ../../library/ssl.rst:1939 msgid "" "A :class:`TLSVersion` enum member representing the highest supported TLS " "version. The value defaults to :attr:`TLSVersion.MAXIMUM_SUPPORTED`. The " -"attribute is read-only for protocols other " -"than :const:`PROTOCOL_TLS`, :const:`PROTOCOL_TLS_CLIENT`, " -"and :const:`PROTOCOL_TLS_SERVER`." +"attribute is read-only for protocols other than :const:`PROTOCOL_TLS`, :" +"const:`PROTOCOL_TLS_CLIENT`, and :const:`PROTOCOL_TLS_SERVER`." msgstr "" -#: ../../library/ssl.rst:1943 +#: ../../library/ssl.rst:1944 msgid "" -"The " -"attributes :attr:`~SSLContext.maximum_version`, :attr:`~SSLContext.minimum_version` " -"and :attr:`SSLContext.options` all affect the supported SSL and TLS versions " -"of the context. The implementation does not prevent invalid combination. For " -"example a context with :attr:`OP_NO_TLSv1_2` in :attr:`~SSLContext.options` " -"and :attr:`~SSLContext.maximum_version` set to :attr:`TLSVersion.TLSv1_2` " -"will not be able to establish a TLS 1.2 connection." +"The attributes :attr:`~SSLContext.maximum_version`, :attr:`~SSLContext." +"minimum_version` and :attr:`SSLContext.options` all affect the supported SSL " +"and TLS versions of the context. The implementation does not prevent invalid " +"combination. For example a context with :attr:`OP_NO_TLSv1_2` in :attr:" +"`~SSLContext.options` and :attr:`~SSLContext.maximum_version` set to :attr:" +"`TLSVersion.TLSv1_2` will not be able to establish a TLS 1.2 connection." msgstr "" -#: ../../library/ssl.rst:1956 +#: ../../library/ssl.rst:1957 msgid "" "Like :attr:`SSLContext.maximum_version` except it is the lowest supported " "version or :attr:`TLSVersion.MINIMUM_SUPPORTED`." msgstr "" -#: ../../library/ssl.rst:1963 +#: ../../library/ssl.rst:1964 msgid "" -"Control the number of TLS 1.3 session tickets of " -"a :const:`PROTOCOL_TLS_SERVER` context. The setting has no impact on TLS 1.0 " -"to 1.2 connections." +"Control the number of TLS 1.3 session tickets of a :const:" +"`PROTOCOL_TLS_SERVER` context. The setting has no impact on TLS 1.0 to 1.2 " +"connections." msgstr "" -#: ../../library/ssl.rst:1971 +#: ../../library/ssl.rst:1972 msgid "" "An integer representing the set of SSL options enabled on this context. The " -"default value is :data:`OP_ALL`, but you can specify other options such " -"as :data:`OP_NO_SSLv2` by ORing them together." +"default value is :data:`OP_ALL`, but you can specify other options such as :" +"data:`OP_NO_SSLv2` by ORing them together." msgstr "" -#: ../../library/ssl.rst:1975 +#: ../../library/ssl.rst:1976 msgid ":attr:`SSLContext.options` returns :class:`Options` flags:" msgstr ":attr:`SSLContext.options` 會回傳 :class:`Options` 旗標:" -#: ../../library/ssl.rst:1983 +#: ../../library/ssl.rst:1984 msgid "" "All ``OP_NO_SSL*`` and ``OP_NO_TLS*`` options have been deprecated since " -"Python 3.7. Use :attr:`SSLContext.minimum_version` " -"and :attr:`SSLContext.maximum_version` instead." +"Python 3.7. Use :attr:`SSLContext.minimum_version` and :attr:`SSLContext." +"maximum_version` instead." msgstr "" -#: ../../library/ssl.rst:1989 +#: ../../library/ssl.rst:1990 msgid "" "Enable TLS 1.3 post-handshake client authentication. Post-handshake auth is " "disabled by default and a server can only request a TLS client certificate " @@ -2781,81 +2762,80 @@ msgid "" "client certificate at any time after the handshake." msgstr "" -#: ../../library/ssl.rst:1994 +#: ../../library/ssl.rst:1995 msgid "" "When enabled on client-side sockets, the client signals the server that it " "supports post-handshake authentication." msgstr "" -#: ../../library/ssl.rst:1997 +#: ../../library/ssl.rst:1998 msgid "" "When enabled on server-side sockets, :attr:`SSLContext.verify_mode` must be " "set to :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`, too. The actual " -"client cert exchange is delayed " -"until :meth:`SSLSocket.verify_client_post_handshake` is called and some I/O " -"is performed." +"client cert exchange is delayed until :meth:`SSLSocket." +"verify_client_post_handshake` is called and some I/O is performed." msgstr "" -#: ../../library/ssl.rst:2007 +#: ../../library/ssl.rst:2008 msgid "" "The protocol version chosen when constructing the context. This attribute " "is read-only." msgstr "" -#: ../../library/ssl.rst:2012 +#: ../../library/ssl.rst:2013 msgid "" "Whether :attr:`~SSLContext.check_hostname` falls back to verify the cert's " "subject common name in the absence of a subject alternative name extension " "(default: true)." msgstr "" -#: ../../library/ssl.rst:2020 +#: ../../library/ssl.rst:2021 msgid "" "The flag had no effect with OpenSSL before version 1.1.1l. Python 3.8.9, " "3.9.3, and 3.10 include workarounds for previous versions." msgstr "" -#: ../../library/ssl.rst:2025 +#: ../../library/ssl.rst:2026 msgid "" "An integer representing the `security level `_ for the context. This attribute is read-" "only." msgstr "" -#: ../../library/ssl.rst:2033 +#: ../../library/ssl.rst:2034 msgid "" -"The flags for certificate verification operations. You can set flags " -"like :data:`VERIFY_CRL_CHECK_LEAF` by ORing them together. By default " -"OpenSSL does neither require nor verify certificate revocation lists (CRLs)." +"The flags for certificate verification operations. You can set flags like :" +"data:`VERIFY_CRL_CHECK_LEAF` by ORing them together. By default OpenSSL does " +"neither require nor verify certificate revocation lists (CRLs)." msgstr "" -#: ../../library/ssl.rst:2039 +#: ../../library/ssl.rst:2040 msgid ":attr:`SSLContext.verify_flags` returns :class:`VerifyFlags` flags:" -msgstr "" +msgstr ":attr:`SSLContext.verify_flags` 會回傳 :class:`VerifyFlags` 旗標:" -#: ../../library/ssl.rst:2047 +#: ../../library/ssl.rst:2048 msgid "" "Whether to try to verify other peers' certificates and how to behave if " -"verification fails. This attribute must be one " -"of :data:`CERT_NONE`, :data:`CERT_OPTIONAL` or :data:`CERT_REQUIRED`." +"verification fails. This attribute must be one of :data:`CERT_NONE`, :data:" +"`CERT_OPTIONAL` or :data:`CERT_REQUIRED`." msgstr "" -#: ../../library/ssl.rst:2051 +#: ../../library/ssl.rst:2052 msgid ":attr:`SSLContext.verify_mode` returns :class:`VerifyMode` enum:" msgstr ":attr:`SSLContext.verify_mode` 會回傳 :class:`VerifyMode` 列舉:" -#: ../../library/ssl.rst:2059 +#: ../../library/ssl.rst:2060 msgid "" "Enables TLS-PSK (pre-shared key) authentication on a client-side connection." msgstr "" -#: ../../library/ssl.rst:2061 ../../library/ssl.rst:2110 +#: ../../library/ssl.rst:2062 ../../library/ssl.rst:2111 msgid "" "In general, certificate based authentication should be preferred over this " "method." msgstr "" -#: ../../library/ssl.rst:2063 +#: ../../library/ssl.rst:2064 msgid "" "The parameter ``callback`` is a callable object with the signature: ``def " "callback(hint: str | None) -> tuple[str | None, bytes]``. The ``hint`` " @@ -2867,27 +2847,27 @@ msgid "" "shared key. Return a zero length PSK to reject the connection." msgstr "" -#: ../../library/ssl.rst:2073 ../../library/ssl.rst:2119 +#: ../../library/ssl.rst:2074 ../../library/ssl.rst:2120 msgid "Setting ``callback`` to :const:`None` removes any existing callback." msgstr "" -#: ../../library/ssl.rst:2076 +#: ../../library/ssl.rst:2077 msgid "When using TLS 1.3:" -msgstr "" +msgstr "使用 TLS 1.3 時:" -#: ../../library/ssl.rst:2078 +#: ../../library/ssl.rst:2079 msgid "the ``hint`` parameter is always :const:`None`." -msgstr "" +msgstr "``hint`` 參數始終為 :const:`None`。" -#: ../../library/ssl.rst:2079 +#: ../../library/ssl.rst:2080 msgid "client-identity must be a non-empty string." msgstr "" -#: ../../library/ssl.rst:2081 ../../library/ssl.rst:2128 +#: ../../library/ssl.rst:2082 ../../library/ssl.rst:2129 msgid "Example usage::" msgstr "範例用法: ::" -#: ../../library/ssl.rst:2083 +#: ../../library/ssl.rst:2084 msgid "" "context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" "context.check_hostname = False\n" @@ -2908,18 +2888,18 @@ msgid "" "context.set_psk_client_callback(callback)" msgstr "" -#: ../../library/ssl.rst:2101 ../../library/ssl.rst:2146 +#: ../../library/ssl.rst:2102 ../../library/ssl.rst:2147 msgid "" "This method will raise :exc:`NotImplementedError` if :data:`HAS_PSK` is " "``False``." msgstr "" -#: ../../library/ssl.rst:2108 +#: ../../library/ssl.rst:2109 msgid "" "Enables TLS-PSK (pre-shared key) authentication on a server-side connection." msgstr "" -#: ../../library/ssl.rst:2112 +#: ../../library/ssl.rst:2113 msgid "" "The parameter ``callback`` is a callable object with the signature: ``def " "callback(identity: str | None) -> bytes``. The ``identity`` parameter is an " @@ -2929,19 +2909,19 @@ msgid "" "connection." msgstr "" -#: ../../library/ssl.rst:2121 +#: ../../library/ssl.rst:2122 msgid "" "The parameter ``identity_hint`` is an optional identity hint string sent to " "the client. The string must be less than or equal to ``256`` octets when " "UTF-8 encoded." msgstr "" -#: ../../library/ssl.rst:2126 +#: ../../library/ssl.rst:2127 msgid "" "When using TLS 1.3 the ``identity_hint`` parameter is not sent to the client." msgstr "" -#: ../../library/ssl.rst:2130 +#: ../../library/ssl.rst:2131 msgid "" "context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)\n" "context.maximum_version = ssl.TLSVersion.TLSv1_2\n" @@ -2960,11 +2940,11 @@ msgid "" "context.set_psk_server_callback(callback, 'ServerId_1')" msgstr "" -#: ../../library/ssl.rst:2158 +#: ../../library/ssl.rst:2159 msgid "Certificates" msgstr "" -#: ../../library/ssl.rst:2160 +#: ../../library/ssl.rst:2161 msgid "" "Certificates in general are part of a public-key / private-key system. In " "this system, each *principal*, (which may be a machine, or a person, or an " @@ -2975,7 +2955,7 @@ msgid "" "other part, and **only** with the other part." msgstr "" -#: ../../library/ssl.rst:2168 +#: ../../library/ssl.rst:2169 msgid "" "A certificate contains information about two principals. It contains the " "name of a *subject*, and the subject's public key. It also contains a " @@ -2989,7 +2969,7 @@ msgid "" "as two fields, called \"notBefore\" and \"notAfter\"." msgstr "" -#: ../../library/ssl.rst:2178 +#: ../../library/ssl.rst:2179 msgid "" "In the Python use of certificates, a client or server can use a certificate " "to prove who they are. The other side of a network connection can also be " @@ -3002,14 +2982,14 @@ msgid "" "take place." msgstr "" -#: ../../library/ssl.rst:2188 +#: ../../library/ssl.rst:2189 msgid "" "Python uses files to contain certificates. They should be formatted as " "\"PEM\" (see :rfc:`1422`), which is a base-64 encoded form wrapped with a " "header line and a footer line::" msgstr "" -#: ../../library/ssl.rst:2192 +#: ../../library/ssl.rst:2193 msgid "" "-----BEGIN CERTIFICATE-----\n" "... (certificate in base64 PEM encoding) ...\n" @@ -3019,11 +2999,11 @@ msgstr "" "... (certificate in base64 PEM encoding) ...\n" "-----END CERTIFICATE-----" -#: ../../library/ssl.rst:2197 +#: ../../library/ssl.rst:2198 msgid "Certificate chains" msgstr "" -#: ../../library/ssl.rst:2199 +#: ../../library/ssl.rst:2200 msgid "" "The Python files which contain certificates can contain a sequence of " "certificates, sometimes called a *certificate chain*. This chain should " @@ -3039,7 +3019,7 @@ msgid "" "agency which issued the certification authority's certificate::" msgstr "" -#: ../../library/ssl.rst:2212 +#: ../../library/ssl.rst:2213 msgid "" "-----BEGIN CERTIFICATE-----\n" "... (certificate for your server)...\n" @@ -3061,27 +3041,27 @@ msgstr "" "... (the root certificate for the CA's issuer)...\n" "-----END CERTIFICATE-----" -#: ../../library/ssl.rst:2223 +#: ../../library/ssl.rst:2224 msgid "CA certificates" msgstr "" -#: ../../library/ssl.rst:2225 +#: ../../library/ssl.rst:2226 msgid "" "If you are going to require validation of the other side of the connection's " "certificate, you need to provide a \"CA certs\" file, filled with the " "certificate chains for each issuer you are willing to trust. Again, this " "file just contains these chains concatenated together. For validation, " "Python will use the first chain it finds in the file which matches. The " -"platform's certificates file can be used by " -"calling :meth:`SSLContext.load_default_certs`, this is done automatically " -"with :func:`.create_default_context`." +"platform's certificates file can be used by calling :meth:`SSLContext." +"load_default_certs`, this is done automatically with :func:`." +"create_default_context`." msgstr "" -#: ../../library/ssl.rst:2234 +#: ../../library/ssl.rst:2235 msgid "Combined key and certificate" msgstr "" -#: ../../library/ssl.rst:2236 +#: ../../library/ssl.rst:2237 msgid "" "Often the private key is stored in the same file as the certificate; in this " "case, only the ``certfile`` parameter to :meth:`SSLContext.load_cert_chain` " @@ -3089,7 +3069,7 @@ msgid "" "should come before the first certificate in the certificate chain::" msgstr "" -#: ../../library/ssl.rst:2242 +#: ../../library/ssl.rst:2243 msgid "" "-----BEGIN RSA PRIVATE KEY-----\n" "... (private key in base64 encoding) ...\n" @@ -3105,11 +3085,11 @@ msgstr "" "... (certificate in base64 PEM encoding) ...\n" "-----END CERTIFICATE-----" -#: ../../library/ssl.rst:2250 +#: ../../library/ssl.rst:2251 msgid "Self-signed certificates" msgstr "" -#: ../../library/ssl.rst:2252 +#: ../../library/ssl.rst:2253 msgid "" "If you are going to create a server that provides SSL-encrypted connection " "services, you will need to acquire a certificate for that service. There " @@ -3119,7 +3099,7 @@ msgid "" "package, using something like the following::" msgstr "" -#: ../../library/ssl.rst:2259 +#: ../../library/ssl.rst:2260 msgid "" "% openssl req -new -x509 -days 365 -nodes -out cert.pem -keyout cert.pem\n" "Generating a 1024 bit RSA private key\n" @@ -3145,28 +3125,28 @@ msgid "" "%" msgstr "" -#: ../../library/ssl.rst:2281 +#: ../../library/ssl.rst:2282 msgid "" "The disadvantage of a self-signed certificate is that it is its own root " "certificate, and no one else will have it in their cache of known (and " "trusted) root certificates." msgstr "" -#: ../../library/ssl.rst:2287 +#: ../../library/ssl.rst:2288 msgid "Examples" msgstr "範例" -#: ../../library/ssl.rst:2290 +#: ../../library/ssl.rst:2291 msgid "Testing for SSL support" msgstr "" -#: ../../library/ssl.rst:2292 +#: ../../library/ssl.rst:2293 msgid "" "To test for the presence of SSL support in a Python installation, user code " "should use the following idiom::" msgstr "" -#: ../../library/ssl.rst:2295 +#: ../../library/ssl.rst:2296 msgid "" "try:\n" " import ssl\n" @@ -3176,27 +3156,27 @@ msgid "" " ... # do something that requires SSL support" msgstr "" -#: ../../library/ssl.rst:2303 +#: ../../library/ssl.rst:2304 msgid "Client-side operation" msgstr "" -#: ../../library/ssl.rst:2305 +#: ../../library/ssl.rst:2306 msgid "" "This example creates a SSL context with the recommended security settings " "for client sockets, including automatic certificate verification::" msgstr "" -#: ../../library/ssl.rst:2308 +#: ../../library/ssl.rst:2309 msgid ">>> context = ssl.create_default_context()" msgstr ">>> context = ssl.create_default_context()" -#: ../../library/ssl.rst:2310 +#: ../../library/ssl.rst:2311 msgid "" "If you prefer to tune security settings yourself, you might create a context " "from scratch (but beware that you might not get the settings right)::" msgstr "" -#: ../../library/ssl.rst:2314 +#: ../../library/ssl.rst:2315 msgid "" ">>> context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" ">>> context.load_verify_locations(\"/etc/ssl/certs/ca-bundle.crt\")" @@ -3204,14 +3184,14 @@ msgstr "" ">>> context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" ">>> context.load_verify_locations(\"/etc/ssl/certs/ca-bundle.crt\")" -#: ../../library/ssl.rst:2317 +#: ../../library/ssl.rst:2318 msgid "" "(this snippet assumes your operating system places a bundle of all CA " "certificates in ``/etc/ssl/certs/ca-bundle.crt``; if not, you'll get an " "error and have to adjust the location)" msgstr "" -#: ../../library/ssl.rst:2321 +#: ../../library/ssl.rst:2322 msgid "" "The :data:`PROTOCOL_TLS_CLIENT` protocol configures the context for cert " "validation and hostname verification. :attr:`~SSLContext.verify_mode` is set " @@ -3219,16 +3199,16 @@ msgid "" "``True``. All other protocols create SSL contexts with insecure defaults." msgstr "" -#: ../../library/ssl.rst:2326 +#: ../../library/ssl.rst:2327 msgid "" -"When you use the context to connect to a server, :const:`CERT_REQUIRED` " -"and :attr:`~SSLContext.check_hostname` validate the server certificate: it " +"When you use the context to connect to a server, :const:`CERT_REQUIRED` and :" +"attr:`~SSLContext.check_hostname` validate the server certificate: it " "ensures that the server certificate was signed with one of the CA " "certificates, checks the signature for correctness, and verifies other " "properties like validity and identity of the hostname::" msgstr "" -#: ../../library/ssl.rst:2332 +#: ../../library/ssl.rst:2333 msgid "" ">>> conn = context.wrap_socket(socket.socket(socket.AF_INET),\n" "... server_hostname=\"www.python.org\")\n" @@ -3238,30 +3218,30 @@ msgstr "" "... server_hostname=\"www.python.org\")\n" ">>> conn.connect((\"www.python.org\", 443))" -#: ../../library/ssl.rst:2336 +#: ../../library/ssl.rst:2337 msgid "You may then fetch the certificate::" msgstr "" -#: ../../library/ssl.rst:2338 +#: ../../library/ssl.rst:2339 msgid ">>> cert = conn.getpeercert()" msgstr ">>> cert = conn.getpeercert()" -#: ../../library/ssl.rst:2340 +#: ../../library/ssl.rst:2341 msgid "" "Visual inspection shows that the certificate does identify the desired " "service (that is, the HTTPS host ``www.python.org``)::" msgstr "" -#: ../../library/ssl.rst:2343 +#: ../../library/ssl.rst:2344 msgid "" ">>> pprint.pprint(cert)\n" "{'OCSP': ('http://ocsp.digicert.com',),\n" " 'caIssuers': ('http://cacerts.digicert.com/" "DigiCertSHA2ExtendedValidationServerCA.crt',),\n" -" 'crlDistributionPoints': ('http://crl3.digicert.com/sha2-ev-server-" -"g1.crl',\n" -" 'http://crl4.digicert.com/sha2-ev-server-" -"g1.crl'),\n" +" 'crlDistributionPoints': ('http://crl3.digicert.com/sha2-ev-server-g1." +"crl',\n" +" 'http://crl4.digicert.com/sha2-ev-server-g1." +"crl'),\n" " 'issuer': ((('countryName', 'US'),),\n" " (('organizationName', 'DigiCert Inc'),),\n" " (('organizationalUnitName', 'www.digicert.com'),),\n" @@ -3302,10 +3282,10 @@ msgstr "" "{'OCSP': ('http://ocsp.digicert.com',),\n" " 'caIssuers': ('http://cacerts.digicert.com/" "DigiCertSHA2ExtendedValidationServerCA.crt',),\n" -" 'crlDistributionPoints': ('http://crl3.digicert.com/sha2-ev-server-" -"g1.crl',\n" -" 'http://crl4.digicert.com/sha2-ev-server-" -"g1.crl'),\n" +" 'crlDistributionPoints': ('http://crl3.digicert.com/sha2-ev-server-g1." +"crl',\n" +" 'http://crl4.digicert.com/sha2-ev-server-g1." +"crl'),\n" " 'issuer': ((('countryName', 'US'),),\n" " (('organizationName', 'DigiCert Inc'),),\n" " (('organizationalUnitName', 'www.digicert.com'),),\n" @@ -3342,13 +3322,13 @@ msgstr "" " ('DNS', 'id.python.org')),\n" " 'version': 3}" -#: ../../library/ssl.rst:2383 +#: ../../library/ssl.rst:2384 msgid "" "Now the SSL channel is established and the certificate verified, you can " "proceed to talk with the server::" msgstr "" -#: ../../library/ssl.rst:2386 +#: ../../library/ssl.rst:2387 msgid "" ">>> conn.sendall(b\"HEAD / HTTP/1.0\\r\\nHost: linuxfr.org\\r\\n\\r\\n\")\n" ">>> pprint.pprint(conn.recv(1024).split(b\"\\r\\n\"))\n" @@ -3390,11 +3370,11 @@ msgstr "" " b'',\n" " b'']" -#: ../../library/ssl.rst:2410 +#: ../../library/ssl.rst:2411 msgid "Server-side operation" -msgstr "" +msgstr "伺服器端操作" -#: ../../library/ssl.rst:2412 +#: ../../library/ssl.rst:2413 msgid "" "For server operation, typically you'll need to have a server certificate, " "and private key, each in a file. You'll first create a context holding the " @@ -3403,7 +3383,7 @@ msgid "" "start waiting for clients to connect::" msgstr "" -#: ../../library/ssl.rst:2418 +#: ../../library/ssl.rst:2419 msgid "" "import socket, ssl\n" "\n" @@ -3423,15 +3403,14 @@ msgstr "" "bindsocket.bind(('myaddr.example.com', 10023))\n" "bindsocket.listen(5)" -#: ../../library/ssl.rst:2427 +#: ../../library/ssl.rst:2428 msgid "" "When a client connects, you'll call :meth:`accept` on the socket to get the " -"new socket from the other end, and use the " -"context's :meth:`SSLContext.wrap_socket` method to create a server-side SSL " -"socket for the connection::" +"new socket from the other end, and use the context's :meth:`SSLContext." +"wrap_socket` method to create a server-side SSL socket for the connection::" msgstr "" -#: ../../library/ssl.rst:2431 +#: ../../library/ssl.rst:2432 msgid "" "while True:\n" " newsocket, fromaddr = bindsocket.accept()\n" @@ -3451,13 +3430,13 @@ msgstr "" " connstream.shutdown(socket.SHUT_RDWR)\n" " connstream.close()" -#: ../../library/ssl.rst:2440 +#: ../../library/ssl.rst:2441 msgid "" "Then you'll read data from the ``connstream`` and do something with it till " "you are finished with the client (or the client is finished with you)::" msgstr "" -#: ../../library/ssl.rst:2443 +#: ../../library/ssl.rst:2444 msgid "" "def deal_with_client(connstream):\n" " data = connstream.recv(1024)\n" @@ -3471,7 +3450,7 @@ msgid "" " # finished with client" msgstr "" -#: ../../library/ssl.rst:2454 +#: ../../library/ssl.rst:2455 msgid "" "And go back to listening for new client connections (of course, a real " "server would probably handle each client connection in a separate thread, or " @@ -3479,46 +3458,46 @@ msgid "" "event loop)." msgstr "" -#: ../../library/ssl.rst:2462 +#: ../../library/ssl.rst:2463 msgid "Notes on non-blocking sockets" msgstr "" -#: ../../library/ssl.rst:2464 +#: ../../library/ssl.rst:2465 msgid "" "SSL sockets behave slightly different than regular sockets in non-blocking " "mode. When working with non-blocking sockets, there are thus several things " "you need to be aware of:" msgstr "" -#: ../../library/ssl.rst:2468 +#: ../../library/ssl.rst:2469 msgid "" "Most :class:`SSLSocket` methods will raise either :exc:`SSLWantWriteError` " "or :exc:`SSLWantReadError` instead of :exc:`BlockingIOError` if an I/O " "operation would block. :exc:`SSLWantReadError` will be raised if a read " -"operation on the underlying socket is necessary, " -"and :exc:`SSLWantWriteError` for a write operation on the underlying socket. " -"Note that attempts to *write* to an SSL socket may require *reading* from " -"the underlying socket first, and attempts to *read* from the SSL socket may " +"operation on the underlying socket is necessary, and :exc:" +"`SSLWantWriteError` for a write operation on the underlying socket. Note " +"that attempts to *write* to an SSL socket may require *reading* from the " +"underlying socket first, and attempts to *read* from the SSL socket may " "require a prior *write* to the underlying socket." msgstr "" -#: ../../library/ssl.rst:2480 +#: ../../library/ssl.rst:2481 msgid "" "In earlier Python versions, the :meth:`!SSLSocket.send` method returned zero " "instead of raising :exc:`SSLWantWriteError` or :exc:`SSLWantReadError`." msgstr "" -#: ../../library/ssl.rst:2484 +#: ../../library/ssl.rst:2485 msgid "" "Calling :func:`~select.select` tells you that the OS-level socket can be " "read from (or written to), but it does not imply that there is sufficient " "data at the upper SSL layer. For example, only part of an SSL frame might " "have arrived. Therefore, you must be ready to handle :meth:`SSLSocket.recv` " -"and :meth:`SSLSocket.send` failures, and retry after another call " -"to :func:`~select.select`." +"and :meth:`SSLSocket.send` failures, and retry after another call to :func:" +"`~select.select`." msgstr "" -#: ../../library/ssl.rst:2491 +#: ../../library/ssl.rst:2492 msgid "" "Conversely, since the SSL layer has its own framing, a SSL socket may still " "have data available for reading without :func:`~select.select` being aware " @@ -3527,21 +3506,21 @@ msgid "" "call if still necessary." msgstr "" -#: ../../library/ssl.rst:2497 +#: ../../library/ssl.rst:2498 msgid "" -"(of course, similar provisions apply when using other primitives such " -"as :func:`~select.poll`, or those in the :mod:`selectors` module)" +"(of course, similar provisions apply when using other primitives such as :" +"func:`~select.poll`, or those in the :mod:`selectors` module)" msgstr "" -#: ../../library/ssl.rst:2500 +#: ../../library/ssl.rst:2501 msgid "" -"The SSL handshake itself will be non-blocking: " -"the :meth:`SSLSocket.do_handshake` method has to be retried until it returns " -"successfully. Here is a synopsis using :func:`~select.select` to wait for " -"the socket's readiness::" +"The SSL handshake itself will be non-blocking: the :meth:`SSLSocket." +"do_handshake` method has to be retried until it returns successfully. Here " +"is a synopsis using :func:`~select.select` to wait for the socket's " +"readiness::" msgstr "" -#: ../../library/ssl.rst:2505 +#: ../../library/ssl.rst:2506 msgid "" "while True:\n" " try:\n" @@ -3561,36 +3540,36 @@ msgstr "" " except ssl.SSLWantWriteError:\n" " select.select([], [sock], [])" -#: ../../library/ssl.rst:2516 +#: ../../library/ssl.rst:2517 msgid "" "The :mod:`asyncio` module supports :ref:`non-blocking SSL sockets ` and provides a higher level :ref:`Streams API `. It polls for events using the :mod:`selectors` module and " -"handles :exc:`SSLWantWriteError`, :exc:`SSLWantReadError` " -"and :exc:`BlockingIOError` exceptions. It runs the SSL handshake " -"asynchronously as well." +"handles :exc:`SSLWantWriteError`, :exc:`SSLWantReadError` and :exc:" +"`BlockingIOError` exceptions. It runs the SSL handshake asynchronously as " +"well." msgstr "" -#: ../../library/ssl.rst:2525 +#: ../../library/ssl.rst:2526 msgid "Memory BIO Support" msgstr "記憶體 BIO 支援" -#: ../../library/ssl.rst:2529 +#: ../../library/ssl.rst:2530 msgid "" -"Ever since the SSL module was introduced in Python 2.6, " -"the :class:`SSLSocket` class has provided two related but distinct areas of " +"Ever since the SSL module was introduced in Python 2.6, the :class:" +"`SSLSocket` class has provided two related but distinct areas of " "functionality:" msgstr "" -#: ../../library/ssl.rst:2532 +#: ../../library/ssl.rst:2533 msgid "SSL protocol handling" msgstr "" -#: ../../library/ssl.rst:2533 +#: ../../library/ssl.rst:2534 msgid "Network IO" msgstr "" -#: ../../library/ssl.rst:2535 +#: ../../library/ssl.rst:2536 msgid "" "The network IO API is identical to that provided by :class:`socket.socket`, " "from which :class:`SSLSocket` also inherits. This allows an SSL socket to be " @@ -3598,19 +3577,19 @@ msgid "" "add SSL support to an existing application." msgstr "" -#: ../../library/ssl.rst:2540 +#: ../../library/ssl.rst:2541 msgid "" "Combining SSL protocol handling and network IO usually works well, but there " "are some cases where it doesn't. An example is async IO frameworks that want " "to use a different IO multiplexing model than the \"select/poll on a file " -"descriptor\" (readiness based) model that is assumed " -"by :class:`socket.socket` and by the internal OpenSSL socket IO routines. " -"This is mostly relevant for platforms like Windows where this model is not " -"efficient. For this purpose, a reduced scope variant of :class:`SSLSocket` " -"called :class:`SSLObject` is provided." +"descriptor\" (readiness based) model that is assumed by :class:`socket." +"socket` and by the internal OpenSSL socket IO routines. This is mostly " +"relevant for platforms like Windows where this model is not efficient. For " +"this purpose, a reduced scope variant of :class:`SSLSocket` called :class:" +"`SSLObject` is provided." msgstr "" -#: ../../library/ssl.rst:2551 +#: ../../library/ssl.rst:2552 msgid "" "A reduced-scope variant of :class:`SSLSocket` representing an SSL protocol " "instance that does not contain any network IO methods. This class is " @@ -3618,7 +3597,7 @@ msgid "" "for SSL through memory buffers." msgstr "" -#: ../../library/ssl.rst:2556 +#: ../../library/ssl.rst:2557 msgid "" "This class implements an interface on top of a low-level SSL object as " "implemented by OpenSSL. This object captures the state of an SSL connection " @@ -3626,7 +3605,7 @@ msgid "" "separate \"BIO\" objects which are OpenSSL's IO abstraction layer." msgstr "" -#: ../../library/ssl.rst:2561 +#: ../../library/ssl.rst:2562 msgid "" "This class has no public constructor. An :class:`SSLObject` instance must " "be created using the :meth:`~SSLContext.wrap_bio` method. This method will " @@ -3635,232 +3614,231 @@ msgid "" "instance, while the *outgoing* BIO is used to pass data the other way around." msgstr "" -#: ../../library/ssl.rst:2568 +#: ../../library/ssl.rst:2569 msgid "The following methods are available:" msgstr "" -#: ../../library/ssl.rst:2570 +#: ../../library/ssl.rst:2571 msgid ":attr:`~SSLSocket.context`" msgstr ":attr:`~SSLSocket.context`" -#: ../../library/ssl.rst:2571 +#: ../../library/ssl.rst:2572 msgid ":attr:`~SSLSocket.server_side`" msgstr ":attr:`~SSLSocket.server_side`" -#: ../../library/ssl.rst:2572 +#: ../../library/ssl.rst:2573 msgid ":attr:`~SSLSocket.server_hostname`" msgstr ":attr:`~SSLSocket.server_hostname`" -#: ../../library/ssl.rst:2573 +#: ../../library/ssl.rst:2574 msgid ":attr:`~SSLSocket.session`" msgstr ":attr:`~SSLSocket.session`" -#: ../../library/ssl.rst:2574 +#: ../../library/ssl.rst:2575 msgid ":attr:`~SSLSocket.session_reused`" msgstr ":attr:`~SSLSocket.session_reused`" -#: ../../library/ssl.rst:2575 +#: ../../library/ssl.rst:2576 msgid ":meth:`~SSLSocket.read`" msgstr ":meth:`~SSLSocket.read`" -#: ../../library/ssl.rst:2576 +#: ../../library/ssl.rst:2577 msgid ":meth:`~SSLSocket.write`" msgstr ":meth:`~SSLSocket.write`" -#: ../../library/ssl.rst:2577 +#: ../../library/ssl.rst:2578 msgid ":meth:`~SSLSocket.getpeercert`" msgstr ":meth:`~SSLSocket.getpeercert`" -#: ../../library/ssl.rst:2578 +#: ../../library/ssl.rst:2579 msgid ":meth:`~SSLSocket.get_verified_chain`" msgstr ":meth:`~SSLSocket.get_verified_chain`" -#: ../../library/ssl.rst:2579 +#: ../../library/ssl.rst:2580 msgid ":meth:`~SSLSocket.get_unverified_chain`" msgstr ":meth:`~SSLSocket.get_unverified_chain`" -#: ../../library/ssl.rst:2580 +#: ../../library/ssl.rst:2581 msgid ":meth:`~SSLSocket.selected_alpn_protocol`" msgstr ":meth:`~SSLSocket.selected_alpn_protocol`" -#: ../../library/ssl.rst:2581 +#: ../../library/ssl.rst:2582 msgid ":meth:`~SSLSocket.selected_npn_protocol`" msgstr ":meth:`~SSLSocket.selected_npn_protocol`" -#: ../../library/ssl.rst:2582 +#: ../../library/ssl.rst:2583 msgid ":meth:`~SSLSocket.cipher`" msgstr ":meth:`~SSLSocket.cipher`" -#: ../../library/ssl.rst:2583 +#: ../../library/ssl.rst:2584 msgid ":meth:`~SSLSocket.shared_ciphers`" msgstr ":meth:`~SSLSocket.shared_ciphers`" -#: ../../library/ssl.rst:2584 +#: ../../library/ssl.rst:2585 msgid ":meth:`~SSLSocket.compression`" msgstr ":meth:`~SSLSocket.compression`" -#: ../../library/ssl.rst:2585 +#: ../../library/ssl.rst:2586 msgid ":meth:`~SSLSocket.pending`" msgstr ":meth:`~SSLSocket.pending`" -#: ../../library/ssl.rst:2586 +#: ../../library/ssl.rst:2587 msgid ":meth:`~SSLSocket.do_handshake`" msgstr ":meth:`~SSLSocket.do_handshake`" -#: ../../library/ssl.rst:2587 +#: ../../library/ssl.rst:2588 msgid ":meth:`~SSLSocket.verify_client_post_handshake`" msgstr ":meth:`~SSLSocket.verify_client_post_handshake`" -#: ../../library/ssl.rst:2588 +#: ../../library/ssl.rst:2589 msgid ":meth:`~SSLSocket.unwrap`" msgstr ":meth:`~SSLSocket.unwrap`" -#: ../../library/ssl.rst:2589 +#: ../../library/ssl.rst:2590 msgid ":meth:`~SSLSocket.get_channel_binding`" msgstr ":meth:`~SSLSocket.get_channel_binding`" -#: ../../library/ssl.rst:2590 +#: ../../library/ssl.rst:2591 msgid ":meth:`~SSLSocket.version`" msgstr ":meth:`~SSLSocket.version`" -#: ../../library/ssl.rst:2592 +#: ../../library/ssl.rst:2593 msgid "" "When compared to :class:`SSLSocket`, this object lacks the following " "features:" msgstr "" -#: ../../library/ssl.rst:2595 +#: ../../library/ssl.rst:2596 msgid "" "Any form of network IO; ``recv()`` and ``send()`` read and write only to the " "underlying :class:`MemoryBIO` buffers." msgstr "" -#: ../../library/ssl.rst:2598 +#: ../../library/ssl.rst:2599 msgid "" "There is no *do_handshake_on_connect* machinery. You must always manually " "call :meth:`~SSLSocket.do_handshake` to start the handshake." msgstr "" -#: ../../library/ssl.rst:2601 +#: ../../library/ssl.rst:2602 msgid "" "There is no handling of *suppress_ragged_eofs*. All end-of-file conditions " -"that are in violation of the protocol are reported via " -"the :exc:`SSLEOFError` exception." +"that are in violation of the protocol are reported via the :exc:" +"`SSLEOFError` exception." msgstr "" -#: ../../library/ssl.rst:2605 +#: ../../library/ssl.rst:2606 msgid "" "The method :meth:`~SSLSocket.unwrap` call does not return anything, unlike " "for an SSL socket where it returns the underlying socket." msgstr "" -#: ../../library/ssl.rst:2608 +#: ../../library/ssl.rst:2609 msgid "" -"The *server_name_callback* callback passed " -"to :meth:`SSLContext.set_servername_callback` will get an :class:`SSLObject` " -"instance instead of a :class:`SSLSocket` instance as its first parameter." +"The *server_name_callback* callback passed to :meth:`SSLContext." +"set_servername_callback` will get an :class:`SSLObject` instance instead of " +"a :class:`SSLSocket` instance as its first parameter." msgstr "" -#: ../../library/ssl.rst:2612 +#: ../../library/ssl.rst:2613 msgid "Some notes related to the use of :class:`SSLObject`:" msgstr "" -#: ../../library/ssl.rst:2614 +#: ../../library/ssl.rst:2615 msgid "" "All IO on an :class:`SSLObject` is :ref:`non-blocking `. " -"This means that for example :meth:`~SSLSocket.read` will raise " -"an :exc:`SSLWantReadError` if it needs more data than the incoming BIO has " -"available." +"This means that for example :meth:`~SSLSocket.read` will raise an :exc:" +"`SSLWantReadError` if it needs more data than the incoming BIO has available." msgstr "" -#: ../../library/ssl.rst:2619 +#: ../../library/ssl.rst:2620 msgid "" -":class:`SSLObject` instances must be created " -"with :meth:`~SSLContext.wrap_bio`. In earlier versions, it was possible to " -"create instances directly. This was never documented or officially supported." +":class:`SSLObject` instances must be created with :meth:`~SSLContext." +"wrap_bio`. In earlier versions, it was possible to create instances " +"directly. This was never documented or officially supported." msgstr "" -#: ../../library/ssl.rst:2625 +#: ../../library/ssl.rst:2626 msgid "" "An SSLObject communicates with the outside world using memory buffers. The " "class :class:`MemoryBIO` provides a memory buffer that can be used for this " "purpose. It wraps an OpenSSL memory BIO (Basic IO) object:" msgstr "" -#: ../../library/ssl.rst:2631 +#: ../../library/ssl.rst:2632 msgid "" "A memory buffer that can be used to pass data between Python and an SSL " "protocol instance." msgstr "" -#: ../../library/ssl.rst:2636 +#: ../../library/ssl.rst:2637 msgid "Return the number of bytes currently in the memory buffer." msgstr "" -#: ../../library/ssl.rst:2640 +#: ../../library/ssl.rst:2641 msgid "" "A boolean indicating whether the memory BIO is current at the end-of-file " "position." msgstr "" -#: ../../library/ssl.rst:2645 +#: ../../library/ssl.rst:2646 msgid "" "Read up to *n* bytes from the memory buffer. If *n* is not specified or " "negative, all bytes are returned." msgstr "" -#: ../../library/ssl.rst:2650 +#: ../../library/ssl.rst:2651 msgid "" "Write the bytes from *buf* to the memory BIO. The *buf* argument must be an " "object supporting the buffer protocol." msgstr "" -#: ../../library/ssl.rst:2653 +#: ../../library/ssl.rst:2654 msgid "" "The return value is the number of bytes written, which is always equal to " "the length of *buf*." msgstr "" -#: ../../library/ssl.rst:2658 +#: ../../library/ssl.rst:2659 msgid "" "Write an EOF marker to the memory BIO. After this method has been called, it " "is illegal to call :meth:`~MemoryBIO.write`. The attribute :attr:`eof` will " "become true after all data currently in the buffer has been read." msgstr "" -#: ../../library/ssl.rst:2664 +#: ../../library/ssl.rst:2665 msgid "SSL session" msgstr "" -#: ../../library/ssl.rst:2670 +#: ../../library/ssl.rst:2671 msgid "Session object used by :attr:`~SSLSocket.session`." msgstr "" -#: ../../library/ssl.rst:2682 +#: ../../library/ssl.rst:2683 msgid "Security considerations" msgstr "" -#: ../../library/ssl.rst:2685 +#: ../../library/ssl.rst:2686 msgid "Best defaults" msgstr "" -#: ../../library/ssl.rst:2687 +#: ../../library/ssl.rst:2688 msgid "" "For **client use**, if you don't have any special requirements for your " -"security policy, it is highly recommended that you use " -"the :func:`create_default_context` function to create your SSL context. It " -"will load the system's trusted CA certificates, enable certificate " -"validation and hostname checking, and try to choose reasonably secure " -"protocol and cipher settings." +"security policy, it is highly recommended that you use the :func:" +"`create_default_context` function to create your SSL context. It will load " +"the system's trusted CA certificates, enable certificate validation and " +"hostname checking, and try to choose reasonably secure protocol and cipher " +"settings." msgstr "" -#: ../../library/ssl.rst:2694 +#: ../../library/ssl.rst:2695 msgid "" "For example, here is how you would use the :class:`smtplib.SMTP` class to " "create a trusted, secure connection to a SMTP server::" msgstr "" -#: ../../library/ssl.rst:2697 +#: ../../library/ssl.rst:2698 msgid "" ">>> import ssl, smtplib\n" ">>> smtp = smtplib.SMTP(\"mail.python.org\", port=587)\n" @@ -3874,50 +3852,50 @@ msgstr "" ">>> smtp.starttls(context=context)\n" "(220, b'2.0.0 Ready to start TLS')" -#: ../../library/ssl.rst:2703 +#: ../../library/ssl.rst:2704 msgid "" -"If a client certificate is needed for the connection, it can be added " -"with :meth:`SSLContext.load_cert_chain`." +"If a client certificate is needed for the connection, it can be added with :" +"meth:`SSLContext.load_cert_chain`." msgstr "" -#: ../../library/ssl.rst:2706 +#: ../../library/ssl.rst:2707 msgid "" -"By contrast, if you create the SSL context by calling " -"the :class:`SSLContext` constructor yourself, it will not have certificate " -"validation nor hostname checking enabled by default. If you do so, please " -"read the paragraphs below to achieve a good security level." +"By contrast, if you create the SSL context by calling the :class:" +"`SSLContext` constructor yourself, it will not have certificate validation " +"nor hostname checking enabled by default. If you do so, please read the " +"paragraphs below to achieve a good security level." msgstr "" -#: ../../library/ssl.rst:2712 +#: ../../library/ssl.rst:2713 msgid "Manual settings" msgstr "手動設定" -#: ../../library/ssl.rst:2715 +#: ../../library/ssl.rst:2716 msgid "Verifying certificates" msgstr "驗證憑證" -#: ../../library/ssl.rst:2717 +#: ../../library/ssl.rst:2718 msgid "" -"When calling the :class:`SSLContext` constructor " -"directly, :const:`CERT_NONE` is the default. Since it does not authenticate " -"the other peer, it can be insecure, especially in client mode where most of " -"the time you would like to ensure the authenticity of the server you're " -"talking to. Therefore, when in client mode, it is highly recommended to " -"use :const:`CERT_REQUIRED`. However, it is in itself not sufficient; you " -"also have to check that the server certificate, which can be obtained by " -"calling :meth:`SSLSocket.getpeercert`, matches the desired service. For " -"many protocols and applications, the service can be identified by the " -"hostname. This common check is automatically performed " -"when :attr:`SSLContext.check_hostname` is enabled." +"When calling the :class:`SSLContext` constructor directly, :const:" +"`CERT_NONE` is the default. Since it does not authenticate the other peer, " +"it can be insecure, especially in client mode where most of the time you " +"would like to ensure the authenticity of the server you're talking to. " +"Therefore, when in client mode, it is highly recommended to use :const:" +"`CERT_REQUIRED`. However, it is in itself not sufficient; you also have to " +"check that the server certificate, which can be obtained by calling :meth:" +"`SSLSocket.getpeercert`, matches the desired service. For many protocols " +"and applications, the service can be identified by the hostname. This common " +"check is automatically performed when :attr:`SSLContext.check_hostname` is " +"enabled." msgstr "" -#: ../../library/ssl.rst:2729 +#: ../../library/ssl.rst:2730 msgid "" -"Hostname matchings is now performed by OpenSSL. Python no longer " -"uses :func:`match_hostname`." +"Hostname matchings is now performed by OpenSSL. Python no longer uses :func:" +"`match_hostname`." msgstr "" -#: ../../library/ssl.rst:2733 +#: ../../library/ssl.rst:2734 msgid "" "In server mode, if you want to authenticate your clients using the SSL layer " "(rather than using a higher-level authentication mechanism), you'll also " @@ -3925,20 +3903,20 @@ msgid "" "certificate." msgstr "" -#: ../../library/ssl.rst:2739 +#: ../../library/ssl.rst:2740 msgid "Protocol versions" msgstr "協定版本" -#: ../../library/ssl.rst:2741 +#: ../../library/ssl.rst:2742 msgid "" "SSL versions 2 and 3 are considered insecure and are therefore dangerous to " "use. If you want maximum compatibility between clients and servers, it is " -"recommended to use :const:`PROTOCOL_TLS_CLIENT` " -"or :const:`PROTOCOL_TLS_SERVER` as the protocol version. SSLv2 and SSLv3 are " -"disabled by default." +"recommended to use :const:`PROTOCOL_TLS_CLIENT` or :const:" +"`PROTOCOL_TLS_SERVER` as the protocol version. SSLv2 and SSLv3 are disabled " +"by default." msgstr "" -#: ../../library/ssl.rst:2749 +#: ../../library/ssl.rst:2750 msgid "" ">>> client_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)\n" ">>> client_context.minimum_version = ssl.TLSVersion.TLSv1_3\n" @@ -3948,36 +3926,36 @@ msgstr "" ">>> client_context.minimum_version = ssl.TLSVersion.TLSv1_3\n" ">>> client_context.maximum_version = ssl.TLSVersion.TLSv1_3" -#: ../../library/ssl.rst:2754 +#: ../../library/ssl.rst:2755 msgid "" "The SSL context created above will only allow TLSv1.3 and later (if " -"supported by your system) connections to a " -"server. :const:`PROTOCOL_TLS_CLIENT` implies certificate validation and " -"hostname checks by default. You have to load certificates into the context." +"supported by your system) connections to a server. :const:" +"`PROTOCOL_TLS_CLIENT` implies certificate validation and hostname checks by " +"default. You have to load certificates into the context." msgstr "" -#: ../../library/ssl.rst:2761 +#: ../../library/ssl.rst:2762 msgid "Cipher selection" msgstr "" -#: ../../library/ssl.rst:2763 +#: ../../library/ssl.rst:2764 msgid "" "If you have advanced security requirements, fine-tuning of the ciphers " -"enabled when negotiating a SSL session is possible through " -"the :meth:`SSLContext.set_ciphers` method. Starting from Python 3.2.3, the " -"ssl module disables certain weak ciphers by default, but you may want to " -"further restrict the cipher choice. Be sure to read OpenSSL's documentation " -"about the `cipher list format `_. If you want to check which ciphers are enabled by a " -"given cipher list, use :meth:`SSLContext.get_ciphers` or the ``openssl " -"ciphers`` command on your system." +"enabled when negotiating a SSL session is possible through the :meth:" +"`SSLContext.set_ciphers` method. Starting from Python 3.2.3, the ssl module " +"disables certain weak ciphers by default, but you may want to further " +"restrict the cipher choice. Be sure to read OpenSSL's documentation about " +"the `cipher list format `_. If you want to check which ciphers are enabled by a given " +"cipher list, use :meth:`SSLContext.get_ciphers` or the ``openssl ciphers`` " +"command on your system." msgstr "" -#: ../../library/ssl.rst:2774 +#: ../../library/ssl.rst:2775 msgid "Multi-processing" msgstr "" -#: ../../library/ssl.rst:2776 +#: ../../library/ssl.rst:2777 msgid "" "If using this module as part of a multi-processed application (using, for " "example the :mod:`multiprocessing` or :mod:`concurrent.futures` modules), be " @@ -3988,32 +3966,32 @@ msgid "" "sufficient." msgstr "" -#: ../../library/ssl.rst:2788 +#: ../../library/ssl.rst:2789 msgid "TLS 1.3" msgstr "TLS 1.3" -#: ../../library/ssl.rst:2792 +#: ../../library/ssl.rst:2793 msgid "" "The TLS 1.3 protocol behaves slightly differently than previous version of " "TLS/SSL. Some new TLS 1.3 features are not yet available." msgstr "" -#: ../../library/ssl.rst:2795 +#: ../../library/ssl.rst:2796 msgid "" "TLS 1.3 uses a disjunct set of cipher suites. All AES-GCM and ChaCha20 " -"cipher suites are enabled by default. The " -"method :meth:`SSLContext.set_ciphers` cannot enable or disable any TLS 1.3 " -"ciphers yet, but :meth:`SSLContext.get_ciphers` returns them." +"cipher suites are enabled by default. The method :meth:`SSLContext." +"set_ciphers` cannot enable or disable any TLS 1.3 ciphers yet, but :meth:" +"`SSLContext.get_ciphers` returns them." msgstr "" -#: ../../library/ssl.rst:2799 +#: ../../library/ssl.rst:2800 msgid "" "Session tickets are no longer sent as part of the initial handshake and are " "handled differently. :attr:`SSLSocket.session` and :class:`SSLSession` are " "not compatible with TLS 1.3." msgstr "" -#: ../../library/ssl.rst:2802 +#: ../../library/ssl.rst:2803 msgid "" "Client-side certificates are also no longer verified during the initial " "handshake. A server can request a certificate at any time. Clients process " @@ -4021,21 +3999,21 @@ msgid "" "server." msgstr "" -#: ../../library/ssl.rst:2806 +#: ../../library/ssl.rst:2807 msgid "" "TLS 1.3 features like early data, deferred TLS client cert request, " "signature algorithm configuration, and rekeying are not supported yet." msgstr "" -#: ../../library/ssl.rst:2812 +#: ../../library/ssl.rst:2813 msgid "Class :class:`socket.socket`" msgstr ":class:`socket.socket` 類別" -#: ../../library/ssl.rst:2813 +#: ../../library/ssl.rst:2814 msgid "Documentation of underlying :mod:`socket` class" msgstr "底層 :mod:`socket` 類別的文件" -#: ../../library/ssl.rst:2815 +#: ../../library/ssl.rst:2816 msgid "" "`SSL/TLS Strong Encryption: An Introduction `_" @@ -4043,11 +4021,11 @@ msgstr "" "`SSL/TLS Strong Encryption: An Introduction `_" -#: ../../library/ssl.rst:2816 +#: ../../library/ssl.rst:2817 msgid "Intro from the Apache HTTP Server documentation" msgstr "Apache HTTP Server 文件的介紹" -#: ../../library/ssl.rst:2818 +#: ../../library/ssl.rst:2819 msgid "" ":rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: " "Certificate-Based Key Management <1422>`" @@ -4055,19 +4033,19 @@ msgstr "" ":rfc:`RFC 1422: Privacy Enhancement for Internet Electronic Mail: Part II: " "Certificate-Based Key Management <1422>`" -#: ../../library/ssl.rst:2819 +#: ../../library/ssl.rst:2820 msgid "Steve Kent" msgstr "Steve Kent" -#: ../../library/ssl.rst:2821 +#: ../../library/ssl.rst:2822 msgid ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" msgstr ":rfc:`RFC 4086: Randomness Requirements for Security <4086>`" -#: ../../library/ssl.rst:2822 +#: ../../library/ssl.rst:2823 msgid "Donald E., Jeffrey I. Schiller" msgstr "Donald E., Jeffrey I. Schiller" -#: ../../library/ssl.rst:2824 +#: ../../library/ssl.rst:2825 msgid "" ":rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and " "Certificate Revocation List (CRL) Profile <5280>`" @@ -4075,11 +4053,11 @@ msgstr "" ":rfc:`RFC 5280: Internet X.509 Public Key Infrastructure Certificate and " "Certificate Revocation List (CRL) Profile <5280>`" -#: ../../library/ssl.rst:2825 +#: ../../library/ssl.rst:2826 msgid "D. Cooper" msgstr "D. Cooper" -#: ../../library/ssl.rst:2827 +#: ../../library/ssl.rst:2828 msgid "" ":rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 " "<5246>`" @@ -4087,19 +4065,19 @@ msgstr "" ":rfc:`RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2 " "<5246>`" -#: ../../library/ssl.rst:2828 +#: ../../library/ssl.rst:2829 msgid "T. Dierks et. al." msgstr "T. Dierks et. al." -#: ../../library/ssl.rst:2830 +#: ../../library/ssl.rst:2831 msgid ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" msgstr ":rfc:`RFC 6066: Transport Layer Security (TLS) Extensions <6066>`" -#: ../../library/ssl.rst:2831 +#: ../../library/ssl.rst:2832 msgid "D. Eastlake" msgstr "D. Eastlake" -#: ../../library/ssl.rst:2833 +#: ../../library/ssl.rst:2834 msgid "" "`IANA TLS: Transport Layer Security (TLS) Parameters `_" @@ -4107,11 +4085,11 @@ msgstr "" "`IANA TLS: Transport Layer Security (TLS) Parameters `_" -#: ../../library/ssl.rst:2834 +#: ../../library/ssl.rst:2835 msgid "IANA" msgstr "IANA" -#: ../../library/ssl.rst:2836 +#: ../../library/ssl.rst:2837 msgid "" ":rfc:`RFC 7525: Recommendations for Secure Use of Transport Layer Security " "(TLS) and Datagram Transport Layer Security (DTLS) <7525>`" @@ -4119,11 +4097,11 @@ msgstr "" ":rfc:`RFC 7525: Recommendations for Secure Use of Transport Layer Security " "(TLS) and Datagram Transport Layer Security (DTLS) <7525>`" -#: ../../library/ssl.rst:2837 +#: ../../library/ssl.rst:2838 msgid "IETF" msgstr "IETF" -#: ../../library/ssl.rst:2839 +#: ../../library/ssl.rst:2840 msgid "" "`Mozilla's Server Side TLS recommendations `_" @@ -4131,7 +4109,7 @@ msgstr "" "`Mozilla's Server Side TLS recommendations `_" -#: ../../library/ssl.rst:2840 +#: ../../library/ssl.rst:2841 msgid "Mozilla" msgstr "Mozilla" @@ -4159,10 +4137,10 @@ msgstr "Transport Layer Security(傳輸層安全)" msgid "Secure Sockets Layer" msgstr "Secure Sockets Layer(安全 socket 層)" -#: ../../library/ssl.rst:2151 +#: ../../library/ssl.rst:2152 msgid "certificates" msgstr "certificates(憑證)" -#: ../../library/ssl.rst:2153 +#: ../../library/ssl.rst:2154 msgid "X509 certificate" msgstr "X509 certificate(X509 憑證)" diff --git a/library/stdtypes.po b/library/stdtypes.po index 9192ab4199..df265115a6 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: 2025-09-10 20:44+0800\n" +"POT-Creation-Date: 2025-09-18 00:15+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-" @@ -65,24 +65,22 @@ msgstr "真值檢測" #: ../../library/stdtypes.rst:41 msgid "" -"Any object can be tested for truth value, for use in an :keyword:`if` " -"or :keyword:`while` condition or as operand of the Boolean operations below." +"Any object can be tested for truth value, for use in an :keyword:`if` or :" +"keyword:`while` condition or as operand of the Boolean operations below." msgstr "" -"任何物件都可以進行檢測以判斷是否為真值,以便在 :keyword:`if` " -"或 :keyword:`while` 條件中使用,或是作為如下所述 boolean(布林)運算之運算元" -"所用。" +"任何物件都可以進行檢測以判斷是否為真值,以便在 :keyword:`if` 或 :keyword:" +"`while` 條件中使用,或是作為如下所述 boolean(布林)運算之運算元所用。" #: ../../library/stdtypes.rst:46 msgid "" -"By default, an object is considered true unless its class defines either " -"a :meth:`~object.__bool__` method that returns ``False`` or " -"a :meth:`~object.__len__` method that returns zero, when called with the " -"object. [1]_ Here are most of the built-in objects considered false:" +"By default, an object is considered true unless its class defines either a :" +"meth:`~object.__bool__` method that returns ``False`` or a :meth:`~object." +"__len__` method that returns zero, when called with the object. [1]_ Here " +"are most of the built-in objects considered false:" msgstr "" -"預設情況下,一個物件會被視為真值,除非它的 class 定義了會回傳 ``False`` " -"的 :meth:`~object.__bool__` method 或是定義了會回傳零" -"的 :meth:`~object.__len__` method。[1]_ 以下列出了大部分會被視為 false 的內建" -"物件:" +"預設情況下,一個物件會被視為真值,除非它的 class 定義了會回傳 ``False`` 的 :" +"meth:`~object.__bool__` method 或是定義了會回傳零的 :meth:`~object.__len__` " +"method。[1]_ 以下列出了大部分會被視為 false 的內建物件:" #: ../../library/stdtypes.rst:56 msgid "constants defined to be false: ``None`` and ``False``" @@ -326,24 +324,23 @@ msgid "" "Non-identical instances of a class normally compare as non-equal unless the " "class defines the :meth:`~object.__eq__` method." msgstr "" -"一個 class 的非相同實例通常會比較為不相等,除非 class 有定" -"義 :meth:`~object.__eq__` method。" +"一個 class 的非相同實例通常會比較為不相等,除非 class 有定義 :meth:`~object." +"__eq__` method。" #: ../../library/stdtypes.rst:184 msgid "" "Instances of a class cannot be ordered with respect to other instances of " "the same class, or other types of object, unless the class defines enough of " -"the " -"methods :meth:`~object.__lt__`, :meth:`~object.__le__`, :meth:`~object.__gt__`, " -"and :meth:`~object.__ge__` (in general, :meth:`~object.__lt__` " -"and :meth:`~object.__eq__` are sufficient, if you want the conventional " -"meanings of the comparison operators)." +"the methods :meth:`~object.__lt__`, :meth:`~object.__le__`, :meth:`~object." +"__gt__`, and :meth:`~object.__ge__` (in general, :meth:`~object.__lt__` and :" +"meth:`~object.__eq__` are sufficient, if you want the conventional meanings " +"of the comparison operators)." msgstr "" "一個 class 的實例不可以與其他相同 class 的實例或其他物件型別進行排序,除非 " -"class 定義足夠的 method ,包" -"含 :meth:`~object.__lt__`、:meth:`~object.__le__`、:meth:`~object.__gt__` " -"及 :meth:`~object.__ge__`\\ (一般來說,使用 :meth:`~object.__lt__` " -"及 :meth:`~object.__eq__` 就可以滿足常規意義上的比較運算子)。" +"class 定義足夠的 method ,包含 :meth:`~object.__lt__`、:meth:`~object." +"__le__`、:meth:`~object.__gt__` 及 :meth:`~object.__ge__`\\ (一般來說,使" +"用 :meth:`~object.__lt__` 及 :meth:`~object.__eq__` 就可以滿足常規意義上的比" +"較運算子)。" #: ../../library/stdtypes.rst:191 msgid "" @@ -356,8 +353,8 @@ msgstr "" #: ../../library/stdtypes.rst:199 msgid "" -"Two more operations with the same syntactic priority, :keyword:`in` " -"and :keyword:`not in`, are supported by types that are :term:`iterable` or " +"Two more operations with the same syntactic priority, :keyword:`in` and :" +"keyword:`not in`, are supported by types that are :term:`iterable` or " "implement the :meth:`~object.__contains__` method." msgstr "" "此外,擁有相同的語法優先序的 :keyword:`in` 及 :keyword:`not in` 兩種運算皆被" @@ -375,21 +372,20 @@ msgid "" "subtype of integers. Integers have unlimited precision. Floating-point " "numbers are usually implemented using :c:expr:`double` in C; information " "about the precision and internal representation of floating-point numbers " -"for the machine on which your program is running is available " -"in :data:`sys.float_info`. Complex numbers have a real and imaginary part, " -"which are each a floating-point number. To extract these parts from a " -"complex number *z*, use ``z.real`` and ``z.imag``. (The standard library " -"includes the additional numeric types :mod:`fractions.Fraction`, for " -"rationals, and :mod:`decimal.Decimal`, for floating-point numbers with user-" -"definable precision.)" +"for the machine on which your program is running is available in :data:`sys." +"float_info`. Complex numbers have a real and imaginary part, which are each " +"a floating-point number. To extract these parts from a complex number *z*, " +"use ``z.real`` and ``z.imag``. (The standard library includes the additional " +"numeric types :mod:`fractions.Fraction`, for rationals, and :mod:`decimal." +"Decimal`, for floating-point numbers with user-definable precision.)" msgstr "" "數值型別共有三種::dfn:`整數`、:dfn:`浮點數` 及 :dfn:`複數`。此外,Boolean 為" -"整數中的一個子型別。整數有無限的精度。浮點數通常使用 C 裡面" -"的 :c:expr:`double` 實作。關於在你程式所運作的機器上之浮點數的精度及內部表示" -"法可以在 :data:`sys.float_info` 進行查找。複數包含實數及虛數的部分,這兩部分" -"各自是一個浮點數。若要從一個複數 *z* 提取這兩部分,需使用 ``z.real`` 及 " -"``z.imag``。(標準函式庫包含額外的數值型別,像是 :mod:`fractions.Fraction` 表" -"示有理數,而 :mod:`decimal.Decimal` 表示可由使用者制定精度的浮點數。)" +"整數中的一個子型別。整數有無限的精度。浮點數通常使用 C 裡面的 :c:expr:" +"`double` 實作。關於在你程式所運作的機器上之浮點數的精度及內部表示法可以在 :" +"data:`sys.float_info` 進行查找。複數包含實數及虛數的部分,這兩部分各自是一個" +"浮點數。若要從一個複數 *z* 提取這兩部分,需使用 ``z.real`` 及 ``z.imag``。" +"(標準函式庫包含額外的數值型別,像是 :mod:`fractions.Fraction` 表示有理數," +"而 :mod:`decimal.Decimal` 表示可由使用者制定精度的浮點數。)" #: ../../library/stdtypes.rst:238 msgid "" @@ -445,8 +441,8 @@ msgid "" "All numeric types (except complex) support the following operations (for " "priorities of the operations, see :ref:`operator-summary`):" msgstr "" -"所有數值型別(除複數外)皆支援以下的運算(有關運算的先後順序,詳" -"見 :ref:`operator-summary`):" +"所有數值型別(除複數外)皆支援以下的運算(有關運算的先後順序,詳見 :ref:" +"`operator-summary`):" #: ../../library/stdtypes.rst:282 msgid "Full documentation" @@ -635,11 +631,11 @@ msgid "" "always rounded towards minus infinity: ``1//2`` is ``0``, ``(-1)//2`` is " "``-1``, ``1//(-2)`` is ``-1``, and ``(-1)//(-2)`` is ``0``." msgstr "" -"也被稱為整數除法。對於型別為 :class:`int` 的運算元來說,結果之型別會" -"是 :class:`int`。對於型別為 :class:`float` 的運算元來說,結果之型別會" -"是 :class:`float`。一般來說,結果會是一個整數,但其型別不一定會" -"是 :class:`int`。結果總是會往負無窮大的方向取整數值: ``1//2`` 為 ``0``、" -"``(-1)//2`` 為 ``-1``、``1//(-2)`` 為 ``-1`` 及 ``(-1)//(-2)`` 為 ``0``。" +"也被稱為整數除法。對於型別為 :class:`int` 的運算元來說,結果之型別會是 :" +"class:`int`。對於型別為 :class:`float` 的運算元來說,結果之型別會是 :class:" +"`float`。一般來說,結果會是一個整數,但其型別不一定會是 :class:`int`。結果總" +"是會往負無窮大的方向取整數值: ``1//2`` 為 ``0``、``(-1)//2`` 為 ``-1``、" +"``1//(-2)`` 為 ``-1`` 及 ``(-1)//(-2)`` 為 ``0``。" #: ../../library/stdtypes.rst:337 msgid "" @@ -653,8 +649,8 @@ msgid "" "fractional part. See functions :func:`math.floor` and :func:`math.ceil` for " "alternative conversions." msgstr "" -"從 :class:`float` 轉換為 :class:`int` 會導致截斷並排除小數部分。詳" -"見 :func:`math.floor` 及 :func:`math.ceil` 以了解更多轉換方式。" +"從 :class:`float` 轉換為 :class:`int` 會導致截斷並排除小數部分。詳見 :func:" +"`math.floor` 及 :func:`math.ceil` 以了解更多轉換方式。" #: ../../library/stdtypes.rst:353 msgid "" @@ -844,13 +840,13 @@ msgstr "向右移動 *n* 個位元等同於向下除法除以 ``pow(2, n)``。" #: ../../library/stdtypes.rst:452 msgid "" "Performing these calculations with at least one extra sign extension bit in " -"a finite two's complement representation (a working bit-width of ``1 + " -"max(x.bit_length(), y.bit_length())`` or more) is sufficient to get the same " +"a finite two's complement representation (a working bit-width of ``1 + max(x." +"bit_length(), y.bit_length())`` or more) is sufficient to get the same " "result as if there were an infinite number of sign bits." msgstr "" -"在有限的二的補數表示法中執行這些計算(一個有效位元寬度為 ``1 + " -"max(x.bit_length(), y.bit_length())`` 或以上)並至少有一個額外的符號擴展位" -"元,便足以得到與無窮多個符號位元相同的結果。" +"在有限的二的補數表示法中執行這些計算(一個有效位元寬度為 ``1 + max(x." +"bit_length(), y.bit_length())`` 或以上)並至少有一個額外的符號擴展位元,便足" +"以得到與無窮多個符號位元相同的結果。" #: ../../library/stdtypes.rst:459 msgid "Additional Methods on Integer Types" @@ -889,13 +885,13 @@ msgid "" "More precisely, if ``x`` is nonzero, then ``x.bit_length()`` is the unique " "positive integer ``k`` such that ``2**(k-1) <= abs(x) < 2**k``. " "Equivalently, when ``abs(x)`` is small enough to have a correctly rounded " -"logarithm, then ``k = 1 + int(log(abs(x), 2))``. If ``x`` is zero, then " -"``x.bit_length()`` returns ``0``." +"logarithm, then ``k = 1 + int(log(abs(x), 2))``. If ``x`` is zero, then ``x." +"bit_length()`` returns ``0``." msgstr "" "更準確來說,若 ``x`` 非為零,則 ``x.bit_length()`` 會得出滿足 ``2**(k-1) <= " "abs(x) < 2**k`` 的單一正整數 ``k``。同樣地,當 ``abs(x)`` 足夠小到能正確地取" -"得捨入的對數,則 ``k = 1 + int(log(abs(x), 2))``。若 ``x`` 為零,則 " -"``x.bit_length()`` 會回傳 ``0``。" +"得捨入的對數,則 ``k = 1 + int(log(abs(x), 2))``。若 ``x`` 為零,則 ``x." +"bit_length()`` 會回傳 ``0``。" #: ../../library/stdtypes.rst:481 ../../library/stdtypes.rst:504 #: ../../library/stdtypes.rst:549 ../../library/stdtypes.rst:593 @@ -948,9 +944,9 @@ msgstr "回傳表示一個整數的一列位元組。" #: ../../library/stdtypes.rst:525 msgid "" -"The integer is represented using *length* bytes, and defaults to 1. " -"An :exc:`OverflowError` is raised if the integer is not representable with " -"the given number of bytes." +"The integer is represented using *length* bytes, and defaults to 1. An :exc:" +"`OverflowError` is raised if the integer is not representable with the given " +"number of bytes." msgstr "" "此整數會使用 *length* 位元組表示,並且預設為 1。如果該整數無法用給定的位元組" "數來表示,則會引發 :exc:`OverflowError`。" @@ -996,8 +992,8 @@ msgid "" "However, when using the default arguments, don't try to convert a value " "greater than 255 or you'll get an :exc:`OverflowError`." msgstr "" -"然而,使用預設引數時,不要嘗試轉換大於 255 的值,否則你將會得到一" -"個 :exc:`OverflowError`。" +"然而,使用預設引數時,不要嘗試轉換大於 255 的值,否則你將會得到一個 :exc:" +"`OverflowError`。" #: ../../library/stdtypes.rst:551 msgid "" @@ -1043,8 +1039,8 @@ msgid "" "integer, and defaults to ``\"big\"``. If *byteorder* is ``\"big\"``, the " "most significant byte is at the beginning of the byte array. If *byteorder* " "is ``\"little\"``, the most significant byte is at the end of the byte " -"array. To request the native byte order of the host system, " -"use :data:`sys.byteorder` as the byte order value." +"array. To request the native byte order of the host system, use :data:`sys." +"byteorder` as the byte order value." msgstr "" "*byteorder* 引數決定了用來表示整數的位元組順序並且預設為 ``\"big\"``。如果 " "*byteorder* 是 ``\"big\"``,最重要的位元組位於位元組陣列的開頭。如果 " @@ -1102,8 +1098,8 @@ msgstr "" #: ../../library/stdtypes.rst:624 msgid "" -"Returns ``True``. Exists for duck type compatibility " -"with :meth:`float.is_integer`." +"Returns ``True``. Exists for duck type compatibility with :meth:`float." +"is_integer`." msgstr "回傳 ``True``。為了與 :meth:`float.is_integer` 的鴨子型別相容而存在。" #: ../../library/stdtypes.rst:629 @@ -1127,22 +1123,22 @@ msgstr "" msgid "" "If the argument is an integer or a floating-point number, a floating-point " "number with the same value (within Python's floating-point precision) is " -"returned. If the argument is outside the range of a Python float, " -"an :exc:`OverflowError` will be raised." +"returned. If the argument is outside the range of a Python float, an :exc:" +"`OverflowError` will be raised." msgstr "" #: ../../library/stdtypes.rst:643 msgid "" -"For a general Python object ``x``, ``float.from_number(x)`` delegates to " -"``x.__float__()``. If :meth:`~object.__float__` is not defined then it falls " +"For a general Python object ``x``, ``float.from_number(x)`` delegates to ``x." +"__float__()``. If :meth:`~object.__float__` is not defined then it falls " "back to :meth:`~object.__index__`." msgstr "" #: ../../library/stdtypes.rst:653 msgid "" "Return a pair of integers whose ratio is exactly equal to the original " -"float. The ratio is in lowest terms and has a positive denominator. " -"Raises :exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs." +"float. The ratio is in lowest terms and has a positive denominator. Raises :" +"exc:`OverflowError` on infinities and a :exc:`ValueError` on NaNs." msgstr "" "回傳一對整數,其比率完全等於原始浮點數。比率是在最低條件下並且有一個正分母。" "在無窮大時引發 :exc:`OverflowError`,在 NaN 時引發 :exc:`ValueError`。" @@ -1199,8 +1195,8 @@ msgstr "" #: ../../library/stdtypes.rst:692 msgid "" -"Note that :meth:`float.hex` is an instance method, " -"while :meth:`float.fromhex` is a class method." +"Note that :meth:`float.hex` is an instance method, while :meth:`float." +"fromhex` is a class method." msgstr "" "請注意 :meth:`float.hex` 是一個實例 method,而 :meth:`float.fromhex` 是一個 " "class method。" @@ -1229,10 +1225,10 @@ msgstr "" "其中可選的 ``sign`` 可以是 ``+`` 或 ``-``,``integer`` 和 ``fraction`` 是十六" "進位數字的字串,而 ``exponent`` 是一個十進位整數並且有一個可選的前導符號。大" "小寫不重要,並且整數或小數部分至少有一個十六進位數字。這個語法與 C99 標準的" -"第 6.4.4.2 節指定的語法相似,也與 Java 1.5 以後的語法相似。特別" -"是 :meth:`float.hex` 的輸出可用作 C 或 Java 程式碼中的十六進位浮點數文字,並" -"且 C 的 ``%a`` 格式字元或 Java 的 ``Double.toHexString`` 產生的十六進位字串可" -"被 :meth:`float.fromhex` 接受。" +"第 6.4.4.2 節指定的語法相似,也與 Java 1.5 以後的語法相似。特別是 :meth:" +"`float.hex` 的輸出可用作 C 或 Java 程式碼中的十六進位浮點數文字,並且 C 的 " +"``%a`` 格式字元或 Java 的 ``Double.toHexString`` 產生的十六進位字串可被 :" +"meth:`float.fromhex` 接受。" #: ../../library/stdtypes.rst:712 msgid "" @@ -1274,9 +1270,9 @@ msgstr "複數的附加方法" #: ../../library/stdtypes.rst:732 msgid "" -"The :class:`!complex` type implements " -"the :class:`numbers.Complex` :term:`abstract base class`. :class:`!complex` " -"also has the following additional methods." +"The :class:`!complex` type implements the :class:`numbers.Complex` :term:" +"`abstract base class`. :class:`!complex` also has the following additional " +"methods." msgstr "" ":class:`!complex` 型別實作了 :class:`numbers.Complex` :term:`抽象基底類別 " "`。:class:`!complex` 也有下列附加方法。" @@ -1300,29 +1296,27 @@ msgstr "數值型別的雜湊" #: ../../library/stdtypes.rst:753 msgid "" "For numbers ``x`` and ``y``, possibly of different types, it's a requirement " -"that ``hash(x) == hash(y)`` whenever ``x == y`` (see " -"the :meth:`~object.__hash__` method documentation for more details). For " -"ease of implementation and efficiency across a variety of numeric types " -"(including :class:`int`, :class:`float`, :class:`decimal.Decimal` " -"and :class:`fractions.Fraction`) Python's hash for numeric types is based on " -"a single mathematical function that's defined for any rational number, and " -"hence applies to all instances of :class:`int` " -"and :class:`fractions.Fraction`, and all finite instances of :class:`float` " -"and :class:`decimal.Decimal`. Essentially, this function is given by " -"reduction modulo ``P`` for a fixed prime ``P``. The value of ``P`` is made " -"available to Python as the :attr:`~sys.hash_info.modulus` attribute " -"of :data:`sys.hash_info`." +"that ``hash(x) == hash(y)`` whenever ``x == y`` (see the :meth:`~object." +"__hash__` method documentation for more details). For ease of " +"implementation and efficiency across a variety of numeric types (including :" +"class:`int`, :class:`float`, :class:`decimal.Decimal` and :class:`fractions." +"Fraction`) Python's hash for numeric types is based on a single mathematical " +"function that's defined for any rational number, and hence applies to all " +"instances of :class:`int` and :class:`fractions.Fraction`, and all finite " +"instances of :class:`float` and :class:`decimal.Decimal`. Essentially, this " +"function is given by reduction modulo ``P`` for a fixed prime ``P``. The " +"value of ``P`` is made available to Python as the :attr:`~sys.hash_info." +"modulus` attribute of :data:`sys.hash_info`." msgstr "" "對於數字 ``x`` 和 ``y``,可能是不同型別,當 ``x == y`` 時,``hash(x) == " "hash(y)`` 是一個要求( 詳見 :meth:`~object.__hash__` method 的文件以獲得更多" -"細節)。為了實作的便利性和效率跨越各種數值型別(包" -"括 :class:`int`、:class:`float`、:class:`decimal.Decimal` " -"和 :class:`fractions.Fraction`)Python 的數值型別的雜湊是基於一個數學函式,它" -"對於任何有理數都是定義的,因此適用於所有 :class:`int` " -"和 :class:`fractions.Fraction` 的實例,以及所有有限的 :class:`float` " -"和 :class:`decimal.Decimal` 的實例。基本上,這個函式是由簡化的 modulo(模" -"數) ``P`` 給出的一個固定的質數 ``P``。``P`` 的值作為 :data:`sys.hash_info` " -"的 :attr:`~sys.hash_info.modulus` 屬性提供給 Python。" +"細節)。為了實作的便利性和效率跨越各種數值型別(包括 :class:`int`、:class:" +"`float`、:class:`decimal.Decimal` 和 :class:`fractions.Fraction`)Python 的數" +"值型別的雜湊是基於一個數學函式,它對於任何有理數都是定義的,因此適用於所有 :" +"class:`int` 和 :class:`fractions.Fraction` 的實例,以及所有有限的 :class:" +"`float` 和 :class:`decimal.Decimal` 的實例。基本上,這個函式是由簡化的 modulo" +"(模數) ``P`` 給出的一個固定的質數 ``P``。``P`` 的值作為 :data:`sys." +"hash_info` 的 :attr:`~sys.hash_info.modulus` 屬性提供給 Python。" #: ../../library/stdtypes.rst:768 msgid "" @@ -1377,23 +1371,21 @@ msgstr "" #: ../../library/stdtypes.rst:790 msgid "" "For a :class:`complex` number ``z``, the hash values of the real and " -"imaginary parts are combined by computing ``hash(z.real) + " -"sys.hash_info.imag * hash(z.imag)``, reduced modulo " -"``2**sys.hash_info.width`` so that it lies in " -"``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - 1))``. " -"Again, if the result is ``-1``, it's replaced with ``-2``." +"imaginary parts are combined by computing ``hash(z.real) + sys.hash_info." +"imag * hash(z.imag)``, reduced modulo ``2**sys.hash_info.width`` so that it " +"lies in ``range(-2**(sys.hash_info.width - 1), 2**(sys.hash_info.width - " +"1))``. Again, if the result is ``-1``, it's replaced with ``-2``." msgstr "" "對於一個 :class:`complex` 值 ``z``,實部和虛部的雜湊值藉由 ``hash(z.real) + " -"sys.hash_info.imag * hash(z.imag)`` 的計算進行組合,對 " -"``2**sys.hash_info.width`` 取模數使其介於 ``range(-2**(sys.hash_info.width - " -"1), 2**(sys.hash_info.width - 1))``。同樣地,如果結果是 ``-1``,則將其替換為 " -"``-2``。" +"sys.hash_info.imag * hash(z.imag)`` 的計算進行組合,對 ``2**sys.hash_info." +"width`` 取模數使其介於 ``range(-2**(sys.hash_info.width - 1), 2**(sys." +"hash_info.width - 1))``。同樣地,如果結果是 ``-1``,則將其替換為 ``-2``。" #: ../../library/stdtypes.rst:798 msgid "" "To clarify the above rules, here's some example Python code, equivalent to " -"the built-in hash, for computing the hash of a rational " -"number, :class:`float`, or :class:`complex`::" +"the built-in hash, for computing the hash of a rational number, :class:" +"`float`, or :class:`complex`::" msgstr "" "為了闡明上述規則,這裡有一些 Python 程式碼範例,等同於內建的雜湊,用於計算有" "理數、:class:`float` 或 :class:`complex` 的雜湊: ::" @@ -1440,8 +1432,8 @@ msgid "" "def hash_complex(z):\n" " \"\"\"Compute the hash of a complex number z.\"\"\"\n" "\n" -" hash_value = hash_float(z.real) + sys.hash_info.imag * " -"hash_float(z.imag)\n" +" hash_value = hash_float(z.real) + sys.hash_info.imag * hash_float(z." +"imag)\n" " # do a signed reduction modulo 2**sys.hash_info.width\n" " M = 2**(sys.hash_info.width - 1)\n" " hash_value = (hash_value & (M - 1)) - (hash_value & M)\n" @@ -1517,8 +1509,8 @@ msgstr "" #: ../../library/stdtypes.rst:900 msgid "" -"One method needs to be defined for container objects to " -"provide :term:`iterable` support:" +"One method needs to be defined for container objects to provide :term:" +"`iterable` support:" msgstr "" "需要為容器物件定義一個 method 來提供\\ :term:`可疊代物件 `\\ 支援:" @@ -1529,15 +1521,15 @@ msgid "" "of iteration, additional methods can be provided to specifically request " "iterators for those iteration types. (An example of an object supporting " "multiple forms of iteration would be a tree structure which supports both " -"breadth-first and depth-first traversal.) This method corresponds to " -"the :c:member:`~PyTypeObject.tp_iter` slot of the type structure for Python " -"objects in the Python/C API." +"breadth-first and depth-first traversal.) This method corresponds to the :c:" +"member:`~PyTypeObject.tp_iter` slot of the type structure for Python objects " +"in the Python/C API." msgstr "" "回傳一個\\ :term:`疊代器 `\\ 物件。該物件需要支援下述的疊代器協定。" "如果一個容器支援不同型別的疊代,則可以提供額外的 methods 來專門請求這些疊代型" "別的疊代器。(支援多種形式疊代的物件的一個例子是支援廣度優先和深度優先遍歷的" -"樹結構。)此 method 對應 Python/C API 中 Python 物件的型別結構" -"的 :c:member:`~PyTypeObject.tp_iter` 插槽。" +"樹結構。)此 method 對應 Python/C API 中 Python 物件的型別結構的 :c:member:" +"`~PyTypeObject.tp_iter` 插槽。" #: ../../library/stdtypes.rst:916 msgid "" @@ -1549,10 +1541,9 @@ msgstr "" #: ../../library/stdtypes.rst:922 msgid "" "Return the :term:`iterator` object itself. This is required to allow both " -"containers and iterators to be used with the :keyword:`for` " -"and :keyword:`in` statements. This method corresponds to " -"the :c:member:`~PyTypeObject.tp_iter` slot of the type structure for Python " -"objects in the Python/C API." +"containers and iterators to be used with the :keyword:`for` and :keyword:" +"`in` statements. This method corresponds to the :c:member:`~PyTypeObject." +"tp_iter` slot of the type structure for Python objects in the Python/C API." msgstr "" "回傳\\ :term:`疊代器 `\\ 物件本身。這是為了允許容器和疊代器都可以" "與 :keyword:`for` 和 :keyword:`in` 在陳述式中使用。此 method 對應於 Python/C " @@ -1565,9 +1556,9 @@ msgid "" "the :c:member:`~PyTypeObject.tp_iternext` slot of the type structure for " "Python objects in the Python/C API." msgstr "" -"從\\ :term:`疊代器 `\\ 回傳下一個項目。如果沒有更多項目,則引" -"發 :exc:`StopIteration` 例外。此 method 對應於 Python/C API 中Python 物件的型" -"別結構的 :c:member:`~PyTypeObject.tp_iternext` 插槽。" +"從\\ :term:`疊代器 `\\ 回傳下一個項目。如果沒有更多項目,則引發 :" +"exc:`StopIteration` 例外。此 method 對應於 Python/C API 中Python 物件的型別結" +"構的 :c:member:`~PyTypeObject.tp_iternext` 插槽。" #: ../../library/stdtypes.rst:936 msgid "" @@ -1581,8 +1572,8 @@ msgstr "" #: ../../library/stdtypes.rst:941 msgid "" -"Once an iterator's :meth:`~iterator.__next__` method " -"raises :exc:`StopIteration`, it must continue to do so on subsequent calls. " +"Once an iterator's :meth:`~iterator.__next__` method raises :exc:" +"`StopIteration`, it must continue to do so on subsequent calls. " "Implementations that do not obey this property are deemed broken." msgstr "" "一旦疊代器的 :meth:`~iterator.__next__` method 引發 :exc:`StopIteration`,則" @@ -1597,10 +1588,10 @@ msgid "" "Python's :term:`generator`\\s provide a convenient way to implement the " "iterator protocol. If a container object's :meth:`~object.__iter__` method " "is implemented as a generator, it will automatically return an iterator " -"object (technically, a generator object) supplying " -"the :meth:`~iterator.__iter__` and :meth:`~generator.__next__` methods. More " -"information about generators can be found in :ref:`the documentation for the " -"yield expression `." +"object (technically, a generator object) supplying the :meth:`~iterator." +"__iter__` and :meth:`~generator.__next__` methods. More information about " +"generators can be found in :ref:`the documentation for the yield expression " +"`." msgstr "" #: ../../library/stdtypes.rst:963 @@ -1756,9 +1747,9 @@ msgstr "" msgid "" "Forward and reversed iterators over mutable sequences access values using an " "index. That index will continue to march forward (or backward) even if the " -"underlying sequence is mutated. The iterator terminates only when " -"an :exc:`IndexError` or a :exc:`StopIteration` is encountered (or when the " -"index drops below zero)." +"underlying sequence is mutated. The iterator terminates only when an :exc:" +"`IndexError` or a :exc:`StopIteration` is encountered (or when the index " +"drops below zero)." msgstr "" #: ../../library/stdtypes.rst:1052 @@ -1870,17 +1861,17 @@ msgstr "" #: ../../library/stdtypes.rst:1117 msgid "" -"if concatenating :class:`str` objects, you can build a list and " -"use :meth:`str.join` at the end or else write to an :class:`io.StringIO` " -"instance and retrieve its value when complete" +"if concatenating :class:`str` objects, you can build a list and use :meth:" +"`str.join` at the end or else write to an :class:`io.StringIO` instance and " +"retrieve its value when complete" msgstr "" #: ../../library/stdtypes.rst:1121 msgid "" -"if concatenating :class:`bytes` objects, you can similarly " -"use :meth:`bytes.join` or :class:`io.BytesIO`, or you can do in-place " -"concatenation with a :class:`bytearray` object. :class:`bytearray` objects " -"are mutable and have an efficient overallocation mechanism" +"if concatenating :class:`bytes` objects, you can similarly use :meth:`bytes." +"join` or :class:`io.BytesIO`, or you can do in-place concatenation with a :" +"class:`bytearray` object. :class:`bytearray` objects are mutable and have " +"an efficient overallocation mechanism" msgstr "" #: ../../library/stdtypes.rst:1126 @@ -1942,15 +1933,15 @@ msgstr "不可變序列型別" #: ../../library/stdtypes.rst:1184 msgid "" "The only operation that immutable sequence types generally implement that is " -"not also implemented by mutable sequence types is support for " -"the :func:`hash` built-in." +"not also implemented by mutable sequence types is support for the :func:" +"`hash` built-in." msgstr "" #: ../../library/stdtypes.rst:1188 msgid "" "This support allows immutable sequences, such as :class:`tuple` instances, " -"to be used as :class:`dict` keys and stored in :class:`set` " -"and :class:`frozenset` instances." +"to be used as :class:`dict` keys and stored in :class:`set` and :class:" +"`frozenset` instances." msgstr "" #: ../../library/stdtypes.rst:1192 @@ -2054,11 +2045,10 @@ msgstr "" #: ../../library/stdtypes.rst:1260 msgid "" -"The value *n* is an integer, or an object " -"implementing :meth:`~object.__index__`. Zero and negative values of *n* " -"clear the sequence. Items in the sequence are not copied; they are " -"referenced multiple times, as explained for ``s * n`` under :ref:`typesseq-" -"common`." +"The value *n* is an integer, or an object implementing :meth:`~object." +"__index__`. Zero and negative values of *n* clear the sequence. Items in " +"the sequence are not copied; they are referenced multiple times, as " +"explained for ``s * n`` under :ref:`typesseq-common`." msgstr "" #: ../../library/stdtypes.rst:1266 @@ -2089,9 +2079,9 @@ msgstr "建立 *sequence* 的淺層複製,這和 ``sequence[:]`` 相同。" #: ../../library/stdtypes.rst:1303 msgid "" -"The :meth:`!copy` method is not part of " -"the :class:`~collections.abc.MutableSequence` :class:`~abc.ABC`, but most " -"concrete mutable sequence types provide it." +"The :meth:`!copy` method is not part of the :class:`~collections.abc." +"MutableSequence` :class:`~abc.ABC`, but most concrete mutable sequence types " +"provide it." msgstr "" #: ../../library/stdtypes.rst:1314 @@ -2189,8 +2179,8 @@ msgstr "" #: ../../library/stdtypes.rst:1404 msgid "" -":meth:`sort` accepts two arguments that can only be passed by keyword " -"(:ref:`keyword-only arguments `):" +":meth:`sort` accepts two arguments that can only be passed by keyword (:ref:" +"`keyword-only arguments `):" msgstr "" #: ../../library/stdtypes.rst:1407 @@ -2252,8 +2242,8 @@ msgid "" "Tuples are immutable sequences, typically used to store collections of " "heterogeneous data (such as the 2-tuples produced by the :func:`enumerate` " "built-in). Tuples are also used for cases where an immutable sequence of " -"homogeneous data is needed (such as allowing storage in a :class:`set` " -"or :class:`dict` instance)." +"homogeneous data is needed (such as allowing storage in a :class:`set` or :" +"class:`dict` instance)." msgstr "" #: ../../library/stdtypes.rst:1455 @@ -2321,8 +2311,8 @@ msgstr "" #: ../../library/stdtypes.rst:1498 msgid "" -"The arguments to the range constructor must be integers (either built-" -"in :class:`int` or any object that implements the :meth:`~object.__index__` " +"The arguments to the range constructor must be integers (either built-in :" +"class:`int` or any object that implements the :meth:`~object.__index__` " "special method). If the *step* argument is omitted, it defaults to ``1``. " "If the *start* argument is omitted, it defaults to ``0``. If *step* is " "zero, :exc:`ValueError` is raised." @@ -2351,8 +2341,8 @@ msgstr "" #: ../../library/stdtypes.rst:1517 msgid "" "Ranges containing absolute values larger than :data:`sys.maxsize` are " -"permitted but some features (such as :func:`len`) may " -"raise :exc:`OverflowError`." +"permitted but some features (such as :func:`len`) may raise :exc:" +"`OverflowError`." msgstr "" #: ../../library/stdtypes.rst:1521 @@ -2417,8 +2407,8 @@ msgstr "" #: ../../library/stdtypes.rst:1557 msgid "" -"The advantage of the :class:`range` type over a regular :class:`list` " -"or :class:`tuple` is that a :class:`range` object will always take the same " +"The advantage of the :class:`range` type over a regular :class:`list` or :" +"class:`tuple` is that a :class:`range` object will always take the same " "(small) amount of memory, no matter the size of the range it represents (as " "it only stores the ``start``, ``stop`` and ``step`` values, calculating " "individual items and subranges as needed)." @@ -2443,9 +2433,9 @@ msgstr "" #: ../../library/stdtypes.rst:1590 msgid "" -"Implement the Sequence ABC. Support slicing and negative indices. " -"Test :class:`int` objects for membership in constant time instead of " -"iterating through all items." +"Implement the Sequence ABC. Support slicing and negative indices. Test :" +"class:`int` objects for membership in constant time instead of iterating " +"through all items." msgstr "" #: ../../library/stdtypes.rst:1596 @@ -2851,9 +2841,9 @@ msgstr "" #: ../../library/stdtypes.rst:1714 msgid "" -"Textual data in Python is handled with :class:`str` objects, " -"or :dfn:`strings`. Strings are immutable :ref:`sequences ` of " -"Unicode code points. String literals are written in a variety of ways:" +"Textual data in Python is handled with :class:`str` objects, or :dfn:" +"`strings`. Strings are immutable :ref:`sequences ` of Unicode code " +"points. String literals are written in a variety of ways:" msgstr "" #: ../../library/stdtypes.rst:1719 @@ -2904,9 +2894,9 @@ msgstr "" #: ../../library/stdtypes.rst:1743 msgid "" -"There is also no mutable string type, but :meth:`str.join` " -"or :class:`io.StringIO` can be used to efficiently construct strings from " -"multiple fragments." +"There is also no mutable string type, but :meth:`str.join` or :class:`io." +"StringIO` can be used to efficiently construct strings from multiple " +"fragments." msgstr "" #: ../../library/stdtypes.rst:1747 @@ -2925,24 +2915,24 @@ msgstr "" #: ../../library/stdtypes.rst:1765 msgid "" -"If neither *encoding* nor *errors* is given, ``str(object)`` " -"returns :meth:`type(object).__str__(object) `, which is the " -"\"informal\" or nicely printable string representation of *object*. For " -"string objects, this is the string itself. If *object* does not have " -"a :meth:`~object.__str__` method, then :func:`str` falls back to " -"returning :func:`repr(object) `." +"If neither *encoding* nor *errors* is given, ``str(object)`` returns :meth:" +"`type(object).__str__(object) `, which is the \"informal\" " +"or nicely printable string representation of *object*. For string objects, " +"this is the string itself. If *object* does not have a :meth:`~object." +"__str__` method, then :func:`str` falls back to returning :func:" +"`repr(object) `." msgstr "" #: ../../library/stdtypes.rst:1777 msgid "" -"If at least one of *encoding* or *errors* is given, *object* should be " -"a :term:`bytes-like object` (e.g. :class:`bytes` or :class:`bytearray`). In " +"If at least one of *encoding* or *errors* is given, *object* should be a :" +"term:`bytes-like object` (e.g. :class:`bytes` or :class:`bytearray`). In " "this case, if *object* is a :class:`bytes` (or :class:`bytearray`) object, " -"then ``str(bytes, encoding, errors)`` is equivalent " -"to :meth:`bytes.decode(encoding, errors) `. Otherwise, the " -"bytes object underlying the buffer object is obtained before " -"calling :meth:`bytes.decode`. See :ref:`binaryseq` and :ref:`bufferobjects` " -"for information on buffer objects." +"then ``str(bytes, encoding, errors)`` is equivalent to :meth:`bytes." +"decode(encoding, errors) `. Otherwise, the bytes object " +"underlying the buffer object is obtained before calling :meth:`bytes." +"decode`. See :ref:`binaryseq` and :ref:`bufferobjects` for information on " +"buffer objects." msgstr "" #: ../../library/stdtypes.rst:1786 @@ -2963,10 +2953,10 @@ msgstr "" #: ../../library/stdtypes.rst:1794 msgid "" -"For more information on the ``str`` class and its methods, " -"see :ref:`textseq` and the :ref:`string-methods` section below. To output " -"formatted strings, see the :ref:`f-strings` and :ref:`formatstrings` " -"sections. In addition, see the :ref:`stringservices` section." +"For more information on the ``str`` class and its methods, see :ref:" +"`textseq` and the :ref:`string-methods` section below. To output formatted " +"strings, see the :ref:`f-strings` and :ref:`formatstrings` sections. In " +"addition, see the :ref:`stringservices` section." msgstr "" #: ../../library/stdtypes.rst:1806 @@ -2982,11 +2972,11 @@ msgstr "" #: ../../library/stdtypes.rst:1814 msgid "" "Strings also support two styles of string formatting, one providing a large " -"degree of flexibility and customization " -"(see :meth:`str.format`, :ref:`formatstrings` and :ref:`string-formatting`) " -"and the other based on C ``printf`` style formatting that handles a narrower " -"range of types and is slightly harder to use correctly, but is often faster " -"for the cases it can handle (:ref:`old-string-formatting`)." +"degree of flexibility and customization (see :meth:`str.format`, :ref:" +"`formatstrings` and :ref:`string-formatting`) and the other based on C " +"``printf`` style formatting that handles a narrower range of types and is " +"slightly harder to use correctly, but is often faster for the cases it can " +"handle (:ref:`old-string-formatting`)." msgstr "" #: ../../library/stdtypes.rst:1821 @@ -3020,8 +3010,8 @@ msgid "" "Casefolding is similar to lowercasing but more aggressive because it is " "intended to remove all case distinctions in a string. For example, the " "German lowercase letter ``'ß'`` is equivalent to ``\"ss\"``. Since it is " -"already lowercase, :meth:`lower` would do nothing to " -"``'ß'``; :meth:`casefold` converts it to ``\"ss\"``." +"already lowercase, :meth:`lower` would do nothing to ``'ß'``; :meth:" +"`casefold` converts it to ``\"ss\"``." msgstr "" #: ../../library/stdtypes.rst:1846 @@ -3106,15 +3096,15 @@ msgid "" "*errors* controls how encoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " "are ``'ignore'``, ``'replace'``, ``'xmlcharrefreplace'``, " -"``'backslashreplace'`` and any other name registered " -"via :func:`codecs.register_error`. See :ref:`error-handlers` for details." +"``'backslashreplace'`` and any other name registered via :func:`codecs." +"register_error`. See :ref:`error-handlers` for details." msgstr "" #: ../../library/stdtypes.rst:1901 msgid "" "For performance reasons, the value of *errors* is not checked for validity " -"unless an encoding error actually occurs, :ref:`devmode` is enabled or " -"a :ref:`debug build ` is used. For example::" +"unless an encoding error actually occurs, :ref:`devmode` is enabled or a :" +"ref:`debug build ` is used. For example::" msgstr "" #: ../../library/stdtypes.rst:1907 @@ -3137,8 +3127,8 @@ msgstr "新增關鍵字引數的支援。" #: ../../library/stdtypes.rst:1917 ../../library/stdtypes.rst:3299 msgid "" -"The value of the *errors* argument is now checked in :ref:`devmode` and " -"in :ref:`debug mode `." +"The value of the *errors* argument is now checked in :ref:`devmode` and in :" +"ref:`debug mode `." msgstr "" #: ../../library/stdtypes.rst:1924 @@ -3235,8 +3225,8 @@ msgstr "另請參閱 :meth:`rfind` 和 :meth:`index`。" #: ../../library/stdtypes.rst:1982 msgid "" "The :meth:`~str.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::" +"position of *sub*. To check if *sub* is a substring or not, use the :" +"keyword:`in` operator::" msgstr "" #: ../../library/stdtypes.rst:1986 @@ -3265,14 +3255,13 @@ msgstr "" #: ../../library/stdtypes.rst:2006 msgid "" -"When formatting a number " -"(:class:`int`, :class:`float`, :class:`complex`, :class:`decimal.Decimal` " -"and subclasses) with the ``n`` type (ex: ``'{:n}'.format(1234)``), the " -"function temporarily sets the ``LC_CTYPE`` locale to the ``LC_NUMERIC`` " -"locale to decode ``decimal_point`` and ``thousands_sep`` fields " -"of :c:func:`localeconv` if they are non-ASCII or longer than 1 byte, and the " -"``LC_NUMERIC`` locale is different than the ``LC_CTYPE`` locale. This " -"temporary change affects other threads." +"When formatting a number (:class:`int`, :class:`float`, :class:`complex`, :" +"class:`decimal.Decimal` and subclasses) with the ``n`` type (ex: ``'{:n}'." +"format(1234)``), the function temporarily sets the ``LC_CTYPE`` locale to " +"the ``LC_NUMERIC`` locale to decode ``decimal_point`` and ``thousands_sep`` " +"fields of :c:func:`localeconv` if they are non-ASCII or longer than 1 byte, " +"and the ``LC_NUMERIC`` locale is different than the ``LC_CTYPE`` locale. " +"This temporary change affects other threads." msgstr "" #: ../../library/stdtypes.rst:2015 @@ -3298,16 +3287,16 @@ msgstr "" msgid "" "Return ``True`` if all characters in the string are alphanumeric and there " "is at least one character, ``False`` otherwise. A character ``c`` is " -"alphanumeric if one of the following returns ``True``: ``c.isalpha()``, " -"``c.isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." +"alphanumeric if one of the following returns ``True``: ``c.isalpha()``, ``c." +"isdecimal()``, ``c.isdigit()``, or ``c.isnumeric()``." msgstr "" #: ../../library/stdtypes.rst:2053 msgid "" "Return ``True`` if all characters in the string are alphabetic and there is " "at least one character, ``False`` otherwise. Alphabetic characters are " -"those characters defined in the Unicode character database as \"Letter\", " -"i.e., those with general category property being one of \"Lm\", \"Lt\", " +"those characters defined in the Unicode character database as \"Letter\", i." +"e., those with general category property being one of \"Lm\", \"Lt\", " "\"Lu\", \"Ll\", or \"Lo\". Note that this is different from the `Alphabetic " "property defined in the section 4.10 'Letters, Alphabetic, and Ideographic' " "of the Unicode Standard ` to access the memory of other " -"binary objects without needing to make a copy." +"The core built-in types for manipulating binary data are :class:`bytes` and :" +"class:`bytearray`. They are supported by :class:`memoryview` which uses the :" +"ref:`buffer protocol ` to access the memory of other binary " +"objects without needing to make a copy." msgstr "" #: ../../library/stdtypes.rst:2946 @@ -5124,22 +5112,22 @@ msgstr "" msgid "" "*errors* controls how decoding errors are handled. If ``'strict'`` (the " "default), a :exc:`UnicodeError` exception is raised. Other possible values " -"are ``'ignore'``, ``'replace'``, and any other name registered " -"via :func:`codecs.register_error`. See :ref:`error-handlers` for details." +"are ``'ignore'``, ``'replace'``, and any other name registered via :func:" +"`codecs.register_error`. See :ref:`error-handlers` for details." msgstr "" #: ../../library/stdtypes.rst:3286 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." +"unless a decoding error actually occurs, :ref:`devmode` is enabled or a :ref:" +"`debug build ` is used." msgstr "" #: ../../library/stdtypes.rst:3292 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." +"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:3307 @@ -5165,8 +5153,8 @@ msgstr "" #: ../../library/stdtypes.rst:3328 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::" +"position of *sub*. To check if *sub* is a substring or not, use the :" +"keyword:`in` operator::" msgstr "" #: ../../library/stdtypes.rst:3332 @@ -5195,10 +5183,10 @@ msgstr "" #: ../../library/stdtypes.rst:3366 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 same position in *to*; *from* and *to* must both " -"be :term:`bytes-like objects ` and have the same length." +"This static method returns a translation table usable for :meth:`bytes." +"translate` that will map each character in *from* into the character at the " +"same position in *to*; *from* and *to* must both be :term:`bytes-like " +"objects ` and have the same length." msgstr "" #: ../../library/stdtypes.rst:3377 @@ -5760,10 +5748,10 @@ msgstr "" #: ../../library/stdtypes.rst:3894 msgid "" -"Unlike :func:`str.swapcase`, it is always the case that " -"``bin.swapcase().swapcase() == bin`` for the binary versions. Case " -"conversions are symmetrical in ASCII, even though that is not generally true " -"for arbitrary Unicode code points." +"Unlike :func:`str.swapcase`, it is always the case that ``bin.swapcase()." +"swapcase() == bin`` for the binary versions. Case conversions are " +"symmetrical in ASCII, even though that is not generally true for arbitrary " +"Unicode code points." msgstr "" #: ../../library/stdtypes.rst:3908 @@ -5877,8 +5865,8 @@ msgid "" "the ``%`` operator (modulo). This is also known as the bytes *formatting* or " "*interpolation* operator. Given ``format % values`` (where *format* is a " "bytes object), ``%`` conversion specifications in *format* are replaced with " -"zero or more elements of *values*. The effect is similar to using " -"the :c:func:`sprintf` in the C language." +"zero or more elements of *values*. The effect is similar to using the :c:" +"func:`sprintf` in the C language." msgstr "" #: ../../library/stdtypes.rst:4023 @@ -6138,8 +6126,8 @@ msgstr "" #: ../../library/stdtypes.rst:4299 msgid "" -"memoryview is now registered automatically " -"with :class:`collections.abc.Sequence`" +"memoryview is now registered automatically with :class:`collections.abc." +"Sequence`" msgstr "" #: ../../library/stdtypes.rst:4303 @@ -6163,9 +6151,8 @@ msgstr "" #: ../../library/stdtypes.rst:4317 msgid "" -"For the subset of :mod:`struct` format strings currently supported " -"by :meth:`tolist`, ``v`` and ``w`` are equal if ``v.tolist() == " -"w.tolist()``::" +"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:4320 @@ -6331,8 +6318,8 @@ msgstr "" #: ../../library/stdtypes.rst:4411 msgid "" -":meth:`tolist` now supports all single character native formats " -"in :mod:`struct` module syntax as well as multi-dimensional representations." +":meth:`tolist` now supports all single character native formats in :mod:" +"`struct` module syntax as well as multi-dimensional representations." msgstr "" #: ../../library/stdtypes.rst:4418 @@ -6370,8 +6357,8 @@ msgstr "" #: ../../library/stdtypes.rst:4437 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 :class:`bytearray` would temporarily forbid resizing); therefore, calling " +"objects take special actions when a view is held on them (for example, a :" +"class:`bytearray` would temporarily forbid resizing); therefore, calling " "release() is handy to remove these restrictions (and free any dangling " "resources) as soon as possible." msgstr "" @@ -6436,10 +6423,10 @@ msgstr "" #: ../../library/stdtypes.rst:4477 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 'c'). The byte length of the result must be the same as the original " -"length. Note that all byte lengths may depend on the operating system." +"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 " +"'c'). The byte length of the result must be the same as the original length. " +"Note that all byte lengths may depend on the operating system." msgstr "" #: ../../library/stdtypes.rst:4483 @@ -6793,8 +6780,8 @@ msgid "" "objects. Common uses include membership testing, removing duplicates from a " "sequence, and computing mathematical operations such as intersection, union, " "difference, and symmetric difference. (For other containers see the built-" -"in :class:`dict`, :class:`list`, and :class:`tuple` classes, and " -"the :mod:`collections` module.)" +"in :class:`dict`, :class:`list`, and :class:`tuple` classes, and the :mod:" +"`collections` module.)" msgstr "" #: ../../library/stdtypes.rst:4712 @@ -6807,10 +6794,10 @@ msgstr "" #: ../../library/stdtypes.rst:4717 msgid "" -"There are currently two built-in set types, :class:`set` " -"and :class:`frozenset`. The :class:`set` type is mutable --- the contents " -"can be changed using methods like :meth:`~set.add` and :meth:`~set.remove`. " -"Since it is mutable, it has no hash value and cannot be used as either a " +"There are currently two built-in set types, :class:`set` and :class:" +"`frozenset`. The :class:`set` type is mutable --- the contents can be " +"changed using methods like :meth:`~set.add` and :meth:`~set.remove`. Since " +"it is mutable, it has no hash value and cannot be used as either a " "dictionary key or as an element of another set. The :class:`frozenset` type " "is immutable and :term:`hashable` --- its contents cannot be altered after " "it is created; it can therefore be used as a dictionary key or as an element " @@ -6923,12 +6910,12 @@ msgstr "" #: ../../library/stdtypes.rst:4811 msgid "" -"Note, the non-operator versions " -"of :meth:`union`, :meth:`intersection`, :meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, " -"and :meth:`issuperset` methods will accept any iterable as an argument. In " -"contrast, their operator based counterparts require their arguments to be " -"sets. This precludes error-prone constructions like ``set('abc') & 'cbs'`` " -"in favor of the more readable ``set('abc').intersection('cbs')``." +"Note, the non-operator versions of :meth:`union`, :meth:`intersection`, :" +"meth:`difference`, :meth:`symmetric_difference`, :meth:`issubset`, and :meth:" +"`issuperset` methods will accept any iterable as an argument. In contrast, " +"their operator based counterparts require their arguments to be sets. This " +"precludes error-prone constructions like ``set('abc') & 'cbs'`` in favor of " +"the more readable ``set('abc').intersection('cbs')``." msgstr "" #: ../../library/stdtypes.rst:4818 @@ -7022,18 +7009,17 @@ msgstr "從集合中移除所有元素。" #: ../../library/stdtypes.rst:4889 msgid "" -"Note, the non-operator versions of " -"the :meth:`update`, :meth:`intersection_update`, :meth:`difference_update`, " -"and :meth:`symmetric_difference_update` methods will accept any iterable as " -"an argument." +"Note, the non-operator versions of the :meth:`update`, :meth:" +"`intersection_update`, :meth:`difference_update`, and :meth:" +"`symmetric_difference_update` methods will accept any iterable as an " +"argument." msgstr "" #: ../../library/stdtypes.rst:4894 msgid "" -"Note, the *elem* argument to " -"the :meth:`~object.__contains__`, :meth:`remove`, and :meth:`discard` " -"methods may be a set. To support searching for an equivalent frozenset, a " -"temporary one is created from *elem*." +"Note, the *elem* argument to the :meth:`~object.__contains__`, :meth:" +"`remove`, and :meth:`discard` methods may be a set. To support searching " +"for an equivalent frozenset, a temporary one is created from *elem*." msgstr "" #: ../../library/stdtypes.rst:4903 @@ -7044,19 +7030,18 @@ msgstr "" msgid "" "A :term:`mapping` object maps :term:`hashable` values to arbitrary objects. " "Mappings are mutable objects. There is currently only one standard mapping " -"type, the :dfn:`dictionary`. (For other containers see the built-" -"in :class:`list`, :class:`set`, and :class:`tuple` classes, and " -"the :mod:`collections` module.)" +"type, the :dfn:`dictionary`. (For other containers see the built-in :class:" +"`list`, :class:`set`, and :class:`tuple` classes, and the :mod:`collections` " +"module.)" msgstr "" #: ../../library/stdtypes.rst:4919 msgid "" -"A dictionary's keys are *almost* arbitrary values. Values that are " -"not :term:`hashable`, that is, values containing lists, dictionaries or " -"other mutable types (that are compared by value rather than by object " -"identity) may not be used as keys. Values that compare equal (such as ``1``, " -"``1.0``, and ``True``) can be used interchangeably to index the same " -"dictionary entry." +"A dictionary's keys are *almost* arbitrary values. Values that are not :" +"term:`hashable`, that is, values containing lists, dictionaries or other " +"mutable types (that are compared by value rather than by object identity) " +"may not be used as keys. Values that compare equal (such as ``1``, ``1.0``, " +"and ``True``) can be used interchangeably to index the same dictionary entry." msgstr "" #: ../../library/stdtypes.rst:4930 @@ -7211,10 +7196,9 @@ msgid "" "is not present, the ``d[key]`` operation calls that method with the key " "*key* as argument. The ``d[key]`` operation then returns or raises whatever " "is returned or raised by the ``__missing__(key)`` call. No other operations " -"or methods invoke :meth:`~object.__missing__`. " -"If :meth:`~object.__missing__` is not defined, :exc:`KeyError` is " -"raised. :meth:`~object.__missing__` must be a method; it cannot be an " -"instance variable::" +"or methods invoke :meth:`~object.__missing__`. If :meth:`~object." +"__missing__` is not defined, :exc:`KeyError` is raised. :meth:`~object." +"__missing__` must be a method; it cannot be an instance variable::" msgstr "" #: ../../library/stdtypes.rst:5025 @@ -7243,9 +7227,9 @@ msgstr "" #: ../../library/stdtypes.rst:5036 msgid "" -"The example above shows part of the implementation " -"of :class:`collections.Counter`. A different :meth:`!__missing__` method is " -"used by :class:`collections.defaultdict`." +"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:5043 @@ -7316,8 +7300,8 @@ msgstr "" #: ../../library/stdtypes.rst:5100 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." +"*default*. If *default* is not given and *key* is not in the dictionary, a :" +"exc:`KeyError` is raised." msgstr "" #: ../../library/stdtypes.rst:5106 @@ -7329,8 +7313,8 @@ msgstr "" #: ../../library/stdtypes.rst:5109 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`." +"often used in set algorithms. If the dictionary is empty, calling :meth:" +"`popitem` raises a :exc:`KeyError`." msgstr "" #: ../../library/stdtypes.rst:5113 @@ -7435,8 +7419,8 @@ msgstr "" #: ../../library/stdtypes.rst:5189 msgid "" -":class:`types.MappingProxyType` can be used to create a read-only view of " -"a :class:`dict`." +":class:`types.MappingProxyType` can be used to create a read-only view of a :" +"class:`dict`." msgstr "" #: ../../library/stdtypes.rst:5196 @@ -7445,10 +7429,10 @@ msgstr "字典視圖物件" #: ../../library/stdtypes.rst:5198 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 dictionary's entries, which means that when the dictionary changes, the " -"view reflects these changes." +"The objects returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:" +"`dict.items` are *view objects*. They provide a dynamic view on the " +"dictionary's entries, which means that when the dictionary changes, the view " +"reflects these changes." msgstr "" #: ../../library/stdtypes.rst:5203 @@ -7470,9 +7454,9 @@ msgstr "" #: ../../library/stdtypes.rst:5215 msgid "" "Keys and values are iterated over in insertion order. This allows the " -"creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = " -"zip(d.values(), d.keys())``. Another way to create the same list is ``pairs " -"= [(v, k) for (k, v) in d.items()]``." +"creation of ``(value, key)`` pairs using :func:`zip`: ``pairs = zip(d." +"values(), d.keys())``. Another way to create the same list is ``pairs = " +"[(v, k) for (k, v) in d.items()]``." msgstr "" #: ../../library/stdtypes.rst:5220 @@ -7595,9 +7579,8 @@ msgstr "" #: ../../library/stdtypes.rst:5322 msgid "" "An example of a context manager that returns itself is a :term:`file " -"object`. File objects return themselves from __enter__() to " -"allow :func:`open` to be used as the context expression in a :keyword:`with` " -"statement." +"object`. File objects return themselves from __enter__() to allow :func:" +"`open` to be used as the context expression in a :keyword:`with` statement." msgstr "" "一個會回傳自己的情境管理器範例是 :term:`file object`。檔案物件從 __enter__() " "回傳自己,以允許將 :func:`open` 用作 :keyword:`with` 陳述式中的情境運算式。" @@ -7624,8 +7607,8 @@ msgid "" "the exception type, value and traceback information. Otherwise, all three " "arguments are ``None``." msgstr "" -"退出 runtime 情境並回傳布林旗標以表示是否應抑制曾發生的任何例外。如果在執" -"行 :keyword:`with` 陳述式主體時發生例外,則引數包含例外型別、值和回溯 " +"退出 runtime 情境並回傳布林旗標以表示是否應抑制曾發生的任何例外。如果在執行 :" +"keyword:`with` 陳述式主體時發生例外,則引數包含例外型別、值和回溯 " "(traceback) 資訊。否則,所有三個引數都是 ``None``。" #: ../../library/stdtypes.rst:5341 @@ -7638,22 +7621,22 @@ msgid "" "replace any exception that occurred in the body of the :keyword:`!with` " "statement." msgstr "" -"從此方法回傳 true 值將導致 :keyword:`with` 陳述式抑制例外並繼續執行緊接" -"著 :keyword:`!with` 陳述式之後的陳述式。否則,該例外將在該方法執行完畢後繼續" -"傳播 (propagate)。執行此方法期間發生的例外會取代 :keyword:`!with` 陳述式主體" -"中發生的任何例外。" +"從此方法回傳 true 值將導致 :keyword:`with` 陳述式抑制例外並繼續執行緊接著 :" +"keyword:`!with` 陳述式之後的陳述式。否則,該例外將在該方法執行完畢後繼續傳播 " +"(propagate)。執行此方法期間發生的例外會取代 :keyword:`!with` 陳述式主體中發生" +"的任何例外。" #: ../../library/stdtypes.rst:5348 msgid "" "The exception passed in should never be reraised explicitly - instead, this " "method should return a false value to indicate that the method completed " "successfully and does not want to suppress the raised exception. This allows " -"context management code to easily detect whether or not " -"an :meth:`~object.__exit__` method has actually failed." +"context management code to easily detect whether or not an :meth:`~object." +"__exit__` method has actually failed." msgstr "" "傳入的例外不應明確重新引發 - 取而代之的是,此方法應回傳 false 值以指示該方法" -"已成功完成且不希望抑制引發的例外。這讓情境管理程式碼能輕鬆檢" -"測 :meth:`__exit__` 方法是否曾實際失敗過。" +"已成功完成且不希望抑制引發的例外。這讓情境管理程式碼能輕鬆檢測 :meth:" +"`__exit__` 方法是否曾實際失敗過。" #: ../../library/stdtypes.rst:5354 msgid "" @@ -7672,16 +7655,15 @@ msgid "" "Python's :term:`generator`\\s and the :class:`contextlib.contextmanager` " "decorator provide a convenient way to implement these protocols. If a " "generator function is decorated with the :class:`contextlib.contextmanager` " -"decorator, it will return a context manager implementing the " -"necessary :meth:`~contextmanager.__enter__` " -"and :meth:`~contextmanager.__exit__` methods, rather than the iterator " -"produced by an undecorated generator function." +"decorator, it will return a context manager implementing the necessary :meth:" +"`~contextmanager.__enter__` and :meth:`~contextmanager.__exit__` methods, " +"rather than the iterator produced by an undecorated generator function." msgstr "" "Python 的 :term:`generator` 和 :class:`contextlib.contextmanager` 裝飾器提供" -"了一種便捷的方法來實作這些協定。如果產生器函式" -"以 :class:`contextlib.contextmanager` 裝飾器裝飾,它將回傳一個有實作出需要" -"的 :meth:`~contextmanager.__enter__` 和 :meth:`~contextmanager.__exit__` 方法" -"的情境管理器,而不是由未裝飾產生器函式產生的疊代器。" +"了一種便捷的方法來實作這些協定。如果產生器函式以 :class:`contextlib." +"contextmanager` 裝飾器裝飾,它將回傳一個有實作出需要的 :meth:" +"`~contextmanager.__enter__` 和 :meth:`~contextmanager.__exit__` 方法的情境管" +"理器,而不是由未裝飾產生器函式產生的疊代器。" #: ../../library/stdtypes.rst:5367 msgid "" @@ -7697,16 +7679,16 @@ msgstr "" #: ../../library/stdtypes.rst:5375 msgid "" -"Type Annotation Types --- :ref:`Generic Alias `, :ref:`Union `" +"Type Annotation Types --- :ref:`Generic Alias `, :ref:" +"`Union `" msgstr "" -"型別註釋的型別 --- :ref:`泛型別名 (Generic Alias) `、:ref:`聯合 (Union) `" +"型別註釋的型別 --- :ref:`泛型別名 (Generic Alias) `、:" +"ref:`聯合 (Union) `" #: ../../library/stdtypes.rst:5380 msgid "" -"The core built-in types for :term:`type annotations ` " -"are :ref:`Generic Alias ` and :ref:`Union `." +"The core built-in types for :term:`type annotations ` are :ref:" +"`Generic Alias ` and :ref:`Union `." msgstr "" ":term:`型別註釋 ` 的核心內建型別是\\ :ref:`泛型別名 `\\ 和\\ :ref:`聯合 `。" @@ -7752,12 +7734,12 @@ 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 " "object contains. For example, ``set[bytes]`` can be used in type annotations " -"to signify a :class:`set` in which all the elements are of " -"type :class:`bytes`." +"to signify a :class:`set` in which all the elements are of type :class:" +"`bytes`." msgstr "" "對於一個容器類別,提供給該類別的\\ :ref:`下標 `\\ 引數可以代表" -"物件所包含元素的型別。例如 ``set[bytes]`` 可以用於型別註釋來表示一" -"個 :class:`set`,其中所有元素的型別都是 :class:`bytes`。" +"物件所包含元素的型別。例如 ``set[bytes]`` 可以用於型別註釋來表示一個 :class:" +"`set`,其中所有元素的型別都是 :class:`bytes`。" #: ../../library/stdtypes.rst:5415 msgid "" @@ -7786,8 +7768,8 @@ msgstr "" #: ../../library/stdtypes.rst:5427 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.group(0)`` and ``y[0]`` will both be of type :class:`bytes`. In type " +"``y`` will also be an instance of ``re.Match``, but the return values of ``y." +"group(0)`` and ``y[0]`` will both be of type :class:`bytes`. In type " "annotations, we would represent this variety of :ref:`re.Match ` objects with ``re.Match[bytes]``." msgstr "" @@ -7798,9 +7780,9 @@ msgstr "" #: ../../library/stdtypes.rst:5433 msgid "" -"``GenericAlias`` objects are instances of the " -"class :class:`types.GenericAlias`, which can also be used to create " -"``GenericAlias`` objects directly." +"``GenericAlias`` objects are instances of the class :class:`types." +"GenericAlias`, which can also be used to create ``GenericAlias`` objects " +"directly." msgstr "" "``GenericAlias`` 物件是 :class:`types.GenericAlias` 類別的實例,也可以用來直" "接建立 ``GenericAlias`` 物件。" @@ -7812,8 +7794,8 @@ msgid "" "expecting a :class:`list` containing :class:`float` elements::" msgstr "" "建立一個 ``GenericAlias`` 來表示一個型別 ``T``,其以型別 *X*、*Y* 等(取決於" -"所使用的 ``T``)來參數化。例如,一個函式需要一個包含 :class:`float` 元素" -"的 :class:`list`: ::" +"所使用的 ``T``)來參數化。例如,一個函式需要一個包含 :class:`float` 元素的 :" +"class:`list`: ::" #: ../../library/stdtypes.rst:5444 msgid "" @@ -7933,8 +7915,8 @@ msgid "" "The :meth:`~object.__getitem__` method of generic containers will raise an " "exception to disallow mistakes like ``dict[str][str]``::" msgstr "" -"為防止像是 ``dict[str][str]`` 的錯誤出現,泛型容器" -"的 :meth:`~object.__getitem__` 方法會在這種情況下引發例外: ::" +"為防止像是 ``dict[str][str]`` 的錯誤出現,泛型容器的 :meth:`~object." +"__getitem__` 方法會在這種情況下引發例外: ::" #: ../../library/stdtypes.rst:5495 msgid "" @@ -7955,8 +7937,8 @@ msgid "" "items in the ``GenericAlias`` object's :attr:`~genericalias.__args__`. ::" msgstr "" "然而當使用\\ :ref:`型別變數 (type variable) ` 時,此類運算式是有效" -"的。索引的元素數量必須與 ``GenericAlias`` 物件" -"的 :attr:`~genericalias.__args__` 中的型別變數項目一樣多: ::" +"的。索引的元素數量必須與 ``GenericAlias`` 物件的 :attr:`~genericalias." +"__args__` 中的型別變數項目一樣多: ::" #: ../../library/stdtypes.rst:5504 msgid "" @@ -8105,114 +8087,118 @@ msgid ":class:`collections.abc.MutableSequence`" msgstr ":class:`collections.abc.MutableSequence`" #: ../../library/stdtypes.rst:5547 +msgid ":class:`collections.abc.ByteString`" +msgstr ":class:`collections.abc.ByteString`" + +#: ../../library/stdtypes.rst:5548 msgid ":class:`collections.abc.MappingView`" msgstr ":class:`collections.abc.MappingView`" -#: ../../library/stdtypes.rst:5548 +#: ../../library/stdtypes.rst:5549 msgid ":class:`collections.abc.KeysView`" msgstr ":class:`collections.abc.KeysView`" -#: ../../library/stdtypes.rst:5549 +#: ../../library/stdtypes.rst:5550 msgid ":class:`collections.abc.ItemsView`" msgstr ":class:`collections.abc.ItemsView`" -#: ../../library/stdtypes.rst:5550 +#: ../../library/stdtypes.rst:5551 msgid ":class:`collections.abc.ValuesView`" msgstr ":class:`collections.abc.ValuesView`" -#: ../../library/stdtypes.rst:5551 +#: ../../library/stdtypes.rst:5552 msgid ":class:`contextlib.AbstractContextManager`" msgstr ":class:`contextlib.AbstractContextManager`" -#: ../../library/stdtypes.rst:5552 +#: ../../library/stdtypes.rst:5553 msgid ":class:`contextlib.AbstractAsyncContextManager`" msgstr ":class:`contextlib.AbstractAsyncContextManager`" -#: ../../library/stdtypes.rst:5553 +#: ../../library/stdtypes.rst:5554 msgid ":class:`dataclasses.Field`" msgstr ":class:`dataclasses.Field`" -#: ../../library/stdtypes.rst:5554 +#: ../../library/stdtypes.rst:5555 msgid ":class:`functools.cached_property`" msgstr ":class:`functools.cached_property`" -#: ../../library/stdtypes.rst:5555 +#: ../../library/stdtypes.rst:5556 msgid ":class:`functools.partialmethod`" msgstr ":class:`functools.partialmethod`" -#: ../../library/stdtypes.rst:5556 +#: ../../library/stdtypes.rst:5557 msgid ":class:`os.PathLike`" msgstr ":class:`os.PathLike`" -#: ../../library/stdtypes.rst:5557 +#: ../../library/stdtypes.rst:5558 msgid ":class:`queue.LifoQueue`" msgstr ":class:`queue.LifoQueue`" -#: ../../library/stdtypes.rst:5558 +#: ../../library/stdtypes.rst:5559 msgid ":class:`queue.Queue`" msgstr ":class:`queue.Queue`" -#: ../../library/stdtypes.rst:5559 +#: ../../library/stdtypes.rst:5560 msgid ":class:`queue.PriorityQueue`" msgstr ":class:`queue.PriorityQueue`" -#: ../../library/stdtypes.rst:5560 +#: ../../library/stdtypes.rst:5561 msgid ":class:`queue.SimpleQueue`" msgstr ":class:`queue.SimpleQueue`" -#: ../../library/stdtypes.rst:5561 +#: ../../library/stdtypes.rst:5562 msgid ":ref:`re.Pattern `" msgstr ":ref:`re.Pattern `" -#: ../../library/stdtypes.rst:5562 +#: ../../library/stdtypes.rst:5563 msgid ":ref:`re.Match `" msgstr ":ref:`re.Match `" -#: ../../library/stdtypes.rst:5563 +#: ../../library/stdtypes.rst:5564 msgid ":class:`shelve.BsdDbShelf`" msgstr ":class:`shelve.BsdDbShelf`" -#: ../../library/stdtypes.rst:5564 +#: ../../library/stdtypes.rst:5565 msgid ":class:`shelve.DbfilenameShelf`" msgstr ":class:`shelve.DbfilenameShelf`" -#: ../../library/stdtypes.rst:5565 +#: ../../library/stdtypes.rst:5566 msgid ":class:`shelve.Shelf`" msgstr ":class:`shelve.Shelf`" -#: ../../library/stdtypes.rst:5566 +#: ../../library/stdtypes.rst:5567 msgid ":class:`types.MappingProxyType`" msgstr ":class:`types.MappingProxyType`" -#: ../../library/stdtypes.rst:5567 +#: ../../library/stdtypes.rst:5568 msgid ":class:`weakref.WeakKeyDictionary`" msgstr ":class:`weakref.WeakKeyDictionary`" -#: ../../library/stdtypes.rst:5568 +#: ../../library/stdtypes.rst:5569 msgid ":class:`weakref.WeakMethod`" msgstr ":class:`weakref.WeakMethod`" -#: ../../library/stdtypes.rst:5569 +#: ../../library/stdtypes.rst:5570 msgid ":class:`weakref.WeakSet`" msgstr ":class:`weakref.WeakSet`" -#: ../../library/stdtypes.rst:5570 +#: ../../library/stdtypes.rst:5571 msgid ":class:`weakref.WeakValueDictionary`" msgstr ":class:`weakref.WeakValueDictionary`" -#: ../../library/stdtypes.rst:5575 +#: ../../library/stdtypes.rst:5576 msgid "Special Attributes of ``GenericAlias`` objects" msgstr "``GenericAlias`` 物件的特殊屬性" -#: ../../library/stdtypes.rst:5577 +#: ../../library/stdtypes.rst:5578 msgid "All parameterized generics implement special read-only attributes." msgstr "所有參數化泛型都有實作特殊的唯讀屬性。" -#: ../../library/stdtypes.rst:5581 +#: ../../library/stdtypes.rst:5582 msgid "This attribute points at the non-parameterized generic class::" msgstr "此屬性指向非參數化泛型類別: ::" -#: ../../library/stdtypes.rst:5583 +#: ../../library/stdtypes.rst:5584 msgid "" ">>> list[int].__origin__\n" "" @@ -8220,16 +8206,16 @@ msgstr "" ">>> list[int].__origin__\n" "" -#: ../../library/stdtypes.rst:5589 +#: ../../library/stdtypes.rst:5590 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 " "class::" msgstr "" -"此屬性是傳遞給泛型類別之原始 :meth:`~object.__class_getitem__` 的泛型型" -"別 :class:`tuple`\\ (長度可以為 1): ::" +"此屬性是傳遞給泛型類別之原始 :meth:`~object.__class_getitem__` 的泛型型別 :" +"class:`tuple`\\ (長度可以為 1): ::" -#: ../../library/stdtypes.rst:5593 +#: ../../library/stdtypes.rst:5594 msgid "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" @@ -8237,7 +8223,7 @@ msgstr "" ">>> dict[str, list[int]].__args__\n" "(, list[int])" -#: ../../library/stdtypes.rst:5599 +#: ../../library/stdtypes.rst:5600 msgid "" "This attribute is a lazily computed tuple (possibly empty) of unique type " "variables found in ``__args__``::" @@ -8245,7 +8231,7 @@ msgstr "" "此屬性是個會被延遲計算 (lazily computed) 的元組(可能為空),包含了在 " "``__args__`` 中找得到的不重複型別變數: ::" -#: ../../library/stdtypes.rst:5602 +#: ../../library/stdtypes.rst:5603 msgid "" ">>> from typing import TypeVar\n" "\n" @@ -8259,90 +8245,89 @@ msgstr "" ">>> list[T].__parameters__\n" "(~T,)" -#: ../../library/stdtypes.rst:5610 +#: ../../library/stdtypes.rst:5611 msgid "" "A ``GenericAlias`` object with :class:`typing.ParamSpec` parameters may not " -"have correct ``__parameters__`` after substitution " -"because :class:`typing.ParamSpec` is intended primarily for static type " -"checking." +"have correct ``__parameters__`` after substitution because :class:`typing." +"ParamSpec` is intended primarily for static type checking." msgstr "" "具有 :class:`typing.ParamSpec` 參數的一個 ``GenericAlias`` 物件在替換後可能沒" "有正確的 ``__parameters__``,因為 :class:`typing.ParamSpec` 主要用於靜態型別" "檢查。" -#: ../../library/stdtypes.rst:5617 +#: ../../library/stdtypes.rst:5618 msgid "" "A boolean that is true if the alias has been unpacked using the ``*`` " "operator (see :data:`~typing.TypeVarTuple`)." msgstr "" -"如果別名已使用 ``*`` 運算子解包 (unpack) 則為 true 的布林值(請參" -"閱 :data:`~typing.TypeVarTuple`\\ )。" +"如果別名已使用 ``*`` 運算子解包 (unpack) 則為 true 的布林值(請參閱 :data:" +"`~typing.TypeVarTuple`\\ )。" -#: ../../library/stdtypes.rst:5625 +#: ../../library/stdtypes.rst:5626 msgid ":pep:`484` - Type Hints" msgstr ":pep:`484` - 型別提示" -#: ../../library/stdtypes.rst:5626 +#: ../../library/stdtypes.rst:5627 msgid "Introducing Python's framework for type annotations." msgstr "引入 Python 的型別註釋框架。" -#: ../../library/stdtypes.rst:5628 +#: ../../library/stdtypes.rst:5629 msgid ":pep:`585` - Type Hinting Generics In Standard Collections" msgstr ":pep:`585` - 標準集合 (Standard Collections) 中的型別提示泛型" -#: ../../library/stdtypes.rst:5629 +#: ../../library/stdtypes.rst:5630 msgid "" "Introducing the ability to natively parameterize standard-library classes, " -"provided they implement the special class " -"method :meth:`~object.__class_getitem__`." +"provided they implement the special class method :meth:`~object." +"__class_getitem__`." msgstr "" -"引入原生參數化標準函式庫類別的能力,前提是它們有實作特殊的類別方" -"法 :meth:`~object.__class_getitem__`。" +"引入原生參數化標準函式庫類別的能力,前提是它們有實作特殊的類別方法 :meth:" +"`~object.__class_getitem__`。" -#: ../../library/stdtypes.rst:5633 +#: ../../library/stdtypes.rst:5634 msgid "" -":ref:`Generics`, :ref:`user-defined generics ` " -"and :class:`typing.Generic`" +":ref:`Generics`, :ref:`user-defined generics ` and :" +"class:`typing.Generic`" msgstr "" -":ref:`Generics`、:ref:`使用者定義泛型 `\\ " -"和 :class:`typing.Generic`" +":ref:`Generics`、:ref:`使用者定義泛型 `\\ 和 :class:" +"`typing.Generic`" -#: ../../library/stdtypes.rst:5634 +#: ../../library/stdtypes.rst:5635 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:5643 +#: ../../library/stdtypes.rst:5644 msgid "Union Type" msgstr "聯合型別 (Union Type)" -#: ../../library/stdtypes.rst:5649 +#: ../../library/stdtypes.rst:5650 msgid "" "A union object holds the value of the ``|`` (bitwise or) operation on " "multiple :ref:`type objects `. These types are intended " "primarily for :term:`type annotations `. The union type " -"expression enables cleaner type hinting syntax compared to " -"subscripting :class:`typing.Union`." +"expression enables cleaner type hinting syntax compared to subscripting :" +"class:`typing.Union`." msgstr "" "一個聯合物件可以保存多個\\ :ref:`型別物件 (type object) `\\ 之 ``|``\\ (位元 or)運算的值。這些型別主要用於\\ :term:`型別註" "釋 (type annotation) `。與下標 :data:`typing.Union` 相比,聯合型" "別運算式可以讓型別提示語法更清晰簡潔。" -#: ../../library/stdtypes.rst:5656 +#: ../../library/stdtypes.rst:5657 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 " -"example, the following function expects an argument of type :class:`int` " -"or :class:`float`::" +"example, the following function expects an argument of type :class:`int` or :" +"class:`float`::" msgstr "" "定義一個包含 *X*、*Y* 等型別的聯合物件。``X | Y`` 表示 X 或 Y。它相當於 " -"``typing.Union[X, Y]``。舉例來說,下列函式需要一個型別為 :class:`int` " -"或 :class:`float` 的引數: ::" +"``typing.Union[X, Y]``。舉例來說,下列函式需要一個型別為 :class:`int` 或 :" +"class:`float` 的引數: ::" -#: ../../library/stdtypes.rst:5661 +#: ../../library/stdtypes.rst:5662 msgid "" "def square(number: int | float) -> int | float:\n" " return number ** 2" @@ -8350,7 +8335,7 @@ msgstr "" "def square(number: int | float) -> int | float:\n" " return number ** 2" -#: ../../library/stdtypes.rst:5666 +#: ../../library/stdtypes.rst:5667 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 " @@ -8363,40 +8348,40 @@ msgstr "" "義類別的參照,將在 runtime 失敗。對於包含向前參照的聯合,請將整個運算式以字串" "呈現,例如 ``\"int | Foo\"``。" -#: ../../library/stdtypes.rst:5674 +#: ../../library/stdtypes.rst:5675 msgid "" "Union objects can be tested for equality with other union objects. Details:" msgstr "聯合物件可以與其他聯合物件一起進行相等性測試。細節如下:" -#: ../../library/stdtypes.rst:5676 +#: ../../library/stdtypes.rst:5677 msgid "Unions of unions are flattened::" msgstr "聯合的聯合會被扁平化: ::" -#: ../../library/stdtypes.rst:5678 +#: ../../library/stdtypes.rst:5679 msgid "(int | str) | float == int | str | float" msgstr "(int | str) | float == int | str | float" -#: ../../library/stdtypes.rst:5680 +#: ../../library/stdtypes.rst:5681 msgid "Redundant types are removed::" msgstr "冗餘型別會被刪除: ::" -#: ../../library/stdtypes.rst:5682 +#: ../../library/stdtypes.rst:5683 msgid "int | str | int == int | str" msgstr "int | str | int == int | str" -#: ../../library/stdtypes.rst:5684 +#: ../../library/stdtypes.rst:5685 msgid "When comparing unions, the order is ignored::" msgstr "比較聯合時,順序會被忽略: ::" -#: ../../library/stdtypes.rst:5686 +#: ../../library/stdtypes.rst:5687 msgid "int | str == str | int" msgstr "int | str == str | int" -#: ../../library/stdtypes.rst:5688 +#: ../../library/stdtypes.rst:5689 msgid "It creates instances of :class:`typing.Union`::" msgstr "它會建立 :class:`types.UnionType` 的實例: ::" -#: ../../library/stdtypes.rst:5690 +#: ../../library/stdtypes.rst:5691 msgid "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" @@ -8404,21 +8389,21 @@ msgstr "" "int | str == typing.Union[int, str]\n" "type(int | str) is typing.Union" -#: ../../library/stdtypes.rst:5693 +#: ../../library/stdtypes.rst:5694 msgid "Optional types can be spelled as a union with ``None``::" msgstr "可選型別可以表示為與 ``None`` 的聯合: ::" -#: ../../library/stdtypes.rst:5695 +#: ../../library/stdtypes.rst:5696 msgid "str | None == typing.Optional[str]" msgstr "str | None == typing.Optional[str]" -#: ../../library/stdtypes.rst:5700 +#: ../../library/stdtypes.rst:5701 msgid "" "Calls to :func:`isinstance` and :func:`issubclass` are also supported with a " "union object::" msgstr "聯合物件也支援 :func:`isinstance` 和 :func:`issubclass` 的呼叫: ::" -#: ../../library/stdtypes.rst:5703 +#: ../../library/stdtypes.rst:5704 msgid "" ">>> isinstance(\"\", int | str)\n" "True" @@ -8426,14 +8411,14 @@ msgstr "" ">>> isinstance(\"\", int | str)\n" "True" -#: ../../library/stdtypes.rst:5706 +#: ../../library/stdtypes.rst:5707 msgid "" "However, :ref:`parameterized generics ` in union objects " "cannot be checked::" msgstr "" "然而聯合物件中的\\ :ref:`參數化泛型 `\\ 則無法被檢查: ::" -#: ../../library/stdtypes.rst:5709 +#: ../../library/stdtypes.rst:5710 msgid "" ">>> isinstance(1, int | list[int]) # short-circuit evaluation\n" "True\n" @@ -8443,15 +8428,15 @@ msgid "" "TypeError: isinstance() argument 2 cannot be a parameterized generic" msgstr "" -#: ../../library/stdtypes.rst:5716 +#: ../../library/stdtypes.rst:5717 msgid "" -"The user-exposed type for the union object can be accessed " -"from :class:`typing.Union` and used for :func:`isinstance` checks::" +"The user-exposed type for the union object can be accessed from :class:" +"`typing.Union` and used for :func:`isinstance` checks::" msgstr "" -"構成聯合物件的對使用者公開型別 (user-exposed type) 可以透" -"過 :data:`types.UnionType` 存取並用於 :func:`isinstance` 檢查: ::" +"構成聯合物件的對使用者公開型別 (user-exposed type) 可以透過 :data:`types." +"UnionType` 存取並用於 :func:`isinstance` 檢查: ::" -#: ../../library/stdtypes.rst:5719 +#: ../../library/stdtypes.rst:5720 msgid "" ">>> import typing\n" ">>> isinstance(int | str, typing.Union)\n" @@ -8469,7 +8454,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: cannot create 'typing.Union' instances" -#: ../../library/stdtypes.rst:5728 +#: ../../library/stdtypes.rst:5729 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 " @@ -8478,7 +8463,7 @@ msgstr "" "新增了型別物件的 :meth:`!__or__` 方法來支援 ``X | Y`` 語法。如果元類別有實" "作 :meth:`!__or__`,則 Union 可以覆寫 (override) 它: ::" -#: ../../library/stdtypes.rst:5732 +#: ../../library/stdtypes.rst:5733 msgid "" ">>> class M(type):\n" "... def __or__(self, other):\n" @@ -8504,79 +8489,79 @@ msgstr "" ">>> int | C\n" "int | C" -#: ../../library/stdtypes.rst:5748 +#: ../../library/stdtypes.rst:5749 msgid ":pep:`604` -- PEP proposing the ``X | Y`` syntax and the Union type." msgstr ":pep:`604` -- PEP 提出 ``X | Y`` 語法和聯合型別。" -#: ../../library/stdtypes.rst:5754 +#: ../../library/stdtypes.rst:5755 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`." +"were instances of :class:`types.UnionType`, which remains an alias for :" +"class:`typing.Union`." msgstr "" -#: ../../library/stdtypes.rst:5761 +#: ../../library/stdtypes.rst:5762 msgid "Other Built-in Types" msgstr "其他內建型別" -#: ../../library/stdtypes.rst:5763 +#: ../../library/stdtypes.rst:5764 msgid "" "The interpreter supports several other kinds of objects. Most of these " "support only one or two operations." msgstr "" -#: ../../library/stdtypes.rst:5770 +#: ../../library/stdtypes.rst:5771 msgid "Modules" msgstr "模組" -#: ../../library/stdtypes.rst:5772 +#: ../../library/stdtypes.rst:5773 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 " -"table. Module attributes can be assigned to. (Note that " -"the :keyword:`import` statement is not, strictly speaking, an operation on a " -"module object; ``import foo`` does not require a module object named *foo* " -"to exist, rather it requires an (external) *definition* for a module named " +"table. Module attributes can be assigned to. (Note that the :keyword:" +"`import` statement is not, strictly speaking, an operation on a module " +"object; ``import foo`` does not require a module object named *foo* to " +"exist, rather it requires an (external) *definition* for a module named " "*foo* somewhere.)" msgstr "" -#: ../../library/stdtypes.rst:5779 +#: ../../library/stdtypes.rst:5780 msgid "" "A special attribute of every module is :attr:`~object.__dict__`. This is the " "dictionary containing the module's symbol table. Modifying this dictionary " "will actually change the module's symbol table, but direct assignment to " -"the :attr:`~object.__dict__` attribute is not possible (you can write " -"``m.__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but you can't " -"write ``m.__dict__ = {}``). Modifying :attr:`~object.__dict__` directly is " -"not recommended." +"the :attr:`~object.__dict__` attribute is not possible (you can write ``m." +"__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but you can't write " +"``m.__dict__ = {}``). Modifying :attr:`~object.__dict__` directly is not " +"recommended." msgstr "" -#: ../../library/stdtypes.rst:5787 +#: ../../library/stdtypes.rst:5788 msgid "" -"Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." +"Modules built into the interpreter are written like this: ````. If loaded from a file, they are written as ````." msgstr "" -#: ../../library/stdtypes.rst:5795 +#: ../../library/stdtypes.rst:5796 msgid "Classes and Class Instances" msgstr "類別與類別實例" -#: ../../library/stdtypes.rst:5797 +#: ../../library/stdtypes.rst:5798 msgid "See :ref:`objects` and :ref:`class` for these." msgstr "請見 :ref:`objects` 和 :ref:`class`。" -#: ../../library/stdtypes.rst:5803 +#: ../../library/stdtypes.rst:5804 msgid "Functions" msgstr "函式" -#: ../../library/stdtypes.rst:5805 +#: ../../library/stdtypes.rst:5806 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:5808 +#: ../../library/stdtypes.rst:5809 msgid "" "There are really two flavors of function objects: built-in functions and " "user-defined functions. Both support the same operation (to call the " @@ -8584,36 +8569,36 @@ msgid "" "types." msgstr "" -#: ../../library/stdtypes.rst:5812 +#: ../../library/stdtypes.rst:5813 msgid "See :ref:`function` for more information." msgstr "更多資訊請見 :ref:`function`。" -#: ../../library/stdtypes.rst:5818 +#: ../../library/stdtypes.rst:5819 msgid "Methods" msgstr "方法" -#: ../../library/stdtypes.rst:5822 +#: ../../library/stdtypes.rst:5823 msgid "" "Methods are functions that are called using the attribute notation. There " -"are two flavors: :ref:`built-in methods ` (such " -"as :meth:`~list.append` on lists) and :ref:`class instance method ` (such as :meth:" +"`~list.append` on lists) and :ref:`class instance method `. Built-in methods are described with the types that support them." msgstr "" -#: ../../library/stdtypes.rst:5828 +#: ../../library/stdtypes.rst:5829 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:`instance method `) object. When called, it " -"will add the ``self`` argument to the argument list. Bound methods have two " -"special read-only attributes: :attr:`m.__self__ ` is the " -"object on which the method operates, and :attr:`m.__func__ " -"` is the function implementing the method. Calling " -"``m(arg-1, arg-2, ..., arg-n)`` is completely equivalent to calling " -"``m.__func__(m.__self__, arg-1, arg-2, ..., arg-n)``." +"instance, you get a special object: a :dfn:`bound method` (also called :ref:" +"`instance method `) object. When called, it will add the " +"``self`` argument to the argument list. Bound methods have two special read-" +"only attributes: :attr:`m.__self__ ` is the object on which " +"the method operates, and :attr:`m.__func__ ` is the " +"function implementing the method. Calling ``m(arg-1, arg-2, ..., arg-n)`` " +"is completely equivalent to calling ``m.__func__(m.__self__, arg-1, " +"arg-2, ..., arg-n)``." msgstr "" -#: ../../library/stdtypes.rst:5839 +#: ../../library/stdtypes.rst:5840 msgid "" "Like :ref:`function objects `, bound method objects " "support getting arbitrary attributes. However, since method attributes are " @@ -8624,7 +8609,7 @@ msgid "" "underlying function object:" msgstr "" -#: ../../library/stdtypes.rst:5847 +#: ../../library/stdtypes.rst:5848 msgid "" ">>> class C:\n" "... def method(self):\n" @@ -8652,25 +8637,25 @@ msgstr "" ">>> c.method.whoami\n" "'my name is method'" -#: ../../library/stdtypes.rst:5862 +#: ../../library/stdtypes.rst:5863 msgid "See :ref:`instance-methods` for more information." msgstr "更多資訊請見 :ref:`instance-methods`。" -#: ../../library/stdtypes.rst:5870 +#: ../../library/stdtypes.rst:5871 msgid "Code Objects" msgstr "程式碼物件" -#: ../../library/stdtypes.rst:5876 +#: ../../library/stdtypes.rst:5877 msgid "" "Code objects are used by the implementation to represent \"pseudo-compiled\" " "executable Python code such as a function body. They differ from function " "objects because they don't contain a reference to their global execution " "environment. Code objects are returned by the built-in :func:`compile` " -"function and can be extracted from function objects through " -"their :attr:`~function.__code__` attribute. See also the :mod:`code` module." +"function and can be extracted from function objects through their :attr:" +"`~function.__code__` attribute. See also the :mod:`code` module." msgstr "" -#: ../../library/stdtypes.rst:5883 +#: ../../library/stdtypes.rst:5884 msgid "" "Accessing :attr:`~function.__code__` raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and " @@ -8679,21 +8664,21 @@ msgstr "" "存取 :attr:`~function.__code__` 會引發一個附帶引數 ``obj`` 與 " "``\"__code__\"`` 的\\ :ref:`稽核事件 ` ``object.__getattr__``。" -#: ../../library/stdtypes.rst:5890 +#: ../../library/stdtypes.rst:5891 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:5893 +#: ../../library/stdtypes.rst:5894 msgid "See :ref:`types` for more information." msgstr "更多資訊請見 :ref:`types`。" -#: ../../library/stdtypes.rst:5899 +#: ../../library/stdtypes.rst:5900 msgid "Type Objects" msgstr "" -#: ../../library/stdtypes.rst:5905 +#: ../../library/stdtypes.rst:5906 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 " @@ -8701,119 +8686,167 @@ msgid "" "standard built-in types." msgstr "" -#: ../../library/stdtypes.rst:5910 +#: ../../library/stdtypes.rst:5911 msgid "Types are written like this: ````." msgstr "" -#: ../../library/stdtypes.rst:5916 +#: ../../library/stdtypes.rst:5917 msgid "The Null Object" msgstr "Null 物件" -#: ../../library/stdtypes.rst:5918 +#: ../../library/stdtypes.rst:5919 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:5922 +#: ../../library/stdtypes.rst:5923 msgid "It is written as ``None``." msgstr "它被寫為 ``None``。" -#: ../../library/stdtypes.rst:5929 +#: ../../library/stdtypes.rst:5930 msgid "The Ellipsis Object" msgstr "Ellipsis 物件" -#: ../../library/stdtypes.rst:5931 +#: ../../library/stdtypes.rst:5932 msgid "" -"This object is commonly used by slicing (see :ref:`slicings`). It supports " -"no special operations. There is exactly one ellipsis object, " +"This object is commonly used used to indicate that something is omitted. It " +"supports no special operations. There is exactly one ellipsis object, " "named :const:`Ellipsis` (a built-in name). ``type(Ellipsis)()`` produces " "the :const:`Ellipsis` singleton." msgstr "" -#: ../../library/stdtypes.rst:5936 +#: ../../library/stdtypes.rst:5937 msgid "It is written as ``Ellipsis`` or ``...``." msgstr "它被寫為 ``Ellipsis`` 或 ``...``。" +#: ../../library/stdtypes.rst:5939 +msgid "" +"In typical use, ``...`` as the ``Ellipsis`` object appears in a few " +"different places, for instance:" +msgstr "" + #: ../../library/stdtypes.rst:5942 +msgid "" +"In type annotations, such as :ref:`callable arguments ` or :ref:`tuple elements `." +msgstr "" + +#: ../../library/stdtypes.rst:5945 +msgid "" +"As the body of a function instead of a :ref:`pass statement `." +msgstr "" + +#: ../../library/stdtypes.rst:5947 +msgid "" +"In third-party libraries, such as `Numpy's slicing and striding `_." +msgstr "" + +#: ../../library/stdtypes.rst:5950 +msgid "" +"Python also uses three dots in ways that are not ``Ellipsis`` objects, for " +"instance:" +msgstr "" + +#: ../../library/stdtypes.rst:5952 +msgid "" +"Doctest's :const:`ELLIPSIS `, as a pattern for missing " +"content." +msgstr "" + +#: ../../library/stdtypes.rst:5954 +msgid "" +"The default Python prompt of the :term:`interactive` shell when partial " +"input is incomplete." +msgstr "" + +#: ../../library/stdtypes.rst:5956 +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:5964 msgid "The NotImplemented Object" msgstr "NotImplemented 物件" -#: ../../library/stdtypes.rst:5944 +#: ../../library/stdtypes.rst:5966 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 " -"more information. There is exactly one :data:`NotImplemented` " -"object. :code:`type(NotImplemented)()` produces the singleton instance." +"more information. There is exactly one :data:`NotImplemented` object. :code:" +"`type(NotImplemented)()` produces the singleton instance." msgstr "" -#: ../../library/stdtypes.rst:5949 +#: ../../library/stdtypes.rst:5971 msgid "It is written as :code:`NotImplemented`." msgstr "它被寫為 :code:`NotImplemented`。" -#: ../../library/stdtypes.rst:5955 +#: ../../library/stdtypes.rst:5977 msgid "Internal Objects" msgstr "內部物件" -#: ../../library/stdtypes.rst:5957 +#: ../../library/stdtypes.rst:5979 msgid "" "See :ref:`types` for this information. It describes :ref:`stack frame " "objects `, :ref:`traceback objects `, and " "slice objects." msgstr "" -#: ../../library/stdtypes.rst:5965 +#: ../../library/stdtypes.rst:5987 msgid "Special Attributes" msgstr "特殊屬性" -#: ../../library/stdtypes.rst:5967 +#: ../../library/stdtypes.rst:5989 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." +"types, where they are relevant. Some of these are not reported by the :func:" +"`dir` built-in function." msgstr "" -#: ../../library/stdtypes.rst:5974 +#: ../../library/stdtypes.rst:5996 msgid "" "The name of the class, function, method, descriptor, or generator instance." msgstr "" -#: ../../library/stdtypes.rst:5980 +#: ../../library/stdtypes.rst:6002 msgid "" "The :term:`qualified name` of the class, function, method, descriptor, or " "generator instance." msgstr "" -#: ../../library/stdtypes.rst:5988 +#: ../../library/stdtypes.rst:6010 msgid "The name of the module in which a class or function was defined." msgstr "" -#: ../../library/stdtypes.rst:5993 +#: ../../library/stdtypes.rst:6015 msgid "" "The documentation string of a class or function, or ``None`` if undefined." msgstr "" -#: ../../library/stdtypes.rst:5998 +#: ../../library/stdtypes.rst:6020 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." +"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:6008 +#: ../../library/stdtypes.rst:6030 msgid "Integer string conversion length limitation" msgstr "" -#: ../../library/stdtypes.rst:6010 +#: ../../library/stdtypes.rst:6032 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 decimal or other non-power-of-two number bases. Hexadecimal, " -"octal, and binary conversions are unlimited. The limit can be configured." +"CPython has a global limit for converting between :class:`int` and :class:" +"`str` to mitigate denial of service attacks. This limit *only* applies to " +"decimal or other non-power-of-two number bases. Hexadecimal, octal, and " +"binary conversions are unlimited. The limit can be configured." msgstr "" -#: ../../library/stdtypes.rst:6015 +#: ../../library/stdtypes.rst:6037 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 " @@ -8823,24 +8856,24 @@ msgid "" "value such as ``int('1' * 500_000)`` can take over a second on a fast CPU." msgstr "" -#: ../../library/stdtypes.rst:6022 +#: ../../library/stdtypes.rst:6044 msgid "" "Limiting conversion size offers a practical way to avoid :cve:`2020-10735`." msgstr "" -#: ../../library/stdtypes.rst:6024 +#: ../../library/stdtypes.rst:6046 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:6028 +#: ../../library/stdtypes.rst:6050 msgid "" "When an operation would exceed the limit, a :exc:`ValueError` is raised:" msgstr "" -#: ../../library/stdtypes.rst:6030 +#: ../../library/stdtypes.rst:6052 msgid "" ">>> import sys\n" ">>> sys.set_int_max_str_digits(4300) # Illustrative, this is the default.\n" @@ -8864,19 +8897,19 @@ msgid "" ">>> assert int(hex(i_squared), base=16) == i*i # Hexadecimal is unlimited." msgstr "" -#: ../../library/stdtypes.rst:6050 +#: ../../library/stdtypes.rst:6072 msgid "" -"The default limit is 4300 digits as provided " -"in :data:`sys.int_info.default_max_str_digits `. The lowest " -"limit that can be configured is 640 digits as provided " -"in :data:`sys.int_info.str_digits_check_threshold `." +"The default limit is 4300 digits as provided in :data:`sys.int_info." +"default_max_str_digits `. The lowest limit that can be " +"configured is 640 digits as provided in :data:`sys.int_info." +"str_digits_check_threshold `." msgstr "" -#: ../../library/stdtypes.rst:6055 +#: ../../library/stdtypes.rst:6077 msgid "Verification:" msgstr "" -#: ../../library/stdtypes.rst:6057 +#: ../../library/stdtypes.rst:6079 msgid "" ">>> import sys\n" ">>> assert sys.int_info.default_max_str_digits == 4300, sys.int_info\n" @@ -8894,84 +8927,84 @@ msgstr "" "... '571186405732').to_bytes(53, 'big')\n" "..." -#: ../../library/stdtypes.rst:6070 +#: ../../library/stdtypes.rst:6092 msgid "Affected APIs" msgstr "受影響的 API" -#: ../../library/stdtypes.rst:6072 +#: ../../library/stdtypes.rst:6094 msgid "" -"The limitation only applies to potentially slow conversions " -"between :class:`int` and :class:`str` or :class:`bytes`:" +"The limitation only applies to potentially slow conversions between :class:" +"`int` and :class:`str` or :class:`bytes`:" msgstr "" -#: ../../library/stdtypes.rst:6075 +#: ../../library/stdtypes.rst:6097 msgid "``int(string)`` with default base 10." msgstr "``int(string)`` 以預設的 10 為底。" -#: ../../library/stdtypes.rst:6076 +#: ../../library/stdtypes.rst:6098 msgid "``int(string, base)`` for all bases that are not a power of 2." msgstr "" -#: ../../library/stdtypes.rst:6077 +#: ../../library/stdtypes.rst:6099 msgid "``str(integer)``." msgstr "``str(integer)``。" -#: ../../library/stdtypes.rst:6078 +#: ../../library/stdtypes.rst:6100 msgid "``repr(integer)``." msgstr "``repr(integer)``。" -#: ../../library/stdtypes.rst:6079 +#: ../../library/stdtypes.rst:6101 msgid "" "any other string conversion to base 10, for example ``f\"{integer}\"``, " "``\"{}\".format(integer)``, or ``b\"%d\" % integer``." msgstr "" -#: ../../library/stdtypes.rst:6082 +#: ../../library/stdtypes.rst:6104 msgid "The limitations do not apply to functions with a linear algorithm:" msgstr "" -#: ../../library/stdtypes.rst:6084 +#: ../../library/stdtypes.rst:6106 msgid "``int(string, base)`` with base 2, 4, 8, 16, or 32." msgstr "" -#: ../../library/stdtypes.rst:6085 +#: ../../library/stdtypes.rst:6107 msgid ":func:`int.from_bytes` and :func:`int.to_bytes`." msgstr ":func:`int.from_bytes` 和 :func:`int.to_bytes`。" -#: ../../library/stdtypes.rst:6086 +#: ../../library/stdtypes.rst:6108 msgid ":func:`hex`, :func:`oct`, :func:`bin`." msgstr ":func:`hex`、:func:`oct`、:func:`bin`。" -#: ../../library/stdtypes.rst:6087 +#: ../../library/stdtypes.rst:6109 msgid ":ref:`formatspec` for hex, octal, and binary numbers." msgstr "" -#: ../../library/stdtypes.rst:6088 +#: ../../library/stdtypes.rst:6110 msgid ":class:`str` to :class:`float`." msgstr "" -#: ../../library/stdtypes.rst:6089 +#: ../../library/stdtypes.rst:6111 msgid ":class:`str` to :class:`decimal.Decimal`." msgstr "" -#: ../../library/stdtypes.rst:6092 +#: ../../library/stdtypes.rst:6114 msgid "Configuring the limit" msgstr "設定限制" -#: ../../library/stdtypes.rst:6094 +#: ../../library/stdtypes.rst:6116 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:6097 +#: ../../library/stdtypes.rst:6119 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:6100 +#: ../../library/stdtypes.rst:6122 msgid "" ":option:`-X int_max_str_digits <-X>`, e.g. ``python3 -X " "int_max_str_digits=640``" @@ -8979,48 +9012,47 @@ msgstr "" ":option:`-X int_max_str_digits <-X>`,例如 ``python3 -X " "int_max_str_digits=640``" -#: ../../library/stdtypes.rst:6102 +#: ../../library/stdtypes.rst:6124 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 env var and the ``-X`` option are set, the ``-X`` option takes " -"precedence. A value of *-1* indicates that both were unset, thus a value " -"of :data:`sys.int_info.default_max_str_digits` was used during " -"initialization." +":data:`sys.flags.int_max_str_digits` contains the value of :envvar:" +"`PYTHONINTMAXSTRDIGITS` or :option:`-X int_max_str_digits <-X>`. If both the " +"env var and the ``-X`` option are set, the ``-X`` option takes precedence. A " +"value of *-1* indicates that both were unset, thus a value of :data:`sys." +"int_info.default_max_str_digits` was used during initialization." msgstr "" -#: ../../library/stdtypes.rst:6108 +#: ../../library/stdtypes.rst:6130 msgid "" -"From code, you can inspect the current limit and set a new one using " -"these :mod:`sys` APIs:" +"From code, you can inspect the current limit and set a new one using these :" +"mod:`sys` APIs:" msgstr "" -#: ../../library/stdtypes.rst:6111 +#: ../../library/stdtypes.rst:6133 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:6115 +#: ../../library/stdtypes.rst:6137 msgid "" -"Information about the default and minimum can be found " -"in :data:`sys.int_info`:" +"Information about the default and minimum can be found in :data:`sys." +"int_info`:" msgstr "" -#: ../../library/stdtypes.rst:6117 +#: ../../library/stdtypes.rst:6139 msgid "" ":data:`sys.int_info.default_max_str_digits ` is the compiled-" "in default limit." msgstr "" -#: ../../library/stdtypes.rst:6119 +#: ../../library/stdtypes.rst:6141 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:6126 +#: ../../library/stdtypes.rst:6148 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 " @@ -9032,7 +9064,7 @@ msgid "" "constants is to convert them to ``0x`` hexadecimal form as it has no limit." msgstr "" -#: ../../library/stdtypes.rst:6135 +#: ../../library/stdtypes.rst:6157 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 " @@ -9040,11 +9072,11 @@ msgid "" "to precompile ``.py`` sources to ``.pyc`` files." msgstr "" -#: ../../library/stdtypes.rst:6141 +#: ../../library/stdtypes.rst:6163 msgid "Recommended configuration" msgstr "建議的配置" -#: ../../library/stdtypes.rst:6143 +#: ../../library/stdtypes.rst:6165 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 " @@ -9052,11 +9084,11 @@ msgid "" "as these APIs were added in security patch releases in versions before 3.12." msgstr "" -#: ../../library/stdtypes.rst:6148 +#: ../../library/stdtypes.rst:6170 msgid "Example::" msgstr "範例: ::" -#: ../../library/stdtypes.rst:6150 +#: ../../library/stdtypes.rst:6172 msgid "" ">>> import sys\n" ">>> if hasattr(sys, \"set_int_max_str_digits\"):\n" @@ -9078,38 +9110,38 @@ msgstr "" "... elif current_limit < lower_bound:\n" "... sys.set_int_max_str_digits(lower_bound)" -#: ../../library/stdtypes.rst:6160 +#: ../../library/stdtypes.rst:6182 msgid "If you need to disable it entirely, set it to ``0``." msgstr "" -#: ../../library/stdtypes.rst:6164 +#: ../../library/stdtypes.rst:6186 msgid "Footnotes" msgstr "註腳" -#: ../../library/stdtypes.rst:6165 +#: ../../library/stdtypes.rst:6187 msgid "" "Additional information on these special methods may be found in the Python " "Reference Manual (:ref:`customization`)." msgstr "" -#: ../../library/stdtypes.rst:6168 +#: ../../library/stdtypes.rst:6190 msgid "" "As a consequence, the list ``[1, 2]`` is considered equal to ``[1.0, 2.0]``, " "and similarly for tuples." msgstr "" -#: ../../library/stdtypes.rst:6171 +#: ../../library/stdtypes.rst:6193 msgid "They must have since the parser can't tell the type of the operands." msgstr "" -#: ../../library/stdtypes.rst:6173 +#: ../../library/stdtypes.rst:6195 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:6176 +#: ../../library/stdtypes.rst:6198 msgid "" "To format only a tuple you should therefore provide a singleton tuple whose " "only element is the tuple to be formatted." @@ -9123,7 +9155,7 @@ msgstr "built-in(內建)" #: ../../library/stdtypes.rst:399 ../../library/stdtypes.rst:992 #: ../../library/stdtypes.rst:1179 ../../library/stdtypes.rst:1201 #: ../../library/stdtypes.rst:1216 ../../library/stdtypes.rst:4905 -#: ../../library/stdtypes.rst:5901 +#: ../../library/stdtypes.rst:5902 msgid "types" msgstr "type(型別)" @@ -9253,8 +9285,8 @@ msgstr "is not" #: ../../library/stdtypes.rst:2935 ../../library/stdtypes.rst:2954 #: ../../library/stdtypes.rst:3067 ../../library/stdtypes.rst:4703 #: ../../library/stdtypes.rst:4905 ../../library/stdtypes.rst:5389 -#: ../../library/stdtypes.rst:5645 ../../library/stdtypes.rst:5820 -#: ../../library/stdtypes.rst:5865 +#: ../../library/stdtypes.rst:5646 ../../library/stdtypes.rst:5821 +#: ../../library/stdtypes.rst:5866 msgid "object" msgstr "object(物件)" @@ -9347,8 +9379,8 @@ msgstr "arithmetic(算術)" #: ../../library/stdtypes.rst:249 ../../library/stdtypes.rst:992 #: ../../library/stdtypes.rst:1179 ../../library/stdtypes.rst:4905 -#: ../../library/stdtypes.rst:5872 ../../library/stdtypes.rst:5886 -#: ../../library/stdtypes.rst:5901 +#: ../../library/stdtypes.rst:5873 ../../library/stdtypes.rst:5887 +#: ../../library/stdtypes.rst:5902 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -9415,7 +9447,7 @@ msgid "conjugate() (complex number method)" msgstr "conjugate()(複數方法)" #: ../../library/stdtypes.rst:341 ../../library/stdtypes.rst:1808 -#: ../../library/stdtypes.rst:2935 ../../library/stdtypes.rst:5901 +#: ../../library/stdtypes.rst:2935 ../../library/stdtypes.rst:5902 msgid "module" msgstr "模組" @@ -9585,7 +9617,7 @@ msgid "bytearray" msgstr "bytearray(位元組陣列)" #: ../../library/stdtypes.rst:1216 ../../library/stdtypes.rst:4905 -#: ../../library/stdtypes.rst:5645 ../../library/stdtypes.rst:5901 +#: ../../library/stdtypes.rst:5646 ../../library/stdtypes.rst:5902 msgid "type" msgstr "type(型別)" @@ -9835,46 +9867,46 @@ msgstr "Generic(泛型)" msgid "Alias" msgstr "Alias(別名)" -#: ../../library/stdtypes.rst:5645 +#: ../../library/stdtypes.rst:5646 msgid "Union" msgstr "Union(聯合)" -#: ../../library/stdtypes.rst:5645 +#: ../../library/stdtypes.rst:5646 msgid "union" msgstr "union(聯集)" -#: ../../library/stdtypes.rst:5820 +#: ../../library/stdtypes.rst:5821 msgid "method" msgstr "method(方法)" -#: ../../library/stdtypes.rst:5865 +#: ../../library/stdtypes.rst:5866 msgid "code" msgstr "code(程式碼)" -#: ../../library/stdtypes.rst:5865 +#: ../../library/stdtypes.rst:5866 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../library/stdtypes.rst:5872 +#: ../../library/stdtypes.rst:5873 msgid "compile" msgstr "compile(編譯)" -#: ../../library/stdtypes.rst:5872 +#: ../../library/stdtypes.rst:5873 msgid "__code__ (function object attribute)" msgstr "__code__(函式物件屬性)" -#: ../../library/stdtypes.rst:5886 +#: ../../library/stdtypes.rst:5887 msgid "exec" msgstr "exec" -#: ../../library/stdtypes.rst:5886 +#: ../../library/stdtypes.rst:5887 msgid "eval" msgstr "eval" -#: ../../library/stdtypes.rst:5925 +#: ../../library/stdtypes.rst:5926 msgid "..." msgstr "..." -#: ../../library/stdtypes.rst:5925 +#: ../../library/stdtypes.rst:5926 msgid "ellipsis literal" -msgstr "ellipsis literal(刪節號)" +msgstr "ellipsis literal(刪節號字面值)" diff --git a/library/typing.po b/library/typing.po index bd592d6832..1bd99ff57d 100644 --- a/library/typing.po +++ b/library/typing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-09 05:11+0800\n" +"POT-Creation-Date: 2025-09-18 00:15+0000\n" "PO-Revision-Date: 2024-07-11 11:12+0800\n" "Last-Translator: Li-Hung Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -55,8 +55,8 @@ msgstr "" msgid "" "The function ``surface_area_of_cube`` takes an argument expected to be an " "instance of :class:`float`, as indicated by the :term:`type hint` " -"``edge_length: float``. The function is expected to return an instance " -"of :class:`str`, as indicated by the ``-> str`` hint." +"``edge_length: float``. The function is expected to return an instance of :" +"class:`str`, as indicated by the ``-> str`` hint." msgstr "" "函式 ``surface_area_of_cube`` 需要一個引數且預期是一個 :class:`float` 的實" "例,如 ``edge_length: float`` 所指出的\\ :term:`型別提示 `。這個函" @@ -73,17 +73,17 @@ msgstr "" #: ../../library/typing.rst:42 msgid "" -"New features are frequently added to the ``typing`` module. " -"The :pypi:`typing_extensions` package provides backports of these new " -"features to older versions of Python." +"New features are frequently added to the ``typing`` module. The :pypi:" +"`typing_extensions` package provides backports of these new features to " +"older versions of Python." msgstr "" "新功能會頻繁的新增至 ``typing`` 模組中。:pypi:`typing_extensions` 套件為這些" "新功能提供了 backport(向後移植的)版本,提供給舊版本的 Python 使用。" #: ../../library/typing.rst:48 msgid "" -"`Typing cheat sheet `_" +"`Typing cheat sheet `_" msgstr "" "`型別小抄 (Typing cheat sheet) `_" @@ -129,8 +129,8 @@ msgstr "Python 型別系統的技術規範" #: ../../library/typing.rst:66 msgid "" "The canonical, up-to-date specification of the Python type system can be " -"found at `Specification for the Python type system `_." +"found at `Specification for the Python type system `_." msgstr "" "關於 Python 型別系統標準的 (canonical)、最新的技術規範可以在\\ `Python 型別系" "統的技術規範 `_\\ 找到。" @@ -145,9 +145,9 @@ msgid "" "an instance of :class:`TypeAliasType`. In this example, ``Vector`` and " "``list[float]`` will be treated equivalently by static type checkers::" msgstr "" -"一個型別別名被定義來使用 :keyword:`type` 陳述式,其建立" -"了 :class:`TypeAliasType` 的實例。在這個範例中,``Vector`` 及 " -"``list[float]`` 會被當作和靜態型別檢查器一樣同等對待: ::" +"一個型別別名被定義來使用 :keyword:`type` 陳述式,其建立了 :class:" +"`TypeAliasType` 的實例。在這個範例中,``Vector`` 及 ``list[float]`` 會被當作" +"和靜態型別檢查器一樣同等對待: ::" #: ../../library/typing.rst:79 msgid "" @@ -379,19 +379,18 @@ msgstr "註釋 callable 物件" #: ../../library/typing.rst:210 msgid "" -"Functions -- or other :term:`callable` objects -- can be annotated " -"using :class:`collections.abc.Callable` or " -"deprecated :data:`typing.Callable`. ``Callable[[int], str]`` signifies a " -"function that takes a single parameter of type :class:`int` and returns " -"a :class:`str`." +"Functions -- or other :term:`callable` objects -- can be annotated using :" +"class:`collections.abc.Callable` or deprecated :data:`typing.Callable`. " +"``Callable[[int], str]`` signifies a function that takes a single parameter " +"of type :class:`int` and returns a :class:`str`." msgstr "" -"函式,或者是其他 :term:`callable` 物件,可以使" -"用 :class:`collections.abc.Callable` 或以棄用的 :data:`typing.Callable` 進行" -"註釋。 ``Callable[[int], str]`` 象徵為一個函式,可以接受一個型別" -"為 :class:`int` 的引數,並回傳一個 :class:`str`。" +"函式,或者是其他 :term:`callable` 物件,可以使用 :class:`collections.abc." +"Callable` 或以棄用的 :data:`typing.Callable` 進行註釋。 ``Callable[[int], " +"str]`` 象徵為一個函式,可以接受一個型別為 :class:`int` 的引數,並回傳一個 :" +"class:`str`。" -#: ../../library/typing.rst:215 ../../library/typing.rst:3281 -#: ../../library/typing.rst:3466 +#: ../../library/typing.rst:215 ../../library/typing.rst:3288 +#: ../../library/typing.rst:3473 msgid "For example:" msgstr "舉例來說:" @@ -411,27 +410,40 @@ msgid "" "\n" "callback: Callable[[str], Awaitable[None]] = on_update" msgstr "" +"from collections.abc import Callable, Awaitable\n" +"\n" +"def feeder(get_next_item: Callable[[], str]) -> None:\n" +" ... # 主體\n" +"\n" +"def async_query(on_success: Callable[[int], None],\n" +" on_error: Callable[[int, Exception], None]) -> None:\n" +" ... # 主體\n" +"\n" +"async def on_update(value: str) -> None:\n" +" ... # 主體\n" +"\n" +"callback: Callable[[str], Awaitable[None]] = on_update" -#: ../../library/typing.rst:233 +#: ../../library/typing.rst:235 msgid "" "The subscription syntax must always be used with exactly two values: the " "argument list and the return type. The argument list must be a list of " -"types, a :class:`ParamSpec`, :data:`Concatenate`, or an ellipsis. The return " -"type must be a single type." +"types, a :class:`ParamSpec`, :data:`Concatenate`, or an ellipsis (``...``). " +"The return type must be a single type." msgstr "" "使用下標語法 (subscription syntax) 時,必須使用到兩個值,分別為引述串列以及回" "傳類別。引數串列必須為一個型別串列::class:`ParamSpec`、:data:`Concatenate` " -"或是一個刪節號 (ellipsis)。回傳類別必為一個單一類別。" +"或是一個刪節號 (ellipsis, ``...``)。回傳類別必為一個單一類別。" -#: ../../library/typing.rst:238 +#: ../../library/typing.rst:240 msgid "" "If a literal ellipsis ``...`` is given as the argument list, it indicates " "that a callable with any arbitrary parameter list would be acceptable:" msgstr "" -"若刪節號文字 ``...`` 被當作引數串列給定,其指出一個具任何、任意參數列表的 " +"若刪節號字面值 ``...`` 被當作引數串列給定,其指出一個具任何、任意參數列表的 " "callable 會被接受: ::" -#: ../../library/typing.rst:241 +#: ../../library/typing.rst:243 msgid "" "def concat(x: str, y: str) -> str:\n" " return x + y\n" @@ -447,20 +459,20 @@ msgstr "" "x = str # OK\n" "x = concat # 也 OK" -#: ../../library/typing.rst:250 +#: ../../library/typing.rst:252 msgid "" "``Callable`` cannot express complex signatures such as functions that take a " "variadic number of arguments, :ref:`overloaded functions `, or " "functions that have keyword-only parameters. However, these signatures can " -"be expressed by defining a :class:`Protocol` class with " -"a :meth:`~object.__call__` method:" +"be expressed by defining a :class:`Protocol` class with a :meth:`~object." +"__call__` method:" msgstr "" "``Callable`` 不如有可變數量引數的函式、:func:`overloaded functions " "`、或是僅限關鍵字參數的函式,可以表示複雜簽名。然而,這些簽名可以透" "過定義一個具有 :meth:`~object.__call__` 方法的 :class:`Protocol` 類別進行表" "示:" -#: ../../library/typing.rst:256 +#: ../../library/typing.rst:258 msgid "" "from collections.abc import Iterable\n" "from typing import Protocol\n" @@ -484,7 +496,7 @@ msgid "" " # different name and kind in the callback" msgstr "" -#: ../../library/typing.rst:277 +#: ../../library/typing.rst:279 msgid "" "Callables which take other callables as arguments may indicate that their " "parameter types are dependent on each other using :class:`ParamSpec`. " @@ -501,15 +513,15 @@ msgstr "" "``Callable[Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable], " "ReturnType]`` 的形式。" -#: ../../library/typing.rst:285 ../../library/typing.rst:3975 +#: ../../library/typing.rst:287 ../../library/typing.rst:3990 msgid "" -"``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. " -"See :pep:`612` for more details." +"``Callable`` now supports :class:`ParamSpec` and :data:`Concatenate`. See :" +"pep:`612` for more details." msgstr "" -"``Callable`` 現已支援 :class:`ParamSpec` 以及 :data:`Concatenate`。請參" -"閱 :pep:`612` 閱讀詳細內容。" +"``Callable`` 現已支援 :class:`ParamSpec` 以及 :data:`Concatenate`。請參閱 :" +"pep:`612` 閱讀詳細內容。" -#: ../../library/typing.rst:290 +#: ../../library/typing.rst:292 msgid "" "The documentation for :class:`ParamSpec` and :class:`Concatenate` provides " "examples of usage in ``Callable``." @@ -517,11 +529,11 @@ msgstr "" ":class:`ParamSpec` 以及 :class:`Concatenate` 的文件中,提供範例如何在 " "``Callable`` 中使用。" -#: ../../library/typing.rst:296 +#: ../../library/typing.rst:298 msgid "Generics" msgstr "泛型" -#: ../../library/typing.rst:298 +#: ../../library/typing.rst:300 msgid "" "Since type information about objects kept in containers cannot be statically " "inferred in a generic way, many container classes in the standard library " @@ -531,7 +543,7 @@ msgstr "" "(statically inferred),許多標準函式庫的容器類別支援以下標來表示容器內預期的元" "素。" -#: ../../library/typing.rst:302 +#: ../../library/typing.rst:304 msgid "" "from collections.abc import Mapping, Sequence\n" "\n" @@ -545,7 +557,7 @@ msgid "" " overrides: Mapping[str, str]) -> None: ..." msgstr "" -#: ../../library/typing.rst:315 +#: ../../library/typing.rst:317 msgid "" "Generic functions and classes can be parameterized by using :ref:`type " "parameter syntax `::" @@ -553,7 +565,7 @@ msgstr "" "泛型函式及類別可以使用\\ :ref:`型別參數語法 (type parameter syntax) ` 進行參數化 (parameterize) : ::" -#: ../../library/typing.rst:318 +#: ../../library/typing.rst:320 msgid "" "from collections.abc import Sequence\n" "\n" @@ -562,11 +574,11 @@ msgid "" " return l[0]" msgstr "" -#: ../../library/typing.rst:323 +#: ../../library/typing.rst:325 msgid "Or by using the :class:`TypeVar` factory directly::" msgstr "或是直接使用 :class:`TypeVar` 工廠 (factory): ::" -#: ../../library/typing.rst:325 +#: ../../library/typing.rst:327 msgid "" "from collections.abc import Sequence\n" "from typing import TypeVar\n" @@ -578,15 +590,15 @@ msgid "" " return l[1]" msgstr "" -#: ../../library/typing.rst:333 +#: ../../library/typing.rst:335 msgid "Syntactic support for generics is new in Python 3.12." msgstr "在 Python 3.12 中,泛型的語法支援是全新功能。" -#: ../../library/typing.rst:339 +#: ../../library/typing.rst:341 msgid "Annotating tuples" msgstr "註釋元組 (tuple)" -#: ../../library/typing.rst:341 +#: ../../library/typing.rst:343 msgid "" "For most containers in Python, the typing system assumes that all elements " "in the container will be of the same type. For example::" @@ -594,7 +606,7 @@ msgstr "" "在 Python 大多數的容器當中,加註型別系統認為容器內的所有元素會是相同型別。舉" "例來說: ::" -#: ../../library/typing.rst:344 +#: ../../library/typing.rst:346 msgid "" "from collections.abc import Mapping\n" "\n" @@ -609,32 +621,31 @@ msgid "" "z: Mapping[str, str | int] = {}" msgstr "" -#: ../../library/typing.rst:356 +#: ../../library/typing.rst:358 msgid "" ":class:`list` only accepts one type argument, so a type checker would emit " -"an error on the ``y`` assignment above. " -"Similarly, :class:`~collections.abc.Mapping` only accepts two type " -"arguments: the first indicates the type of the keys, and the second " -"indicates the type of the values." +"an error on the ``y`` assignment above. Similarly, :class:`~collections.abc." +"Mapping` only accepts two type arguments: the first indicates the type of " +"the keys, and the second indicates the type of the values." msgstr "" ":class:`list` 只接受一個型別引數,所以型別檢查器可能在上述 ``y`` 賦值 " "(assignment) 觸發錯誤。類似的範例,:class:`~collections.abc.Mapping` 只接受兩" "個型別引數:第一個引數指出 keys(鍵)的型別;第二個引數指出 values(值)的型" "別。" -#: ../../library/typing.rst:362 +#: ../../library/typing.rst:364 msgid "" "Unlike most other Python containers, however, it is common in idiomatic " "Python code for tuples to have elements which are not all of the same type. " -"For this reason, tuples are special-cased in Python's typing " -"system. :class:`tuple` accepts *any number* of type arguments::" +"For this reason, tuples are special-cased in Python's typing system. :class:" +"`tuple` accepts *any number* of type arguments::" msgstr "" "然而,與其他多數的 Python 容器不同,在慣用的 (idiomatic) Python 程式碼中,元" "組可以擁有不完全相同型別的元素是相當常見的。為此,元組在 Python 的加註型別系" "統中是個特例 (special-cased)。:class:`tuple` 接受\\ *任何數量*\\ 的型別引" "數: ::" -#: ../../library/typing.rst:367 +#: ../../library/typing.rst:369 msgid "" "# OK: ``x`` is assigned to a tuple of length 1 where the sole element is an " "int\n" @@ -649,18 +660,19 @@ msgid "" "z: tuple[int] = (1, 2, 3)" msgstr "" -#: ../../library/typing.rst:378 +#: ../../library/typing.rst:382 msgid "" "To denote a tuple which could be of *any* length, and in which all elements " -"are of the same type ``T``, use ``tuple[T, ...]``. To denote an empty tuple, " -"use ``tuple[()]``. Using plain ``tuple`` as an annotation is equivalent to " -"using ``tuple[Any, ...]``::" +"are of the same type ``T``, use the literal ellipsis ``...``: " +"``tuple[T, ...]``. To denote an empty tuple, use ``tuple[()]``. Using plain " +"``tuple`` as an annotation is equivalent to using ``tuple[Any, ...]``::" msgstr "" "為了標示一個元組可以為\\ *任意*\\ 長度,且所有元素皆是相同型別 ``T``,請使用 " -"``tuple[T, ...]`` 進行標示。為了標示一個空元組,請使用 ``tuple[()]``。單純使" -"用 ``tuple`` 作為註釋,會與使用 ``tuple[Any, ...]`` 是相等的: ::" +"刪節號字面值 (literal ellipsis) ``...``:``tuple[T, ...]``。為了標示" +"一個空元組,請使用 ``tuple[()]``。單純使用 ``tuple`` 作為註釋會與使用 ``tuple[Any, ...]`` " +"相等: ::" -#: ../../library/typing.rst:383 +#: ../../library/typing.rst:388 msgid "" "x: tuple[int, ...] = (1, 2)\n" "# These reassignments are OK: ``tuple[int, ...]`` indicates x can be of any " @@ -680,35 +692,34 @@ msgid "" "z = ()" msgstr "" -#: ../../library/typing.rst:401 +#: ../../library/typing.rst:406 msgid "The type of class objects" msgstr "類別物件的型別" -#: ../../library/typing.rst:403 +#: ../../library/typing.rst:408 msgid "" "A variable annotated with ``C`` may accept a value of type ``C``. In " -"contrast, a variable annotated with ``type[C]`` (or " -"deprecated :class:`typing.Type[C] `) may accept values that are " -"classes themselves -- specifically, it will accept the *class object* of " -"``C``. For example::" +"contrast, a variable annotated with ``type[C]`` (or deprecated :class:" +"`typing.Type[C] `) may accept values that are classes themselves -- " +"specifically, it will accept the *class object* of ``C``. For example::" msgstr "" "一個變數被註釋為 ``C`` 可以接受一個型別為 ``C`` 的值。相對的,一個變數備註解" "為 ``type[C]`` \\ (或已棄用的 :class:`typing.Type[C] `)\\ 可以接受本" "身為該類別的值 -- 具體來說,他可能會接受 ``C`` 的\\ *類別物件*\\。舉例來" "說: ::" -#: ../../library/typing.rst:409 +#: ../../library/typing.rst:414 msgid "" "a = 3 # Has type ``int``\n" "b = int # Has type ``type[int]``\n" "c = type(a) # Also has type ``type[int]``" msgstr "" -#: ../../library/typing.rst:413 +#: ../../library/typing.rst:418 msgid "Note that ``type[C]`` is covariant::" msgstr "請記得 ``type[C]`` 是共變 (covariant) 的: ::" -#: ../../library/typing.rst:415 +#: ../../library/typing.rst:420 msgid "" "class User: ...\n" "class ProUser(User): ...\n" @@ -727,16 +738,15 @@ msgid "" "``type[User]``" msgstr "" -#: ../../library/typing.rst:429 +#: ../../library/typing.rst:434 msgid "" -"The only legal parameters for :class:`type` are " -"classes, :data:`Any`, :ref:`type variables `, and unions of any of " -"these types. For example::" +"The only legal parameters for :class:`type` are classes, :data:`Any`, :ref:" +"`type variables `, and unions of any of these types. For example::" msgstr "" ":class:`type` 僅有的合法參數是類別、:data:`Any`、:ref:`型別變數 " "`\\ 以及這些型別任意組合成的聯集。舉例來說: ::" -#: ../../library/typing.rst:433 +#: ../../library/typing.rst:438 msgid "" "def new_non_team_user(user_class: type[BasicUser | ProUser]): ...\n" "\n" @@ -747,26 +757,26 @@ msgid "" "new_non_team_user(User) # Also an error" msgstr "" -#: ../../library/typing.rst:441 +#: ../../library/typing.rst:446 msgid "" -"``type[Any]`` is equivalent to :class:`type`, which is the root of " -"Python's :ref:`metaclass hierarchy `." +"``type[Any]`` is equivalent to :class:`type`, which is the root of Python's :" +"ref:`metaclass hierarchy `." msgstr "" "``type[Any]`` 等價於 :class:`type` ,其為 Python :ref:`metaclass 階層結構 " "(hierachy) `。" -#: ../../library/typing.rst:448 +#: ../../library/typing.rst:453 msgid "Annotating generators and coroutines" msgstr "" -#: ../../library/typing.rst:450 +#: ../../library/typing.rst:455 msgid "" -"A generator can be annotated using the generic " -"type :class:`Generator[YieldType, SendType, ReturnType] " -"`. For example::" +"A generator can be annotated using the generic type :class:" +"`Generator[YieldType, SendType, ReturnType] `. " +"For example::" msgstr "" -#: ../../library/typing.rst:454 +#: ../../library/typing.rst:459 msgid "" "def echo_round() -> Generator[int, float, str]:\n" " sent = yield 0\n" @@ -774,32 +784,41 @@ msgid "" " sent = yield round(sent)\n" " return 'Done'" msgstr "" +"def echo_round() -> Generator[int, float, str]:\n" +" sent = yield 0\n" +" while sent >= 0:\n" +" sent = yield round(sent)\n" +" return 'Done'" -#: ../../library/typing.rst:460 +#: ../../library/typing.rst:465 msgid "" "Note that unlike many other generic classes in the standard library, the " "``SendType`` of :class:`~collections.abc.Generator` behaves contravariantly, " "not covariantly or invariantly." msgstr "" -#: ../../library/typing.rst:464 +#: ../../library/typing.rst:469 msgid "" "The ``SendType`` and ``ReturnType`` parameters default to :const:`!None`::" msgstr "" -#: ../../library/typing.rst:466 +#: ../../library/typing.rst:471 msgid "" "def infinite_stream(start: int) -> Generator[int]:\n" " while True:\n" " yield start\n" " start += 1" msgstr "" +"def infinite_stream(start: int) -> Generator[int]:\n" +" while True:\n" +" yield start\n" +" start += 1" -#: ../../library/typing.rst:471 +#: ../../library/typing.rst:476 msgid "It is also possible to set these types explicitly::" msgstr "" -#: ../../library/typing.rst:473 +#: ../../library/typing.rst:478 msgid "" "def infinite_stream(start: int) -> Generator[int, None, None]:\n" " while True:\n" @@ -811,15 +830,14 @@ msgstr "" " yield start\n" " start += 1" -#: ../../library/typing.rst:478 +#: ../../library/typing.rst:483 msgid "" "Simple generators that only ever yield values can also be annotated as " -"having a return type of either :class:`Iterable[YieldType] " -"` or :class:`Iterator[YieldType] " -"`::" +"having a return type of either :class:`Iterable[YieldType] ` or :class:`Iterator[YieldType] `::" msgstr "" -#: ../../library/typing.rst:483 +#: ../../library/typing.rst:488 msgid "" "def infinite_stream(start: int) -> Iterator[int]:\n" " while True:\n" @@ -831,15 +849,15 @@ msgstr "" " yield start\n" " start += 1" -#: ../../library/typing.rst:488 +#: ../../library/typing.rst:493 msgid "" "Async generators are handled in a similar fashion, but don't expect a " "``ReturnType`` type argument (:class:`AsyncGenerator[YieldType, SendType] " -"`). The ``SendType`` argument defaults " -"to :const:`!None`, so the following definitions are equivalent::" +"`). The ``SendType`` argument defaults to :" +"const:`!None`, so the following definitions are equivalent::" msgstr "" -#: ../../library/typing.rst:494 +#: ../../library/typing.rst:499 msgid "" "async def infinite_stream(start: int) -> AsyncGenerator[int]:\n" " while True:\n" @@ -861,14 +879,14 @@ msgstr "" " yield start\n" " start = await increment(start)" -#: ../../library/typing.rst:504 +#: ../../library/typing.rst:509 msgid "" -"As in the synchronous case, :class:`AsyncIterable[YieldType] " -"` and :class:`AsyncIterator[YieldType] " -"` are available as well::" +"As in the synchronous case, :class:`AsyncIterable[YieldType] ` and :class:`AsyncIterator[YieldType] ` are available as well::" msgstr "" -#: ../../library/typing.rst:509 +#: ../../library/typing.rst:514 msgid "" "async def infinite_stream(start: int) -> AsyncIterator[int]:\n" " while True:\n" @@ -880,14 +898,14 @@ msgstr "" " yield start\n" " start = await increment(start)" -#: ../../library/typing.rst:514 +#: ../../library/typing.rst:519 msgid "" "Coroutines can be annotated using :class:`Coroutine[YieldType, SendType, " "ReturnType] `. Generic arguments correspond to " "those of :class:`~collections.abc.Generator`, for example::" msgstr "" -#: ../../library/typing.rst:519 +#: ../../library/typing.rst:524 msgid "" "from collections.abc import Coroutine\n" "c: Coroutine[list[str], str, int] # Some coroutine defined elsewhere\n" @@ -896,15 +914,15 @@ msgid "" " y = await c # Inferred type of 'y' is int" msgstr "" -#: ../../library/typing.rst:528 +#: ../../library/typing.rst:533 msgid "User-defined generic types" msgstr "使用者定義泛型型別" -#: ../../library/typing.rst:530 +#: ../../library/typing.rst:535 msgid "A user-defined class can be defined as a generic class." msgstr "一個使用者定義的類別可以被定義成一個泛型類別。" -#: ../../library/typing.rst:534 +#: ../../library/typing.rst:539 msgid "" "from logging import Logger\n" "\n" @@ -944,7 +962,7 @@ msgstr "" " def log(self, message: str) -> None:\n" " self.logger.info('%s: %s', self.name, message)" -#: ../../library/typing.rst:553 +#: ../../library/typing.rst:558 msgid "" "This syntax indicates that the class ``LoggedVar`` is parameterised around a " "single :ref:`type variable ` ``T`` . This also makes ``T`` valid as " @@ -953,16 +971,16 @@ msgstr "" "這個語法指出類別 ``LoggedVar`` 透過一個單一的 :ref:`型別變數 ` " "``T`` 進行參數化 (parameterised)。這使得 ``T`` 在類別中有效的成為型別。" -#: ../../library/typing.rst:557 +#: ../../library/typing.rst:562 msgid "" "Generic classes implicitly inherit from :class:`Generic`. For compatibility " -"with Python 3.11 and lower, it is also possible to inherit explicitly " -"from :class:`Generic` to indicate a generic class::" +"with Python 3.11 and lower, it is also possible to inherit explicitly from :" +"class:`Generic` to indicate a generic class::" msgstr "" "泛型類別隱性繼承了 :class:`Generic`。為了相容 Python 3.11 及更早版本,也可以" "明確的繼承 :class:`Generic` 並指出是一個泛型類別: ::" -#: ../../library/typing.rst:561 +#: ../../library/typing.rst:566 msgid "" "from typing import TypeVar, Generic\n" "\n" @@ -978,7 +996,7 @@ msgstr "" "class LoggedVar(Generic[T]):\n" " ..." -#: ../../library/typing.rst:568 +#: ../../library/typing.rst:573 msgid "" "Generic classes have :meth:`~object.__class_getitem__` methods, meaning they " "can be parameterised at runtime (e.g. ``LoggedVar[int]`` below)::" @@ -986,7 +1004,7 @@ msgstr "" "泛型類別有 :meth:`~object.__class_getitem__` 方法,其意味著可以在 runtime 進" "行參數化(如下述的 ``LoggedVar[int]``): ::" -#: ../../library/typing.rst:571 +#: ../../library/typing.rst:576 msgid "" "from collections.abc import Iterable\n" "\n" @@ -1000,15 +1018,15 @@ msgstr "" " for var in vars:\n" " var.set(0)" -#: ../../library/typing.rst:577 +#: ../../library/typing.rst:582 msgid "" -"A generic type can have any number of type variables. All varieties " -"of :class:`TypeVar` are permissible as parameters for a generic type::" +"A generic type can have any number of type variables. All varieties of :" +"class:`TypeVar` are permissible as parameters for a generic type::" msgstr "" "一個泛型型別可以有任意數量的型別變數。所有種類的 :class:`TypeVar` 都可以作為" "泛型型別的參數: ::" -#: ../../library/typing.rst:580 +#: ../../library/typing.rst:585 msgid "" "from typing import TypeVar, Generic, Sequence\n" "\n" @@ -1034,13 +1052,13 @@ msgstr "" "class OldWeirdTrio(Generic[OldT, OldB, OldS]):\n" " ..." -#: ../../library/typing.rst:592 +#: ../../library/typing.rst:597 msgid "" "Each type variable argument to :class:`Generic` must be distinct. This is " "thus invalid::" msgstr ":class:`Generic` 的每個型別變數引數必不相同。因此以下是無效的: ::" -#: ../../library/typing.rst:595 +#: ../../library/typing.rst:600 msgid "" "from typing import TypeVar, Generic\n" "...\n" @@ -1064,11 +1082,11 @@ msgstr "" "class Pair(Generic[T, T]): # INVALID\n" " ..." -#: ../../library/typing.rst:606 +#: ../../library/typing.rst:611 msgid "Generic classes can also inherit from other classes::" msgstr "泛型類別亦可以繼承其他類別: ::" -#: ../../library/typing.rst:608 +#: ../../library/typing.rst:613 msgid "" "from collections.abc import Sized\n" "\n" @@ -1080,12 +1098,12 @@ msgstr "" "class LinkedList[T](Sized):\n" " ..." -#: ../../library/typing.rst:613 +#: ../../library/typing.rst:618 msgid "" "When inheriting from generic classes, some type parameters could be fixed::" msgstr "當繼承泛型類別時,部份的型別參數可固定: ::" -#: ../../library/typing.rst:615 +#: ../../library/typing.rst:620 msgid "" "from collections.abc import Mapping\n" "\n" @@ -1097,11 +1115,11 @@ msgstr "" "class MyDict[T](Mapping[str, T]):\n" " ..." -#: ../../library/typing.rst:620 +#: ../../library/typing.rst:625 msgid "In this case ``MyDict`` has a single parameter, ``T``." msgstr "在這種情況下 ``MyDict`` 有一個單一的參數 ``T``。" -#: ../../library/typing.rst:622 +#: ../../library/typing.rst:627 msgid "" "Using a generic class without specifying type parameters assumes :data:`Any` " "for each position. In the following example, ``MyIterable`` is not generic " @@ -1110,7 +1128,7 @@ msgstr "" "若使用泛型類別卻沒有特指型別參數,則會將每個位置視為 :data:`Any`。在下列的範" "例中 ``MyIterable`` 不是泛型,但隱性繼承了 ``Iterable[Any]``: ::" -#: ../../library/typing.rst:626 +#: ../../library/typing.rst:631 msgid "" "from collections.abc import Iterable\n" "\n" @@ -1118,11 +1136,11 @@ msgid "" " ..." msgstr "" -#: ../../library/typing.rst:633 +#: ../../library/typing.rst:638 msgid "User-defined generic type aliases are also supported. Examples::" msgstr "使用者定義的泛型型別別名也有支援。例如: ::" -#: ../../library/typing.rst:635 +#: ../../library/typing.rst:640 msgid "" "from collections.abc import Iterable\n" "\n" @@ -1139,13 +1157,13 @@ msgid "" " return sum(x*y for x, y in v)" msgstr "" -#: ../../library/typing.rst:648 +#: ../../library/typing.rst:653 msgid "" "For backward compatibility, generic type aliases can also be created through " "a simple assignment::" msgstr "為了向後相容性,泛型型別別名可以透過簡單的賦值來建立: ::" -#: ../../library/typing.rst:651 +#: ../../library/typing.rst:656 msgid "" "from collections.abc import Iterable\n" "from typing import TypeVar\n" @@ -1159,11 +1177,11 @@ msgstr "" "S = TypeVar(\"S\")\n" "Response = Iterable[S] | int" -#: ../../library/typing.rst:657 +#: ../../library/typing.rst:662 msgid ":class:`Generic` no longer has a custom metaclass." msgstr ":class:`Generic` 不再是一個自訂的 metaclass。" -#: ../../library/typing.rst:660 +#: ../../library/typing.rst:665 msgid "" "Syntactic support for generics and type aliases is new in version 3.12. " "Previously, generic classes had to explicitly inherit from :class:`Generic` " @@ -1172,7 +1190,7 @@ msgstr "" "在版本 3.12 新增了泛型及型別別名的語法支援。在之前的版本中,泛型類別必須顯性" "繼承 :class:`Generic` 或是包含一個型別變數在基底類別 (base) 當中。" -#: ../../library/typing.rst:665 +#: ../../library/typing.rst:670 msgid "" "User-defined generics for parameter expressions are also supported via " "parameter specification variables in the form ``[**P]``. The behavior is " @@ -1182,11 +1200,11 @@ msgid "" "substitute a :class:`ParamSpec`::" msgstr "" "使用者定義的參數運算式 (parameter expression) 泛型一樣有支援,透過 ``[**P]`` " -"格式的參數規格變數來進行表示。對於上述作為參數規格變數的型別變數,將持續" -"被 :mod:`!typing` 模組視為一個特定的型別變數。對此,其中一個例外是一個型別列" -"表可以替代 :class:`ParamSpec`: ::" +"格式的參數規格變數來進行表示。對於上述作為參數規格變數的型別變數,將持續被 :" +"mod:`!typing` 模組視為一個特定的型別變數。對此,其中一個例外是一個型別列表可" +"以替代 :class:`ParamSpec`: ::" -#: ../../library/typing.rst:671 +#: ../../library/typing.rst:676 msgid "" ">>> class Z[T, **P]: ... # T is a TypeVar; P is a ParamSpec\n" "...\n" @@ -1198,7 +1216,7 @@ msgstr "" ">>> Z[int, [dict, float]]\n" "__main__.Z[int, [dict, float]]" -#: ../../library/typing.rst:676 +#: ../../library/typing.rst:681 msgid "" "Classes generic over a :class:`ParamSpec` can also be created using explicit " "inheritance from :class:`Generic`. In this case, ``**`` is not used::" @@ -1206,7 +1224,7 @@ msgstr "" "具有 :class:`ParamSpec` 的泛型類別可以透過顯性繼承 :class:`Generic` 進行建" "立。在這種情況下,不需要使用 ``**``: ::" -#: ../../library/typing.rst:679 +#: ../../library/typing.rst:684 msgid "" "from typing import ParamSpec, Generic\n" "\n" @@ -1222,7 +1240,7 @@ msgstr "" "class Z(Generic[P]):\n" " ..." -#: ../../library/typing.rst:686 +#: ../../library/typing.rst:691 msgid "" "Another difference between :class:`TypeVar` and :class:`ParamSpec` is that a " "generic with only one parameter specification variable will accept parameter " @@ -1235,7 +1253,7 @@ msgstr "" "``X[Type1, Type2, ...]`` 的參數列表。在內部中,後者會被轉換為前者,所以在下方" "的範例中為相等的: ::" -#: ../../library/typing.rst:692 +#: ../../library/typing.rst:697 msgid "" ">>> class X[**P]: ...\n" "...\n" @@ -1251,7 +1269,7 @@ msgstr "" ">>> X[[int, str]]\n" "__main__.X[[int, str]]" -#: ../../library/typing.rst:699 +#: ../../library/typing.rst:704 msgid "" "Note that generics with :class:`ParamSpec` may not have correct " "``__parameters__`` after substitution in some cases because they are " @@ -1260,15 +1278,15 @@ msgstr "" "請記得,具有 :class:`ParamSpec` 的泛型在某些情況下替換之後可能不會有正確的 " "``__parameters__``,因為參數規格主要還是用於靜態型別檢查。" -#: ../../library/typing.rst:703 +#: ../../library/typing.rst:708 msgid "" -":class:`Generic` can now be parameterized over parameter expressions. " -"See :class:`ParamSpec` and :pep:`612` for more details." +":class:`Generic` can now be parameterized over parameter expressions. See :" +"class:`ParamSpec` and :pep:`612` for more details." msgstr "" -":class:`Generic` 現在可以透過參數運算式來進行參數化。詳細內容請" -"見 :class:`ParamSpec` 以及 :pep:`612`。" +":class:`Generic` 現在可以透過參數運算式來進行參數化。詳細內容請見 :class:" +"`ParamSpec` 以及 :pep:`612`。" -#: ../../library/typing.rst:707 +#: ../../library/typing.rst:712 msgid "" "A user-defined generic class can have ABCs as base classes without a " "metaclass conflict. Generic metaclasses are not supported. The outcome of " @@ -1279,20 +1297,20 @@ msgstr "" "突。泛型的 metaclass 則不支援。參數化泛型的輸出將被存為快取,而在 :mod:`!" "typing` 模組中多數的型別皆為 :term:`hashable` 且可以比較相等性。" -#: ../../library/typing.rst:714 +#: ../../library/typing.rst:719 msgid "The :data:`Any` type" msgstr ":data:`Any` 型別" -#: ../../library/typing.rst:716 +#: ../../library/typing.rst:721 msgid "" "A special kind of type is :data:`Any`. A static type checker will treat " "every type as being compatible with :data:`Any` and :data:`Any` as being " "compatible with every type." msgstr "" -":data:`Any` 是一種特別的型別。一個靜態型別檢查器會將每個型別視為可相容" -"於 :data:`Any` 且 :data:`Any` 也可以相容於每個型別。" +":data:`Any` 是一種特別的型別。一個靜態型別檢查器會將每個型別視為可相容於 :" +"data:`Any` 且 :data:`Any` 也可以相容於每個型別。" -#: ../../library/typing.rst:720 +#: ../../library/typing.rst:725 msgid "" "This means that it is possible to perform any operation or method call on a " "value of type :data:`Any` and assign it to any variable::" @@ -1300,7 +1318,7 @@ msgstr "" "這意味著如果在一個為 :data:`Any` 的值上執行任何操作或呼叫方法是可行的,且可以" "賦值給任意變數: ::" -#: ../../library/typing.rst:723 +#: ../../library/typing.rst:728 msgid "" "from typing import Any\n" "\n" @@ -1318,25 +1336,25 @@ msgid "" " ..." msgstr "" -#: ../../library/typing.rst:738 +#: ../../library/typing.rst:743 msgid "" -"Notice that no type checking is performed when assigning a value of " -"type :data:`Any` to a more precise type. For example, the static type " -"checker did not report an error when assigning ``a`` to ``s`` even though " -"``s`` was declared to be of type :class:`str` and receives an :class:`int` " -"value at runtime!" +"Notice that no type checking is performed when assigning a value of type :" +"data:`Any` to a more precise type. For example, the static type checker did " +"not report an error when assigning ``a`` to ``s`` even though ``s`` was " +"declared to be of type :class:`str` and receives an :class:`int` value at " +"runtime!" msgstr "" "請注意,當賦予型別為 :data:`Any` 的值更精確的型別時,將不會執行任何型別檢查。" "舉例來說,靜態型別檢查器不會在 runtime 中,將 ``a`` 賦值給 ``s`` 的情況下回報" "錯誤,儘管 ``s`` 是被宣告為型別 :class:`str` 卻接收到 :class:`int` 的值!" -#: ../../library/typing.rst:744 +#: ../../library/typing.rst:749 msgid "" "Furthermore, all functions without a return type or parameter types will " "implicitly default to using :data:`Any`::" msgstr "另外,所有缺少回傳型別或參數型別的函式將會隱性預設為 :data:`Any`: ::" -#: ../../library/typing.rst:747 +#: ../../library/typing.rst:752 msgid "" "def legacy_parser(text):\n" " ...\n" @@ -1349,7 +1367,7 @@ msgid "" " return data" msgstr "" -#: ../../library/typing.rst:757 +#: ../../library/typing.rst:762 msgid "" "This behavior allows :data:`Any` to be used as an *escape hatch* when you " "need to mix dynamically and statically typed code." @@ -1357,7 +1375,7 @@ msgstr "" "當你需要混和動態及靜態的型別程式碼,這個行為允許 :data:`Any` 被當作一個\\ *緊" "急出口 (escape hatch)*\\使用。" -#: ../../library/typing.rst:760 +#: ../../library/typing.rst:765 msgid "" "Contrast the behavior of :data:`Any` with the behavior of :class:`object`. " "Similar to :data:`Any`, every type is a subtype of :class:`object`. However, " @@ -1365,10 +1383,10 @@ msgid "" "subtype of every other type." msgstr "" ":data:`Any` 的行為對比 :class:`object` 的行為。與 :data:`Any` 相似,所有的型" -"別會作為 :class:`object` 的子型別。然而,不像 :data:`Any`,反之不亦" -"然::class:`object` 並\\ *不是*\\一個其他型別的子型別。" +"別會作為 :class:`object` 的子型別。然而,不像 :data:`Any`,反之不亦然::" +"class:`object` 並\\ *不是*\\一個其他型別的子型別。" -#: ../../library/typing.rst:765 +#: ../../library/typing.rst:770 msgid "" "That means when the type of a value is :class:`object`, a type checker will " "reject almost all operations on it, and assigning it to a variable (or using " @@ -1379,7 +1397,7 @@ msgstr "" "並將賦予這個值到一個特定型別變數(或是當作回傳值使用)視為一個型別錯誤。舉例" "來說: ::" -#: ../../library/typing.rst:769 +#: ../../library/typing.rst:774 msgid "" "def hash_a(item: object) -> int:\n" " # Fails type checking; an object does not have a 'magic' method.\n" @@ -1400,7 +1418,7 @@ msgid "" "hash_b(\"foo\")" msgstr "" -#: ../../library/typing.rst:787 +#: ../../library/typing.rst:792 msgid "" "Use :class:`object` to indicate that a value could be any type in a typesafe " "manner. Use :data:`Any` to indicate that a value is dynamically typed." @@ -1408,11 +1426,11 @@ msgstr "" "使用 :class:`object` ,將指出在型別安全 (typesafe) 的習慣之下一個值可以為任意" "型別。使用 :data:`Any`,將指出這個值是個動態型別。" -#: ../../library/typing.rst:792 +#: ../../library/typing.rst:797 msgid "Nominal vs structural subtyping" msgstr "標稱 (nominal) 子型別 vs 結構子型別" -#: ../../library/typing.rst:794 +#: ../../library/typing.rst:799 msgid "" "Initially :pep:`484` defined the Python static type system as using *nominal " "subtyping*. This means that a class ``A`` is allowed where a class ``B`` is " @@ -1421,20 +1439,20 @@ msgstr "" "最初 :pep:`484` 定義 Python 靜態型別系統使用\\ *標稱子型別*。這意味著只有 " "``A`` 為 ``B`` 的子類別時,``A`` 才被允許使用在預期是類別 ``B`` 出現的地方。" -#: ../../library/typing.rst:798 +#: ../../library/typing.rst:803 msgid "" -"This requirement previously also applied to abstract base classes, such " -"as :class:`~collections.abc.Iterable`. The problem with this approach is " -"that a class had to be explicitly marked to support them, which is " -"unpythonic and unlike what one would normally do in idiomatic dynamically " -"typed Python code. For example, this conforms to :pep:`484`::" +"This requirement previously also applied to abstract base classes, such as :" +"class:`~collections.abc.Iterable`. The problem with this approach is that a " +"class had to be explicitly marked to support them, which is unpythonic and " +"unlike what one would normally do in idiomatic dynamically typed Python " +"code. For example, this conforms to :pep:`484`::" msgstr "" "這個需求之前也被運用在抽象基底類別,例如 :class:`~collections.abc.Iterable`。" "這種方式的問題在於,一個類別需要顯式的標記來支援他們,這並不符合 Python 風" -"格,也不像一個常見的慣用動態型別 Python 程式碼。舉例來說,下列程式碼符" -"合 :pep:`484`: ::" +"格,也不像一個常見的慣用動態型別 Python 程式碼。舉例來說,下列程式碼符合 :" +"pep:`484`: ::" -#: ../../library/typing.rst:804 +#: ../../library/typing.rst:809 msgid "" "from collections.abc import Sized, Iterable, Iterator\n" "\n" @@ -1450,7 +1468,7 @@ msgstr "" " def __len__(self) -> int: ...\n" " def __iter__(self) -> Iterator[int]: ..." -#: ../../library/typing.rst:811 +#: ../../library/typing.rst:816 msgid "" ":pep:`544` allows to solve this problem by allowing users to write the above " "code without explicit base classes in the class definition, allowing " @@ -1463,7 +1481,7 @@ msgstr "" "``Iterable[int]`` 兩者的子型別。這就是眾所周知的\\ *結構子型別*\\ (或是靜態" "鴨子型別): ::" -#: ../../library/typing.rst:817 +#: ../../library/typing.rst:822 msgid "" "from collections.abc import Iterator, Iterable\n" "\n" @@ -1485,7 +1503,7 @@ msgstr "" "def collect(items: Iterable[int]) -> int: ...\n" "result = collect(Bucket()) # Passes type check" -#: ../../library/typing.rst:827 +#: ../../library/typing.rst:832 msgid "" "Moreover, by subclassing a special class :class:`Protocol`, a user can " "define new custom protocols to fully enjoy structural subtyping (see " @@ -1494,43 +1512,43 @@ msgstr "" "而且,基於一個特別的型別 :class:`Protocol` 建立子型別時,使用者可以定義新的" "協定並充份發揮結構子型別的優勢(請見下方範例)。" -#: ../../library/typing.rst:832 +#: ../../library/typing.rst:837 msgid "Module contents" msgstr "模組內容" -#: ../../library/typing.rst:834 +#: ../../library/typing.rst:839 msgid "" "The ``typing`` module defines the following classes, functions and " "decorators." msgstr "模組 ``typing`` 定義了下列的類別、函式以及裝飾器。" -#: ../../library/typing.rst:837 +#: ../../library/typing.rst:842 msgid "Special typing primitives" msgstr "特別型別原語 (primitive)" -#: ../../library/typing.rst:840 +#: ../../library/typing.rst:845 msgid "Special types" msgstr "特別型別" -#: ../../library/typing.rst:842 +#: ../../library/typing.rst:847 msgid "" "These can be used as types in annotations. They do not support subscription " "using ``[]``." msgstr "這些可以在註釋中做為型別。他們並不支援 ``[]`` 的下標使用。" -#: ../../library/typing.rst:847 +#: ../../library/typing.rst:852 msgid "Special type indicating an unconstrained type." msgstr "特別型別,指出一個不受約束 (unconstrained) 的型別。" -#: ../../library/typing.rst:849 +#: ../../library/typing.rst:854 msgid "Every type is compatible with :data:`Any`." msgstr "所有型別皆與 :data:`Any` 相容。" -#: ../../library/typing.rst:850 +#: ../../library/typing.rst:855 msgid ":data:`Any` is compatible with every type." msgstr ":data:`Any` 相容於所有型別。" -#: ../../library/typing.rst:852 +#: ../../library/typing.rst:857 msgid "" ":data:`Any` can now be used as a base class. This can be useful for avoiding " "type checker errors with classes that can duck type anywhere or are highly " @@ -1539,19 +1557,19 @@ msgstr "" ":data:`Any` 可以作為一個基礎類別。這對於在任何地方使用鴨子型別或是高度動態的" "型別,避免型別檢查器的錯誤是非常有用的。" -#: ../../library/typing.rst:859 +#: ../../library/typing.rst:864 msgid "A :ref:`constrained type variable `." msgstr "一個\\ :ref:`不受約束的型別變數 `。" -#: ../../library/typing.rst:861 +#: ../../library/typing.rst:866 msgid "Definition::" msgstr "定義: ::" -#: ../../library/typing.rst:863 +#: ../../library/typing.rst:868 msgid "AnyStr = TypeVar('AnyStr', str, bytes)" msgstr "AnyStr = TypeVar('AnyStr', str, bytes)" -#: ../../library/typing.rst:865 +#: ../../library/typing.rst:870 msgid "" "``AnyStr`` is meant to be used for functions that may accept :class:`str` " "or :class:`bytes` arguments but cannot allow the two to mix." @@ -1559,15 +1577,15 @@ msgstr "" "``AnyStr`` 是對於函式有用的,他可以接受 :class:`str` 或 :class:`bytes` 引數但" "不可以將此兩種混合。" -#: ../../library/typing.rst:868 ../../library/typing.rst:986 -#: ../../library/typing.rst:1043 ../../library/typing.rst:1223 -#: ../../library/typing.rst:1310 ../../library/typing.rst:1352 -#: ../../library/typing.rst:1561 ../../library/typing.rst:1622 -#: ../../library/typing.rst:3218 ../../library/typing.rst:3451 +#: ../../library/typing.rst:873 ../../library/typing.rst:991 +#: ../../library/typing.rst:1048 ../../library/typing.rst:1230 +#: ../../library/typing.rst:1317 ../../library/typing.rst:1359 +#: ../../library/typing.rst:1568 ../../library/typing.rst:1629 +#: ../../library/typing.rst:3225 ../../library/typing.rst:3458 msgid "For example::" msgstr "舉例來說: ::" -#: ../../library/typing.rst:870 +#: ../../library/typing.rst:875 msgid "" "def concat(a: AnyStr, b: AnyStr) -> AnyStr:\n" " return a + b\n" @@ -1577,18 +1595,17 @@ msgid "" "concat(\"foo\", b\"bar\") # Error, cannot mix str and bytes" msgstr "" -#: ../../library/typing.rst:877 +#: ../../library/typing.rst:882 msgid "" -"Note that, despite its name, ``AnyStr`` has nothing to do with " -"the :class:`Any` type, nor does it mean \"any string\". In particular, " -"``AnyStr`` and ``str | bytes`` are different from each other and have " -"different use cases::" +"Note that, despite its name, ``AnyStr`` has nothing to do with the :class:" +"`Any` type, nor does it mean \"any string\". In particular, ``AnyStr`` and " +"``str | bytes`` are different from each other and have different use cases::" msgstr "" "請注意,儘管他的名稱相近,``AnyStr`` 與 :class:`Any` 型別無關,更不代表是「任" "何字串」的意思。尤其,``AnyStr`` 與 ``str | bytes`` 兩者不同且具有不同的使用" "情境: ::" -#: ../../library/typing.rst:882 +#: ../../library/typing.rst:887 msgid "" "# Invalid use of AnyStr:\n" "# The type variable is used only once in the function signature,\n" @@ -1601,14 +1618,14 @@ msgid "" " return \"hi there!\" if cond else b\"greetings!\"" msgstr "" -#: ../../library/typing.rst:892 +#: ../../library/typing.rst:897 msgid "" "Deprecated in favor of the new :ref:`type parameter syntax `. " -"Use ``class A[T: (str, bytes)]: ...`` instead of importing ``AnyStr``. " -"See :pep:`695` for more details." +"Use ``class A[T: (str, bytes)]: ...`` instead of importing ``AnyStr``. See :" +"pep:`695` for more details." msgstr "" -#: ../../library/typing.rst:897 +#: ../../library/typing.rst:902 msgid "" "In Python 3.16, ``AnyStr`` will be removed from ``typing.__all__``, and " "deprecation warnings will be emitted at runtime when it is accessed or " @@ -1616,11 +1633,11 @@ msgid "" "Python 3.18." msgstr "" -#: ../../library/typing.rst:904 +#: ../../library/typing.rst:909 msgid "Special type that includes only literal strings." msgstr "特別型別,只包含文本字串。" -#: ../../library/typing.rst:906 +#: ../../library/typing.rst:911 msgid "" "Any string literal is compatible with ``LiteralString``, as is another " "``LiteralString``. However, an object typed as just ``str`` is not. A string " @@ -1631,11 +1648,11 @@ msgstr "" "此。然而,若是一個型別僅為 ``str`` 的物件則不相容。一個字串若是透過組合多個 " "``LiteralString`` 型別的物件建立,則此字串也可以視為 ``LiteralString``。" -#: ../../library/typing.rst:912 ../../library/typing.rst:2243 +#: ../../library/typing.rst:917 ../../library/typing.rst:2250 msgid "Example:" msgstr "舉例來說: ::" -#: ../../library/typing.rst:914 +#: ../../library/typing.rst:919 msgid "" "def run_query(sql: LiteralString) -> None:\n" " ...\n" @@ -1650,7 +1667,7 @@ msgid "" " )" msgstr "" -#: ../../library/typing.rst:928 +#: ../../library/typing.rst:933 msgid "" "``LiteralString`` is useful for sensitive APIs where arbitrary user-" "generated strings could generate problems. For example, the two cases above " @@ -1661,25 +1678,25 @@ msgstr "" "會產生問題。舉例來說,上面兩個案例中產生的型別檢查器錯誤是脆弱的且容易受到 " "SQL 注入攻擊。" -#: ../../library/typing.rst:933 +#: ../../library/typing.rst:938 msgid "See :pep:`675` for more details." msgstr "更多細節請見 :pep:`675`。" -#: ../../library/typing.rst:940 +#: ../../library/typing.rst:945 msgid "" -":data:`!Never` and :data:`!NoReturn` represent the `bottom type `_, a type that has no members." +":data:`!Never` and :data:`!NoReturn` represent the `bottom type `_, a type that has no members." msgstr "" ":data:`!Never` 和 :data:`!NoReturn` 表示\\ `底部型別 (bottom type) `_,為一個沒有任何成員的型別。" -#: ../../library/typing.rst:944 +#: ../../library/typing.rst:949 msgid "" -"They can be used to indicate that a function never returns, such " -"as :func:`sys.exit`::" +"They can be used to indicate that a function never returns, such as :func:" +"`sys.exit`::" msgstr "它們可以被用來代表一個不會回傳的函式,像是 :func:`sys.exit`: ::" -#: ../../library/typing.rst:947 +#: ../../library/typing.rst:952 msgid "" "from typing import Never # or NoReturn\n" "\n" @@ -1691,15 +1708,15 @@ msgstr "" "def stop() -> Never:\n" " raise RuntimeError('no way')" -#: ../../library/typing.rst:952 +#: ../../library/typing.rst:957 msgid "" "Or to define a function that should never be called, as there are no valid " "arguments, such as :func:`assert_never`::" msgstr "" -"或被用來定義一個不應被呼叫的函式,因為不會有有效的引數,、像" -"是 :func:`assert_never`: ::" +"或被用來定義一個不應被呼叫的函式,因為不會有有效的引數,、像是 :func:" +"`assert_never`: ::" -#: ../../library/typing.rst:956 +#: ../../library/typing.rst:961 msgid "" "from typing import Never # or NoReturn\n" "\n" @@ -1717,7 +1734,7 @@ msgid "" " never_call_me(arg) # OK, arg is of type Never (or NoReturn)" msgstr "" -#: ../../library/typing.rst:971 +#: ../../library/typing.rst:976 msgid "" ":data:`!Never` and :data:`!NoReturn` have the same meaning in the type " "system and static type checkers treat both equivalently." @@ -1725,19 +1742,19 @@ msgstr "" ":data:`!Never` 以及 :data:`!NoReturn` 在型別系統中具有相同的意義且靜態型別檢" "查器會將兩者視為相等。" -#: ../../library/typing.rst:976 +#: ../../library/typing.rst:981 msgid "Added :data:`NoReturn`." msgstr "新增 :data:`NoReturn`。" -#: ../../library/typing.rst:980 +#: ../../library/typing.rst:985 msgid "Added :data:`Never`." msgstr "新增 :data:`Never`。" -#: ../../library/typing.rst:984 +#: ../../library/typing.rst:989 msgid "Special type to represent the current enclosed class." msgstr "特別型別,用來表示目前類別之內 (enclosed class)。" -#: ../../library/typing.rst:988 +#: ../../library/typing.rst:993 msgid "" "from typing import Self, reveal_type\n" "\n" @@ -1753,13 +1770,13 @@ msgid "" "\"SubclassOfFoo\"" msgstr "" -#: ../../library/typing.rst:1000 +#: ../../library/typing.rst:1005 msgid "" "This annotation is semantically equivalent to the following, albeit in a " "more succinct fashion::" msgstr "這個註釋在語意上相等於下列內容,且形式更為簡潔: ::" -#: ../../library/typing.rst:1003 +#: ../../library/typing.rst:1008 msgid "" "from typing import TypeVar\n" "\n" @@ -1779,7 +1796,7 @@ msgstr "" " ...\n" " return self" -#: ../../library/typing.rst:1012 +#: ../../library/typing.rst:1017 msgid "" "In general, if something returns ``self``, as in the above examples, you " "should use ``Self`` as the return annotation. If ``Foo.return_self`` was " @@ -1792,11 +1809,11 @@ msgstr "" "器應該推論這個從 ``SubclassOfFoo.return_self`` 回傳的物件為 ``Foo`` 型別,而" "並非回傳 ``SubclassOfFoo`` 型別。" -#: ../../library/typing.rst:1018 +#: ../../library/typing.rst:1023 msgid "Other common use cases include:" msgstr "其他常見的使用案例包含: ::" -#: ../../library/typing.rst:1020 +#: ../../library/typing.rst:1025 msgid "" ":class:`classmethod`\\s that are used as alternative constructors and return " "instances of the ``cls`` parameter." @@ -1804,11 +1821,11 @@ msgstr "" ":class:`classmethod` 被用來作為替代的建構函式 (constructor) 並回傳 ``cls`` 參" "數的實例。" -#: ../../library/typing.rst:1022 +#: ../../library/typing.rst:1027 msgid "Annotating an :meth:`~object.__enter__` method which returns self." msgstr "註釋一個回傳自己的 :meth:`~object.__enter__` 方法。" -#: ../../library/typing.rst:1024 +#: ../../library/typing.rst:1029 msgid "" "You should not use ``Self`` as the return annotation if the method is not " "guaranteed to return an instance of a subclass when the class is subclassed::" @@ -1816,7 +1833,7 @@ msgstr "" "當類別被子類別化時,若方法不保證回傳一個子類別的實例,你不應該使用 ``Self`` " "作為回傳註釋: ::" -#: ../../library/typing.rst:1028 +#: ../../library/typing.rst:1033 msgid "" "class Eggs:\n" " # Self would be an incorrect return annotation here,\n" @@ -1826,17 +1843,17 @@ msgid "" " return Eggs()" msgstr "" -#: ../../library/typing.rst:1035 +#: ../../library/typing.rst:1040 msgid "See :pep:`673` for more details." msgstr "更多細節請見 :pep:`673`。" -#: ../../library/typing.rst:1041 +#: ../../library/typing.rst:1046 msgid "" "Special annotation for explicitly declaring a :ref:`type alias `." msgstr "做為明確宣告一個\\ :ref:`型別別名 ` 的特別註釋。" -#: ../../library/typing.rst:1045 +#: ../../library/typing.rst:1050 msgid "" "from typing import TypeAlias\n" "\n" @@ -1846,7 +1863,7 @@ msgstr "" "\n" "Factors: TypeAlias = list[int]" -#: ../../library/typing.rst:1049 +#: ../../library/typing.rst:1054 msgid "" "``TypeAlias`` is particularly useful on older Python versions for annotating " "aliases that make use of forward references, as it can be hard for type " @@ -1856,7 +1873,7 @@ msgstr "" "(forward reference),因為對於型別檢查器來說,分辨這些別名與一般的變數賦值相當" "困難: ::" -#: ../../library/typing.rst:1053 +#: ../../library/typing.rst:1058 msgid "" "from typing import Generic, TypeAlias, TypeVar\n" "\n" @@ -1874,31 +1891,31 @@ msgid "" " def make_box_of_strings(cls) -> BoxOfStrings: ..." msgstr "" -#: ../../library/typing.rst:1069 +#: ../../library/typing.rst:1074 msgid "See :pep:`613` for more details." msgstr "更多細節請見 :pep:`613`。" -#: ../../library/typing.rst:1073 +#: ../../library/typing.rst:1078 msgid "" ":data:`TypeAlias` is deprecated in favor of the :keyword:`type` statement, " "which creates instances of :class:`TypeAliasType` and which natively " -"supports forward references. Note that while :data:`TypeAlias` " -"and :class:`TypeAliasType` serve similar purposes and have similar names, " -"they are distinct and the latter is not the type of the former. Removal " -"of :data:`TypeAlias` is not currently planned, but users are encouraged to " -"migrate to :keyword:`type` statements." -msgstr "" -":data:`TypeAlias` 被棄用,請改用 :keyword:`type` 陳述式來建" -"立 :class:`TypeAliasType` 的實例,其自然可以支援傳遞參照的使用。請注意,雖" -"然 :data:`TypeAlias` 以及 :class:`TypeAliasType` 提供相似的用途且具有相似的名" -"稱,他們是不同的,且後者不是前者的型別。現在還沒有移除 :data:`TypeAlias` 的計" -"畫,但鼓勵使用者們遷移 (migrate) 至 :keyword:`type` 陳述式。" - -#: ../../library/typing.rst:1084 +"supports forward references. Note that while :data:`TypeAlias` and :class:" +"`TypeAliasType` serve similar purposes and have similar names, they are " +"distinct and the latter is not the type of the former. Removal of :data:" +"`TypeAlias` is not currently planned, but users are encouraged to migrate " +"to :keyword:`type` statements." +msgstr "" +":data:`TypeAlias` 被棄用,請改用 :keyword:`type` 陳述式來建立 :class:" +"`TypeAliasType` 的實例,其自然可以支援傳遞參照的使用。請注意,雖然 :data:" +"`TypeAlias` 以及 :class:`TypeAliasType` 提供相似的用途且具有相似的名稱,他們" +"是不同的,且後者不是前者的型別。現在還沒有移除 :data:`TypeAlias` 的計畫,但鼓" +"勵使用者們遷移 (migrate) 至 :keyword:`type` 陳述式。" + +#: ../../library/typing.rst:1089 msgid "Special forms" msgstr "特別型式" -#: ../../library/typing.rst:1086 +#: ../../library/typing.rst:1091 msgid "" "These can be used as types in annotations. They all support subscription " "using ``[]``, but each has a unique syntax." @@ -1906,14 +1923,14 @@ msgstr "" "這些在註釋中可以當作型別使用。他們全都支援 ``[]`` 的下標使用,但每個都具有獨" "特的語法。" -#: ../../library/typing.rst:1091 +#: ../../library/typing.rst:1096 msgid "" "Union type; ``Union[X, Y]`` is equivalent to ``X | Y`` and means either X or " "Y." msgstr "" "聯集型別;``Union[X, Y]`` 與 ``X | Y`` 是相等的,且都意味著 X 或 Y 兩者其一。" -#: ../../library/typing.rst:1093 +#: ../../library/typing.rst:1098 msgid "" "To define a union, use e.g. ``Union[int, str]`` or the shorthand ``int | " "str``. Using that shorthand is recommended. Details:" @@ -1921,25 +1938,25 @@ msgstr "" "為了定義聯集,例如可以使用 ``Union[int, str]`` 或是使用簡寫 (shorthand) " "``int | str``。使用這種簡寫是非常推薦的。詳細請看: ::" -#: ../../library/typing.rst:1095 +#: ../../library/typing.rst:1100 msgid "The arguments must be types and there must be at least one." msgstr "引數必須為型別且必須有至少一個。" -#: ../../library/typing.rst:1097 +#: ../../library/typing.rst:1102 msgid "Unions of unions are flattened, e.g.::" msgstr "聯集中的聯集會是扁平化的 (flattened),舉例來說: ::" -#: ../../library/typing.rst:1099 +#: ../../library/typing.rst:1104 msgid "Union[Union[int, str], float] == Union[int, str, float]" msgstr "Union[Union[int, str], float] == Union[int, str, float]" -#: ../../library/typing.rst:1101 +#: ../../library/typing.rst:1106 msgid "" "However, this does not apply to unions referenced through a type alias, to " "avoid forcing evaluation of the underlying :class:`TypeAliasType`::" msgstr "" -#: ../../library/typing.rst:1104 +#: ../../library/typing.rst:1109 msgid "" "type A = Union[int, str]\n" "Union[A, float] != Union[int, str, float]" @@ -1947,50 +1964,50 @@ msgstr "" "type A = Union[int, str]\n" "Union[A, float] != Union[int, str, float]" -#: ../../library/typing.rst:1107 +#: ../../library/typing.rst:1112 msgid "Unions of a single argument vanish, e.g.::" msgstr "單一引數的聯集會消失不見,舉例來說: ::" -#: ../../library/typing.rst:1109 +#: ../../library/typing.rst:1114 msgid "Union[int] == int # The constructor actually returns int" msgstr "Union[int] == int # 實際上建構函式會回傳 int" -#: ../../library/typing.rst:1111 ../../library/typing.rst:1253 +#: ../../library/typing.rst:1116 ../../library/typing.rst:1260 msgid "Redundant arguments are skipped, e.g.::" msgstr "多餘的引數會被略過,舉例來說: ::" -#: ../../library/typing.rst:1113 +#: ../../library/typing.rst:1118 msgid "Union[int, str, int] == Union[int, str] == int | str" msgstr "Union[int, str, int] == Union[int, str] == int | str" -#: ../../library/typing.rst:1115 +#: ../../library/typing.rst:1120 msgid "When comparing unions, the argument order is ignored, e.g.::" msgstr "當比較聯集時,引數的順序會被忽略,舉例來說: ::" -#: ../../library/typing.rst:1117 +#: ../../library/typing.rst:1122 msgid "Union[int, str] == Union[str, int]" msgstr "Union[int, str] == Union[str, int]" -#: ../../library/typing.rst:1119 +#: ../../library/typing.rst:1124 msgid "You cannot subclass or instantiate a ``Union``." msgstr "你不能建立 ``Union`` 的子類別或是實例。" -#: ../../library/typing.rst:1121 +#: ../../library/typing.rst:1126 msgid "You cannot write ``Union[X][Y]``." msgstr "你不能寫成 ``Union[X][Y]``。" -#: ../../library/typing.rst:1123 +#: ../../library/typing.rst:1128 msgid "Don't remove explicit subclasses from unions at runtime." msgstr "請勿在 runtime 中將顯性子類別從聯集中移除。" -#: ../../library/typing.rst:1126 +#: ../../library/typing.rst:1131 msgid "" "Unions can now be written as ``X | Y``. See :ref:`union type " "expressions`." msgstr "" "現在可以將聯集寫成 ``X | Y``。請見\\ :ref:`聯集型別運算式 `。" -#: ../../library/typing.rst:1130 +#: ../../library/typing.rst:1135 msgid "" ":class:`types.UnionType` is now an alias for :class:`Union`, and both " "``Union[int, str]`` and ``int | str`` create instances of the same class. To " @@ -1999,11 +2016,11 @@ msgid "" "``get_origin(obj) is typing.Union or get_origin(obj) is types.UnionType``." msgstr "" -#: ../../library/typing.rst:1140 +#: ../../library/typing.rst:1145 msgid "``Optional[X]`` is equivalent to ``X | None`` (or ``Union[X, None]``)." msgstr "``Optional[X]`` 與 ``X | None`` 是相等的(或是 ``Union[X, None]``)。" -#: ../../library/typing.rst:1142 +#: ../../library/typing.rst:1147 msgid "" "Note that this is not the same concept as an optional argument, which is one " "that has a default. An optional argument with a default does not require " @@ -2014,7 +2031,7 @@ msgstr "" "有預設值的選擇性引數的型別註釋中不具有 ``Optional`` 限定符 (qualifier),單純" "的因為它就是選擇性的。舉例來說: ::" -#: ../../library/typing.rst:1147 +#: ../../library/typing.rst:1152 msgid "" "def foo(arg: int = 0) -> None:\n" " ..." @@ -2022,7 +2039,7 @@ msgstr "" "def foo(arg: int = 0) -> None:\n" " ..." -#: ../../library/typing.rst:1150 +#: ../../library/typing.rst:1155 msgid "" "On the other hand, if an explicit value of ``None`` is allowed, the use of " "``Optional`` is appropriate, whether the argument is optional or not. For " @@ -2031,7 +2048,7 @@ msgstr "" "另一方面,如果一個顯性的值 ``None`` 是被允許的,不論引數是不是選擇性的," "``Optional`` 都適用。舉例來說: ::" -#: ../../library/typing.rst:1154 +#: ../../library/typing.rst:1159 msgid "" "def foo(arg: Optional[int] = None) -> None:\n" " ..." @@ -2039,7 +2056,7 @@ msgstr "" "def foo(arg: Optional[int] = None) -> None:\n" " ..." -#: ../../library/typing.rst:1157 +#: ../../library/typing.rst:1162 msgid "" "Optional can now be written as ``X | None``. See :ref:`union type " "expressions`." @@ -2047,11 +2064,11 @@ msgstr "" "現在可以將 Optional 寫成 ``X | None``。請見\\ :ref:`聯集型別運算式 `。" -#: ../../library/typing.rst:1163 +#: ../../library/typing.rst:1168 msgid "Special form for annotating higher-order functions." msgstr "用於註釋高階函式的特別型式。" -#: ../../library/typing.rst:1165 +#: ../../library/typing.rst:1172 msgid "" "``Concatenate`` can be used in conjunction with :ref:`Callable ` and :class:`ParamSpec` to annotate a higher-order callable which " @@ -2061,23 +2078,23 @@ msgid "" "a :ref:`Callable `. The last parameter to " "``Concatenate`` must be a :class:`ParamSpec` or ellipsis (``...``)." msgstr "" -"``Concatenate`` 可以被用在\\ :ref:`可呼叫物件 `\\ " -"與 :class:`ParamSpec` 的接合 (conjunction) 並註釋一個高階的 Callable 物件可以" -"新增、移除、轉換另一個 Callable 物件的參數。使用方法是依照這個格式 " +"``Concatenate`` 可以被用在\\ :ref:`可呼叫物件 `\\ 與 :" +"class:`ParamSpec` 的接合 (conjunction) 並註釋一個高階的 Callable 物件可以新" +"增、移除、轉換另一個 Callable 物件的參數。使用方法是依照這個格式 " "``Concatenate[Arg1Type, Arg2Type, ..., ParamSpecVariable]``。``Concatenate`` " "目前只在 :ref:`Callable 物件 `\\ 中第一個引數使用時有" "效。``Concatenate`` 的最後一個參數必須為一個 :class:`ParamSpec` 或是刪節號 " "(``...``)。" -#: ../../library/typing.rst:1174 +#: ../../library/typing.rst:1181 msgid "" -"For example, to annotate a decorator ``with_lock`` which provides " -"a :class:`threading.Lock` to the decorated function, ``Concatenate`` can be " -"used to indicate that ``with_lock`` expects a callable which takes in a " -"``Lock`` as the first argument, and returns a callable with a different type " -"signature. In this case, the :class:`ParamSpec` indicates that the returned " -"callable's parameter types are dependent on the parameter types of the " -"callable being passed in::" +"For example, to annotate a decorator ``with_lock`` which provides a :class:" +"`threading.Lock` to the decorated function, ``Concatenate`` can be used to " +"indicate that ``with_lock`` expects a callable which takes in a ``Lock`` as " +"the first argument, and returns a callable with a different type signature. " +"In this case, the :class:`ParamSpec` indicates that the returned callable's " +"parameter types are dependent on the parameter types of the callable being " +"passed in::" msgstr "" "舉例來說,註釋一個為裝飾過後的函式提供 :class:`threading.Lock` 的裝飾器 " "``with_lock``,``Concatenate`` 可以用於指出 ``with_lock`` 預期一個 Callable " @@ -2085,7 +2102,7 @@ msgstr "" "Callable 物件。在這種情況下,:class:`ParamSpec` 指出回傳的 Callable 物件的參" "數型別會依賴傳遞的 Callable 物件的參數型別: ::" -#: ../../library/typing.rst:1182 +#: ../../library/typing.rst:1189 msgid "" "from collections.abc import Callable\n" "from threading import Lock\n" @@ -2113,32 +2130,32 @@ msgid "" "sum_threadsafe([1.1, 2.2, 3.3])" msgstr "" -#: ../../library/typing.rst:1210 ../../library/typing.rst:2211 +#: ../../library/typing.rst:1217 ../../library/typing.rst:2218 msgid "" ":pep:`612` -- Parameter Specification Variables (the PEP which introduced " "``ParamSpec`` and ``Concatenate``)" msgstr ":pep:`612` -- 參數技術規範變數" -#: ../../library/typing.rst:1212 +#: ../../library/typing.rst:1219 msgid ":class:`ParamSpec`" msgstr ":class:`ParamSpec`" -#: ../../library/typing.rst:1213 ../../library/typing.rst:2214 +#: ../../library/typing.rst:1220 ../../library/typing.rst:2221 msgid ":ref:`annotating-callables`" msgstr ":ref:`annotating-callables`" -#: ../../library/typing.rst:1217 +#: ../../library/typing.rst:1224 msgid "Special typing form to define \"literal types\"." msgstr "特殊型別格式,用於定義「文本型別 (literal type)」。" -#: ../../library/typing.rst:1219 +#: ../../library/typing.rst:1226 msgid "" "``Literal`` can be used to indicate to type checkers that the annotated " "object has a value equivalent to one of the provided literals." msgstr "" "``Literal`` 可以用於型別檢查器並指出註釋物件具有一個與提供的文本相同的值。" -#: ../../library/typing.rst:1225 +#: ../../library/typing.rst:1232 msgid "" "def validate_simple(data: Any) -> Literal[True]: # always returns True\n" " ...\n" @@ -2151,7 +2168,7 @@ msgid "" "open_helper('/other/path', 'typo') # Error in type checker" msgstr "" -#: ../../library/typing.rst:1235 +#: ../../library/typing.rst:1242 msgid "" "``Literal[...]`` cannot be subclassed. At runtime, an arbitrary value is " "allowed as type argument to ``Literal[...]``, but type checkers may impose " @@ -2161,29 +2178,29 @@ msgstr "" "``Literal[...]`` 的型別引數,但型別檢查器可能會加強限制。更多有關文本型別的詳" "細資訊請看 :pep:`586`。" -#: ../../library/typing.rst:1239 +#: ../../library/typing.rst:1246 msgid "Additional details:" msgstr "其他細節:" -#: ../../library/typing.rst:1241 +#: ../../library/typing.rst:1248 msgid "The arguments must be literal values and there must be at least one." msgstr "引數必須為文本值且必須有至少一個。" -#: ../../library/typing.rst:1243 +#: ../../library/typing.rst:1250 msgid "Nested ``Literal`` types are flattened, e.g.::" msgstr "巢狀的 ``Literal`` 會是扁平化的 (flattened),舉例來說: ::" -#: ../../library/typing.rst:1245 +#: ../../library/typing.rst:1252 msgid "assert Literal[Literal[1, 2], 3] == Literal[1, 2, 3]" msgstr "assert Literal[Literal[1, 2], 3] == Literal[1, 2, 3]" -#: ../../library/typing.rst:1247 +#: ../../library/typing.rst:1254 msgid "" "However, this does not apply to ``Literal`` types referenced through a type " "alias, to avoid forcing evaluation of the underlying :class:`TypeAliasType`::" msgstr "" -#: ../../library/typing.rst:1250 +#: ../../library/typing.rst:1257 msgid "" "type A = Literal[1, 2]\n" "assert Literal[A, 3] != Literal[1, 2, 3]" @@ -2191,27 +2208,27 @@ msgstr "" "type A = Literal[1, 2]\n" "assert Literal[A, 3] != Literal[1, 2, 3]" -#: ../../library/typing.rst:1255 +#: ../../library/typing.rst:1262 msgid "assert Literal[1, 2, 1] == Literal[1, 2]" msgstr "assert Literal[1, 2, 1] == Literal[1, 2]" -#: ../../library/typing.rst:1257 +#: ../../library/typing.rst:1264 msgid "When comparing literals, the argument order is ignored, e.g.::" msgstr "當比較文本時,引數的順序會被忽略,舉例來說: ::" -#: ../../library/typing.rst:1259 +#: ../../library/typing.rst:1266 msgid "assert Literal[1, 2] == Literal[2, 1]" msgstr "assert Literal[1, 2] == Literal[2, 1]" -#: ../../library/typing.rst:1261 +#: ../../library/typing.rst:1268 msgid "You cannot subclass or instantiate a ``Literal``." msgstr "你不能建立 ``Literal`` 的子類別或是實例。" -#: ../../library/typing.rst:1263 +#: ../../library/typing.rst:1270 msgid "You cannot write ``Literal[X][Y]``." msgstr "你不能寫成 ``Literal[X][Y]``。" -#: ../../library/typing.rst:1267 +#: ../../library/typing.rst:1274 msgid "" "``Literal`` now de-duplicates parameters. Equality comparisons of " "``Literal`` objects are no longer order dependent. ``Literal`` objects will " @@ -2222,11 +2239,11 @@ msgstr "" "比較不再依照相依性排序。``Literal`` 物件現在會在相等性比較期間,若任一個其中" "的參數無法 :term:`hashable` 時,則會引發一個 :exc:`TypeError` 例外。" -#: ../../library/typing.rst:1275 +#: ../../library/typing.rst:1282 msgid "Special type construct to mark class variables." msgstr "特殊型別建構,用來標記類別變數。" -#: ../../library/typing.rst:1277 +#: ../../library/typing.rst:1284 msgid "" "As introduced in :pep:`526`, a variable annotation wrapped in ClassVar " "indicates that a given attribute is intended to be used as a class variable " @@ -2236,7 +2253,7 @@ msgstr "" "定的屬性 (attribute) 意圖被當作類別變數使用,且不該被設定成該類別的實例。使用" "方法如下: ::" -#: ../../library/typing.rst:1281 +#: ../../library/typing.rst:1288 msgid "" "class Starship:\n" " stats: ClassVar[dict[str, int]] = {} # class variable\n" @@ -2246,39 +2263,38 @@ msgstr "" " stats: ClassVar[dict[str, int]] = {} # 類別變數\n" " damage: int = 10 # 實例變數" -#: ../../library/typing.rst:1285 +#: ../../library/typing.rst:1292 msgid ":data:`ClassVar` accepts only types and cannot be further subscribed." msgstr ":data:`ClassVar` 只接受型別請不得使用下標。" -#: ../../library/typing.rst:1287 +#: ../../library/typing.rst:1294 msgid "" -":data:`ClassVar` is not a class itself, and should not be used " -"with :func:`isinstance` or :func:`issubclass`. :data:`ClassVar` does not " -"change Python runtime behavior, but it can be used by third-party type " -"checkers. For example, a type checker might flag the following code as an " -"error::" +":data:`ClassVar` is not a class itself, and should not be used with :func:" +"`isinstance` or :func:`issubclass`. :data:`ClassVar` does not change Python " +"runtime behavior, but it can be used by third-party type checkers. For " +"example, a type checker might flag the following code as an error::" msgstr "" -":data:`ClassVar` 並不代表該類別本身,而且不應該和 :func:`isinstance` 或" -"是 :func:`issubclass` 一起使用。:data:`ClassVar` 不會改變 Python runtime 的行" -"為,但它可以被第三方的型別檢查器使用。舉例來說,一個型別檢查器可能會標記下方" -"的程式碼為一個錯誤: ::" +":data:`ClassVar` 並不代表該類別本身,而且不應該和 :func:`isinstance` 或是 :" +"func:`issubclass` 一起使用。:data:`ClassVar` 不會改變 Python runtime 的行為," +"但它可以被第三方的型別檢查器使用。舉例來說,一個型別檢查器可能會標記下方的程" +"式碼為一個錯誤: ::" -#: ../../library/typing.rst:1293 +#: ../../library/typing.rst:1300 msgid "" "enterprise_d = Starship(3000)\n" "enterprise_d.stats = {} # Error, setting class variable on instance\n" "Starship.stats = {} # This is OK" msgstr "" -#: ../../library/typing.rst:1301 +#: ../../library/typing.rst:1308 msgid ":data:`ClassVar` can now be nested in :data:`Final` and vice versa." msgstr "" -#: ../../library/typing.rst:1305 +#: ../../library/typing.rst:1312 msgid "Special typing construct to indicate final names to type checkers." msgstr "特殊型別建構,用來指出給型別檢查器的最終名稱。" -#: ../../library/typing.rst:1307 +#: ../../library/typing.rst:1314 msgid "" "Final names cannot be reassigned in any scope. Final names declared in class " "scopes cannot be overridden in subclasses." @@ -2286,7 +2302,7 @@ msgstr "" "最終名稱不可以在任何作用域 (scope) 中重新賦值。在類別作用域中宣告的最終名稱," "不得在子類別中進行覆寫 (override)。" -#: ../../library/typing.rst:1312 +#: ../../library/typing.rst:1319 msgid "" "MAX_SIZE: Final = 9000\n" "MAX_SIZE += 1 # Error reported by type checker\n" @@ -2298,46 +2314,46 @@ msgid "" " TIMEOUT = 1 # Error reported by type checker" msgstr "" -#: ../../library/typing.rst:1321 ../../library/typing.rst:3234 +#: ../../library/typing.rst:1328 ../../library/typing.rst:3241 msgid "" "There is no runtime checking of these properties. See :pep:`591` for more " "details." msgstr "" "這些屬性 (property) 不會在 runtime 時進行檢查。更多詳細資訊請看 :pep:`591`。" -#: ../../library/typing.rst:1328 +#: ../../library/typing.rst:1335 msgid ":data:`Final` can now be nested in :data:`ClassVar` and vice versa." msgstr "" -#: ../../library/typing.rst:1332 +#: ../../library/typing.rst:1339 msgid "Special typing construct to mark a :class:`TypedDict` key as required." msgstr "特殊型別建構,用來標記一個 :class:`TypedDict` 鍵值是必須的。" -#: ../../library/typing.rst:1334 +#: ../../library/typing.rst:1341 msgid "" "This is mainly useful for ``total=False`` TypedDicts. See :class:`TypedDict` " "and :pep:`655` for more details." msgstr "" -"主要用於 ``total=False`` 的 TypedDict。更多細節請見 :class:`TypedDict` " -"與 :pep:`655`。" +"主要用於 ``total=False`` 的 TypedDict。更多細節請見 :class:`TypedDict` 與 :" +"pep:`655`。" -#: ../../library/typing.rst:1341 +#: ../../library/typing.rst:1348 msgid "" "Special typing construct to mark a :class:`TypedDict` key as potentially " "missing." msgstr "特殊型別建構,用來標記一個 :class:`TypedDict` 鍵值是可能消失的。" -#: ../../library/typing.rst:1344 +#: ../../library/typing.rst:1351 msgid "See :class:`TypedDict` and :pep:`655` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`655`。" -#: ../../library/typing.rst:1350 +#: ../../library/typing.rst:1357 msgid "" "A special typing construct to mark an item of a :class:`TypedDict` as read-" "only." msgstr "特殊型別建構,用來標記一個 :class:`TypedDict` 的項目是唯讀的。" -#: ../../library/typing.rst:1354 +#: ../../library/typing.rst:1361 msgid "" "class Movie(TypedDict):\n" " title: ReadOnly[str]\n" @@ -2355,19 +2371,19 @@ msgstr "" " m[\"year\"] = 1999 # allowed\n" " m[\"title\"] = \"The Matrix\" # 型別檢查器錯誤" -#: ../../library/typing.rst:1362 +#: ../../library/typing.rst:1369 msgid "There is no runtime checking for this property." msgstr "這些屬性 (property) 不會在 runtime 時進行檢查。" -#: ../../library/typing.rst:1364 +#: ../../library/typing.rst:1371 msgid "See :class:`TypedDict` and :pep:`705` for more details." msgstr "更多細節請見 :class:`TypedDict` 與 :pep:`705`。" -#: ../../library/typing.rst:1370 +#: ../../library/typing.rst:1377 msgid "Special typing form to add context-specific metadata to an annotation." msgstr "" -#: ../../library/typing.rst:1372 +#: ../../library/typing.rst:1379 msgid "" "Add metadata ``x`` to a given type ``T`` by using the annotation " "``Annotated[T, x]``. Metadata added using ``Annotated`` can be used by " @@ -2375,7 +2391,7 @@ msgid "" "a :attr:`!__metadata__` attribute." msgstr "" -#: ../../library/typing.rst:1377 +#: ../../library/typing.rst:1384 msgid "" "If a library or tool encounters an annotation ``Annotated[T, x]`` and has no " "special logic for the metadata, it should ignore the metadata and simply " @@ -2384,7 +2400,7 @@ msgid "" "system." msgstr "" -#: ../../library/typing.rst:1383 +#: ../../library/typing.rst:1390 msgid "" "Using ``Annotated[T, x]`` as an annotation still allows for static " "typechecking of ``T``, as type checkers will simply ignore the metadata " @@ -2394,7 +2410,7 @@ msgid "" "for a function or class." msgstr "" -#: ../../library/typing.rst:1390 +#: ../../library/typing.rst:1397 msgid "" "The responsibility of how to interpret the metadata lies with the tool or " "library encountering an ``Annotated`` annotation. A tool or library " @@ -2402,13 +2418,13 @@ msgid "" "determine if they are of interest (e.g., using :func:`isinstance`)." msgstr "" -#: ../../library/typing.rst:1398 +#: ../../library/typing.rst:1405 msgid "" "Here is an example of how you might use ``Annotated`` to add metadata to " "type annotations if you were doing range analysis:" msgstr "" -#: ../../library/typing.rst:1401 +#: ../../library/typing.rst:1408 msgid "" "@dataclass\n" "class ValueRange:\n" @@ -2426,14 +2442,14 @@ msgstr "" "T1 = Annotated[int, ValueRange(-10, 5)]\n" "T2 = Annotated[T1, ValueRange(-20, 3)]" -#: ../../library/typing.rst:1411 +#: ../../library/typing.rst:1418 msgid "" "The first argument to ``Annotated`` must be a valid type. Multiple metadata " "elements can be supplied as ``Annotated`` supports variadic arguments. The " "order of the metadata elements is preserved and matters for equality checks::" msgstr "" -#: ../../library/typing.rst:1415 +#: ../../library/typing.rst:1422 msgid "" "@dataclass\n" "class ctype:\n" @@ -2453,20 +2469,20 @@ msgstr "" "\n" "assert a1 != a2 # 順序是有意義的" -#: ../../library/typing.rst:1424 +#: ../../library/typing.rst:1431 msgid "" "It is up to the tool consuming the annotations to decide whether the client " "is allowed to add multiple metadata elements to one annotation and how to " "merge those annotations." msgstr "" -#: ../../library/typing.rst:1428 +#: ../../library/typing.rst:1435 msgid "" "Nested ``Annotated`` types are flattened. The order of the metadata elements " "starts with the innermost annotation::" msgstr "" -#: ../../library/typing.rst:1431 +#: ../../library/typing.rst:1438 msgid "" "assert Annotated[Annotated[int, ValueRange(3, 10)], ctype(\"char\")] == " "Annotated[\n" @@ -2478,14 +2494,14 @@ msgstr "" " int, ValueRange(3, 10), ctype(\"char\")\n" "]" -#: ../../library/typing.rst:1435 +#: ../../library/typing.rst:1442 msgid "" "However, this does not apply to ``Annotated`` types referenced through a " -"type alias, to avoid forcing evaluation of the " -"underlying :class:`TypeAliasType`::" +"type alias, to avoid forcing evaluation of the underlying :class:" +"`TypeAliasType`::" msgstr "" -#: ../../library/typing.rst:1438 +#: ../../library/typing.rst:1445 msgid "" "type From3To10[T] = Annotated[T, ValueRange(3, 10)]\n" "assert Annotated[From3To10[int], ctype(\"char\")] != Annotated[\n" @@ -2497,11 +2513,11 @@ msgstr "" " int, ValueRange(3, 10), ctype(\"char\")\n" "]" -#: ../../library/typing.rst:1443 +#: ../../library/typing.rst:1450 msgid "Duplicated metadata elements are not removed::" msgstr "" -#: ../../library/typing.rst:1445 +#: ../../library/typing.rst:1452 msgid "" "assert Annotated[int, ValueRange(3, 10)] != Annotated[\n" " int, ValueRange(3, 10), ValueRange(3, 10)\n" @@ -2511,11 +2527,11 @@ msgstr "" " int, ValueRange(3, 10), ValueRange(3, 10)\n" "]" -#: ../../library/typing.rst:1449 +#: ../../library/typing.rst:1456 msgid "``Annotated`` can be used with nested and generic aliases:" msgstr "" -#: ../../library/typing.rst:1451 +#: ../../library/typing.rst:1458 msgid "" "@dataclass\n" "class MaxLen:\n" @@ -2529,11 +2545,11 @@ msgid "" "type V = Vec[int]" msgstr "" -#: ../../library/typing.rst:1463 +#: ../../library/typing.rst:1470 msgid "``Annotated`` cannot be used with an unpacked :class:`TypeVarTuple`::" msgstr "" -#: ../../library/typing.rst:1465 +#: ../../library/typing.rst:1472 msgid "" "type Variadic[*Ts] = Annotated[*Ts, Ann1] = Annotated[T1, T2, T3, ..., " "Ann1] # NOT valid" @@ -2541,19 +2557,19 @@ msgstr "" "type Variadic[*Ts] = Annotated[*Ts, Ann1] = Annotated[T1, T2, T3, ..., " "Ann1] # 無效" -#: ../../library/typing.rst:1467 +#: ../../library/typing.rst:1474 msgid "" "where ``T1``, ``T2``, ... are :class:`TypeVars `. This is invalid " "as only one type should be passed to Annotated." msgstr "" -#: ../../library/typing.rst:1470 +#: ../../library/typing.rst:1477 msgid "" "By default, :func:`get_type_hints` strips the metadata from annotations. " "Pass ``include_extras=True`` to have the metadata preserved:" msgstr "" -#: ../../library/typing.rst:1473 +#: ../../library/typing.rst:1480 msgid "" ">>> from typing import Annotated, get_type_hints\n" ">>> def func(x: Annotated[int, \"metadata\"]) -> None: pass\n" @@ -2571,13 +2587,13 @@ msgstr "" ">>> get_type_hints(func, include_extras=True)\n" "{'x': typing.Annotated[int, 'metadata'], 'return': }" -#: ../../library/typing.rst:1483 +#: ../../library/typing.rst:1490 msgid "" "At runtime, the metadata associated with an ``Annotated`` type can be " "retrieved via the :attr:`!__metadata__` attribute:" msgstr "" -#: ../../library/typing.rst:1486 +#: ../../library/typing.rst:1493 msgid "" ">>> from typing import Annotated\n" ">>> X = Annotated[int, \"very\", \"important\", \"metadata\"]\n" @@ -2593,13 +2609,13 @@ msgstr "" ">>> X.__metadata__\n" "('very', 'important', 'metadata')" -#: ../../library/typing.rst:1495 +#: ../../library/typing.rst:1502 msgid "" -"If you want to retrieve the original type wrapped by ``Annotated``, use " -"the :attr:`!__origin__` attribute:" +"If you want to retrieve the original type wrapped by ``Annotated``, use the :" +"attr:`!__origin__` attribute:" msgstr "" -#: ../../library/typing.rst:1498 +#: ../../library/typing.rst:1505 msgid "" ">>> from typing import Annotated, get_origin\n" ">>> Password = Annotated[str, \"secret\"]\n" @@ -2611,11 +2627,11 @@ msgstr "" ">>> Password.__origin__\n" "" -#: ../../library/typing.rst:1505 +#: ../../library/typing.rst:1512 msgid "Note that using :func:`get_origin` will return ``Annotated`` itself:" msgstr "" -#: ../../library/typing.rst:1507 +#: ../../library/typing.rst:1514 msgid "" ">>> get_origin(Password)\n" "typing.Annotated" @@ -2623,20 +2639,20 @@ msgstr "" ">>> get_origin(Password)\n" "typing.Annotated" -#: ../../library/typing.rst:1514 +#: ../../library/typing.rst:1521 msgid ":pep:`593` - Flexible function and variable annotations" msgstr "" -#: ../../library/typing.rst:1515 +#: ../../library/typing.rst:1522 msgid "The PEP introducing ``Annotated`` to the standard library." msgstr "" -#: ../../library/typing.rst:1522 ../../library/typing.rst:1606 +#: ../../library/typing.rst:1529 ../../library/typing.rst:1613 msgid "" "Special typing construct for marking user-defined type predicate functions." msgstr "" -#: ../../library/typing.rst:1524 +#: ../../library/typing.rst:1531 msgid "" "``TypeIs`` can be used to annotate the return type of a user-defined type " "predicate function. ``TypeIs`` only accepts a single type argument. At " @@ -2644,7 +2660,7 @@ msgid "" "one positional argument." msgstr "" -#: ../../library/typing.rst:1529 +#: ../../library/typing.rst:1536 msgid "" "``TypeIs`` aims to benefit *type narrowing* -- a technique used by static " "type checkers to determine a more precise type of an expression within a " @@ -2654,7 +2670,7 @@ msgid "" "predicate\"::" msgstr "" -#: ../../library/typing.rst:1535 +#: ../../library/typing.rst:1542 msgid "" "def is_str(val: str | float):\n" " # \"isinstance\" type predicate\n" @@ -2666,40 +2682,40 @@ msgid "" " ..." msgstr "" -#: ../../library/typing.rst:1544 +#: ../../library/typing.rst:1551 msgid "" "Sometimes it would be convenient to use a user-defined boolean function as a " -"type predicate. Such a function should use ``TypeIs[...]`` " -"or :data:`TypeGuard` as its return type to alert static type checkers to " -"this intention. ``TypeIs`` usually has more intuitive behavior than " +"type predicate. Such a function should use ``TypeIs[...]`` or :data:" +"`TypeGuard` as its return type to alert static type checkers to this " +"intention. ``TypeIs`` usually has more intuitive behavior than " "``TypeGuard``, but it cannot be used when the input and output types are " "incompatible (e.g., ``list[object]`` to ``list[int]``) or when the function " "does not return ``True`` for all instances of the narrowed type." msgstr "" -#: ../../library/typing.rst:1552 +#: ../../library/typing.rst:1559 msgid "" "Using ``-> TypeIs[NarrowedType]`` tells the static type checker that for a " "given function:" msgstr "" -#: ../../library/typing.rst:1555 ../../library/typing.rst:1616 +#: ../../library/typing.rst:1562 ../../library/typing.rst:1623 msgid "The return value is a boolean." msgstr "回傳值是一個布林值。" -#: ../../library/typing.rst:1556 +#: ../../library/typing.rst:1563 msgid "" "If the return value is ``True``, the type of its argument is the " "intersection of the argument's original type and ``NarrowedType``." msgstr "" -#: ../../library/typing.rst:1558 +#: ../../library/typing.rst:1565 msgid "" "If the return value is ``False``, the type of its argument is narrowed to " "exclude ``NarrowedType``." msgstr "" -#: ../../library/typing.rst:1563 +#: ../../library/typing.rst:1570 msgid "" "from typing import assert_type, final, TypeIs\n" "\n" @@ -2723,7 +2739,7 @@ msgid "" " assert_type(arg, Unrelated)" msgstr "" -#: ../../library/typing.rst:1584 +#: ../../library/typing.rst:1591 msgid "" "The type inside ``TypeIs`` must be consistent with the type of the " "function's argument; if it is not, static type checkers will raise an " @@ -2732,27 +2748,27 @@ msgid "" "functions in a type-safe manner." msgstr "" -#: ../../library/typing.rst:1590 +#: ../../library/typing.rst:1597 msgid "" "If a ``TypeIs`` function is a class or instance method, then the type in " "``TypeIs`` maps to the type of the second parameter (after ``cls`` or " "``self``)." msgstr "" -#: ../../library/typing.rst:1594 +#: ../../library/typing.rst:1601 msgid "" "In short, the form ``def foo(arg: TypeA) -> TypeIs[TypeB]: ...``, means that " "if ``foo(arg)`` returns ``True``, then ``arg`` is an instance of ``TypeB``, " "and if it returns ``False``, it is not an instance of ``TypeB``." msgstr "" -#: ../../library/typing.rst:1598 +#: ../../library/typing.rst:1605 msgid "" -"``TypeIs`` also works with type variables. For more information, " -"see :pep:`742` (Narrowing types with ``TypeIs``)." +"``TypeIs`` also works with type variables. For more information, see :pep:" +"`742` (Narrowing types with ``TypeIs``)." msgstr "" -#: ../../library/typing.rst:1608 +#: ../../library/typing.rst:1615 msgid "" "Type predicate functions are user-defined functions that return whether " "their argument is an instance of a particular type. ``TypeGuard`` works " @@ -2760,25 +2776,25 @@ msgid "" "checking behavior (see below)." msgstr "" -#: ../../library/typing.rst:1613 +#: ../../library/typing.rst:1620 msgid "" "Using ``-> TypeGuard`` tells the static type checker that for a given " "function:" msgstr "" -#: ../../library/typing.rst:1617 +#: ../../library/typing.rst:1624 msgid "" "If the return value is ``True``, the type of its argument is the type inside " "``TypeGuard``." msgstr "" -#: ../../library/typing.rst:1620 +#: ../../library/typing.rst:1627 msgid "" "``TypeGuard`` also works with type variables. See :pep:`647` for more " "details." msgstr "" -#: ../../library/typing.rst:1624 +#: ../../library/typing.rst:1631 msgid "" "def is_str_list(val: list[object]) -> TypeGuard[list[str]]:\n" " '''Determines whether all objects in the list are strings'''\n" @@ -2793,11 +2809,11 @@ msgid "" " print(\"Not a list of strings!\")" msgstr "" -#: ../../library/typing.rst:1636 +#: ../../library/typing.rst:1643 msgid "``TypeIs`` and ``TypeGuard`` differ in the following ways:" msgstr "``TypeIs`` 和 ``TypeGuard`` 在以下幾個方面有所不同:" -#: ../../library/typing.rst:1638 +#: ../../library/typing.rst:1645 msgid "" "``TypeIs`` requires the narrowed type to be a subtype of the input type, " "while ``TypeGuard`` does not. The main reason is to allow for things like " @@ -2805,7 +2821,7 @@ msgid "" "subtype of the former, since ``list`` is invariant." msgstr "" -#: ../../library/typing.rst:1642 +#: ../../library/typing.rst:1649 msgid "" "When a ``TypeGuard`` function returns ``True``, type checkers narrow the " "type of the variable to exactly the ``TypeGuard`` type. When a ``TypeIs`` " @@ -2814,7 +2830,7 @@ msgid "" "type. (Technically, this is known as an intersection type.)" msgstr "" -#: ../../library/typing.rst:1646 +#: ../../library/typing.rst:1653 msgid "" "When a ``TypeGuard`` function returns ``False``, type checkers cannot narrow " "the type of the variable at all. When a ``TypeIs`` function returns " @@ -2822,18 +2838,18 @@ msgid "" "``TypeIs`` type." msgstr "" -#: ../../library/typing.rst:1655 +#: ../../library/typing.rst:1662 msgid "Typing operator to conceptually mark an object as having been unpacked." msgstr "" -#: ../../library/typing.rst:1657 +#: ../../library/typing.rst:1664 msgid "" "For example, using the unpack operator ``*`` on a :ref:`type variable tuple " "` is equivalent to using ``Unpack`` to mark the type variable " "tuple as having been unpacked::" msgstr "" -#: ../../library/typing.rst:1661 +#: ../../library/typing.rst:1668 msgid "" "Ts = TypeVarTuple('Ts')\n" "tup: tuple[*Ts]\n" @@ -2841,7 +2857,7 @@ msgid "" "tup: tuple[Unpack[Ts]]" msgstr "" -#: ../../library/typing.rst:1666 +#: ../../library/typing.rst:1673 msgid "" "In fact, ``Unpack`` can be used interchangeably with ``*`` in the context " "of :class:`typing.TypeVarTuple ` and :class:`builtins.tuple " @@ -2849,7 +2865,7 @@ msgid "" "versions of Python, where ``*`` couldn't be used in certain places::" msgstr "" -#: ../../library/typing.rst:1672 +#: ../../library/typing.rst:1679 msgid "" "# In older versions of Python, TypeVarTuple and Unpack\n" "# are located in the `typing_extensions` backports package.\n" @@ -2860,13 +2876,13 @@ msgid "" "tup: tuple[Unpack[Ts]] # Semantically equivalent, and backwards-compatible" msgstr "" -#: ../../library/typing.rst:1680 +#: ../../library/typing.rst:1687 msgid "" "``Unpack`` can also be used along with :class:`typing.TypedDict` for typing " "``**kwargs`` in a function signature::" msgstr "" -#: ../../library/typing.rst:1683 +#: ../../library/typing.rst:1690 msgid "" "from typing import TypedDict, Unpack\n" "\n" @@ -2879,23 +2895,23 @@ msgid "" "def foo(**kwargs: Unpack[Movie]): ..." msgstr "" -#: ../../library/typing.rst:1693 +#: ../../library/typing.rst:1700 msgid "" "See :pep:`692` for more details on using ``Unpack`` for ``**kwargs`` typing." msgstr "" -#: ../../library/typing.rst:1698 +#: ../../library/typing.rst:1705 msgid "Building generic types and type aliases" msgstr "" -#: ../../library/typing.rst:1700 +#: ../../library/typing.rst:1707 msgid "" "The following classes should not be used directly as annotations. Their " "intended purpose is to be building blocks for creating generic types and " "type aliases." msgstr "" -#: ../../library/typing.rst:1704 +#: ../../library/typing.rst:1711 msgid "" "These objects can be created through special syntax (:ref:`type parameter " "lists ` and the :keyword:`type` statement). For compatibility " @@ -2903,17 +2919,17 @@ msgid "" "syntax, as documented below." msgstr "" -#: ../../library/typing.rst:1711 +#: ../../library/typing.rst:1718 msgid "Abstract base class for generic types." msgstr "" -#: ../../library/typing.rst:1713 +#: ../../library/typing.rst:1720 msgid "" "A generic type is typically declared by adding a list of type parameters " "after the class name::" msgstr "" -#: ../../library/typing.rst:1716 +#: ../../library/typing.rst:1723 msgid "" "class Mapping[KT, VT]:\n" " def __getitem__(self, key: KT) -> VT:\n" @@ -2925,17 +2941,17 @@ msgstr "" " ...\n" " # Etc." -#: ../../library/typing.rst:1721 +#: ../../library/typing.rst:1728 msgid "" "Such a class implicitly inherits from ``Generic``. The runtime semantics of " "this syntax are discussed in the :ref:`Language Reference `." msgstr "" -#: ../../library/typing.rst:1725 +#: ../../library/typing.rst:1732 msgid "This class can then be used as follows::" msgstr "" -#: ../../library/typing.rst:1727 +#: ../../library/typing.rst:1734 msgid "" "def lookup_name[X, Y](mapping: Mapping[X, Y], key: X, default: Y) -> Y:\n" " try:\n" @@ -2949,20 +2965,20 @@ msgstr "" " except KeyError:\n" " return default" -#: ../../library/typing.rst:1733 +#: ../../library/typing.rst:1740 msgid "" "Here the brackets after the function name indicate a :ref:`generic function " "`." msgstr "" -#: ../../library/typing.rst:1736 +#: ../../library/typing.rst:1743 msgid "" "For backwards compatibility, generic classes can also be declared by " "explicitly inheriting from ``Generic``. In this case, the type parameters " "must be declared separately::" msgstr "" -#: ../../library/typing.rst:1741 +#: ../../library/typing.rst:1748 msgid "" "KT = TypeVar('KT')\n" "VT = TypeVar('VT')\n" @@ -2980,18 +2996,18 @@ msgstr "" " ...\n" " # Etc." -#: ../../library/typing.rst:1753 +#: ../../library/typing.rst:1760 msgid "Type variable." msgstr "" -#: ../../library/typing.rst:1755 +#: ../../library/typing.rst:1762 msgid "" "The preferred way to construct a type variable is via the dedicated syntax " "for :ref:`generic functions `, :ref:`generic classes " "`, and :ref:`generic type aliases `::" msgstr "" -#: ../../library/typing.rst:1760 +#: ../../library/typing.rst:1767 msgid "" "class Sequence[T]: # T is a TypeVar\n" " ..." @@ -2999,13 +3015,13 @@ msgstr "" "class Sequence[T]: # T 是一個 TypeVar\n" " ..." -#: ../../library/typing.rst:1763 +#: ../../library/typing.rst:1770 msgid "" "This syntax can also be used to create bounded and constrained type " "variables::" msgstr "" -#: ../../library/typing.rst:1766 +#: ../../library/typing.rst:1773 msgid "" "class StrSequence[S: str]: # S is a TypeVar with a `str` upper bound;\n" " ... # we can say that S is \"bounded by `str`\"\n" @@ -3016,13 +3032,13 @@ msgid "" " ..." msgstr "" -#: ../../library/typing.rst:1773 +#: ../../library/typing.rst:1780 msgid "" "However, if desired, reusable type variables can also be constructed " "manually, like so::" msgstr "" -#: ../../library/typing.rst:1775 +#: ../../library/typing.rst:1782 msgid "" "T = TypeVar('T') # Can be anything\n" "S = TypeVar('S', bound=str) # Can be any subtype of str\n" @@ -3032,7 +3048,7 @@ msgstr "" "S = TypeVar('S', bound=str) # 可以是任何 str 的子型別\n" "A = TypeVar('A', str, bytes) # 必須是 str 或 bytes" -#: ../../library/typing.rst:1779 +#: ../../library/typing.rst:1786 msgid "" "Type variables exist primarily for the benefit of static type checkers. " "They serve as the parameters for generic types as well as for generic " @@ -3040,7 +3056,7 @@ msgid "" "information on generic types. Generic functions work as follows::" msgstr "" -#: ../../library/typing.rst:1785 +#: ../../library/typing.rst:1792 msgid "" "def repeat[T](x: T, n: int) -> Sequence[T]:\n" " \"\"\"Return a list containing n references to x.\"\"\"\n" @@ -3058,13 +3074,13 @@ msgid "" " return x + y" msgstr "" -#: ../../library/typing.rst:1800 +#: ../../library/typing.rst:1807 msgid "" "Note that type variables can be *bounded*, *constrained*, or neither, but " "cannot be both bounded *and* constrained." msgstr "" -#: ../../library/typing.rst:1803 +#: ../../library/typing.rst:1810 msgid "" "The variance of type variables is inferred by type checkers when they are " "created through the :ref:`type parameter syntax ` or when " @@ -3074,14 +3090,14 @@ msgid "" "invariant. See :pep:`484` and :pep:`695` for more details." msgstr "" -#: ../../library/typing.rst:1811 +#: ../../library/typing.rst:1818 msgid "" "Bounded type variables and constrained type variables have different " "semantics in several important ways. Using a *bounded* type variable means " "that the ``TypeVar`` will be solved using the most specific type possible::" msgstr "" -#: ../../library/typing.rst:1815 +#: ../../library/typing.rst:1822 msgid "" "x = print_capitalized('a string')\n" "reveal_type(x) # revealed type is str\n" @@ -3095,13 +3111,13 @@ msgid "" "z = print_capitalized(45) # error: int is not a subtype of str" msgstr "" -#: ../../library/typing.rst:1826 +#: ../../library/typing.rst:1833 msgid "" "The upper bound of a type variable can be a concrete type, abstract type " "(ABC or Protocol), or even a union of types::" msgstr "" -#: ../../library/typing.rst:1829 +#: ../../library/typing.rst:1836 msgid "" "# Can be anything with an __abs__ method\n" "def print_abs[T: SupportsAbs](arg: T) -> None:\n" @@ -3112,13 +3128,13 @@ msgid "" "V = TypeVar('V', bound=SupportsAbs) # Can be anything with an __abs__ method" msgstr "" -#: ../../library/typing.rst:1838 +#: ../../library/typing.rst:1845 msgid "" "Using a *constrained* type variable, however, means that the ``TypeVar`` can " "only ever be solved as being exactly one of the constraints given::" msgstr "" -#: ../../library/typing.rst:1841 +#: ../../library/typing.rst:1848 msgid "" "a = concatenate('one', 'two')\n" "reveal_type(a) # revealed type is str\n" @@ -3131,120 +3147,118 @@ msgid "" "or bytes in a function call, but not both" msgstr "" -#: ../../library/typing.rst:1849 +#: ../../library/typing.rst:1856 msgid "At runtime, ``isinstance(x, T)`` will raise :exc:`TypeError`." msgstr "在 runtime ``isinstance(x, T)`` 會引發 :exc:`TypeError`。" -#: ../../library/typing.rst:1853 +#: ../../library/typing.rst:1860 msgid "The name of the type variable." msgstr "" -#: ../../library/typing.rst:1857 +#: ../../library/typing.rst:1864 msgid "Whether the type var has been explicitly marked as covariant." msgstr "" -#: ../../library/typing.rst:1861 +#: ../../library/typing.rst:1868 msgid "Whether the type var has been explicitly marked as contravariant." msgstr "" -#: ../../library/typing.rst:1865 +#: ../../library/typing.rst:1872 msgid "" "Whether the type variable's variance should be inferred by type checkers." msgstr "" -#: ../../library/typing.rst:1871 +#: ../../library/typing.rst:1878 msgid "The upper bound of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1875 +#: ../../library/typing.rst:1882 msgid "" "For type variables created through :ref:`type parameter syntax `, the bound is evaluated only when the attribute is accessed, not " "when the type variable is created (see :ref:`lazy-evaluation`)." msgstr "" -#: ../../library/typing.rst:1881 +#: ../../library/typing.rst:1888 msgid "" "An :term:`evaluate function` corresponding to the :attr:`~TypeVar.__bound__` " -"attribute. When called directly, this method supports only " -"the :attr:`~annotationlib.Format.VALUE` format, which is equivalent to " -"accessing the :attr:`~TypeVar.__bound__` attribute directly, but the method " -"object can be passed to :func:`annotationlib.call_evaluate_function` to " -"evaluate the value in a different format." +"attribute. When called directly, this method supports only the :attr:" +"`~annotationlib.Format.VALUE` format, which is equivalent to accessing the :" +"attr:`~TypeVar.__bound__` attribute directly, but the method object can be " +"passed to :func:`annotationlib.call_evaluate_function` to evaluate the value " +"in a different format." msgstr "" -#: ../../library/typing.rst:1891 +#: ../../library/typing.rst:1898 msgid "A tuple containing the constraints of the type variable, if any." msgstr "" -#: ../../library/typing.rst:1895 +#: ../../library/typing.rst:1902 msgid "" "For type variables created through :ref:`type parameter syntax `, the constraints are evaluated only when the attribute is accessed, " "not when the type variable is created (see :ref:`lazy-evaluation`)." msgstr "" -#: ../../library/typing.rst:1901 +#: ../../library/typing.rst:1908 msgid "" -"An :term:`evaluate function` corresponding to " -"the :attr:`~TypeVar.__constraints__` attribute. When called directly, this " -"method supports only the :attr:`~annotationlib.Format.VALUE` format, which " -"is equivalent to accessing the :attr:`~TypeVar.__constraints__` attribute " -"directly, but the method object can be passed " -"to :func:`annotationlib.call_evaluate_function` to evaluate the value in a " -"different format." +"An :term:`evaluate function` corresponding to the :attr:`~TypeVar." +"__constraints__` attribute. When called directly, this method supports only " +"the :attr:`~annotationlib.Format.VALUE` format, which is equivalent to " +"accessing the :attr:`~TypeVar.__constraints__` attribute directly, but the " +"method object can be passed to :func:`annotationlib.call_evaluate_function` " +"to evaluate the value in a different format." msgstr "" -#: ../../library/typing.rst:1911 +#: ../../library/typing.rst:1918 msgid "" "The default value of the type variable, or :data:`typing.NoDefault` if it " "has no default." msgstr "" -#: ../../library/typing.rst:1918 +#: ../../library/typing.rst:1925 msgid "" -"An :term:`evaluate function` corresponding to " -"the :attr:`~TypeVar.__default__` attribute. When called directly, this " -"method supports only the :attr:`~annotationlib.Format.VALUE` format, which " -"is equivalent to accessing the :attr:`~TypeVar.__default__` attribute " -"directly, but the method object can be passed " -"to :func:`annotationlib.call_evaluate_function` to evaluate the value in a " -"different format." +"An :term:`evaluate function` corresponding to the :attr:`~TypeVar." +"__default__` attribute. When called directly, this method supports only the :" +"attr:`~annotationlib.Format.VALUE` format, which is equivalent to accessing " +"the :attr:`~TypeVar.__default__` attribute directly, but the method object " +"can be passed to :func:`annotationlib.call_evaluate_function` to evaluate " +"the value in a different format." msgstr "" -#: ../../library/typing.rst:1928 +#: ../../library/typing.rst:1935 msgid "" "Return whether or not the type variable has a default value. This is " -"equivalent to checking whether :attr:`__default__` is not " -"the :data:`typing.NoDefault` singleton, except that it does not force " -"evaluation of the :ref:`lazily evaluated ` default value." +"equivalent to checking whether :attr:`__default__` is not the :data:`typing." +"NoDefault` singleton, except that it does not force evaluation of the :ref:" +"`lazily evaluated ` default value." msgstr "" -#: ../../library/typing.rst:1937 +#: ../../library/typing.rst:1944 msgid "" "Type variables can now be declared using the :ref:`type parameter ` syntax introduced by :pep:`695`. The ``infer_variance`` parameter " "was added." msgstr "" -#: ../../library/typing.rst:1943 ../../library/typing.rst:2092 -#: ../../library/typing.rst:2204 +#: ../../library/typing.rst:1950 ../../library/typing.rst:2099 +#: ../../library/typing.rst:2211 msgid "Support for default values was added." msgstr "新增對預設值的支援。" -#: ../../library/typing.rst:1949 +#: ../../library/typing.rst:1956 msgid "" "Type variable tuple. A specialized form of :ref:`type variable ` " "that enables *variadic* generics." msgstr "" -#: ../../library/typing.rst:1952 +#: ../../library/typing.rst:1959 msgid "" "Type variable tuples can be declared in :ref:`type parameter lists ` using a single asterisk (``*``) before the name::" msgstr "" -#: ../../library/typing.rst:1955 +#: ../../library/typing.rst:1962 msgid "" "def move_first_element_to_last[T, *Ts](tup: tuple[T, *Ts]) -> tuple[*Ts, " "T]:\n" @@ -3254,11 +3268,11 @@ msgstr "" "T]:\n" " return (*tup[1:], tup[0])" -#: ../../library/typing.rst:1958 +#: ../../library/typing.rst:1965 msgid "Or by explicitly invoking the ``TypeVarTuple`` constructor::" msgstr "" -#: ../../library/typing.rst:1960 +#: ../../library/typing.rst:1967 msgid "" "T = TypeVar(\"T\")\n" "Ts = TypeVarTuple(\"Ts\")\n" @@ -3272,7 +3286,7 @@ msgstr "" "def move_first_element_to_last(tup: tuple[T, *Ts]) -> tuple[*Ts, T]:\n" " return (*tup[1:], tup[0])" -#: ../../library/typing.rst:1966 +#: ../../library/typing.rst:1973 msgid "" "A normal type variable enables parameterization with a single type. A type " "variable tuple, in contrast, allows parameterization with an *arbitrary* " @@ -3280,7 +3294,7 @@ msgid "" "wrapped in a tuple. For example::" msgstr "" -#: ../../library/typing.rst:1971 +#: ../../library/typing.rst:1978 msgid "" "# T is bound to int, Ts is bound to ()\n" "# Return value is (1,), which has type tuple[int]\n" @@ -3300,7 +3314,7 @@ msgid "" "move_first_element_to_last(tup=())" msgstr "" -#: ../../library/typing.rst:1988 +#: ../../library/typing.rst:1995 msgid "" "Note the use of the unpacking operator ``*`` in ``tuple[T, *Ts]``. " "Conceptually, you can think of ``Ts`` as a tuple of type variables ``(T1, " @@ -3310,13 +3324,13 @@ msgid "" "` instead, as ``Unpack[Ts]``.)" msgstr "" -#: ../../library/typing.rst:1996 +#: ../../library/typing.rst:2003 msgid "" "Type variable tuples must *always* be unpacked. This helps distinguish type " "variable tuples from normal type variables::" msgstr "" -#: ../../library/typing.rst:1999 +#: ../../library/typing.rst:2006 msgid "" "x: Ts # Not valid\n" "x: tuple[Ts] # Not valid\n" @@ -3326,13 +3340,13 @@ msgstr "" "x: tuple[Ts] # 無效\n" "x: tuple[*Ts] # 正確的做法" -#: ../../library/typing.rst:2003 +#: ../../library/typing.rst:2010 msgid "" "Type variable tuples can be used in the same contexts as normal type " "variables. For example, in class definitions, arguments, and return types::" msgstr "" -#: ../../library/typing.rst:2006 +#: ../../library/typing.rst:2013 msgid "" "class Array[*Shape]:\n" " def __getitem__(self, key: tuple[*Shape]) -> float: ...\n" @@ -3344,12 +3358,12 @@ msgstr "" " def __abs__(self) -> \"Array[*Shape]\": ...\n" " def get_shape(self) -> tuple[*Shape]: ..." -#: ../../library/typing.rst:2011 +#: ../../library/typing.rst:2018 msgid "" "Type variable tuples can be happily combined with normal type variables:" msgstr "" -#: ../../library/typing.rst:2013 +#: ../../library/typing.rst:2020 msgid "" "class Array[DType, *Shape]: # This is fine\n" " pass\n" @@ -3364,13 +3378,13 @@ msgid "" "int_array_2d: Array[int, Height, Width] = Array() # Yup, fine too" msgstr "" -#: ../../library/typing.rst:2027 +#: ../../library/typing.rst:2034 msgid "" "However, note that at most one type variable tuple may appear in a single " "list of type arguments or type parameters::" msgstr "" -#: ../../library/typing.rst:2030 +#: ../../library/typing.rst:2037 msgid "" "x: tuple[*Ts, *Ts] # Not valid\n" "class Array[*Shape, *Shape]: # Not valid\n" @@ -3380,13 +3394,13 @@ msgstr "" "class Array[*Shape, *Shape]: # 無效\n" " pass" -#: ../../library/typing.rst:2034 +#: ../../library/typing.rst:2041 msgid "" "Finally, an unpacked type variable tuple can be used as the type annotation " "of ``*args``::" msgstr "" -#: ../../library/typing.rst:2037 +#: ../../library/typing.rst:2044 msgid "" "def call_soon[*Ts](\n" " callback: Callable[[*Ts], None],\n" @@ -3402,7 +3416,7 @@ msgstr "" " ...\n" " callback(*args)" -#: ../../library/typing.rst:2044 +#: ../../library/typing.rst:2051 msgid "" "In contrast to non-unpacked annotations of ``*args`` - e.g. ``*args: int``, " "which would specify that *all* arguments are ``int`` - ``*args: *Ts`` " @@ -3411,72 +3425,71 @@ msgid "" "``call_soon`` match the types of the (positional) arguments of ``callback``." msgstr "" -#: ../../library/typing.rst:2051 +#: ../../library/typing.rst:2058 msgid "See :pep:`646` for more details on type variable tuples." msgstr "" -#: ../../library/typing.rst:2055 +#: ../../library/typing.rst:2062 msgid "The name of the type variable tuple." msgstr "" -#: ../../library/typing.rst:2059 +#: ../../library/typing.rst:2066 msgid "" "The default value of the type variable tuple, or :data:`typing.NoDefault` if " "it has no default." msgstr "" -#: ../../library/typing.rst:2066 +#: ../../library/typing.rst:2073 msgid "" -"An :term:`evaluate function` corresponding to " -"the :attr:`~TypeVarTuple.__default__` attribute. When called directly, this " -"method supports only the :attr:`~annotationlib.Format.VALUE` format, which " -"is equivalent to accessing the :attr:`~TypeVarTuple.__default__` attribute " -"directly, but the method object can be passed " -"to :func:`annotationlib.call_evaluate_function` to evaluate the value in a " -"different format." +"An :term:`evaluate function` corresponding to the :attr:`~TypeVarTuple." +"__default__` attribute. When called directly, this method supports only the :" +"attr:`~annotationlib.Format.VALUE` format, which is equivalent to accessing " +"the :attr:`~TypeVarTuple.__default__` attribute directly, but the method " +"object can be passed to :func:`annotationlib.call_evaluate_function` to " +"evaluate the value in a different format." msgstr "" -#: ../../library/typing.rst:2076 +#: ../../library/typing.rst:2083 msgid "" "Return whether or not the type variable tuple has a default value. This is " -"equivalent to checking whether :attr:`__default__` is not " -"the :data:`typing.NoDefault` singleton, except that it does not force " -"evaluation of the :ref:`lazily evaluated ` default value." +"equivalent to checking whether :attr:`__default__` is not the :data:`typing." +"NoDefault` singleton, except that it does not force evaluation of the :ref:" +"`lazily evaluated ` default value." msgstr "" -#: ../../library/typing.rst:2087 +#: ../../library/typing.rst:2094 msgid "" "Type variable tuples can now be declared using the :ref:`type parameter " "` syntax introduced by :pep:`695`." msgstr "" -#: ../../library/typing.rst:2096 +#: ../../library/typing.rst:2103 msgid "" "Parameter specification variable. A specialized version of :ref:`type " "variables `." msgstr "" -#: ../../library/typing.rst:2099 +#: ../../library/typing.rst:2106 msgid "" "In :ref:`type parameter lists `, parameter specifications can " "be declared with two asterisks (``**``)::" msgstr "" -#: ../../library/typing.rst:2102 +#: ../../library/typing.rst:2109 msgid "type IntFunc[**P] = Callable[P, int]" msgstr "type IntFunc[**P] = Callable[P, int]" -#: ../../library/typing.rst:2104 +#: ../../library/typing.rst:2111 msgid "" "For compatibility with Python 3.11 and earlier, ``ParamSpec`` objects can " "also be created as follows::" msgstr "" -#: ../../library/typing.rst:2107 +#: ../../library/typing.rst:2114 msgid "P = ParamSpec('P')" msgstr "P = ParamSpec('P')" -#: ../../library/typing.rst:2109 +#: ../../library/typing.rst:2116 msgid "" "Parameter specification variables exist primarily for the benefit of static " "type checkers. They are used to forward the parameter types of one callable " @@ -3486,7 +3499,7 @@ msgid "" "See :class:`Generic` for more information on generic types." msgstr "" -#: ../../library/typing.rst:2116 +#: ../../library/typing.rst:2123 msgid "" "For example, to add basic logging to a function, one can create a decorator " "``add_logging`` to log function calls. The parameter specification variable " @@ -3494,7 +3507,7 @@ msgid "" "new callable returned by it have inter-dependent type parameters::" msgstr "" -#: ../../library/typing.rst:2121 +#: ../../library/typing.rst:2128 msgid "" "from collections.abc import Callable\n" "import logging\n" @@ -3512,109 +3525,107 @@ msgid "" " return x + y" msgstr "" -#: ../../library/typing.rst:2136 +#: ../../library/typing.rst:2143 msgid "" "Without ``ParamSpec``, the simplest way to annotate this previously was to " "use a :class:`TypeVar` with upper bound ``Callable[..., Any]``. However " "this causes two problems:" msgstr "" -#: ../../library/typing.rst:2140 +#: ../../library/typing.rst:2147 msgid "" "The type checker can't type check the ``inner`` function because ``*args`` " "and ``**kwargs`` have to be typed :data:`Any`." msgstr "" -#: ../../library/typing.rst:2142 +#: ../../library/typing.rst:2149 msgid "" ":func:`~cast` may be required in the body of the ``add_logging`` decorator " "when returning the ``inner`` function, or the static type checker must be " "told to ignore the ``return inner``." msgstr "" -#: ../../library/typing.rst:2149 +#: ../../library/typing.rst:2156 msgid "" -"Since ``ParamSpec`` captures both positional and keyword parameters, " -"``P.args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " +"Since ``ParamSpec`` captures both positional and keyword parameters, ``P." +"args`` and ``P.kwargs`` can be used to split a ``ParamSpec`` into its " "components. ``P.args`` represents the tuple of positional parameters in a " "given call and should only be used to annotate ``*args``. ``P.kwargs`` " "represents the mapping of keyword parameters to their values in a given " "call, and should be only be used to annotate ``**kwargs``. Both attributes " "require the annotated parameter to be in scope. At runtime, ``P.args`` and " -"``P.kwargs`` are instances respectively of :class:`ParamSpecArgs` " -"and :class:`ParamSpecKwargs`." +"``P.kwargs`` are instances respectively of :class:`ParamSpecArgs` and :class:" +"`ParamSpecKwargs`." msgstr "" -#: ../../library/typing.rst:2161 +#: ../../library/typing.rst:2168 msgid "The name of the parameter specification." msgstr "" -#: ../../library/typing.rst:2165 +#: ../../library/typing.rst:2172 msgid "" -"The default value of the parameter specification, " -"or :data:`typing.NoDefault` if it has no default." +"The default value of the parameter specification, or :data:`typing." +"NoDefault` if it has no default." msgstr "" -#: ../../library/typing.rst:2172 +#: ../../library/typing.rst:2179 msgid "" -"An :term:`evaluate function` corresponding to " -"the :attr:`~ParamSpec.__default__` attribute. When called directly, this " -"method supports only the :attr:`~annotationlib.Format.VALUE` format, which " -"is equivalent to accessing the :attr:`~ParamSpec.__default__` attribute " -"directly, but the method object can be passed " -"to :func:`annotationlib.call_evaluate_function` to evaluate the value in a " -"different format." +"An :term:`evaluate function` corresponding to the :attr:`~ParamSpec." +"__default__` attribute. When called directly, this method supports only the :" +"attr:`~annotationlib.Format.VALUE` format, which is equivalent to accessing " +"the :attr:`~ParamSpec.__default__` attribute directly, but the method object " +"can be passed to :func:`annotationlib.call_evaluate_function` to evaluate " +"the value in a different format." msgstr "" -#: ../../library/typing.rst:2182 +#: ../../library/typing.rst:2189 msgid "" "Return whether or not the parameter specification has a default value. This " -"is equivalent to checking whether :attr:`__default__` is not " -"the :data:`typing.NoDefault` singleton, except that it does not force " -"evaluation of the :ref:`lazily evaluated ` default value." +"is equivalent to checking whether :attr:`__default__` is not the :data:" +"`typing.NoDefault` singleton, except that it does not force evaluation of " +"the :ref:`lazily evaluated ` default value." msgstr "" -#: ../../library/typing.rst:2189 +#: ../../library/typing.rst:2196 msgid "" "Parameter specification variables created with ``covariant=True`` or " "``contravariant=True`` can be used to declare covariant or contravariant " -"generic types. The ``bound`` argument is also accepted, similar " -"to :class:`TypeVar`. However the actual semantics of these keywords are yet " -"to be decided." +"generic types. The ``bound`` argument is also accepted, similar to :class:" +"`TypeVar`. However the actual semantics of these keywords are yet to be " +"decided." msgstr "" -#: ../../library/typing.rst:2199 +#: ../../library/typing.rst:2206 msgid "" "Parameter specifications can now be declared using the :ref:`type parameter " "` syntax introduced by :pep:`695`." msgstr "" -#: ../../library/typing.rst:2207 +#: ../../library/typing.rst:2214 msgid "" "Only parameter specification variables defined in global scope can be " "pickled." msgstr "" -#: ../../library/typing.rst:2213 +#: ../../library/typing.rst:2220 msgid ":data:`Concatenate`" msgstr ":data:`Concatenate`" -#: ../../library/typing.rst:2219 +#: ../../library/typing.rst:2226 msgid "" -"Arguments and keyword arguments attributes of a :class:`ParamSpec`. The " -"``P.args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, " -"and ``P.kwargs`` is an instance of ``ParamSpecKwargs``. They are intended " -"for runtime introspection and have no special meaning to static type " -"checkers." +"Arguments and keyword arguments attributes of a :class:`ParamSpec`. The ``P." +"args`` attribute of a ``ParamSpec`` is an instance of ``ParamSpecArgs``, and " +"``P.kwargs`` is an instance of ``ParamSpecKwargs``. They are intended for " +"runtime introspection and have no special meaning to static type checkers." msgstr "" -#: ../../library/typing.rst:2224 +#: ../../library/typing.rst:2231 msgid "" "Calling :func:`get_origin` on either of these objects will return the " "original ``ParamSpec``:" msgstr "" -#: ../../library/typing.rst:2227 +#: ../../library/typing.rst:2234 msgid "" ">>> from typing import ParamSpec, get_origin\n" ">>> P = ParamSpec(\"P\")\n" @@ -3630,11 +3641,11 @@ msgstr "" ">>> get_origin(P.kwargs) is P\n" "True" -#: ../../library/typing.rst:2241 +#: ../../library/typing.rst:2248 msgid "The type of type aliases created through the :keyword:`type` statement." msgstr "" -#: ../../library/typing.rst:2245 +#: ../../library/typing.rst:2252 msgid "" ">>> type Alias = int\n" ">>> type(Alias)\n" @@ -3644,11 +3655,11 @@ msgstr "" ">>> type(Alias)\n" "" -#: ../../library/typing.rst:2255 +#: ../../library/typing.rst:2262 msgid "The name of the type alias:" msgstr "" -#: ../../library/typing.rst:2257 +#: ../../library/typing.rst:2264 msgid "" ">>> type Alias = int\n" ">>> Alias.__name__\n" @@ -3658,11 +3669,11 @@ msgstr "" ">>> Alias.__name__\n" "'Alias'" -#: ../../library/typing.rst:2265 +#: ../../library/typing.rst:2272 msgid "The module in which the type alias was defined::" msgstr "" -#: ../../library/typing.rst:2267 +#: ../../library/typing.rst:2274 msgid "" ">>> type Alias = int\n" ">>> Alias.__module__\n" @@ -3672,13 +3683,13 @@ msgstr "" ">>> Alias.__module__\n" "'__main__'" -#: ../../library/typing.rst:2273 +#: ../../library/typing.rst:2280 msgid "" "The type parameters of the type alias, or an empty tuple if the alias is not " "generic:" msgstr "" -#: ../../library/typing.rst:2276 +#: ../../library/typing.rst:2283 msgid "" ">>> type ListOrSet[T] = list[T] | set[T]\n" ">>> ListOrSet.__type_params__\n" @@ -3694,14 +3705,14 @@ msgstr "" ">>> NotGeneric.__type_params__\n" "()" -#: ../../library/typing.rst:2287 +#: ../../library/typing.rst:2294 msgid "" "The type alias's value. This is :ref:`lazily evaluated `, " "so names used in the definition of the alias are not resolved until the " "``__value__`` attribute is accessed:" msgstr "" -#: ../../library/typing.rst:2291 +#: ../../library/typing.rst:2298 msgid "" ">>> type Mutually = Recursive\n" ">>> type Recursive = Mutually\n" @@ -3725,17 +3736,17 @@ msgstr "" ">>> Recursive.__value__\n" "Mutually" -#: ../../library/typing.rst:2306 +#: ../../library/typing.rst:2313 msgid "" "An :term:`evaluate function` corresponding to the :attr:`__value__` " -"attribute. When called directly, this method supports only " -"the :attr:`~annotationlib.Format.VALUE` format, which is equivalent to " -"accessing the :attr:`__value__` attribute directly, but the method object " -"can be passed to :func:`annotationlib.call_evaluate_function` to evaluate " -"the value in a different format:" +"attribute. When called directly, this method supports only the :attr:" +"`~annotationlib.Format.VALUE` format, which is equivalent to accessing the :" +"attr:`__value__` attribute directly, but the method object can be passed to :" +"func:`annotationlib.call_evaluate_function` to evaluate the value in a " +"different format:" msgstr "" -#: ../../library/typing.rst:2312 +#: ../../library/typing.rst:2319 msgid "" ">>> type Alias = undefined\n" ">>> Alias.__value__\n" @@ -3751,17 +3762,17 @@ msgid "" "ForwardRef('undefined')" msgstr "" -#: ../../library/typing.rst:2330 +#: ../../library/typing.rst:2337 msgid "Unpacking" msgstr "" -#: ../../library/typing.rst:2331 +#: ../../library/typing.rst:2338 msgid "" "Type aliases support star unpacking using the ``*Alias`` syntax. This is " "equivalent to using ``Unpack[Alias]`` directly:" msgstr "" -#: ../../library/typing.rst:2334 +#: ../../library/typing.rst:2341 msgid "" ">>> type Alias = tuple[int, str]\n" ">>> type Unpacked = tuple[bool, *Alias]\n" @@ -3769,27 +3780,27 @@ msgid "" "tuple[bool, typing.Unpack[Alias]]" msgstr "" -#: ../../library/typing.rst:2345 +#: ../../library/typing.rst:2352 msgid "Other special directives" msgstr "" -#: ../../library/typing.rst:2347 +#: ../../library/typing.rst:2354 msgid "" "These functions and classes should not be used directly as annotations. " "Their intended purpose is to be building blocks for creating and declaring " "types." msgstr "" -#: ../../library/typing.rst:2353 +#: ../../library/typing.rst:2360 msgid "Typed version of :func:`collections.namedtuple`." msgstr "" -#: ../../library/typing.rst:2355 ../../library/typing.rst:2451 -#: ../../library/typing.rst:3555 +#: ../../library/typing.rst:2362 ../../library/typing.rst:2458 +#: ../../library/typing.rst:3562 msgid "Usage::" msgstr "用法: ::" -#: ../../library/typing.rst:2357 +#: ../../library/typing.rst:2364 msgid "" "class Employee(NamedTuple):\n" " name: str\n" @@ -3799,20 +3810,20 @@ msgstr "" " name: str\n" " id: int" -#: ../../library/typing.rst:2361 +#: ../../library/typing.rst:2368 msgid "This is equivalent to::" msgstr "這等價於: ::" -#: ../../library/typing.rst:2363 +#: ../../library/typing.rst:2370 msgid "Employee = collections.namedtuple('Employee', ['name', 'id'])" msgstr "Employee = collections.namedtuple('Employee', ['name', 'id'])" -#: ../../library/typing.rst:2365 +#: ../../library/typing.rst:2372 msgid "" "To give a field a default value, you can assign to it in the class body::" msgstr "" -#: ../../library/typing.rst:2367 +#: ../../library/typing.rst:2374 msgid "" "class Employee(NamedTuple):\n" " name: str\n" @@ -3828,12 +3839,12 @@ msgstr "" "employee = Employee('Guido')\n" "assert employee.id == 3" -#: ../../library/typing.rst:2374 +#: ../../library/typing.rst:2381 msgid "" "Fields with a default value must come after any fields without a default." msgstr "" -#: ../../library/typing.rst:2376 +#: ../../library/typing.rst:2383 msgid "" "The resulting class has an extra attribute ``__annotations__`` giving a dict " "that maps the field names to the field types. (The field names are in the " @@ -3842,11 +3853,11 @@ msgid "" "API.)" msgstr "" -#: ../../library/typing.rst:2382 +#: ../../library/typing.rst:2389 msgid "``NamedTuple`` subclasses can also have docstrings and methods::" msgstr "" -#: ../../library/typing.rst:2384 +#: ../../library/typing.rst:2391 msgid "" "class Employee(NamedTuple):\n" " \"\"\"Represents an employee.\"\"\"\n" @@ -3857,11 +3868,11 @@ msgid "" " return f''" msgstr "" -#: ../../library/typing.rst:2392 +#: ../../library/typing.rst:2399 msgid "``NamedTuple`` subclasses can be generic::" msgstr "" -#: ../../library/typing.rst:2394 +#: ../../library/typing.rst:2401 msgid "" "class Group[T](NamedTuple):\n" " key: T\n" @@ -3871,11 +3882,11 @@ msgstr "" " key: T\n" " group: list[T]" -#: ../../library/typing.rst:2398 +#: ../../library/typing.rst:2405 msgid "Backward-compatible usage::" msgstr "" -#: ../../library/typing.rst:2400 +#: ../../library/typing.rst:2407 msgid "" "# For creating a generic NamedTuple on Python 3.11\n" "T = TypeVar(\"T\")\n" @@ -3888,45 +3899,45 @@ msgid "" "Employee = NamedTuple('Employee', [('name', str), ('id', int)])" msgstr "" -#: ../../library/typing.rst:2410 +#: ../../library/typing.rst:2417 msgid "Added support for :pep:`526` variable annotation syntax." msgstr "" -#: ../../library/typing.rst:2413 +#: ../../library/typing.rst:2420 msgid "Added support for default values, methods, and docstrings." msgstr "" -#: ../../library/typing.rst:2416 +#: ../../library/typing.rst:2423 msgid "" "The ``_field_types`` and ``__annotations__`` attributes are now regular " "dictionaries instead of instances of ``OrderedDict``." msgstr "" -#: ../../library/typing.rst:2420 +#: ../../library/typing.rst:2427 msgid "" "Removed the ``_field_types`` attribute in favor of the more standard " "``__annotations__`` attribute which has the same information." msgstr "" -#: ../../library/typing.rst:2424 +#: ../../library/typing.rst:2431 msgid "Added support for generic namedtuples." msgstr "" -#: ../../library/typing.rst:2427 +#: ../../library/typing.rst:2434 msgid "" "Using :func:`super` (and the ``__class__`` :term:`closure variable`) in " -"methods of ``NamedTuple`` subclasses is unsupported and causes " -"a :class:`TypeError`." +"methods of ``NamedTuple`` subclasses is unsupported and causes a :class:" +"`TypeError`." msgstr "" -#: ../../library/typing.rst:2431 +#: ../../library/typing.rst:2438 msgid "" "The undocumented keyword argument syntax for creating NamedTuple classes " "(``NT = NamedTuple(\"NT\", x=int)``) is deprecated, and will be disallowed " "in 3.15. Use the class-based syntax or the functional syntax instead." msgstr "" -#: ../../library/typing.rst:2436 +#: ../../library/typing.rst:2443 msgid "" "When using the functional syntax to create a NamedTuple class, failing to " "pass a value to the 'fields' parameter (``NT = NamedTuple(\"NT\")``) is " @@ -3936,48 +3947,48 @@ msgid "" "NT(NamedTuple): pass`` or ``NT = NamedTuple(\"NT\", [])``." msgstr "" -#: ../../library/typing.rst:2446 +#: ../../library/typing.rst:2453 msgid "Helper class to create low-overhead :ref:`distinct types `." msgstr "" -#: ../../library/typing.rst:2448 +#: ../../library/typing.rst:2455 msgid "" "A ``NewType`` is considered a distinct type by a typechecker. At runtime, " "however, calling a ``NewType`` returns its argument unchanged." msgstr "" -#: ../../library/typing.rst:2453 +#: ../../library/typing.rst:2460 msgid "" "UserId = NewType('UserId', int) # Declare the NewType \"UserId\"\n" "first_user = UserId(1) # \"UserId\" returns the argument unchanged at " "runtime" msgstr "" -#: ../../library/typing.rst:2458 +#: ../../library/typing.rst:2465 msgid "The module in which the new type is defined." msgstr "" -#: ../../library/typing.rst:2462 +#: ../../library/typing.rst:2469 msgid "The name of the new type." msgstr "" -#: ../../library/typing.rst:2466 +#: ../../library/typing.rst:2473 msgid "The type that the new type is based on." msgstr "" -#: ../../library/typing.rst:2470 +#: ../../library/typing.rst:2477 msgid "``NewType`` is now a class rather than a function." msgstr "" -#: ../../library/typing.rst:2475 +#: ../../library/typing.rst:2482 msgid "Base class for protocol classes." msgstr "" -#: ../../library/typing.rst:2477 +#: ../../library/typing.rst:2484 msgid "Protocol classes are defined like this::" msgstr "" -#: ../../library/typing.rst:2479 +#: ../../library/typing.rst:2486 msgid "" "class Proto(Protocol):\n" " def meth(self) -> int:\n" @@ -3987,13 +3998,13 @@ msgstr "" " def meth(self) -> int:\n" " ..." -#: ../../library/typing.rst:2483 +#: ../../library/typing.rst:2490 msgid "" "Such classes are primarily used with static type checkers that recognize " "structural subtyping (static duck-typing), for example::" msgstr "" -#: ../../library/typing.rst:2486 +#: ../../library/typing.rst:2493 msgid "" "class C:\n" " def meth(self) -> int:\n" @@ -4005,20 +4016,20 @@ msgid "" "func(C()) # Passes static type check" msgstr "" -#: ../../library/typing.rst:2495 +#: ../../library/typing.rst:2502 msgid "" -"See :pep:`544` for more details. Protocol classes decorated " -"with :func:`runtime_checkable` (described later) act as simple-minded " -"runtime protocols that check only the presence of given attributes, ignoring " -"their type signatures. Protocol classes without this decorator cannot be " -"used as the second argument to :func:`isinstance` or :func:`issubclass`." +"See :pep:`544` for more details. Protocol classes decorated with :func:" +"`runtime_checkable` (described later) act as simple-minded runtime protocols " +"that check only the presence of given attributes, ignoring their type " +"signatures. Protocol classes without this decorator cannot be used as the " +"second argument to :func:`isinstance` or :func:`issubclass`." msgstr "" -#: ../../library/typing.rst:2501 +#: ../../library/typing.rst:2508 msgid "Protocol classes can be generic, for example::" msgstr "" -#: ../../library/typing.rst:2503 +#: ../../library/typing.rst:2510 msgid "" "class GenProto[T](Protocol):\n" " def meth(self) -> T:\n" @@ -4028,13 +4039,13 @@ msgstr "" " def meth(self) -> T:\n" " ..." -#: ../../library/typing.rst:2507 +#: ../../library/typing.rst:2514 msgid "" "In code that needs to be compatible with Python 3.11 or older, generic " "Protocols can be written as follows::" msgstr "" -#: ../../library/typing.rst:2510 +#: ../../library/typing.rst:2517 msgid "" "T = TypeVar(\"T\")\n" "\n" @@ -4048,19 +4059,19 @@ msgstr "" " def meth(self) -> T:\n" " ..." -#: ../../library/typing.rst:2520 +#: ../../library/typing.rst:2527 msgid "Mark a protocol class as a runtime protocol." msgstr "" -#: ../../library/typing.rst:2522 +#: ../../library/typing.rst:2529 msgid "" "Such a protocol can be used with :func:`isinstance` and :func:`issubclass`. " "This allows a simple-minded structural check, very similar to \"one trick " -"ponies\" in :mod:`collections.abc` such " -"as :class:`~collections.abc.Iterable`. For example::" +"ponies\" in :mod:`collections.abc` such as :class:`~collections.abc." +"Iterable`. For example::" msgstr "" -#: ../../library/typing.rst:2526 +#: ../../library/typing.rst:2533 msgid "" "@runtime_checkable\n" "class Closable(Protocol):\n" @@ -4088,23 +4099,23 @@ msgstr "" "import threading\n" "assert isinstance(threading.Thread(name='Bob'), Named)" -#: ../../library/typing.rst:2539 +#: ../../library/typing.rst:2546 msgid "" "This decorator raises :exc:`TypeError` when applied to a non-protocol class." msgstr "" -#: ../../library/typing.rst:2543 +#: ../../library/typing.rst:2550 msgid "" ":func:`!runtime_checkable` will check only the presence of the required " -"methods or attributes, not their type signatures or types. For " -"example, :class:`ssl.SSLObject` is a class, therefore it passes " -"an :func:`issubclass` check against :ref:`Callable `. " -"However, the ``ssl.SSLObject.__init__`` method exists only to raise " -"a :exc:`TypeError` with a more informative message, therefore making it " -"impossible to call (instantiate) :class:`ssl.SSLObject`." +"methods or attributes, not their type signatures or types. For example, :" +"class:`ssl.SSLObject` is a class, therefore it passes an :func:`issubclass` " +"check against :ref:`Callable `. However, the ``ssl." +"SSLObject.__init__`` method exists only to raise a :exc:`TypeError` with a " +"more informative message, therefore making it impossible to call " +"(instantiate) :class:`ssl.SSLObject`." msgstr "" -#: ../../library/typing.rst:2554 +#: ../../library/typing.rst:2561 msgid "" "An :func:`isinstance` check against a runtime-checkable protocol can be " "surprisingly slow compared to an ``isinstance()`` check against a non-" @@ -4112,7 +4123,7 @@ msgid "" "calls for structural checks in performance-sensitive code." msgstr "" -#: ../../library/typing.rst:2562 +#: ../../library/typing.rst:2569 msgid "" "The internal implementation of :func:`isinstance` checks against runtime-" "checkable protocols now uses :func:`inspect.getattr_static` to look up " @@ -4122,23 +4133,22 @@ msgid "" "versa. Most users are unlikely to be affected by this change." msgstr "" -#: ../../library/typing.rst:2571 +#: ../../library/typing.rst:2578 msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " "onto a runtime-checkable protocol will still work, but will have no impact " -"on :func:`isinstance` checks comparing objects to the protocol. " -"See :ref:`What's new in Python 3.12 ` for more " -"details." +"on :func:`isinstance` checks comparing objects to the protocol. See :ref:" +"`What's new in Python 3.12 ` for more details." msgstr "" -#: ../../library/typing.rst:2582 +#: ../../library/typing.rst:2589 msgid "" "Special construct to add type hints to a dictionary. At runtime it is a " "plain :class:`dict`." msgstr "" -#: ../../library/typing.rst:2585 +#: ../../library/typing.rst:2592 msgid "" "``TypedDict`` declares a dictionary type that expects all of its instances " "to have a certain set of keys, where each key is associated with a value of " @@ -4146,7 +4156,7 @@ msgid "" "enforced by type checkers. Usage::" msgstr "" -#: ../../library/typing.rst:2591 +#: ../../library/typing.rst:2598 msgid "" "class Point2D(TypedDict):\n" " x: int\n" @@ -4159,25 +4169,25 @@ msgid "" "assert Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first')" msgstr "" -#: ../../library/typing.rst:2601 +#: ../../library/typing.rst:2608 msgid "" "An alternative way to create a ``TypedDict`` is by using function-call " "syntax. The second argument must be a literal :class:`dict`::" msgstr "" -#: ../../library/typing.rst:2604 +#: ../../library/typing.rst:2611 msgid "Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})" msgstr "Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})" -#: ../../library/typing.rst:2606 +#: ../../library/typing.rst:2613 msgid "" -"This functional syntax allows defining keys which are not " -"valid :ref:`identifiers `, for example because they are " -"keywords or contain hyphens, or when key names must not be :ref:`mangled " -"` like regular private names::" +"This functional syntax allows defining keys which are not valid :ref:" +"`identifiers `, for example because they are keywords or " +"contain hyphens, or when key names must not be :ref:`mangled ` like regular private names::" msgstr "" -#: ../../library/typing.rst:2611 +#: ../../library/typing.rst:2618 msgid "" "# raises SyntaxError\n" "class Point2D(TypedDict):\n" @@ -4192,13 +4202,13 @@ msgid "" "Definition = TypedDict('Definition', {'__schema': str}) # not mangled" msgstr "" -#: ../../library/typing.rst:2623 +#: ../../library/typing.rst:2630 msgid "" "By default, all keys must be present in a ``TypedDict``. It is possible to " "mark individual keys as non-required using :data:`NotRequired`::" msgstr "" -#: ../../library/typing.rst:2626 +#: ../../library/typing.rst:2633 msgid "" "class Point2D(TypedDict):\n" " x: int\n" @@ -4218,19 +4228,19 @@ msgstr "" "Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': " "NotRequired[str]})" -#: ../../library/typing.rst:2634 +#: ../../library/typing.rst:2641 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have the ``label`` key " "omitted." msgstr "" -#: ../../library/typing.rst:2637 +#: ../../library/typing.rst:2644 msgid "" "It is also possible to mark all keys as non-required by default by " "specifying a totality of ``False``::" msgstr "" -#: ../../library/typing.rst:2640 +#: ../../library/typing.rst:2647 msgid "" "class Point2D(TypedDict, total=False):\n" " x: int\n" @@ -4246,7 +4256,7 @@ msgstr "" "# 替代語法\n" "Point2D = TypedDict('Point2D', {'x': int, 'y': int}, total=False)" -#: ../../library/typing.rst:2647 +#: ../../library/typing.rst:2654 msgid "" "This means that a ``Point2D`` ``TypedDict`` can have any of the keys " "omitted. A type checker is only expected to support a literal ``False`` or " @@ -4254,13 +4264,13 @@ msgid "" "and makes all items defined in the class body required." msgstr "" -#: ../../library/typing.rst:2652 +#: ../../library/typing.rst:2659 msgid "" "Individual keys of a ``total=False`` ``TypedDict`` can be marked as required " "using :data:`Required`::" msgstr "" -#: ../../library/typing.rst:2655 +#: ../../library/typing.rst:2662 msgid "" "class Point2D(TypedDict, total=False):\n" " x: Required[int]\n" @@ -4286,13 +4296,13 @@ msgstr "" " 'label': str\n" "}, total=False)" -#: ../../library/typing.rst:2667 +#: ../../library/typing.rst:2674 msgid "" "It is possible for a ``TypedDict`` type to inherit from one or more other " "``TypedDict`` types using the class-based syntax. Usage::" msgstr "" -#: ../../library/typing.rst:2671 +#: ../../library/typing.rst:2678 msgid "" "class Point3D(Point2D):\n" " z: int" @@ -4300,13 +4310,13 @@ msgstr "" "class Point3D(Point2D):\n" " z: int" -#: ../../library/typing.rst:2674 +#: ../../library/typing.rst:2681 msgid "" "``Point3D`` has three items: ``x``, ``y`` and ``z``. It is equivalent to " "this definition::" msgstr "" -#: ../../library/typing.rst:2677 +#: ../../library/typing.rst:2684 msgid "" "class Point3D(TypedDict):\n" " x: int\n" @@ -4318,13 +4328,13 @@ msgstr "" " y: int\n" " z: int" -#: ../../library/typing.rst:2682 +#: ../../library/typing.rst:2689 msgid "" "A ``TypedDict`` cannot inherit from a non-\\ ``TypedDict`` class, except " "for :class:`Generic`. For example::" msgstr "" -#: ../../library/typing.rst:2685 +#: ../../library/typing.rst:2692 msgid "" "class X(TypedDict):\n" " x: int\n" @@ -4350,11 +4360,11 @@ msgstr "" "\n" "class XZ(X, Z): pass # 引發 TypeError" -#: ../../library/typing.rst:2697 +#: ../../library/typing.rst:2704 msgid "A ``TypedDict`` can be generic::" msgstr "" -#: ../../library/typing.rst:2699 +#: ../../library/typing.rst:2706 msgid "" "class Group[T](TypedDict):\n" " key: T\n" @@ -4364,13 +4374,13 @@ msgstr "" " key: T\n" " group: list[T]" -#: ../../library/typing.rst:2703 +#: ../../library/typing.rst:2710 msgid "" "To create a generic ``TypedDict`` that is compatible with Python 3.11 or " "lower, inherit from :class:`Generic` explicitly:" msgstr "" -#: ../../library/typing.rst:2706 +#: ../../library/typing.rst:2713 msgid "" "T = TypeVar(\"T\")\n" "\n" @@ -4384,20 +4394,19 @@ msgstr "" " key: T\n" " group: list[T]" -#: ../../library/typing.rst:2714 +#: ../../library/typing.rst:2721 msgid "" -"A ``TypedDict`` can be introspected via annotations dicts " -"(see :ref:`annotations-howto` for more information on annotations best " -"practices), :attr:`__total__`, :attr:`__required_keys__`, " -"and :attr:`__optional_keys__`." +"A ``TypedDict`` can be introspected via annotations dicts (see :ref:" +"`annotations-howto` for more information on annotations best practices), :" +"attr:`__total__`, :attr:`__required_keys__`, and :attr:`__optional_keys__`." msgstr "" -#: ../../library/typing.rst:2720 +#: ../../library/typing.rst:2727 msgid "" "``Point2D.__total__`` gives the value of the ``total`` argument. Example:" msgstr "" -#: ../../library/typing.rst:2723 +#: ../../library/typing.rst:2730 msgid "" ">>> from typing import TypedDict\n" ">>> class Point2D(TypedDict): pass\n" @@ -4421,7 +4430,7 @@ msgstr "" ">>> Point3D.__total__\n" "True" -#: ../../library/typing.rst:2736 +#: ../../library/typing.rst:2743 msgid "" "This attribute reflects *only* the value of the ``total`` argument to the " "current ``TypedDict`` class, not whether the class is semantically total. " @@ -4432,21 +4441,21 @@ msgid "" "introspection." msgstr "" -#: ../../library/typing.rst:2749 +#: ../../library/typing.rst:2756 msgid "" -"``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` " -"return :class:`frozenset` objects containing required and non-required keys, " +"``Point2D.__required_keys__`` and ``Point2D.__optional_keys__`` return :" +"class:`frozenset` objects containing required and non-required keys, " "respectively." msgstr "" -#: ../../library/typing.rst:2752 +#: ../../library/typing.rst:2759 msgid "" "Keys marked with :data:`Required` will always appear in " "``__required_keys__`` and keys marked with :data:`NotRequired` will always " "appear in ``__optional_keys__``." msgstr "" -#: ../../library/typing.rst:2755 +#: ../../library/typing.rst:2762 msgid "" "For backwards compatibility with Python 3.10 and below, it is also possible " "to use inheritance to declare both required and non-required keys in the " @@ -4455,7 +4464,7 @@ msgid "" "``TypedDict`` with a different value for ``total``:" msgstr "" -#: ../../library/typing.rst:2762 +#: ../../library/typing.rst:2769 msgid "" ">>> class Point2D(TypedDict, total=False):\n" "... x: int\n" @@ -4481,7 +4490,7 @@ msgstr "" ">>> Point3D.__optional_keys__ == frozenset({'x', 'y'})\n" "True" -#: ../../library/typing.rst:2780 +#: ../../library/typing.rst:2787 msgid "" "If ``from __future__ import annotations`` is used or if annotations are " "given as strings, annotations are not evaluated when the ``TypedDict`` is " @@ -4490,50 +4499,50 @@ msgid "" "attributes may be incorrect." msgstr "" -#: ../../library/typing.rst:2786 +#: ../../library/typing.rst:2793 msgid "Support for :data:`ReadOnly` is reflected in the following attributes:" msgstr "" -#: ../../library/typing.rst:2790 +#: ../../library/typing.rst:2797 msgid "" "A :class:`frozenset` containing the names of all read-only keys. Keys are " "read-only if they carry the :data:`ReadOnly` qualifier." msgstr "" -#: ../../library/typing.rst:2797 +#: ../../library/typing.rst:2804 msgid "" "A :class:`frozenset` containing the names of all mutable keys. Keys are " "mutable if they do not carry the :data:`ReadOnly` qualifier." msgstr "" -#: ../../library/typing.rst:2802 +#: ../../library/typing.rst:2809 msgid "" -"See the `TypedDict `_ section in the typing documentation for more " -"examples and detailed rules." +"See the `TypedDict `_ section in the typing documentation for more examples and " +"detailed rules." msgstr "" -#: ../../library/typing.rst:2806 +#: ../../library/typing.rst:2813 msgid "" -"Added support for marking individual keys as :data:`Required` " -"or :data:`NotRequired`. See :pep:`655`." +"Added support for marking individual keys as :data:`Required` or :data:" +"`NotRequired`. See :pep:`655`." msgstr "" -#: ../../library/typing.rst:2810 +#: ../../library/typing.rst:2817 msgid "Added support for generic ``TypedDict``\\ s." msgstr "" -#: ../../library/typing.rst:2813 +#: ../../library/typing.rst:2820 msgid "" "Removed support for the keyword-argument method of creating ``TypedDict``\\ " "s." msgstr "" -#: ../../library/typing.rst:2816 +#: ../../library/typing.rst:2823 msgid "Support for the :data:`ReadOnly` qualifier was added." msgstr "" -#: ../../library/typing.rst:2819 +#: ../../library/typing.rst:2826 msgid "" "When using the functional syntax to create a TypedDict class, failing to " "pass a value to the 'fields' parameter (``TD = TypedDict(\"TD\")``) is " @@ -4543,53 +4552,53 @@ msgid "" "TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})``." msgstr "" -#: ../../library/typing.rst:2828 +#: ../../library/typing.rst:2835 msgid "Protocols" msgstr "協定" -#: ../../library/typing.rst:2830 +#: ../../library/typing.rst:2837 msgid "" "The following protocols are provided by the :mod:`!typing` module. All are " "decorated with :func:`@runtime_checkable `." msgstr "" -#: ../../library/typing.rst:2835 +#: ../../library/typing.rst:2842 msgid "" "An ABC with one abstract method ``__abs__`` that is covariant in its return " "type." msgstr "" -#: ../../library/typing.rst:2840 +#: ../../library/typing.rst:2847 msgid "An ABC with one abstract method ``__bytes__``." msgstr "一個有抽象方法 ``__bytes__`` 的 ABC。" -#: ../../library/typing.rst:2844 +#: ../../library/typing.rst:2851 msgid "An ABC with one abstract method ``__complex__``." msgstr "一個有抽象方法 ``__complex__`` 的 ABC。" -#: ../../library/typing.rst:2848 +#: ../../library/typing.rst:2855 msgid "An ABC with one abstract method ``__float__``." msgstr "一個有抽象方法 ``__float__`` 的 ABC。" -#: ../../library/typing.rst:2852 +#: ../../library/typing.rst:2859 msgid "An ABC with one abstract method ``__index__``." msgstr "一個有抽象方法 ``__index__`` 的 ABC。" -#: ../../library/typing.rst:2858 +#: ../../library/typing.rst:2865 msgid "An ABC with one abstract method ``__int__``." msgstr "一個有抽象方法 ``__int__`` 的 ABC。" -#: ../../library/typing.rst:2862 +#: ../../library/typing.rst:2869 msgid "" "An ABC with one abstract method ``__round__`` that is covariant in its " "return type." msgstr "" -#: ../../library/typing.rst:2868 +#: ../../library/typing.rst:2875 msgid "ABCs and Protocols for working with I/O" msgstr "" -#: ../../library/typing.rst:2874 +#: ../../library/typing.rst:2881 msgid "" "Generic class ``IO[AnyStr]`` and its subclasses ``TextIO(IO[str])`` and " "``BinaryIO(IO[bytes])`` represent the types of I/O streams such as returned " @@ -4597,80 +4606,80 @@ msgid "" "interface is fairly broad." msgstr "" -#: ../../library/typing.rst:2880 +#: ../../library/typing.rst:2887 msgid "" "The protocols :class:`io.Reader` and :class:`io.Writer` offer a simpler " "alternative for argument types, when only the ``read()`` or ``write()`` " "methods are accessed, respectively::" msgstr "" -#: ../../library/typing.rst:2884 +#: ../../library/typing.rst:2891 msgid "" "def read_and_write(reader: Reader[str], writer: Writer[bytes]):\n" " data = reader.read()\n" " writer.write(data.encode())" msgstr "" -#: ../../library/typing.rst:2888 +#: ../../library/typing.rst:2895 msgid "" "Also consider using :class:`collections.abc.Iterable` for iterating over the " "lines of an input stream::" msgstr "" -#: ../../library/typing.rst:2891 +#: ../../library/typing.rst:2898 msgid "" "def read_config(stream: Iterable[str]):\n" " for line in stream:\n" " ..." msgstr "" -#: ../../library/typing.rst:2896 +#: ../../library/typing.rst:2903 msgid "Functions and decorators" msgstr "函式與裝飾器" -#: ../../library/typing.rst:2900 +#: ../../library/typing.rst:2907 msgid "Cast a value to a type." msgstr "" -#: ../../library/typing.rst:2902 +#: ../../library/typing.rst:2909 msgid "" "This returns the value unchanged. To the type checker this signals that the " "return value has the designated type, but at runtime we intentionally don't " "check anything (we want this to be as fast as possible)." msgstr "" -#: ../../library/typing.rst:2909 +#: ../../library/typing.rst:2916 msgid "" "Ask a static type checker to confirm that *val* has an inferred type of " "*typ*." msgstr "" -#: ../../library/typing.rst:2911 +#: ../../library/typing.rst:2918 msgid "" "At runtime this does nothing: it returns the first argument unchanged with " "no checks or side effects, no matter the actual type of the argument." msgstr "" -#: ../../library/typing.rst:2914 +#: ../../library/typing.rst:2921 msgid "" "When a static type checker encounters a call to ``assert_type()``, it emits " "an error if the value is not of the specified type::" msgstr "" -#: ../../library/typing.rst:2917 +#: ../../library/typing.rst:2924 msgid "" "def greet(name: str) -> None:\n" " assert_type(name, str) # OK, inferred type of `name` is `str`\n" " assert_type(name, int) # type checker error" msgstr "" -#: ../../library/typing.rst:2921 +#: ../../library/typing.rst:2928 msgid "" "This function is useful for ensuring the type checker's understanding of a " "script is in line with the developer's intentions::" msgstr "" -#: ../../library/typing.rst:2924 +#: ../../library/typing.rst:2931 msgid "" "def complex_function(arg: object):\n" " # Do some complex type-narrowing logic,\n" @@ -4680,16 +4689,16 @@ msgid "" " assert_type(arg, int)" msgstr "" -#: ../../library/typing.rst:2935 +#: ../../library/typing.rst:2942 msgid "" "Ask a static type checker to confirm that a line of code is unreachable." msgstr "" -#: ../../library/typing.rst:2937 +#: ../../library/typing.rst:2944 msgid "Example::" msgstr "舉例來說: ::" -#: ../../library/typing.rst:2939 +#: ../../library/typing.rst:2946 msgid "" "def int_or_str(arg: int | str) -> None:\n" " match arg:\n" @@ -4709,14 +4718,14 @@ msgstr "" " case _ as unreachable:\n" " assert_never(unreachable)" -#: ../../library/typing.rst:2948 +#: ../../library/typing.rst:2955 msgid "" "Here, the annotations allow the type checker to infer that the last case can " "never execute, because ``arg`` is either an :class:`int` or a :class:`str`, " "and both options are covered by earlier cases." msgstr "" -#: ../../library/typing.rst:2953 +#: ../../library/typing.rst:2960 msgid "" "If a type checker finds that a call to ``assert_never()`` is reachable, it " "will emit an error. For example, if the type annotation for ``arg`` was " @@ -4726,47 +4735,47 @@ msgid "" "passed in must be the bottom type, :data:`Never`, and nothing else." msgstr "" -#: ../../library/typing.rst:2961 +#: ../../library/typing.rst:2968 msgid "At runtime, this throws an exception when called." msgstr "" -#: ../../library/typing.rst:2964 +#: ../../library/typing.rst:2971 msgid "" "`Unreachable Code and Exhaustiveness Checking `__ has more information about exhaustiveness " "checking with static typing." msgstr "" -#: ../../library/typing.rst:2972 +#: ../../library/typing.rst:2979 msgid "Ask a static type checker to reveal the inferred type of an expression." msgstr "" -#: ../../library/typing.rst:2974 +#: ../../library/typing.rst:2981 msgid "" "When a static type checker encounters a call to this function, it emits a " "diagnostic with the inferred type of the argument. For example::" msgstr "" -#: ../../library/typing.rst:2977 +#: ../../library/typing.rst:2984 msgid "" "x: int = 1\n" "reveal_type(x) # Revealed type is \"builtins.int\"" msgstr "" -#: ../../library/typing.rst:2980 +#: ../../library/typing.rst:2987 msgid "" "This can be useful when you want to debug how your type checker handles a " "particular piece of code." msgstr "" -#: ../../library/typing.rst:2983 +#: ../../library/typing.rst:2990 msgid "" -"At runtime, this function prints the runtime type of its argument " -"to :data:`sys.stderr` and returns the argument unchanged (allowing the call " -"to be used within an expression)::" +"At runtime, this function prints the runtime type of its argument to :data:" +"`sys.stderr` and returns the argument unchanged (allowing the call to be " +"used within an expression)::" msgstr "" -#: ../../library/typing.rst:2987 +#: ../../library/typing.rst:2994 msgid "" "x = reveal_type(1) # prints \"Runtime type is int\"\n" "print(x) # prints \"1\"" @@ -4774,13 +4783,13 @@ msgstr "" "x = reveal_type(1) # 印出 \"Runtime type is int\"\n" "print(x) # 印出 \"1\"" -#: ../../library/typing.rst:2990 +#: ../../library/typing.rst:2997 msgid "" "Note that the runtime type may be different from (more or less specific " "than) the type statically inferred by a type checker." msgstr "" -#: ../../library/typing.rst:2993 +#: ../../library/typing.rst:3000 msgid "" "Most type checkers support ``reveal_type()`` anywhere, even if the name is " "not imported from ``typing``. Importing the name from ``typing``, however, " @@ -4788,13 +4797,13 @@ msgid "" "clearly." msgstr "" -#: ../../library/typing.rst:3004 +#: ../../library/typing.rst:3011 msgid "" -"Decorator to mark an object as providing :func:`dataclass " -"`-like behavior." +"Decorator to mark an object as providing :func:`dataclass `-like behavior." msgstr "" -#: ../../library/typing.rst:3007 +#: ../../library/typing.rst:3014 msgid "" "``dataclass_transform`` may be used to decorate a class, metaclass, or a " "function that is itself a decorator. The presence of " @@ -4803,11 +4812,11 @@ msgid "" "to :func:`@dataclasses.dataclass `." msgstr "" -#: ../../library/typing.rst:3014 +#: ../../library/typing.rst:3021 msgid "Example usage with a decorator function:" msgstr "" -#: ../../library/typing.rst:3016 +#: ../../library/typing.rst:3023 msgid "" "@dataclass_transform()\n" "def create_model[T](cls: type[T]) -> type[T]:\n" @@ -4829,11 +4838,11 @@ msgstr "" " id: int\n" " name: str" -#: ../../library/typing.rst:3028 +#: ../../library/typing.rst:3035 msgid "On a base class::" msgstr "" -#: ../../library/typing.rst:3030 +#: ../../library/typing.rst:3037 msgid "" "@dataclass_transform()\n" "class ModelBase: ...\n" @@ -4849,11 +4858,11 @@ msgstr "" " id: int\n" " name: str" -#: ../../library/typing.rst:3037 +#: ../../library/typing.rst:3044 msgid "On a metaclass::" msgstr "" -#: ../../library/typing.rst:3039 +#: ../../library/typing.rst:3046 msgid "" "@dataclass_transform()\n" "class ModelMeta(type): ...\n" @@ -4873,15 +4882,15 @@ msgstr "" " id: int\n" " name: str" -#: ../../library/typing.rst:3048 +#: ../../library/typing.rst:3055 msgid "" "The ``CustomerModel`` classes defined above will be treated by type checkers " -"similarly to classes created with :func:`@dataclasses.dataclass " -"`. For example, type checkers will assume these " -"classes have ``__init__`` methods that accept ``id`` and ``name``." +"similarly to classes created with :func:`@dataclasses.dataclass `. For example, type checkers will assume these classes have " +"``__init__`` methods that accept ``id`` and ``name``." msgstr "" -#: ../../library/typing.rst:3054 +#: ../../library/typing.rst:3061 msgid "" "The decorated class, metaclass, or function may accept the following bool " "arguments which type checkers will assume have the same effect as they would " @@ -4891,7 +4900,7 @@ msgid "" "arguments (``True`` or ``False``) to be statically evaluated." msgstr "" -#: ../../library/typing.rst:3062 +#: ../../library/typing.rst:3069 msgid "" "The arguments to the ``dataclass_transform`` decorator can be used to " "customize the default behaviors of the decorated class, metaclass, or " @@ -4902,90 +4911,90 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/typing.rst:3066 +#: ../../library/typing.rst:3073 msgid "" "Indicates whether the ``eq`` parameter is assumed to be ``True`` or " "``False`` if it is omitted by the caller. Defaults to ``True``." msgstr "" -#: ../../library/typing.rst:3071 +#: ../../library/typing.rst:3078 msgid "" "Indicates whether the ``order`` parameter is assumed to be ``True`` or " "``False`` if it is omitted by the caller. Defaults to ``False``." msgstr "" -#: ../../library/typing.rst:3076 +#: ../../library/typing.rst:3083 msgid "" "Indicates whether the ``kw_only`` parameter is assumed to be ``True`` or " "``False`` if it is omitted by the caller. Defaults to ``False``." msgstr "" -#: ../../library/typing.rst:3081 +#: ../../library/typing.rst:3088 msgid "" "Indicates whether the ``frozen`` parameter is assumed to be ``True`` or " "``False`` if it is omitted by the caller. Defaults to ``False``. .. " "versionadded:: 3.12" msgstr "" -#: ../../library/typing.rst:3082 +#: ../../library/typing.rst:3089 msgid "" "Indicates whether the ``frozen`` parameter is assumed to be ``True`` or " "``False`` if it is omitted by the caller. Defaults to ``False``." msgstr "" -#: ../../library/typing.rst:3088 +#: ../../library/typing.rst:3095 msgid "" "Specifies a static list of supported classes or functions that describe " "fields, similar to :func:`dataclasses.field`. Defaults to ``()``." msgstr "" -#: ../../library/typing.rst:3094 +#: ../../library/typing.rst:3101 msgid "" "Arbitrary other keyword arguments are accepted in order to allow for " "possible future extensions." msgstr "" -#: ../../library/typing.rst:3098 +#: ../../library/typing.rst:3105 msgid "" "Type checkers recognize the following optional parameters on field " "specifiers:" msgstr "" -#: ../../library/typing.rst:3101 +#: ../../library/typing.rst:3108 msgid "**Recognised parameters for field specifiers**" msgstr "" -#: ../../library/typing.rst:3105 +#: ../../library/typing.rst:3112 msgid "Parameter name" msgstr "" -#: ../../library/typing.rst:3106 +#: ../../library/typing.rst:3113 msgid "Description" msgstr "" -#: ../../library/typing.rst:3107 +#: ../../library/typing.rst:3114 msgid "``init``" msgstr "``init``" -#: ../../library/typing.rst:3108 +#: ../../library/typing.rst:3115 msgid "" "Indicates whether the field should be included in the synthesized " "``__init__`` method. If unspecified, ``init`` defaults to ``True``." msgstr "" -#: ../../library/typing.rst:3111 +#: ../../library/typing.rst:3118 msgid "``default``" msgstr "``default``" -#: ../../library/typing.rst:3112 +#: ../../library/typing.rst:3119 msgid "Provides the default value for the field." msgstr "" -#: ../../library/typing.rst:3113 +#: ../../library/typing.rst:3120 msgid "``default_factory``" msgstr "``default_factory``" -#: ../../library/typing.rst:3114 +#: ../../library/typing.rst:3121 msgid "" "Provides a runtime callback that returns the default value for the field. If " "neither ``default`` nor ``default_factory`` are specified, the field is " @@ -4993,19 +5002,19 @@ msgid "" "is instantiated." msgstr "" -#: ../../library/typing.rst:3119 +#: ../../library/typing.rst:3126 msgid "``factory``" msgstr "``factory``" -#: ../../library/typing.rst:3120 +#: ../../library/typing.rst:3127 msgid "An alias for the ``default_factory`` parameter on field specifiers." msgstr "" -#: ../../library/typing.rst:3121 +#: ../../library/typing.rst:3128 msgid "``kw_only``" msgstr "``kw_only``" -#: ../../library/typing.rst:3122 +#: ../../library/typing.rst:3129 msgid "" "Indicates whether the field should be marked as keyword-only. If ``True``, " "the field will be keyword-only. If ``False``, it will not be keyword-only. " @@ -5015,32 +5024,32 @@ msgid "" "will be used." msgstr "" -#: ../../library/typing.rst:3128 +#: ../../library/typing.rst:3135 msgid "``alias``" msgstr "``alias``" -#: ../../library/typing.rst:3129 +#: ../../library/typing.rst:3136 msgid "" "Provides an alternative name for the field. This alternative name is used in " "the synthesized ``__init__`` method." msgstr "" -#: ../../library/typing.rst:3132 +#: ../../library/typing.rst:3139 msgid "" "At runtime, this decorator records its arguments in the " "``__dataclass_transform__`` attribute on the decorated object. It has no " "other runtime effect." msgstr "" -#: ../../library/typing.rst:3136 +#: ../../library/typing.rst:3143 msgid "See :pep:`681` for more details." msgstr "更多細節請見 :pep:`681`。" -#: ../../library/typing.rst:3144 +#: ../../library/typing.rst:3151 msgid "Decorator for creating overloaded functions and methods." msgstr "" -#: ../../library/typing.rst:3146 +#: ../../library/typing.rst:3153 msgid "" "The ``@overload`` decorator allows describing functions and methods that " "support multiple different combinations of argument types. A series of " @@ -5048,23 +5057,23 @@ msgid "" "``@overload``-decorated definition (for the same function/method)." msgstr "" -#: ../../library/typing.rst:3151 +#: ../../library/typing.rst:3158 msgid "" "``@overload``-decorated definitions are for the benefit of the type checker " "only, since they will be overwritten by the non-``@overload``-decorated " "definition. The non-``@overload``-decorated definition, meanwhile, will be " "used at runtime but should be ignored by a type checker. At runtime, " -"calling an ``@overload``-decorated function directly will " -"raise :exc:`NotImplementedError`." +"calling an ``@overload``-decorated function directly will raise :exc:" +"`NotImplementedError`." msgstr "" -#: ../../library/typing.rst:3159 +#: ../../library/typing.rst:3166 msgid "" "An example of overload that gives a more precise type than can be expressed " "using a union or a type variable:" msgstr "" -#: ../../library/typing.rst:3162 +#: ../../library/typing.rst:3169 msgid "" "@overload\n" "def process(response: None) -> None:\n" @@ -5090,24 +5099,24 @@ msgstr "" "def process(response):\n" " ... # 實際的實作在這邊" -#: ../../library/typing.rst:3176 +#: ../../library/typing.rst:3183 msgid "" "See :pep:`484` for more details and comparison with other typing semantics." msgstr "" -#: ../../library/typing.rst:3178 +#: ../../library/typing.rst:3185 msgid "" -"Overloaded functions can now be introspected at runtime " -"using :func:`get_overloads`." +"Overloaded functions can now be introspected at runtime using :func:" +"`get_overloads`." msgstr "" -#: ../../library/typing.rst:3185 +#: ../../library/typing.rst:3192 msgid "" "Return a sequence of :func:`@overload `-decorated definitions for " "*func*." msgstr "" -#: ../../library/typing.rst:3188 +#: ../../library/typing.rst:3195 msgid "" "*func* is the function object for the implementation of the overloaded " "function. For example, given the definition of ``process`` in the " @@ -5117,32 +5126,32 @@ msgid "" "returns an empty sequence." msgstr "" -#: ../../library/typing.rst:3195 +#: ../../library/typing.rst:3202 msgid "" "``get_overloads()`` can be used for introspecting an overloaded function at " "runtime." msgstr "" -#: ../../library/typing.rst:3203 +#: ../../library/typing.rst:3210 msgid "Clear all registered overloads in the internal registry." msgstr "" -#: ../../library/typing.rst:3205 +#: ../../library/typing.rst:3212 msgid "This can be used to reclaim the memory used by the registry." msgstr "" -#: ../../library/typing.rst:3212 +#: ../../library/typing.rst:3219 msgid "Decorator to indicate final methods and final classes." msgstr "" -#: ../../library/typing.rst:3214 +#: ../../library/typing.rst:3221 msgid "" "Decorating a method with ``@final`` indicates to a type checker that the " "method cannot be overridden in a subclass. Decorating a class with " "``@final`` indicates that it cannot be subclassed." msgstr "" -#: ../../library/typing.rst:3220 +#: ../../library/typing.rst:3227 msgid "" "class Base:\n" " @final\n" @@ -5172,7 +5181,7 @@ msgstr "" "class Other(Leaf): # 型別檢查器回報的錯誤\n" " ..." -#: ../../library/typing.rst:3239 +#: ../../library/typing.rst:3246 msgid "" "The decorator will now attempt to set a ``__final__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, \"__final__\", " @@ -5182,11 +5191,11 @@ msgid "" "exception." msgstr "" -#: ../../library/typing.rst:3250 +#: ../../library/typing.rst:3257 msgid "Decorator to indicate that annotations are not type hints." msgstr "" -#: ../../library/typing.rst:3252 +#: ../../library/typing.rst:3259 msgid "" "This works as a class or function :term:`decorator`. With a class, it " "applies recursively to all methods and classes defined in that class (but " @@ -5194,40 +5203,40 @@ msgid "" "will ignore all annotations in a function or class with this decorator." msgstr "" -#: ../../library/typing.rst:3258 +#: ../../library/typing.rst:3265 msgid "``@no_type_check`` mutates the decorated object in place." msgstr "" -#: ../../library/typing.rst:3262 +#: ../../library/typing.rst:3269 msgid "Decorator to give another decorator the :func:`no_type_check` effect." msgstr "" -#: ../../library/typing.rst:3264 +#: ../../library/typing.rst:3271 msgid "" "This wraps the decorator with something that wraps the decorated function " "in :func:`no_type_check`." msgstr "" -#: ../../library/typing.rst:3267 +#: ../../library/typing.rst:3274 msgid "" "No type checker ever added support for ``@no_type_check_decorator``. It is " "therefore deprecated, and will be removed in Python 3.15." msgstr "" -#: ../../library/typing.rst:3273 +#: ../../library/typing.rst:3280 msgid "" "Decorator to indicate that a method in a subclass is intended to override a " "method or attribute in a superclass." msgstr "" -#: ../../library/typing.rst:3276 +#: ../../library/typing.rst:3283 msgid "" "Type checkers should emit an error if a method decorated with ``@override`` " "does not, in fact, override anything. This helps prevent bugs that may occur " "when a base class is changed without an equivalent change to a child class." msgstr "" -#: ../../library/typing.rst:3283 +#: ../../library/typing.rst:3290 msgid "" "class Base:\n" " def log_status(self) -> None:\n" @@ -5243,11 +5252,11 @@ msgid "" " ..." msgstr "" -#: ../../library/typing.rst:3298 +#: ../../library/typing.rst:3305 msgid "There is no runtime checking of this property." msgstr "" -#: ../../library/typing.rst:3300 +#: ../../library/typing.rst:3307 msgid "" "The decorator will attempt to set an ``__override__`` attribute to ``True`` " "on the decorated object. Thus, a check like ``if getattr(obj, " @@ -5257,22 +5266,22 @@ msgid "" "without raising an exception." msgstr "" -#: ../../library/typing.rst:3307 +#: ../../library/typing.rst:3314 msgid "See :pep:`698` for more details." msgstr "更多細節請見 :pep:`698`。" -#: ../../library/typing.rst:3314 +#: ../../library/typing.rst:3321 msgid "Decorator to mark a class or function as unavailable at runtime." msgstr "" -#: ../../library/typing.rst:3316 +#: ../../library/typing.rst:3323 msgid "" "This decorator is itself not available at runtime. It is mainly intended to " "mark classes that are defined in type stub files if an implementation " "returns an instance of a private class::" msgstr "" -#: ../../library/typing.rst:3320 +#: ../../library/typing.rst:3327 msgid "" "@type_check_only\n" "class Response: # private or not available at runtime\n" @@ -5282,29 +5291,29 @@ msgid "" "def fetch_response() -> Response: ..." msgstr "" -#: ../../library/typing.rst:3327 +#: ../../library/typing.rst:3334 msgid "" "Note that returning instances of private classes is not recommended. It is " "usually preferable to make such classes public." msgstr "" -#: ../../library/typing.rst:3331 +#: ../../library/typing.rst:3338 msgid "Introspection helpers" msgstr "" -#: ../../library/typing.rst:3335 +#: ../../library/typing.rst:3342 msgid "" "Return a dictionary containing type hints for a function, method, module or " "class object." msgstr "" -#: ../../library/typing.rst:3338 +#: ../../library/typing.rst:3345 msgid "" "This is often the same as ``obj.__annotations__``, but this function makes " "the following changes to the annotations dictionary:" msgstr "" -#: ../../library/typing.rst:3341 +#: ../../library/typing.rst:3348 msgid "" "Forward references encoded as string literals or :class:`ForwardRef` objects " "are handled by evaluating them in *globalns*, *localns*, and (where " @@ -5313,17 +5322,17 @@ msgid "" "inferred from *obj*." msgstr "" -#: ../../library/typing.rst:3346 +#: ../../library/typing.rst:3353 msgid "``None`` is replaced with :class:`types.NoneType`." msgstr "" -#: ../../library/typing.rst:3347 +#: ../../library/typing.rst:3354 msgid "" "If :func:`@no_type_check ` has been applied to *obj*, an " "empty dictionary is returned." msgstr "" -#: ../../library/typing.rst:3349 +#: ../../library/typing.rst:3356 msgid "" "If *obj* is a class ``C``, the function returns a dictionary that merges " "annotations from ``C``'s base classes with those on ``C`` directly. This is " @@ -5333,68 +5342,68 @@ msgid "" "annotations on classes appearing later in the method resolution order." msgstr "" -#: ../../library/typing.rst:3356 +#: ../../library/typing.rst:3363 msgid "" "The function recursively replaces all occurrences of ``Annotated[T, ...]`` " -"with ``T``, unless *include_extras* is set to ``True`` " -"(see :class:`Annotated` for more information)." +"with ``T``, unless *include_extras* is set to ``True`` (see :class:" +"`Annotated` for more information)." msgstr "" -#: ../../library/typing.rst:3360 +#: ../../library/typing.rst:3367 msgid "" "See also :func:`annotationlib.get_annotations`, a lower-level function that " "returns annotations more directly." msgstr "" -#: ../../library/typing.rst:3365 ../../library/typing.rst:3516 +#: ../../library/typing.rst:3372 ../../library/typing.rst:3523 msgid "" -"This function may execute arbitrary code contained in annotations. " -"See :ref:`annotationlib-security` for more information." +"This function may execute arbitrary code contained in annotations. See :ref:" +"`annotationlib-security` for more information." msgstr "" -#: ../../library/typing.rst:3370 +#: ../../library/typing.rst:3377 msgid "" "If any forward references in the annotations of *obj* are not resolvable or " -"are not valid Python code, this function will raise an exception such " -"as :exc:`NameError`. For example, this can happen with imported :ref:`type " +"are not valid Python code, this function will raise an exception such as :" +"exc:`NameError`. For example, this can happen with imported :ref:`type " "aliases ` that include forward references, or with names " "imported under :data:`if TYPE_CHECKING `." msgstr "" -#: ../../library/typing.rst:3376 +#: ../../library/typing.rst:3383 msgid "" "Added ``include_extras`` parameter as part of :pep:`593`. See the " "documentation on :data:`Annotated` for more information." msgstr "" -"新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。更多資訊請" -"見 :data:`Annotated` 的文件。" +"新增 ``include_extras`` 參數(如 :pep:`593` 中所述)。更多資訊請見 :data:" +"`Annotated` 的文件。" -#: ../../library/typing.rst:3380 +#: ../../library/typing.rst:3387 msgid "" "Previously, ``Optional[t]`` was added for function and method annotations if " "a default value equal to ``None`` was set. Now the annotation is returned " "unchanged." msgstr "" -#: ../../library/typing.rst:3387 +#: ../../library/typing.rst:3394 msgid "" "Get the unsubscripted version of a type: for a typing object of the form " "``X[Y, Z, ...]`` return ``X``." msgstr "" -#: ../../library/typing.rst:3390 +#: ../../library/typing.rst:3397 msgid "" "If ``X`` is a typing-module alias for a builtin or :mod:`collections` class, " -"it will be normalized to the original class. If ``X`` is an instance " -"of :class:`ParamSpecArgs` or :class:`ParamSpecKwargs`, return the " -"underlying :class:`ParamSpec`. Return ``None`` for unsupported objects." +"it will be normalized to the original class. If ``X`` is an instance of :" +"class:`ParamSpecArgs` or :class:`ParamSpecKwargs`, return the underlying :" +"class:`ParamSpec`. Return ``None`` for unsupported objects." msgstr "" -#: ../../library/typing.rst:3396 ../../library/typing.rst:3420 +#: ../../library/typing.rst:3403 ../../library/typing.rst:3427 msgid "Examples:" msgstr "舉例:" -#: ../../library/typing.rst:3398 +#: ../../library/typing.rst:3405 msgid "" "assert get_origin(str) is None\n" "assert get_origin(Dict[str, int]) is dict\n" @@ -5412,13 +5421,13 @@ msgstr "" "assert get_origin(P.args) is P\n" "assert get_origin(P.kwargs) is P" -#: ../../library/typing.rst:3412 +#: ../../library/typing.rst:3419 msgid "" "Get type arguments with all substitutions performed: for a typing object of " "the form ``X[Y, Z, ...]`` return ``(Y, Z, ...)``." msgstr "" -#: ../../library/typing.rst:3415 +#: ../../library/typing.rst:3422 msgid "" "If ``X`` is a union or :class:`Literal` contained in another generic type, " "the order of ``(Y, Z, ...)`` may be different from the order of the original " @@ -5426,7 +5435,7 @@ msgid "" "objects." msgstr "" -#: ../../library/typing.rst:3422 +#: ../../library/typing.rst:3429 msgid "" "assert get_args(int) == ()\n" "assert get_args(Dict[int, str]) == (int, str)\n" @@ -5436,11 +5445,11 @@ msgstr "" "assert get_args(Dict[int, str]) == (int, str)\n" "assert get_args(Union[int, str]) == (int, str)" -#: ../../library/typing.rst:3432 +#: ../../library/typing.rst:3439 msgid "Return the set of members defined in a :class:`Protocol`." msgstr "" -#: ../../library/typing.rst:3434 +#: ../../library/typing.rst:3441 msgid "" ">>> from typing import Protocol, get_protocol_members\n" ">>> class P(Protocol):\n" @@ -5456,15 +5465,15 @@ msgstr "" ">>> get_protocol_members(P) == frozenset({'a', 'b'})\n" "True" -#: ../../library/typing.rst:3443 +#: ../../library/typing.rst:3450 msgid "Raise :exc:`TypeError` for arguments that are not Protocols." msgstr "" -#: ../../library/typing.rst:3449 +#: ../../library/typing.rst:3456 msgid "Determine if a type is a :class:`Protocol`." msgstr "確定一個型別是否 :class:`Protocol`。" -#: ../../library/typing.rst:3453 +#: ../../library/typing.rst:3460 msgid "" "class P(Protocol):\n" " def a(self) -> str: ...\n" @@ -5480,11 +5489,11 @@ msgstr "" "is_protocol(P) # => True\n" "is_protocol(int) # => False" -#: ../../library/typing.rst:3464 +#: ../../library/typing.rst:3471 msgid "Check if a type is a :class:`TypedDict`." msgstr "" -#: ../../library/typing.rst:3468 +#: ../../library/typing.rst:3475 msgid "" "class Film(TypedDict):\n" " title: str\n" @@ -5498,57 +5507,57 @@ msgid "" "assert not is_typeddict(TypedDict)" msgstr "" -#: ../../library/typing.rst:3485 +#: ../../library/typing.rst:3492 msgid "" "Class used for internal typing representation of string forward references." msgstr "" -#: ../../library/typing.rst:3487 +#: ../../library/typing.rst:3494 msgid "" "For example, ``List[\"SomeClass\"]`` is implicitly transformed into " "``List[ForwardRef(\"SomeClass\")]``. :class:`!ForwardRef` should not be " "instantiated by a user, but may be used by introspection tools." msgstr "" -#: ../../library/typing.rst:3492 +#: ../../library/typing.rst:3499 msgid "" ":pep:`585` generic types such as ``list[\"SomeClass\"]`` will not be " "implicitly transformed into ``list[ForwardRef(\"SomeClass\")]`` and thus " "will not automatically resolve to ``list[SomeClass]``." msgstr "" -#: ../../library/typing.rst:3498 +#: ../../library/typing.rst:3505 msgid "" "This is now an alias for :class:`annotationlib.ForwardRef`. Several " "undocumented behaviors of this class have been changed; for example, after a " "``ForwardRef`` has been evaluated, the evaluated value is no longer cached." msgstr "" -#: ../../library/typing.rst:3505 +#: ../../library/typing.rst:3512 msgid "Evaluate an :class:`annotationlib.ForwardRef` as a :term:`type hint`." msgstr "" -#: ../../library/typing.rst:3507 +#: ../../library/typing.rst:3514 msgid "" "This is similar to calling :meth:`annotationlib.ForwardRef.evaluate`, but " "unlike that method, :func:`!evaluate_forward_ref` also recursively evaluates " "forward references nested within the type hint." msgstr "" -#: ../../library/typing.rst:3511 +#: ../../library/typing.rst:3518 msgid "" "See the documentation for :meth:`annotationlib.ForwardRef.evaluate` for the " "meaning of the *owner*, *globals*, *locals*, *type_params*, and *format* " "parameters." msgstr "" -#: ../../library/typing.rst:3523 +#: ../../library/typing.rst:3530 msgid "" "A sentinel object used to indicate that a type parameter has no default " "value. For example:" msgstr "" -#: ../../library/typing.rst:3526 +#: ../../library/typing.rst:3533 msgid "" ">>> T = TypeVar(\"T\")\n" ">>> T.__default__ is typing.NoDefault\n" @@ -5564,17 +5573,17 @@ msgstr "" ">>> S.__default__ is None\n" "True" -#: ../../library/typing.rst:3538 +#: ../../library/typing.rst:3545 msgid "Constant" msgstr "常數" -#: ../../library/typing.rst:3542 +#: ../../library/typing.rst:3549 msgid "" "A special constant that is assumed to be ``True`` by 3rd party static type " "checkers. It's ``False`` at runtime." msgstr "" -#: ../../library/typing.rst:3545 +#: ../../library/typing.rst:3552 msgid "" "A module which is expensive to import, and which only contain types used for " "typing annotations, can be safely imported inside an ``if TYPE_CHECKING:`` " @@ -5586,7 +5595,7 @@ msgid "" "will be checked properly during such analysis." msgstr "" -#: ../../library/typing.rst:3557 +#: ../../library/typing.rst:3564 msgid "" "if TYPE_CHECKING:\n" " import expensive_mod\n" @@ -5600,20 +5609,20 @@ msgstr "" "def fun(arg: expensive_mod.SomeType) -> None:\n" " local_var: expensive_mod.AnotherType = other_fun()" -#: ../../library/typing.rst:3563 +#: ../../library/typing.rst:3570 msgid "" "If you occasionally need to examine type annotations at runtime which may " "contain undefined symbols, use :meth:`annotationlib.get_annotations` with a " -"``format`` parameter of :attr:`annotationlib.Format.STRING` " -"or :attr:`annotationlib.Format.FORWARDREF` to safely retrieve the " -"annotations without raising :exc:`NameError`." +"``format`` parameter of :attr:`annotationlib.Format.STRING` or :attr:" +"`annotationlib.Format.FORWARDREF` to safely retrieve the annotations without " +"raising :exc:`NameError`." msgstr "" -#: ../../library/typing.rst:3576 +#: ../../library/typing.rst:3583 msgid "Deprecated aliases" msgstr "棄用的別名" -#: ../../library/typing.rst:3578 +#: ../../library/typing.rst:3585 msgid "" "This module defines several deprecated aliases to pre-existing standard " "library classes. These were originally included in the :mod:`!typing` module " @@ -5622,7 +5631,7 @@ msgid "" "pre-existing classes were enhanced to support ``[]`` (see :pep:`585`)." msgstr "" -#: ../../library/typing.rst:3585 +#: ../../library/typing.rst:3592 msgid "" "The redundant types are deprecated as of Python 3.9. However, while the " "aliases may be removed at some point, removal of these aliases is not " @@ -5630,214 +5639,213 @@ msgid "" "the interpreter for these aliases." msgstr "" -#: ../../library/typing.rst:3590 +#: ../../library/typing.rst:3597 msgid "" "If at some point it is decided to remove these deprecated aliases, a " "deprecation warning will be issued by the interpreter for at least two " -"releases prior to removal. The aliases are guaranteed to remain in " -"the :mod:`!typing` module without deprecation warnings until at least Python " -"3.14." +"releases prior to removal. The aliases are guaranteed to remain in the :mod:" +"`!typing` module without deprecation warnings until at least Python 3.14." msgstr "" -#: ../../library/typing.rst:3595 +#: ../../library/typing.rst:3602 msgid "" "Type checkers are encouraged to flag uses of the deprecated types if the " "program they are checking targets a minimum Python version of 3.9 or newer." msgstr "" -#: ../../library/typing.rst:3601 +#: ../../library/typing.rst:3608 msgid "Aliases to built-in types" msgstr "內建型別的別名" -#: ../../library/typing.rst:3605 +#: ../../library/typing.rst:3612 msgid "Deprecated alias to :class:`dict`." msgstr "棄用 :class:`dict` 的別名。" -#: ../../library/typing.rst:3607 +#: ../../library/typing.rst:3614 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " "collection type such as :class:`~collections.abc.Mapping` rather than to " "use :class:`dict` or :class:`!typing.Dict`." msgstr "" -#: ../../library/typing.rst:3611 +#: ../../library/typing.rst:3618 msgid "" -":class:`builtins.dict ` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`builtins.dict ` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3617 +#: ../../library/typing.rst:3624 msgid "Deprecated alias to :class:`list`." msgstr "棄用 :class:`list` 的別名。" -#: ../../library/typing.rst:3619 +#: ../../library/typing.rst:3626 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " -"collection type such as :class:`~collections.abc.Sequence` " -"or :class:`~collections.abc.Iterable` rather than to use :class:`list` " -"or :class:`!typing.List`." +"collection type such as :class:`~collections.abc.Sequence` or :class:" +"`~collections.abc.Iterable` rather than to use :class:`list` or :class:`!" +"typing.List`." msgstr "" -#: ../../library/typing.rst:3624 +#: ../../library/typing.rst:3631 msgid "" -":class:`builtins.list ` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`builtins.list ` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3630 +#: ../../library/typing.rst:3637 msgid "Deprecated alias to :class:`builtins.set `." msgstr "棄用 :class:`builtins.set ` 的別名。" -#: ../../library/typing.rst:3632 +#: ../../library/typing.rst:3639 msgid "" "Note that to annotate arguments, it is preferred to use an abstract " -"collection type such as :class:`collections.abc.Set` rather than to " -"use :class:`set` or :class:`typing.Set`." +"collection type such as :class:`collections.abc.Set` rather than to use :" +"class:`set` or :class:`typing.Set`." msgstr "" -#: ../../library/typing.rst:3636 +#: ../../library/typing.rst:3643 msgid "" -":class:`builtins.set ` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`builtins.set ` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3642 +#: ../../library/typing.rst:3649 msgid "Deprecated alias to :class:`builtins.frozenset `." msgstr "棄用 :class:`builtins.frozenset ` 的別名。" -#: ../../library/typing.rst:3644 +#: ../../library/typing.rst:3651 msgid "" ":class:`builtins.frozenset ` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3651 +#: ../../library/typing.rst:3658 msgid "Deprecated alias for :class:`tuple`." msgstr "棄用 :class:`tuple` 的別名。" -#: ../../library/typing.rst:3653 +#: ../../library/typing.rst:3660 msgid "" -":class:`tuple` and ``Tuple`` are special-cased in the type system; " -"see :ref:`annotating-tuples` for more details." +":class:`tuple` and ``Tuple`` are special-cased in the type system; see :ref:" +"`annotating-tuples` for more details." msgstr "" -#: ../../library/typing.rst:3656 +#: ../../library/typing.rst:3663 msgid "" -":class:`builtins.tuple ` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`builtins.tuple ` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3662 +#: ../../library/typing.rst:3669 msgid "Deprecated alias to :class:`type`." msgstr "棄用 :class:`type` 的別名。" -#: ../../library/typing.rst:3664 +#: ../../library/typing.rst:3671 msgid "" "See :ref:`type-of-class-objects` for details on using :class:`type` or " "``typing.Type`` in type annotations." msgstr "" -#: ../../library/typing.rst:3669 +#: ../../library/typing.rst:3676 msgid "" -":class:`builtins.type ` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`builtins.type ` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3676 +#: ../../library/typing.rst:3683 msgid "Aliases to types in :mod:`collections`" msgstr ":mod:`collections` 中型別的別名" -#: ../../library/typing.rst:3680 +#: ../../library/typing.rst:3687 msgid "Deprecated alias to :class:`collections.defaultdict`." msgstr "棄用 :class:`collections.defaultdict` 的別名。" -#: ../../library/typing.rst:3684 +#: ../../library/typing.rst:3691 msgid "" -":class:`collections.defaultdict` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.defaultdict` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3690 +#: ../../library/typing.rst:3697 msgid "Deprecated alias to :class:`collections.OrderedDict`." msgstr "棄用 :class:`collections.OrderedDict` 的別名。" -#: ../../library/typing.rst:3694 +#: ../../library/typing.rst:3701 msgid "" -":class:`collections.OrderedDict` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.OrderedDict` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3700 +#: ../../library/typing.rst:3707 msgid "Deprecated alias to :class:`collections.ChainMap`." msgstr "棄用 :class:`collections.ChainMap` 的別名。" -#: ../../library/typing.rst:3704 +#: ../../library/typing.rst:3711 msgid "" -":class:`collections.ChainMap` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.ChainMap` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3710 +#: ../../library/typing.rst:3717 msgid "Deprecated alias to :class:`collections.Counter`." msgstr "棄用 :class:`collections.Counter` 的別名。" -#: ../../library/typing.rst:3714 +#: ../../library/typing.rst:3721 msgid "" -":class:`collections.Counter` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.Counter` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3720 +#: ../../library/typing.rst:3727 msgid "Deprecated alias to :class:`collections.deque`." msgstr "棄用 :class:`collections.deque` 的別名。" -#: ../../library/typing.rst:3724 +#: ../../library/typing.rst:3731 msgid "" -":class:`collections.deque` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.deque` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3731 +#: ../../library/typing.rst:3738 msgid "Aliases to other concrete types" msgstr "" -#: ../../library/typing.rst:3736 +#: ../../library/typing.rst:3743 msgid "" "Deprecated aliases corresponding to the return types from :func:`re.compile` " "and :func:`re.match`." msgstr "" -#: ../../library/typing.rst:3739 +#: ../../library/typing.rst:3746 msgid "" -"These types (and the corresponding functions) are generic " -"over :data:`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " +"These types (and the corresponding functions) are generic over :data:" +"`AnyStr`. ``Pattern`` can be specialised as ``Pattern[str]`` or " "``Pattern[bytes]``; ``Match`` can be specialised as ``Match[str]`` or " "``Match[bytes]``." msgstr "" -#: ../../library/typing.rst:3744 +#: ../../library/typing.rst:3751 msgid "" -"Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. " -"See :pep:`585` and :ref:`types-genericalias`." +"Classes ``Pattern`` and ``Match`` from :mod:`re` now support ``[]``. See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3750 +#: ../../library/typing.rst:3757 msgid "Deprecated alias for :class:`str`." msgstr "棄用 :class:`str` 的別名。" -#: ../../library/typing.rst:3752 +#: ../../library/typing.rst:3759 msgid "" "``Text`` is provided to supply a forward compatible path for Python 2 code: " "in Python 2, ``Text`` is an alias for ``unicode``." msgstr "" -#: ../../library/typing.rst:3756 +#: ../../library/typing.rst:3763 msgid "" "Use ``Text`` to indicate that a value must contain a unicode string in a " "manner that is compatible with both Python 2 and Python 3::" msgstr "" -#: ../../library/typing.rst:3759 +#: ../../library/typing.rst:3766 msgid "" "def add_unicode_checkmark(text: Text) -> Text:\n" " return text + u' \\u2713'" @@ -5845,350 +5853,359 @@ msgstr "" "def add_unicode_checkmark(text: Text) -> Text:\n" " return text + u' \\u2713'" -#: ../../library/typing.rst:3764 +#: ../../library/typing.rst:3771 msgid "" "Python 2 is no longer supported, and most type checkers also no longer " "support type checking Python 2 code. Removal of the alias is not currently " "planned, but users are encouraged to use :class:`str` instead of ``Text``." msgstr "" -#: ../../library/typing.rst:3774 +#: ../../library/typing.rst:3781 msgid "Aliases to container ABCs in :mod:`collections.abc`" msgstr ":mod:`collections.abc` 中容器 ABC 的別名" -#: ../../library/typing.rst:3778 +#: ../../library/typing.rst:3785 msgid "Deprecated alias to :class:`collections.abc.Set`." msgstr "棄用 :class:`collections.abc.Set` 的別名。" -#: ../../library/typing.rst:3780 +#: ../../library/typing.rst:3787 msgid "" -":class:`collections.abc.Set` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.Set` now supports subscripting (``[]``). See :pep:" +"`585` and :ref:`types-genericalias`." +msgstr "" + +#: ../../library/typing.rst:3793 +msgid "" +"This type represents the types :class:`bytes`, :class:`bytearray`, and :" +"class:`memoryview` of byte sequences." +msgstr "" + +#: ../../library/typing.rst:3796 +msgid "" +"Prefer :class:`collections.abc.Buffer`, or a union like ``bytes | bytearray " +"| memoryview``." msgstr "" -#: ../../library/typing.rst:3786 +#: ../../library/typing.rst:3801 msgid "Deprecated alias to :class:`collections.abc.Collection`." msgstr "棄用 :class:`collections.abc.Collection` 的別名。" -#: ../../library/typing.rst:3790 +#: ../../library/typing.rst:3805 msgid "" -":class:`collections.abc.Collection` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.Collection` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3796 +#: ../../library/typing.rst:3811 msgid "Deprecated alias to :class:`collections.abc.Container`." msgstr "棄用 :class:`collections.abc.Container` 的別名。" -#: ../../library/typing.rst:3798 +#: ../../library/typing.rst:3813 msgid "" -":class:`collections.abc.Container` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.Container` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3804 +#: ../../library/typing.rst:3819 msgid "Deprecated alias to :class:`collections.abc.ItemsView`." msgstr "棄用 :class:`collections.abc.ItemsView` 的別名。" -#: ../../library/typing.rst:3806 +#: ../../library/typing.rst:3821 msgid "" -":class:`collections.abc.ItemsView` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.ItemsView` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3812 +#: ../../library/typing.rst:3827 msgid "Deprecated alias to :class:`collections.abc.KeysView`." msgstr "棄用 :class:`collections.abc.KeysView` 的別名。" -#: ../../library/typing.rst:3814 +#: ../../library/typing.rst:3829 msgid "" -":class:`collections.abc.KeysView` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.KeysView` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3820 +#: ../../library/typing.rst:3835 msgid "Deprecated alias to :class:`collections.abc.Mapping`." msgstr "棄用 :class:`collections.abc.Mapping` 的別名。" -#: ../../library/typing.rst:3822 +#: ../../library/typing.rst:3837 msgid "" -":class:`collections.abc.Mapping` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.Mapping` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3828 +#: ../../library/typing.rst:3843 msgid "Deprecated alias to :class:`collections.abc.MappingView`." msgstr "棄用 :class:`collections.abc.MappingView` 的別名。" -#: ../../library/typing.rst:3830 +#: ../../library/typing.rst:3845 msgid "" ":class:`collections.abc.MappingView` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3836 +#: ../../library/typing.rst:3851 msgid "Deprecated alias to :class:`collections.abc.MutableMapping`." msgstr "棄用 :class:`collections.abc.MutableMapping` 的別名。" -#: ../../library/typing.rst:3838 +#: ../../library/typing.rst:3853 msgid "" ":class:`collections.abc.MutableMapping` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3845 +#: ../../library/typing.rst:3860 msgid "Deprecated alias to :class:`collections.abc.MutableSequence`." msgstr "棄用 :class:`collections.abc.MutableSequence` 的別名。" -#: ../../library/typing.rst:3847 +#: ../../library/typing.rst:3862 msgid "" ":class:`collections.abc.MutableSequence` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3854 +#: ../../library/typing.rst:3869 msgid "Deprecated alias to :class:`collections.abc.MutableSet`." msgstr "棄用 :class:`collections.abc.MutableSet` 的別名。" -#: ../../library/typing.rst:3856 +#: ../../library/typing.rst:3871 msgid "" -":class:`collections.abc.MutableSet` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.MutableSet` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3862 +#: ../../library/typing.rst:3877 msgid "Deprecated alias to :class:`collections.abc.Sequence`." msgstr "棄用 :class:`collections.abc.Sequence` 的別名。" -#: ../../library/typing.rst:3864 +#: ../../library/typing.rst:3879 msgid "" -":class:`collections.abc.Sequence` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.Sequence` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3870 +#: ../../library/typing.rst:3885 msgid "Deprecated alias to :class:`collections.abc.ValuesView`." msgstr "棄用 :class:`collections.abc.ValuesView` 的別名。" -#: ../../library/typing.rst:3872 +#: ../../library/typing.rst:3887 msgid "" -":class:`collections.abc.ValuesView` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.ValuesView` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3879 +#: ../../library/typing.rst:3894 msgid "Aliases to asynchronous ABCs in :mod:`collections.abc`" msgstr ":mod:`collections.abc` 中非同步 ABC 的別名" -#: ../../library/typing.rst:3883 +#: ../../library/typing.rst:3898 msgid "Deprecated alias to :class:`collections.abc.Coroutine`." msgstr "棄用 :class:`collections.abc.Coroutine` 的別名。" -#: ../../library/typing.rst:3885 +#: ../../library/typing.rst:3900 msgid "" -"See :ref:`annotating-generators-and-coroutines` for details on " -"using :class:`collections.abc.Coroutine` and ``typing.Coroutine`` in type " -"annotations." +"See :ref:`annotating-generators-and-coroutines` for details on using :class:" +"`collections.abc.Coroutine` and ``typing.Coroutine`` in type annotations." msgstr "" -#: ../../library/typing.rst:3891 +#: ../../library/typing.rst:3906 msgid "" -":class:`collections.abc.Coroutine` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.Coroutine` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3897 +#: ../../library/typing.rst:3912 msgid "Deprecated alias to :class:`collections.abc.AsyncGenerator`." msgstr "棄用 :class:`collections.abc.AsyncGenerator` 的別名。" -#: ../../library/typing.rst:3899 +#: ../../library/typing.rst:3914 msgid "" -"See :ref:`annotating-generators-and-coroutines` for details on " -"using :class:`collections.abc.AsyncGenerator` and ``typing.AsyncGenerator`` " -"in type annotations." +"See :ref:`annotating-generators-and-coroutines` for details on using :class:" +"`collections.abc.AsyncGenerator` and ``typing.AsyncGenerator`` in type " +"annotations." msgstr "" -#: ../../library/typing.rst:3905 +#: ../../library/typing.rst:3920 msgid "" ":class:`collections.abc.AsyncGenerator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3910 +#: ../../library/typing.rst:3925 msgid "The ``SendType`` parameter now has a default." msgstr "``SendType`` 參數現在有預設值。" -#: ../../library/typing.rst:3915 +#: ../../library/typing.rst:3930 msgid "Deprecated alias to :class:`collections.abc.AsyncIterable`." msgstr "棄用 :class:`collections.abc.AsyncIterable` 的別名。" -#: ../../library/typing.rst:3919 +#: ../../library/typing.rst:3934 msgid "" ":class:`collections.abc.AsyncIterable` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3925 +#: ../../library/typing.rst:3940 msgid "Deprecated alias to :class:`collections.abc.AsyncIterator`." msgstr "棄用 :class:`collections.abc.AsyncIterator` 的別名。" -#: ../../library/typing.rst:3929 +#: ../../library/typing.rst:3944 msgid "" ":class:`collections.abc.AsyncIterator` now supports subscripting (``[]``). " "See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3935 +#: ../../library/typing.rst:3950 msgid "Deprecated alias to :class:`collections.abc.Awaitable`." msgstr "棄用 :class:`collections.abc.Awaitable` 的別名。" -#: ../../library/typing.rst:3939 +#: ../../library/typing.rst:3954 msgid "" -":class:`collections.abc.Awaitable` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.Awaitable` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3946 +#: ../../library/typing.rst:3961 msgid "Aliases to other ABCs in :mod:`collections.abc`" msgstr "" -#: ../../library/typing.rst:3950 +#: ../../library/typing.rst:3965 msgid "Deprecated alias to :class:`collections.abc.Iterable`." msgstr "棄用 :class:`collections.abc.Iterable` 的別名。" -#: ../../library/typing.rst:3952 +#: ../../library/typing.rst:3967 msgid "" -":class:`collections.abc.Iterable` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.Iterable` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3958 +#: ../../library/typing.rst:3973 msgid "Deprecated alias to :class:`collections.abc.Iterator`." msgstr "棄用 :class:`collections.abc.Iterator` 的別名。" -#: ../../library/typing.rst:3960 +#: ../../library/typing.rst:3975 msgid "" -":class:`collections.abc.Iterator` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.Iterator` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3966 +#: ../../library/typing.rst:3981 msgid "Deprecated alias to :class:`collections.abc.Callable`." msgstr "棄用 :class:`collections.abc.Callable` 的別名。" -#: ../../library/typing.rst:3968 +#: ../../library/typing.rst:3983 msgid "" -"See :ref:`annotating-callables` for details on how to " -"use :class:`collections.abc.Callable` and ``typing.Callable`` in type " -"annotations." +"See :ref:`annotating-callables` for details on how to use :class:" +"`collections.abc.Callable` and ``typing.Callable`` in type annotations." msgstr "" -#: ../../library/typing.rst:3971 +#: ../../library/typing.rst:3986 msgid "" -":class:`collections.abc.Callable` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.Callable` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3981 +#: ../../library/typing.rst:3996 msgid "Deprecated alias to :class:`collections.abc.Generator`." msgstr "棄用 :class:`collections.abc.Generator` 的別名。" -#: ../../library/typing.rst:3983 +#: ../../library/typing.rst:3998 msgid "" -"See :ref:`annotating-generators-and-coroutines` for details on " -"using :class:`collections.abc.Generator` and ``typing.Generator`` in type " -"annotations." +"See :ref:`annotating-generators-and-coroutines` for details on using :class:" +"`collections.abc.Generator` and ``typing.Generator`` in type annotations." msgstr "" -#: ../../library/typing.rst:3987 +#: ../../library/typing.rst:4002 msgid "" -":class:`collections.abc.Generator` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.Generator` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:3991 +#: ../../library/typing.rst:4006 msgid "Default values for the send and return types were added." msgstr "" -#: ../../library/typing.rst:3996 +#: ../../library/typing.rst:4011 msgid "Deprecated alias to :class:`collections.abc.Hashable`." msgstr "棄用 :class:`collections.abc.Hashable` 的別名。" -#: ../../library/typing.rst:3998 +#: ../../library/typing.rst:4013 msgid "Use :class:`collections.abc.Hashable` directly instead." msgstr "改為直接使用 :class:`collections.abc.Hashable`。" -#: ../../library/typing.rst:4003 +#: ../../library/typing.rst:4018 msgid "Deprecated alias to :class:`collections.abc.Reversible`." msgstr "棄用 :class:`collections.abc.Reversible` 的別名。" -#: ../../library/typing.rst:4005 +#: ../../library/typing.rst:4020 msgid "" -":class:`collections.abc.Reversible` now supports subscripting (``[]``). " -"See :pep:`585` and :ref:`types-genericalias`." +":class:`collections.abc.Reversible` now supports subscripting (``[]``). See :" +"pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:4011 +#: ../../library/typing.rst:4026 msgid "Deprecated alias to :class:`collections.abc.Sized`." msgstr "棄用 :class:`collections.abc.Sized` 的別名。" -#: ../../library/typing.rst:4013 +#: ../../library/typing.rst:4028 msgid "Use :class:`collections.abc.Sized` directly instead." msgstr "改為直接使用 :class:`collections.abc.Sized`。" -#: ../../library/typing.rst:4019 +#: ../../library/typing.rst:4034 msgid "Aliases to :mod:`contextlib` ABCs" msgstr ":mod:`contextlib` ABC 的別名" -#: ../../library/typing.rst:4023 +#: ../../library/typing.rst:4038 msgid "Deprecated alias to :class:`contextlib.AbstractContextManager`." msgstr "" -#: ../../library/typing.rst:4025 +#: ../../library/typing.rst:4040 msgid "" -"The first type parameter, ``T_co``, represents the type returned by " -"the :meth:`~object.__enter__` method. The optional second type parameter, " +"The first type parameter, ``T_co``, represents the type returned by the :" +"meth:`~object.__enter__` method. The optional second type parameter, " "``ExitT_co``, which defaults to ``bool | None``, represents the type " "returned by the :meth:`~object.__exit__` method." msgstr "" -#: ../../library/typing.rst:4032 +#: ../../library/typing.rst:4047 msgid "" ":class:`contextlib.AbstractContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:4037 +#: ../../library/typing.rst:4052 msgid "Added the optional second type parameter, ``ExitT_co``." msgstr "" -#: ../../library/typing.rst:4042 +#: ../../library/typing.rst:4057 msgid "Deprecated alias to :class:`contextlib.AbstractAsyncContextManager`." msgstr "" -#: ../../library/typing.rst:4044 +#: ../../library/typing.rst:4059 msgid "" -"The first type parameter, ``T_co``, represents the type returned by " -"the :meth:`~object.__aenter__` method. The optional second type parameter, " +"The first type parameter, ``T_co``, represents the type returned by the :" +"meth:`~object.__aenter__` method. The optional second type parameter, " "``AExitT_co``, which defaults to ``bool | None``, represents the type " "returned by the :meth:`~object.__aexit__` method." msgstr "" -#: ../../library/typing.rst:4051 +#: ../../library/typing.rst:4066 msgid "" ":class:`contextlib.AbstractAsyncContextManager` now supports subscripting " "(``[]``). See :pep:`585` and :ref:`types-genericalias`." msgstr "" -#: ../../library/typing.rst:4056 +#: ../../library/typing.rst:4071 msgid "Added the optional second type parameter, ``AExitT_co``." msgstr "" -#: ../../library/typing.rst:4060 +#: ../../library/typing.rst:4075 msgid "Deprecation Timeline of Major Features" msgstr "主要功能的棄用時程表" -#: ../../library/typing.rst:4062 +#: ../../library/typing.rst:4077 msgid "" "Certain features in ``typing`` are deprecated and may be removed in a future " "version of Python. The following table summarizes major deprecations for " @@ -6196,112 +6213,128 @@ msgid "" "listed." msgstr "" -#: ../../library/typing.rst:4069 +#: ../../library/typing.rst:4084 msgid "Feature" msgstr "" -#: ../../library/typing.rst:4070 +#: ../../library/typing.rst:4085 msgid "Deprecated in" msgstr "棄用於" -#: ../../library/typing.rst:4071 +#: ../../library/typing.rst:4086 msgid "Projected removal" msgstr "" -#: ../../library/typing.rst:4072 +#: ../../library/typing.rst:4087 msgid "PEP/issue" msgstr "" -#: ../../library/typing.rst:4073 +#: ../../library/typing.rst:4088 msgid "``typing`` versions of standard collections" msgstr "" -#: ../../library/typing.rst:4074 +#: ../../library/typing.rst:4089 ../../library/typing.rst:4093 msgid "3.9" msgstr "3.9" -#: ../../library/typing.rst:4075 +#: ../../library/typing.rst:4090 msgid "Undecided (see :ref:`deprecated-aliases` for more information)" msgstr "" -#: ../../library/typing.rst:4076 +#: ../../library/typing.rst:4091 msgid ":pep:`585`" msgstr ":pep:`585`" -#: ../../library/typing.rst:4077 +#: ../../library/typing.rst:4092 +msgid ":class:`typing.ByteString`" +msgstr ":class:`typing.ByteString`" + +#: ../../library/typing.rst:4094 +msgid "3.17" +msgstr "" + +#: ../../library/typing.rst:4095 +msgid ":gh:`91896`" +msgstr ":gh:`91896`" + +#: ../../library/typing.rst:4096 msgid ":data:`typing.Text`" msgstr ":data:`typing.Text`" -#: ../../library/typing.rst:4078 +#: ../../library/typing.rst:4097 msgid "3.11" msgstr "3.11" -#: ../../library/typing.rst:4079 ../../library/typing.rst:4083 -#: ../../library/typing.rst:4087 +#: ../../library/typing.rst:4098 ../../library/typing.rst:4102 +#: ../../library/typing.rst:4106 msgid "Undecided" msgstr "" -#: ../../library/typing.rst:4080 +#: ../../library/typing.rst:4099 msgid ":gh:`92332`" msgstr ":gh:`92332`" -#: ../../library/typing.rst:4081 +#: ../../library/typing.rst:4100 msgid ":class:`typing.Hashable` and :class:`typing.Sized`" msgstr ":class:`typing.Hashable` 和 :class:`typing.Sized`" -#: ../../library/typing.rst:4082 ../../library/typing.rst:4086 +#: ../../library/typing.rst:4101 ../../library/typing.rst:4105 msgid "3.12" msgstr "3.12" -#: ../../library/typing.rst:4084 +#: ../../library/typing.rst:4103 msgid ":gh:`94309`" msgstr ":gh:`94309`" -#: ../../library/typing.rst:4085 +#: ../../library/typing.rst:4104 msgid ":data:`typing.TypeAlias`" msgstr ":data:`typing.TypeAlias`" -#: ../../library/typing.rst:4088 +#: ../../library/typing.rst:4107 msgid ":pep:`695`" msgstr ":pep:`695`" -#: ../../library/typing.rst:4089 +#: ../../library/typing.rst:4108 msgid ":func:`@typing.no_type_check_decorator `" msgstr ":func:`@typing.no_type_check_decorator `" -#: ../../library/typing.rst:4090 ../../library/typing.rst:4094 +#: ../../library/typing.rst:4109 ../../library/typing.rst:4113 msgid "3.13" msgstr "3.13" -#: ../../library/typing.rst:4091 +#: ../../library/typing.rst:4110 msgid "3.15" msgstr "3.15" -#: ../../library/typing.rst:4092 +#: ../../library/typing.rst:4111 msgid ":gh:`106309`" msgstr ":gh:`106309`" -#: ../../library/typing.rst:4093 +#: ../../library/typing.rst:4112 msgid ":data:`typing.AnyStr`" msgstr ":data:`typing.AnyStr`" -#: ../../library/typing.rst:4095 +#: ../../library/typing.rst:4114 msgid "3.18" msgstr "3.18" -#: ../../library/typing.rst:4096 +#: ../../library/typing.rst:4115 msgid ":gh:`105578`" msgstr ":gh:`105578`" -#~ msgid ":class:`typing.ByteString`" -#~ msgstr ":class:`typing.ByteString`" +#: ../../library/typing.rst:233 ../../library/typing.rst:380 +#: ../../library/typing.rst:1170 +msgid "..." +msgstr "" + +#: ../../library/typing.rst:233 ../../library/typing.rst:380 +#: ../../library/typing.rst:1170 +msgid "ellipsis literal" +msgstr "" #~ msgid "3.14" #~ msgstr "3.14" -#~ msgid ":gh:`91896`" -#~ msgstr ":gh:`91896`" - #~ msgid "" #~ "@dataclass\n" #~ "class ctype:\n" diff --git a/library/unicodedata.po b/library/unicodedata.po index a061cf62bf..f4adfb8c54 100644 --- a/library/unicodedata.po +++ b/library/unicodedata.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-17 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:14+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -25,8 +25,8 @@ msgstr ":mod:`!unicodedata` --- Unicode 資料庫" msgid "" "This module provides access to the Unicode Character Database (UCD) which " "defines character properties for all Unicode characters. The data contained " -"in this database is compiled from the `UCD version 16.0.0 `_." +"in this database is compiled from the `UCD version 16.0.0 `_." msgstr "" #: ../../library/unicodedata.rst:23 @@ -36,84 +36,197 @@ msgid "" "tr44/>`_. It defines the following functions:" msgstr "" -#: ../../library/unicodedata.rst:31 +#: ../../library/unicodedata.rst:30 +msgid "" +"The :ref:`unicode-howto` for more information about Unicode and how to use " +"this module." +msgstr "" + +#: ../../library/unicodedata.rst:36 msgid "" "Look up character by name. If a character with the given name is found, " -"return the corresponding character. If not found, :exc:`KeyError` is raised." +"return the corresponding character. If not found, :exc:`KeyError` is " +"raised. For example::" +msgstr "" + +#: ../../library/unicodedata.rst:40 +msgid "" +">>> unicodedata.lookup('LEFT CURLY BRACKET')\n" +"'{'" +msgstr "" +">>> unicodedata.lookup('LEFT CURLY BRACKET')\n" +"'{'" + +#: ../../library/unicodedata.rst:43 +msgid "" +"The characters returned by this function are the same as those produced by " +"``\\N`` escape sequence in string literals. For example::" +msgstr "" + +#: ../../library/unicodedata.rst:46 +msgid "" +">>> unicodedata.lookup('MIDDLE DOT') == '\\N{MIDDLE DOT}'\n" +"True" msgstr "" +">>> unicodedata.lookup('MIDDLE DOT') == '\\N{MIDDLE DOT}'\n" +"True" -#: ../../library/unicodedata.rst:34 +#: ../../library/unicodedata.rst:49 msgid "Support for name aliases [#]_ and named sequences [#]_ has been added." msgstr "已新增對名稱別名 [#]_ 和命名序列 [#]_ 的支援。" -#: ../../library/unicodedata.rst:40 +#: ../../library/unicodedata.rst:55 msgid "" "Returns the name assigned to the character *chr* as a string. If no name is " "defined, *default* is returned, or, if not given, :exc:`ValueError` is " -"raised." +"raised. For example::" +msgstr "" + +#: ../../library/unicodedata.rst:59 +msgid "" +">>> unicodedata.name('½')\n" +"'VULGAR FRACTION ONE HALF'\n" +">>> unicodedata.name('\\uFFFF', 'fallback')\n" +"'fallback'" msgstr "" +">>> unicodedata.name('½')\n" +"'VULGAR FRACTION ONE HALF'\n" +">>> unicodedata.name('\\uFFFF', 'fallback')\n" +"'fallback'" -#: ../../library/unicodedata.rst:47 +#: ../../library/unicodedata.rst:67 msgid "" "Returns the decimal value assigned to the character *chr* as integer. If no " -"such value is defined, *default* is returned, or, if not " -"given, :exc:`ValueError` is raised." +"such value is defined, *default* is returned, or, if not given, :exc:" +"`ValueError` is raised. For example::" +msgstr "" + +#: ../../library/unicodedata.rst:71 +msgid "" +">>> unicodedata.decimal('\\N{ARABIC-INDIC DIGIT NINE}')\n" +"9\n" +">>> unicodedata.decimal('\\N{SUPERSCRIPT NINE}', -1)\n" +"-1" msgstr "" +">>> unicodedata.decimal('\\N{ARABIC-INDIC DIGIT NINE}')\n" +"9\n" +">>> unicodedata.decimal('\\N{SUPERSCRIPT NINE}', -1)\n" +"-1" -#: ../../library/unicodedata.rst:54 +#: ../../library/unicodedata.rst:79 msgid "" "Returns the digit value assigned to the character *chr* as integer. If no " -"such value is defined, *default* is returned, or, if not " -"given, :exc:`ValueError` is raised." +"such value is defined, *default* is returned, or, if not given, :exc:" +"`ValueError` is raised::" +msgstr "" + +#: ../../library/unicodedata.rst:83 +msgid "" +">>> unicodedata.digit('\\N{SUPERSCRIPT NINE}')\n" +"9" msgstr "" +">>> unicodedata.digit('\\N{SUPERSCRIPT NINE}')\n" +"9" -#: ../../library/unicodedata.rst:61 +#: ../../library/unicodedata.rst:89 msgid "" "Returns the numeric value assigned to the character *chr* as float. If no " -"such value is defined, *default* is returned, or, if not " -"given, :exc:`ValueError` is raised." +"such value is defined, *default* is returned, or, if not given, :exc:" +"`ValueError` is raised::" msgstr "" -#: ../../library/unicodedata.rst:68 -msgid "Returns the general category assigned to the character *chr* as string." +#: ../../library/unicodedata.rst:93 +msgid "" +">>> unicodedata.numeric('½')\n" +"0.5" msgstr "" +">>> unicodedata.numeric('½')\n" +"0.5" -#: ../../library/unicodedata.rst:74 +#: ../../library/unicodedata.rst:99 +msgid "" +"Returns the general category assigned to the character *chr* as string. " +"General category names consist of two letters. See the `General Category " +"Values section of the Unicode Character Database documentation `_ for a list " +"of category codes. For example::" +msgstr "" + +#: ../../library/unicodedata.rst:105 +msgid "" +">>> unicodedata.category('A') # 'L'etter, 'u'ppercase\n" +"'Lu'" +msgstr "" + +#: ../../library/unicodedata.rst:111 msgid "" "Returns the bidirectional class assigned to the character *chr* as string. " -"If no such value is defined, an empty string is returned." +"If no such value is defined, an empty string is returned. See the " +"`Bidirectional Class Values section of the Unicode Character Database " +"`_ " +"documentation for a list of bidirectional codes. For example::" msgstr "" -#: ../../library/unicodedata.rst:80 +#: ../../library/unicodedata.rst:117 +msgid "" +">>> unicodedata.bidirectional('\\N{ARABIC-INDIC DIGIT SEVEN}') # 'A'rabic, " +"'N'umber\n" +"'AN'" +msgstr "" + +#: ../../library/unicodedata.rst:123 msgid "" "Returns the canonical combining class assigned to the character *chr* as " -"integer. Returns ``0`` if no combining class is defined." +"integer. Returns ``0`` if no combining class is defined. See the `Canonical " +"Combining Class Values section of the Unicode Character Database `_ " +"for more information." msgstr "" -#: ../../library/unicodedata.rst:86 -msgid "Returns the east asian width assigned to the character *chr* as string." +#: ../../library/unicodedata.rst:132 +msgid "" +"Returns the east asian width assigned to the character *chr* as string. For " +"a list of widths and or more information, see the `Unicode Standard Annex " +"#11 `_." msgstr "" -#: ../../library/unicodedata.rst:92 +#: ../../library/unicodedata.rst:139 msgid "" "Returns the mirrored property assigned to the character *chr* as integer. " "Returns ``1`` if the character has been identified as a \"mirrored\" " -"character in bidirectional text, ``0`` otherwise." +"character in bidirectional text, ``0`` otherwise. For example::" msgstr "" -#: ../../library/unicodedata.rst:99 +#: ../../library/unicodedata.rst:143 +msgid "" +">>> unicodedata.mirrored('>')\n" +"1" +msgstr "" +">>> unicodedata.mirrored('>')\n" +"1" + +#: ../../library/unicodedata.rst:149 msgid "" "Returns the character decomposition mapping assigned to the character *chr* " -"as string. An empty string is returned in case no such mapping is defined." +"as string. An empty string is returned in case no such mapping is defined. " +"For example::" +msgstr "" + +#: ../../library/unicodedata.rst:153 +msgid "" +">>> unicodedata.decomposition('Ã')\n" +"'0041 0303'" msgstr "" +">>> unicodedata.decomposition('Ã')\n" +"'0041 0303'" -#: ../../library/unicodedata.rst:106 +#: ../../library/unicodedata.rst:159 msgid "" "Return the normal form *form* for the Unicode string *unistr*. Valid values " "for *form* are 'NFC', 'NFKC', 'NFD', and 'NFKD'." msgstr "" -#: ../../library/unicodedata.rst:109 +#: ../../library/unicodedata.rst:162 msgid "" "The Unicode standard defines various normalization forms of a Unicode " "string, based on the definition of canonical equivalence and compatibility " @@ -123,7 +236,7 @@ msgid "" "(COMBINING CEDILLA)." msgstr "" -#: ../../library/unicodedata.rst:115 +#: ../../library/unicodedata.rst:168 msgid "" "For each character, there are two normal forms: normal form C and normal " "form D. Normal form D (NFD) is also known as canonical decomposition, and " @@ -132,65 +245,61 @@ msgid "" "characters again." msgstr "" -#: ../../library/unicodedata.rst:120 +#: ../../library/unicodedata.rst:173 msgid "" "In addition to these two forms, there are two additional normal forms based " "on compatibility equivalence. In Unicode, certain characters are supported " "which normally would be unified with other characters. For example, U+2160 " "(ROMAN NUMERAL ONE) is really the same thing as U+0049 (LATIN CAPITAL LETTER " "I). However, it is supported in Unicode for compatibility with existing " -"character sets (e.g. gb2312)." +"character sets (for example, gb2312)." msgstr "" -#: ../../library/unicodedata.rst:127 +#: ../../library/unicodedata.rst:180 msgid "" -"The normal form KD (NFKD) will apply the compatibility decomposition, i.e. " -"replace all compatibility characters with their equivalents. The normal form " -"KC (NFKC) first applies the compatibility decomposition, followed by the " -"canonical composition." +"The normal form KD (NFKD) will apply the compatibility decomposition, that " +"is, replace all compatibility characters with their equivalents. The normal " +"form KC (NFKC) first applies the compatibility decomposition, followed by " +"the canonical composition." msgstr "" -#: ../../library/unicodedata.rst:132 +#: ../../library/unicodedata.rst:185 msgid "" "Even if two unicode strings are normalized and look the same to a human " "reader, if one has combining characters and the other doesn't, they may not " "compare equal." msgstr "" -#: ../../library/unicodedata.rst:138 +#: ../../library/unicodedata.rst:192 msgid "" "Return whether the Unicode string *unistr* is in the normal form *form*. " "Valid values for *form* are 'NFC', 'NFKC', 'NFD', and 'NFKD'." msgstr "" -#: ../../library/unicodedata.rst:144 +#: ../../library/unicodedata.rst:198 msgid "In addition, the module exposes the following constant:" msgstr "" -#: ../../library/unicodedata.rst:148 +#: ../../library/unicodedata.rst:202 msgid "The version of the Unicode database used in this module." msgstr "在此模組中使用的 Unicode 資料庫版本。" -#: ../../library/unicodedata.rst:153 +#: ../../library/unicodedata.rst:207 msgid "" "This is an object that has the same methods as the entire module, but uses " "the Unicode database version 3.2 instead, for applications that require this " "specific version of the Unicode database (such as IDNA)." msgstr "" -#: ../../library/unicodedata.rst:157 -msgid "Examples:" -msgstr "範例:" - -#: ../../library/unicodedata.rst:177 +#: ../../library/unicodedata.rst:213 msgid "Footnotes" msgstr "註腳" -#: ../../library/unicodedata.rst:178 +#: ../../library/unicodedata.rst:214 msgid "https://www.unicode.org/Public/16.0.0/ucd/NameAliases.txt" msgstr "https://www.unicode.org/Public/16.0.0/ucd/NameAliases.txt" -#: ../../library/unicodedata.rst:180 +#: ../../library/unicodedata.rst:216 msgid "https://www.unicode.org/Public/16.0.0/ucd/NamedSequences.txt" msgstr "https://www.unicode.org/Public/16.0.0/ucd/NamedSequences.txt" diff --git a/library/unittest.mock.po b/library/unittest.mock.po index e5af3c35d6..49923b419b 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2024-02-19 21:27+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -50,15 +50,15 @@ msgstr "" #: ../../library/unittest.mock.rst:26 msgid "" "Additionally, mock provides a :func:`patch` decorator that handles patching " -"module and class level attributes within the scope of a test, along " -"with :const:`sentinel` for creating unique objects. See the `quick guide`_ " -"for some examples of how to use :class:`Mock`, :class:`MagicMock` " -"and :func:`patch`." +"module and class level attributes within the scope of a test, along with :" +"const:`sentinel` for creating unique objects. See the `quick guide`_ for " +"some examples of how to use :class:`Mock`, :class:`MagicMock` and :func:" +"`patch`." msgstr "" "此外,mock 還提供了一個 :func:`patch` 裝飾器,用於 patching 測試範圍內對 " -"module(模組)以及 class(類別)級別的屬性,以及用於建立唯一物件" -"的 :const:`sentinel`。有關如何使用 :class:`Mock`\\、:class:`MagicMock` " -"和 :func:`patch` 的一些範例,請參閱\\ `快速導引 `_。" +"module(模組)以及 class(類別)級別的屬性,以及用於建立唯一物件的 :const:" +"`sentinel`。有關如何使用 :class:`Mock`\\、:class:`MagicMock` 和 :func:" +"`patch` 的一些範例,請參閱\\ `快速導引 `_。" #: ../../library/unittest.mock.rst:32 msgid "" @@ -222,11 +222,11 @@ msgid "" "replacing, and any functions and methods (including constructors) have the " "same call signature as the real object." msgstr "" -"為了確保測試中的 mock 物件與它們要替換的物件具有相同的 api,你可以使用" -"\\ :ref:`自動規格 `。自動規格(auto-speccing)可以通過 patch " -"的 *autospec* 引數或 :func:`create_autospec` 函式來完成。自動規格建立的 mock " -"物件與它們要替換的物件具有相同的屬性和方法,並且任何函式和方法(包括建構函" -"式)都具有與真實物件相同的呼叫簽名(call signature)。" +"為了確保測試中的 mock 物件與它們要替換的物件具有相同的 api,你可以使用\\ :" +"ref:`自動規格 `。自動規格(auto-speccing)可以通過 patch 的 " +"*autospec* 引數或 :func:`create_autospec` 函式來完成。自動規格建立的 mock 物" +"件與它們要替換的物件具有相同的屬性和方法,並且任何函式和方法(包括建構函式)" +"都具有與真實物件相同的呼叫簽名(call signature)。" #: ../../library/unittest.mock.rst:177 msgid "" @@ -264,12 +264,12 @@ msgstr "" msgid "" ":class:`MagicMock` is a subclass of :class:`Mock` with all the magic methods " "pre-created and ready to use. There are also non-callable variants, useful " -"when you are mocking out objects that aren't " -"callable: :class:`NonCallableMock` and :class:`NonCallableMagicMock`" +"when you are mocking out objects that aren't callable: :class:" +"`NonCallableMock` and :class:`NonCallableMagicMock`" msgstr "" ":class:`MagicMock` 是 :class:`Mock` 的子類別,其中所有魔術方法均已預先建立並" -"可供使用。也有不可呼叫的變體,在你 mock 無法呼叫的物件時很有" -"用::class:`NonCallableMock` 和 :class:`NonCallableMagicMock`" +"可供使用。也有不可呼叫的變體,在你 mock 無法呼叫的物件時很有用::class:" +"`NonCallableMock` 和 :class:`NonCallableMagicMock`" #: ../../library/unittest.mock.rst:224 msgid "" @@ -279,8 +279,8 @@ msgid "" "class of :class:`Mock` using the *new_callable* argument to :func:`patch`." msgstr "" ":func:`patch` 裝飾器可以輕鬆地用 :class:`Mock` 物件臨時替換特定模組中的類別。" -"預設情況下,:func:`patch` 會為你建立一個 :class:`MagicMock`。你可以使" -"用 :func:`patch` 的 *new_callable* 引數指定 :class:`Mock` 的替代類別。" +"預設情況下,:func:`patch` 會為你建立一個 :class:`MagicMock`。你可以使用 :" +"func:`patch` 的 *new_callable* 引數指定 :class:`Mock` 的替代類別。" #: ../../library/unittest.mock.rst:232 msgid "" @@ -300,18 +300,18 @@ msgid "" msgstr "" "*spec*:這可以是字串的 list(串列),也可以是充當 mock 物件規格的現有物件(類" "別或實例)。如果傳入一個物件,則通過對該物件呼叫 dir 來形成字串的串列(不包括" -"不支援的魔術屬性和方法)。存取不在此串列中的任何屬性都會引" -"發 :exc:`AttributeError`。" +"不支援的魔術屬性和方法)。存取不在此串列中的任何屬性都會引發 :exc:" +"`AttributeError`。" #: ../../library/unittest.mock.rst:241 msgid "" -"If *spec* is an object (rather than a list of strings) " -"then :attr:`~object.__class__` returns the class of the spec object. This " -"allows mocks to pass :func:`isinstance` tests." +"If *spec* is an object (rather than a list of strings) then :attr:`~object." +"__class__` returns the class of the spec object. This allows mocks to pass :" +"func:`isinstance` tests." msgstr "" -"如果 *spec* 是一個物件(而不是一個字串的串列),那" -"麼 :attr:`~object.__class__` 會回傳 spec 物件的類別。這允許 mocks 通" -"過 :func:`isinstance` 測試。" +"如果 *spec* 是一個物件(而不是一個字串的串列),那麼 :attr:`~object." +"__class__` 會回傳 spec 物件的類別。這允許 mocks 通過 :func:`isinstance` 測" +"試。" #: ../../library/unittest.mock.rst:245 msgid "" @@ -320,13 +320,13 @@ msgid "" "will raise an :exc:`AttributeError`." msgstr "" "*spec_set*:*spec* 的一個更嚴格的變體。如果使用 *spec_set*,在 mock 上嘗試 " -"*set* 或取得不在傳遞給 *spec_set* 的物件上的屬性將會引" -"發 :exc:`AttributeError`。" +"*set* 或取得不在傳遞給 *spec_set* 的物件上的屬性將會引發 :exc:" +"`AttributeError`。" #: ../../library/unittest.mock.rst:249 msgid "" -"*side_effect*: A function to be called whenever the Mock is called. See " -"the :attr:`~Mock.side_effect` attribute. Useful for raising exceptions or " +"*side_effect*: A function to be called whenever the Mock is called. See the :" +"attr:`~Mock.side_effect` attribute. Useful for raising exceptions or " "dynamically changing return values. The function is called with the same " "arguments as the mock, and unless it returns :data:`DEFAULT`, the return " "value of this function is used as the return value." @@ -367,8 +367,8 @@ msgstr "" #: ../../library/unittest.mock.rst:267 msgid "" "*unsafe*: By default, accessing any attribute whose name starts with " -"*assert*, *assret*, *asert*, *aseert* or *assrt* will raise " -"an :exc:`AttributeError`. Passing ``unsafe=True`` will allow access to these " +"*assert*, *assret*, *asert*, *aseert* or *assrt* will raise an :exc:" +"`AttributeError`. Passing ``unsafe=True`` will allow access to these " "attributes." msgstr "" "*unsafe*:預設情況下,存取任何以 *assert*、*assret*、*asert*、*aseert* 或 " @@ -381,13 +381,13 @@ msgid "" "calling the Mock will pass the call through to the wrapped object (returning " "the real result). Attribute access on the mock will return a Mock object " "that wraps the corresponding attribute of the wrapped object (so attempting " -"to access an attribute that doesn't exist will raise " -"an :exc:`AttributeError`)." +"to access an attribute that doesn't exist will raise an :exc:" +"`AttributeError`)." msgstr "" "*wraps*:被 mock 物件包裝的項目。如果 *wraps* 不是 ``None``,那麼呼叫 Mock 將" "通過被包裝的物件(回傳真實結果)。存取 mock 的屬性將會回傳一個 Mock 物件,該" -"物件包裝了被包裝物件的對應屬性(因此嘗試存取不存在的屬性將引" -"發 :exc:`AttributeError`\\ )。" +"物件包裝了被包裝物件的對應屬性(因此嘗試存取不存在的屬性將引發 :exc:" +"`AttributeError`\\ )。" #: ../../library/unittest.mock.rst:281 msgid "" @@ -408,8 +408,8 @@ msgstr "" #: ../../library/unittest.mock.rst:288 msgid "" "Mocks can also be called with arbitrary keyword arguments. These will be " -"used to set attributes on the mock after it is created. See " -"the :meth:`configure_mock` method for details." +"used to set attributes on the mock after it is created. See the :meth:" +"`configure_mock` method for details." msgstr "" "Mocks 還可以使用任意的關鍵字引數進行呼叫。這些關鍵字引數將在建立 mock 之後用" "於設定 mock 的屬性。欲知更多,請參見 :meth:`configure_mock` 方法。" @@ -440,19 +440,19 @@ msgstr "斷言 mock 已經被使用指定的引數呼叫。" #: ../../library/unittest.mock.rst:351 msgid "" -"The assert passes if the mock has *ever* been called, " -"unlike :meth:`assert_called_with` and :meth:`assert_called_once_with` that " -"only pass if the call is the most recent one, and in the case " -"of :meth:`assert_called_once_with` it must also be the only call." +"The assert passes if the mock has *ever* been called, unlike :meth:" +"`assert_called_with` and :meth:`assert_called_once_with` that only pass if " +"the call is the most recent one, and in the case of :meth:" +"`assert_called_once_with` it must also be the only call." msgstr "" -"這個斷言在 mock 曾經被呼叫過時通過,不同於 :meth:`assert_called_with` " -"和 :meth:`assert_called_once_with`,他們針對的是最近的一次的呼叫,而且對" -"於 :meth:`assert_called_once_with`,最近一次的呼叫還必須也是唯一一次的呼叫。" +"這個斷言在 mock 曾經被呼叫過時通過,不同於 :meth:`assert_called_with` 和 :" +"meth:`assert_called_once_with`,他們針對的是最近的一次的呼叫,而且對於 :meth:" +"`assert_called_once_with`,最近一次的呼叫還必須也是唯一一次的呼叫。" #: ../../library/unittest.mock.rst:364 msgid "" -"assert the mock has been called with the specified calls. " -"The :attr:`mock_calls` list is checked for the calls." +"assert the mock has been called with the specified calls. The :attr:" +"`mock_calls` list is checked for the calls." msgstr "" "斷言 mock 已經使用指定的呼叫方式來呼叫。此斷言會檢查 :attr:`mock_calls` 串列" "中的呼叫。" @@ -553,9 +553,9 @@ msgstr "" #: ../../library/unittest.mock.rst:441 msgid "" -"Note that :meth:`reset_mock` *doesn't* clear " -"the :attr:`return_value`, :attr:`side_effect` or any child attributes you " -"have set using normal assignment by default." +"Note that :meth:`reset_mock` *doesn't* clear the :attr:`return_value`, :attr:" +"`side_effect` or any child attributes you have set using normal assignment " +"by default." msgstr "" #: ../../library/unittest.mock.rst:445 @@ -581,8 +581,8 @@ msgstr "如果 *spec_set* 為 true,那麼只能設定在規格中的屬性。" #: ../../library/unittest.mock.rst:461 msgid "" "Attach a mock as an attribute of this one, replacing its name and parent. " -"Calls to the attached mock will be recorded in the :attr:`method_calls` " -"and :attr:`mock_calls` attributes of this one." +"Calls to the attached mock will be recorded in the :attr:`method_calls` and :" +"attr:`mock_calls` attributes of this one." msgstr "" "將一個 mock 作為這個 Mock 的屬性附加,取代它的名稱和上代 (parent)。對附加的 " "mock 的呼叫將被記錄在這個 Mock 的 :attr:`method_calls` 和 :attr:`mock_calls` " @@ -679,17 +679,17 @@ msgid "" "returns :data:`DEFAULT` then the mock will return its normal value (from " "the :attr:`return_value`)." msgstr "" -"如果你傳遞一個函式,它將被呼叫,其引數與 mock 相同,且除非該函式回" -"傳 :data:`DEFAULT` 單例 (singleton),否則對 mock 的呼叫將回傳函式回傳的任何" -"值。如果函式回傳 :data:`DEFAULT`,那麼 mock 將回傳其正常的回傳值" -"(從 :attr:`return_value` 得到)。" +"如果你傳遞一個函式,它將被呼叫,其引數與 mock 相同,且除非該函式回傳 :data:" +"`DEFAULT` 單例 (singleton),否則對 mock 的呼叫將回傳函式回傳的任何值。如果函" +"式回傳 :data:`DEFAULT`,那麼 mock 將回傳其正常的回傳值(從 :attr:" +"`return_value` 得到)。" #: ../../library/unittest.mock.rst:583 msgid "" "If you pass in an iterable, it is used to retrieve an iterator which must " "yield a value on every call. This value can either be an exception instance " -"to be raised, or a value to be returned from the call to the mock " -"(:data:`DEFAULT` handling is identical to the function case)." +"to be raised, or a value to be returned from the call to the mock (:data:" +"`DEFAULT` handling is identical to the function case)." msgstr "" "如果你傳遞一個可疊代物件,它將被用於檢索一個疊代器,該疊代器必須在每次呼叫時" "產出 (yield) 一個值。這個值可以是要引發的例外實例,或者是對 mock 呼叫時要回傳" @@ -726,26 +726,25 @@ msgid "" "This is either ``None`` (if the mock hasn't been called), or the arguments " "that the mock was last called with. This will be in the form of a tuple: the " "first member, which can also be accessed through the ``args`` property, is " -"any ordered arguments the mock was called with (or an empty tuple) and the " -"second member, which can also be accessed through the ``kwargs`` property, " -"is any keyword arguments (or an empty dictionary)." +"any positional arguments the mock was called with (or an empty tuple) and " +"the second member, which can also be accessed through the ``kwargs`` " +"property, is any keyword arguments (or an empty dictionary)." msgstr "" "這會是 ``None``\\ (如果 mock 尚未被呼叫),或是 mock 上次被呼叫時使用的引" "數。這將以元組的形式呈現:第一個成員 (member),其可以通過 ``args`` 屬性存取," -"是 mock 被呼叫時傳遞的所有有序引數(或一個空元組)。第二個成員,其可以通過 " +"是 mock 被呼叫時傳遞的所有位置引數(或一個空元組)。第二個成員,其可以通過 " "``kwargs`` 屬性存取,是所有關鍵字引數(或一個空字典)。" #: ../../library/unittest.mock.rst:672 msgid "" -":attr:`call_args`, along with members of the " -"lists :attr:`call_args_list`, :attr:`method_calls` and :attr:`mock_calls` " -"are :data:`call` objects. These are tuples, so they can be unpacked to get " -"at the individual arguments and make more complex assertions. " -"See :ref:`calls as tuples `." +":attr:`call_args`, along with members of the lists :attr:`call_args_list`, :" +"attr:`method_calls` and :attr:`mock_calls` are :data:`call` objects. These " +"are tuples, so they can be unpacked to get at the individual arguments and " +"make more complex assertions. See :ref:`calls as tuples `." msgstr "" -":attr:`call_args`,以及串列 :attr:`call_args_list`、:attr:`method_calls` " -"和 :attr:`mock_calls` 的成員都是 :data:`call` 物件。這些都是元組,因此可以解" -"包以取得各個引數並進行更複雜的斷言。參見 :ref:`calls as tuples `。" #: ../../library/unittest.mock.rst:678 @@ -757,8 +756,8 @@ msgid "" "This is a list of all the calls made to the mock object in sequence (so the " "length of the list is the number of times it has been called). Before any " "calls have been made it is an empty list. The :data:`call` object can be " -"used for conveniently constructing lists of calls to compare " -"with :attr:`call_args_list`." +"used for conveniently constructing lists of calls to compare with :attr:" +"`call_args_list`." msgstr "" "這是按順序列出所有呼叫 mock 物件的串列(因此串列的長度表示它被呼叫的次數)。" "在任何呼叫發生之前,它會是一個空的串列。 :data:`call` 物件可用於方便地建構呼" @@ -829,8 +828,8 @@ msgstr "" #: ../../library/unittest.mock.rst:772 msgid "" -":attr:`!__class__` is assignable to, this allows a mock to pass " -"an :func:`isinstance` check without forcing you to use a spec:" +":attr:`!__class__` is assignable to, this allows a mock to pass an :func:" +"`isinstance` check without forcing you to use a spec:" msgstr "" ":attr:`!__class__` 可以被指定,這允許 mock 通過 :func:`isinstance` 檢查,而不" "需要強制使用 spec:" @@ -849,13 +848,13 @@ msgid "" "Mock objects that use a class or an instance as a :attr:`!spec` or :attr:`!" "spec_set` are able to pass :func:`isinstance` tests:" msgstr "" -"使用類別或實例作為 :attr:`!spec` 或 :attr:`!spec_set` 的 mock 物件能夠通" -"過 :func:`isinstance` 測試:" +"使用類別或實例作為 :attr:`!spec` 或 :attr:`!spec_set` 的 mock 物件能夠通過 :" +"func:`isinstance` 測試:" #: ../../library/unittest.mock.rst:796 msgid "" -"The :class:`Mock` classes have support for mocking magic methods. " -"See :ref:`magic methods ` for the full details." +"The :class:`Mock` classes have support for mocking magic methods. See :ref:" +"`magic methods ` for the full details." msgstr "" ":class:`Mock` 類別支援 mock 魔術方法。細節請參考\\ :ref:`魔術方法 `。" @@ -867,9 +866,9 @@ msgid "" "are passed to the constructor of the mock being created. The keyword " "arguments are for configuring attributes of the mock:" msgstr "" -"Mock類別和 :func:`patch` 裝飾器於組態時接受任意的關鍵字引數。對" -"於 :func:`patch` 裝飾器,這些關鍵字會傳遞給正在建立 mock 的建構函式。這些關鍵" -"字引數用於配置 mock 的屬性:" +"Mock類別和 :func:`patch` 裝飾器於組態時接受任意的關鍵字引數。對於 :func:" +"`patch` 裝飾器,這些關鍵字會傳遞給正在建立 mock 的建構函式。這些關鍵字引數用" +"於配置 mock 的屬性:" #: ../../library/unittest.mock.rst:810 msgid "" @@ -911,15 +910,15 @@ msgstr "" #: ../../library/unittest.mock.rst:838 msgid "" -"This applies " -"to :meth:`~Mock.assert_called_with`, :meth:`~Mock.assert_called_once_with`, :meth:`~Mock.assert_has_calls` " -"and :meth:`~Mock.assert_any_call`. When :ref:`auto-speccing`, it will also " -"apply to method calls on the mock object." +"This applies to :meth:`~Mock.assert_called_with`, :meth:`~Mock." +"assert_called_once_with`, :meth:`~Mock.assert_has_calls` and :meth:`~Mock." +"assert_any_call`. When :ref:`auto-speccing`, it will also apply to method " +"calls on the mock object." msgstr "" -"這適用" -"於 :meth:`~Mock.assert_called_with`、:meth:`~Mock.assert_called_once_with`、:meth:`~Mock.assert_has_calls` " -"和 :meth:`~Mock.assert_any_call`。在使用 :ref:`auto-speccing` 時,它還適用於 " -"mock 物件的方法呼叫。" +"這適用於 :meth:`~Mock.assert_called_with`、:meth:`~Mock." +"assert_called_once_with`、:meth:`~Mock.assert_has_calls` 和 :meth:`~Mock." +"assert_any_call`。在使用 :ref:`auto-speccing` 時,它還適用於 mock 物件的方法" +"呼叫。" #: ../../library/unittest.mock.rst:843 msgid "Added signature introspection on specced and autospecced mock objects." @@ -929,14 +928,14 @@ msgstr "" #: ../../library/unittest.mock.rst:849 msgid "" -"A mock intended to be used as a :class:`property`, or " -"other :term:`descriptor`, on a class. :class:`PropertyMock` " -"provides :meth:`~object.__get__` and :meth:`~object.__set__` methods so you " -"can specify a return value when it is fetched." +"A mock intended to be used as a :class:`property`, or other :term:" +"`descriptor`, on a class. :class:`PropertyMock` provides :meth:`~object." +"__get__` and :meth:`~object.__set__` methods so you can specify a return " +"value when it is fetched." msgstr "" -"一個理應在類別上當成 :class:`property` 或其他 :term:`descriptor` 的 " -"mock。:class:`PropertyMock` 提供了 :meth:`~object.__get__` " -"和 :meth:`~object.__set__` 方法,因此你可以在它被提取時指定回傳值。" +"一個理應在類別上當成 :class:`property` 或其他 :term:`descriptor` 的 mock。:" +"class:`PropertyMock` 提供了 :meth:`~object.__get__` 和 :meth:`~object." +"__set__` 方法,因此你可以在它被提取時指定回傳值。" #: ../../library/unittest.mock.rst:854 msgid "" @@ -986,9 +985,9 @@ msgstr "" #: ../../library/unittest.mock.rst:875 msgid "" -"Because of the way mock attributes are stored you can't directly attach " -"a :class:`PropertyMock` to a mock object. Instead you can attach it to the " -"mock type object::" +"Because of the way mock attributes are stored you can't directly attach a :" +"class:`PropertyMock` to a mock object. Instead you can attach it to the mock " +"type object::" msgstr "" "由於 mock 屬性的儲存方式,你無法直接將 :class:`PropertyMock` 附加到 mock 物" "件。但是你可以將其附加到 mock 型別的物件: ::" @@ -1091,18 +1090,18 @@ msgstr "" #: ../../library/unittest.mock.rst:940 msgid "" -"Setting the *spec* of a :class:`Mock`, :class:`MagicMock`, " -"or :class:`AsyncMock` to a class with asynchronous and synchronous functions " -"will automatically detect the synchronous functions and set them " -"as :class:`MagicMock` (if the parent mock is :class:`AsyncMock` " -"or :class:`MagicMock`) or :class:`Mock` (if the parent mock " -"is :class:`Mock`). All asynchronous functions will be :class:`AsyncMock`." +"Setting the *spec* of a :class:`Mock`, :class:`MagicMock`, or :class:" +"`AsyncMock` to a class with asynchronous and synchronous functions will " +"automatically detect the synchronous functions and set them as :class:" +"`MagicMock` (if the parent mock is :class:`AsyncMock` or :class:`MagicMock`) " +"or :class:`Mock` (if the parent mock is :class:`Mock`). All asynchronous " +"functions will be :class:`AsyncMock`." msgstr "" "將 :class:`Mock`、:class:`MagicMock` 或 :class:`AsyncMock` 的 *spec* 設定為具" -"有同步和非同步函式的類別,會自動檢測同步函式並將其設定" -"為 :class:`MagicMock`\\ (如果上代 mock 為 :class:`AsyncMock` " -"或 :class:`MagicMock`\\ )或 :class:`Mock`\\ (如果上代 mock " -"為 :class:`Mock`\\ )。所有非同步函式將被設定為 :class:`AsyncMock`。" +"有同步和非同步函式的類別,會自動檢測同步函式並將其設定為 :class:" +"`MagicMock`\\ (如果上代 mock 為 :class:`AsyncMock` 或 :class:" +"`MagicMock`\\ )或 :class:`Mock`\\ (如果上代 mock 為 :class:`Mock`\\ )。所" +"有非同步函式將被設定為 :class:`AsyncMock`。" #: ../../library/unittest.mock.rst:968 msgid "" @@ -1132,8 +1131,8 @@ msgstr "斷言 mock 曾經被使用指定的引數等待過。" #: ../../library/unittest.mock.rst:1053 msgid "" -"Assert the mock has been awaited with the specified calls. " -"The :attr:`await_args_list` list is checked for the awaits." +"Assert the mock has been awaited with the specified calls. The :attr:" +"`await_args_list` list is checked for the awaits." msgstr "" "斷言 mock 已被使用指定的呼叫進行等待。:attr:`await_args_list` 串列將被檢查以" "確認等待的內容。" @@ -1151,8 +1150,8 @@ msgid "" "If *any_order* is true then the awaits can be in any order, but they must " "all appear in :attr:`await_args_list`." msgstr "" -"如果 *any_order* 為 true,則等待可以以任何順序出現,但它們必須全部出現" -"在 :attr:`await_args_list` 中。" +"如果 *any_order* 為 true,則等待可以以任何順序出現,但它們必須全部出現在 :" +"attr:`await_args_list` 中。" #: ../../library/unittest.mock.rst:1080 msgid "Assert that the mock was never awaited." @@ -1160,11 +1159,11 @@ msgstr "斷言 mock 從未被等待。" #: ../../library/unittest.mock.rst:1087 msgid "" -"See :func:`Mock.reset_mock`. Also sets :attr:`await_count` to " -"0, :attr:`await_args` to None, and clears the :attr:`await_args_list`." +"See :func:`Mock.reset_mock`. Also sets :attr:`await_count` to 0, :attr:" +"`await_args` to None, and clears the :attr:`await_args_list`." msgstr "" -"參見 :func:`Mock.reset_mock`。同時將 :attr:`await_count` 設定為 " -"0,:attr:`await_args` 設定為 None,並清除 :attr:`await_args_list`。" +"參見 :func:`Mock.reset_mock`。同時將 :attr:`await_count` 設定為 0,:attr:" +"`await_args` 設定為 None,並清除 :attr:`await_args_list`。" #: ../../library/unittest.mock.rst:1092 msgid "" @@ -1174,8 +1173,8 @@ msgstr "一個整數,用來記錄 mock 物件已被等待的次數。" #: ../../library/unittest.mock.rst:1107 msgid "" "This is either ``None`` (if the mock hasn’t been awaited), or the arguments " -"that the mock was last awaited with. Functions the same " -"as :attr:`Mock.call_args`." +"that the mock was last awaited with. Functions the same as :attr:`Mock." +"call_args`." msgstr "" "這可能是 ``None``\\ (如果 mock 尚未被等待),或者是上次等待 mock 時使用的引" "數。與 :attr:`Mock.call_args` 的功能相同。" @@ -1191,9 +1190,9 @@ msgstr "" #: ../../library/unittest.mock.rst:1145 msgid "" -"A version of :class:`MagicMock` for multithreading tests. " -"The :class:`ThreadingMock` object provides extra methods to wait for a call " -"to be invoked, rather than assert on it immediately." +"A version of :class:`MagicMock` for multithreading tests. The :class:" +"`ThreadingMock` object provides extra methods to wait for a call to be " +"invoked, rather than assert on it immediately." msgstr "" #: ../../library/unittest.mock.rst:1149 @@ -1205,8 +1204,8 @@ msgstr "" #: ../../library/unittest.mock.rst:1152 msgid "" -"You can configure the global default timeout by " -"setting :attr:`ThreadingMock.DEFAULT_TIMEOUT`." +"You can configure the global default timeout by setting :attr:`ThreadingMock." +"DEFAULT_TIMEOUT`." msgstr "" #: ../../library/unittest.mock.rst:1156 @@ -1226,14 +1225,14 @@ msgstr "等到直到 mock 被以特定引數呼叫。" #: ../../library/unittest.mock.rst:1172 msgid "" -"If a timeout was passed at the creation of the mock the function raises " -"an :exc:`AssertionError` if the call is not performed in time." +"If a timeout was passed at the creation of the mock the function raises an :" +"exc:`AssertionError` if the call is not performed in time." msgstr "" #: ../../library/unittest.mock.rst:1183 msgid "" -"Global default timeout in seconds to create instances " -"of :class:`ThreadingMock`." +"Global default timeout in seconds to create instances of :class:" +"`ThreadingMock`." msgstr "" #: ../../library/unittest.mock.rst:1189 @@ -1242,11 +1241,11 @@ msgstr "呼叫" #: ../../library/unittest.mock.rst:1191 msgid "" -"Mock objects are callable. The call will return the value set as " -"the :attr:`~Mock.return_value` attribute. The default return value is a new " -"Mock object; it is created the first time the return value is accessed " -"(either explicitly or by calling the Mock) - but it is stored and the same " -"one returned each time." +"Mock objects are callable. The call will return the value set as the :attr:" +"`~Mock.return_value` attribute. The default return value is a new Mock " +"object; it is created the first time the return value is accessed (either " +"explicitly or by calling the Mock) - but it is stored and the same one " +"returned each time." msgstr "" "Mock 物件可被呼叫。呼叫將回傳設定為 :attr:`~Mock.return_value` 屬性的值。預設" "的回傳值是一個新的 Mock 物件;它會在第一次存取回傳值時(無論是顯式存取還是透" @@ -1254,11 +1253,11 @@ msgstr "" #: ../../library/unittest.mock.rst:1197 msgid "" -"Calls made to the object will be recorded in the attributes " -"like :attr:`~Mock.call_args` and :attr:`~Mock.call_args_list`." +"Calls made to the object will be recorded in the attributes like :attr:" +"`~Mock.call_args` and :attr:`~Mock.call_args_list`." msgstr "" -"對物件的呼叫會被記錄在如 :attr:`~Mock.call_args` " -"和 :attr:`~Mock.call_args_list` 等屬性中。" +"對物件的呼叫會被記錄在如 :attr:`~Mock.call_args` 和 :attr:`~Mock." +"call_args_list` 等屬性中。" #: ../../library/unittest.mock.rst:1200 msgid "" @@ -1271,8 +1270,8 @@ msgstr "" #: ../../library/unittest.mock.rst:1204 msgid "" -"The simplest way to make a mock raise an exception when called is to " -"make :attr:`~Mock.side_effect` an exception class or instance:" +"The simplest way to make a mock raise an exception when called is to make :" +"attr:`~Mock.side_effect` an exception class or instance:" msgstr "" "呼叫 mock 時引發例外的最簡單方式是將 :attr:`~Mock.side_effect` 設定為例外類別" "或實例:" @@ -1296,8 +1295,8 @@ msgid "" "return :data:`DEFAULT`:" msgstr "" "如果你希望 mock 仍然回傳預設的回傳值(一個新的 mock),或者是任何已設定的回傳" -"值,有兩種方法可以實現。從 :attr:`~Mock.side_effect` 內部回" -"傳 :attr:`~Mock.return_value`,或回傳 :data:`DEFAULT`:" +"值,有兩種方法可以實現。從 :attr:`~Mock.side_effect` 內部回傳 :attr:`~Mock." +"return_value`,或回傳 :data:`DEFAULT`:" #: ../../library/unittest.mock.rst:1257 msgid "" @@ -1372,8 +1371,8 @@ msgid "" "You \"block\" attributes by deleting them. Once deleted, accessing an " "attribute will raise an :exc:`AttributeError`." msgstr "" -"你可以通過刪除屬性來「阻擋」它們。一旦刪除,再次存取該屬性將會引" -"發 :exc:`AttributeError`。" +"你可以通過刪除屬性來「阻擋」它們。一旦刪除,再次存取該屬性將會引發 :exc:" +"`AttributeError`。" #: ../../library/unittest.mock.rst:1331 msgid "Mock names and the name attribute" @@ -1383,8 +1382,8 @@ msgstr "Mock 名稱與名稱屬性" msgid "" "Since \"name\" is an argument to the :class:`Mock` constructor, if you want " "your mock object to have a \"name\" attribute you can't just pass it in at " -"creation time. There are two alternatives. One option is to " -"use :meth:`~Mock.configure_mock`::" +"creation time. There are two alternatives. One option is to use :meth:`~Mock." +"configure_mock`::" msgstr "" "由於 \"name\" 是傳遞給 :class:`Mock` 建構函式的引數,如果你想讓你的 mock 物件" "擁有 \"name\" 屬性,你不能在建立時直接傳遞它。有兩種替代方法。其中一個選擇是" @@ -1447,8 +1446,8 @@ msgstr "" #: ../../library/unittest.mock.rst:1381 msgid "" "Mocks created for you by :func:`patch` are automatically given names. To " -"attach mocks that have names to a parent you use " -"the :meth:`~Mock.attach_mock` method::" +"attach mocks that have names to a parent you use the :meth:`~Mock." +"attach_mock` method::" msgstr "" "由 :func:`patch` 為你建立的 mock 會自動被賦予名稱。若要將具有名稱的 mock 附加" "到上代,你可以使用 :meth:`~Mock.attach_mock` 方法: ::" @@ -1490,10 +1489,10 @@ msgid "" "a new Mock object when it expects a magic method. If you need magic method " "support see :ref:`magic methods `." msgstr "" -"唯一的例外是魔術方法和屬性(具有前後雙底線)。Mock 不會建立這些,而是會引" -"發 :exc:`AttributeError`。這是因為直譯器通常會隱式地要求這些方法,在期望得到" -"一個魔術方法卻獲得一個新的 Mock 物件時,會讓直譯器\\ *非常*\\ 困惑。如果你需" -"要魔術方法的支援,請參閱\\ :ref:`魔術方法 `。" +"唯一的例外是魔術方法和屬性(具有前後雙底線)。Mock 不會建立這些,而是會引發 :" +"exc:`AttributeError`。這是因為直譯器通常會隱式地要求這些方法,在期望得到一個" +"魔術方法卻獲得一個新的 Mock 物件時,會讓直譯器\\ *非常*\\ 困惑。如果你需要魔" +"術方法的支援,請參閱\\ :ref:`魔術方法 `。" #: ../../library/unittest.mock.rst:1408 msgid "The patchers" @@ -1540,11 +1539,10 @@ msgid "" "If :func:`patch` is used as a context manager the created mock is returned " "by the context manager." msgstr "" -"如果 *new* 被省略,則如果被 patch 的物件是非同步函式,目標會被替換" -"為 :class:`AsyncMock`,反之則替換為 :class:`MagicMock`。如果 :func:`patch` 做" -"為裝飾器使用且省略了 *new*,則所建立的 mock 會作為額外的引數傳遞給被裝飾的函" -"式。如果 :func:`patch` 作為情境管理器使用,則所建立的 mock 將由情境管理器回" -"傳。" +"如果 *new* 被省略,則如果被 patch 的物件是非同步函式,目標會被替換為 :class:" +"`AsyncMock`,反之則替換為 :class:`MagicMock`。如果 :func:`patch` 做為裝飾器使" +"用且省略了 *new*,則所建立的 mock 會作為額外的引數傳遞給被裝飾的函式。如果 :" +"func:`patch` 作為情境管理器使用,則所建立的 mock 將由情境管理器回傳。" #: ../../library/unittest.mock.rst:1438 msgid "" @@ -1555,14 +1553,14 @@ msgid "" "function is executed, not at decoration time." msgstr "" "*target* 應該是以 ``'package.module.ClassName'`` 形式出現的字串。*target* 會" -"被引入並用 *new* 物件替換指定的物件,因此 *target* 必須可從你呼" -"叫 :func:`patch` 的環境中引入。target 在執行被裝飾的函式時被引入,而不是在裝" -"飾器作用時 (decoration time)。" +"被引入並用 *new* 物件替換指定的物件,因此 *target* 必須可從你呼叫 :func:" +"`patch` 的環境中引入。target 在執行被裝飾的函式時被引入,而不是在裝飾器作用" +"時 (decoration time)。" #: ../../library/unittest.mock.rst:1444 msgid "" -"The *spec* and *spec_set* keyword arguments are passed to " -"the :class:`MagicMock` if patch is creating one for you." +"The *spec* and *spec_set* keyword arguments are passed to the :class:" +"`MagicMock` if patch is creating one for you." msgstr "" "*spec* 和 *spec_set* 關鍵字引數會傳遞給 :class:`MagicMock`,如果 patch 正在為" "你建立一個。" @@ -1578,9 +1576,8 @@ msgstr "" #: ../../library/unittest.mock.rst:1450 msgid "" "*new_callable* allows you to specify a different class, or callable object, " -"that will be called to create the *new* object. By " -"default :class:`AsyncMock` is used for async functions " -"and :class:`MagicMock` for the rest." +"that will be called to create the *new* object. By default :class:" +"`AsyncMock` is used for async functions and :class:`MagicMock` for the rest." msgstr "" "*new_callable* 允許你指定一個不同的類別或可呼叫的物件,用於被呼叫並建立 " "*new* 物件。預設情況下,對於非同步函式使用 :class:`AsyncMock`,而對於其他情況" @@ -1594,15 +1591,15 @@ msgid "" "attribute of the object being replaced. Methods and functions being mocked " "will have their arguments checked and will raise a :exc:`TypeError` if they " "are called with the wrong signature. For mocks replacing a class, their " -"return value (the 'instance') will have the same spec as the class. See " -"the :func:`create_autospec` function and :ref:`auto-speccing`." +"return value (the 'instance') will have the same spec as the class. See the :" +"func:`create_autospec` function and :ref:`auto-speccing`." msgstr "" "*spec* 的一種更強大的形式是 *autospec*。如果你設定 ``autospec=True``,則該 " "mock 將使用被替換物件的規格來建立。該 mock 的所有屬性也將具有被替換物件的對應" "屬性的規格。被 mock 的方法和函式將檢查其引數,如果呼叫時引數與規格不符(被使" "用錯誤的簽名 (signature) 呼叫),將引發 :exc:`TypeError`。對於替換類別的 " -"mock,它們的回傳值(即 'instance')將具有與類別相同的規格。請參" -"閱 :func:`create_autospec` 函式和 :ref:`auto-speccing`。" +"mock,它們的回傳值(即 'instance')將具有與類別相同的規格。請參閱 :func:" +"`create_autospec` 函式和 :ref:`auto-speccing`。" #: ../../library/unittest.mock.rst:1464 msgid "" @@ -1641,10 +1638,10 @@ msgid "" "Patch can be used as a :class:`~unittest.TestCase` class decorator. It works " "by decorating each test method in the class. This reduces the boilerplate " "code when your test methods share a common patchings set. :func:`patch` " -"finds tests by looking for method names that start with " -"``patch.TEST_PREFIX``. By default this is ``'test'``, which matches the " -"way :mod:`unittest` finds tests. You can specify an alternative prefix by " -"setting ``patch.TEST_PREFIX``." +"finds tests by looking for method names that start with ``patch." +"TEST_PREFIX``. By default this is ``'test'``, which matches the way :mod:" +"`unittest` finds tests. You can specify an alternative prefix by setting " +"``patch.TEST_PREFIX``." msgstr "" "patch 可以做為 :class:`~unittest.TestCase` 類別的裝飾器使用。它透過裝飾類別中" "的每個測試方法來運作。當你的測試方法共享一組常見的 patch 時,這會減少繁冗的代" @@ -1665,9 +1662,9 @@ msgstr "" #: ../../library/unittest.mock.rst:1493 msgid "" -":func:`patch` takes arbitrary keyword arguments. These will be passed " -"to :class:`AsyncMock` if the patched object is asynchronous, " -"to :class:`MagicMock` otherwise or to *new_callable* if specified." +":func:`patch` takes arbitrary keyword arguments. These will be passed to :" +"class:`AsyncMock` if the patched object is asynchronous, to :class:" +"`MagicMock` otherwise or to *new_callable* if specified." msgstr "" ":func:`patch` 接受任意的關鍵字引數。如果被 patch 的物件是非同步的,這些將會被" "傳遞給 :class:`AsyncMock`,如果是同步的則會傳遞給 :class:`MagicMock`,或如果" @@ -1707,18 +1704,18 @@ msgstr "" #: ../../library/unittest.mock.rst:1510 msgid "" "Patching a class replaces the class with a :class:`MagicMock` *instance*. If " -"the class is instantiated in the code under test then it will be " -"the :attr:`~Mock.return_value` of the mock that will be used." +"the class is instantiated in the code under test then it will be the :attr:" +"`~Mock.return_value` of the mock that will be used." msgstr "" "Patch 一個類別會以 :class:`MagicMock`\\ *實例*\\ 取代該類別。如果該類別在被" -"測試的程式碼中實例化,那麼它將是會被使用的 mock " -"的 :attr:`~Mock.return_value`。" +"測試的程式碼中實例化,那麼它將是會被使用的 mock 的 :attr:`~Mock." +"return_value`。" #: ../../library/unittest.mock.rst:1514 msgid "" -"If the class is instantiated multiple times you could " -"use :attr:`~Mock.side_effect` to return a new mock each time. Alternatively " -"you can set the *return_value* to be anything you want." +"If the class is instantiated multiple times you could use :attr:`~Mock." +"side_effect` to return a new mock each time. Alternatively you can set the " +"*return_value* to be anything you want." msgstr "" "如果該類別被實例化多次,你可以使用 :attr:`~Mock.side_effect` 來每次回傳一個新" "的 mock。 或者你可以將 *return_value* 設定成你想要的任何值。" @@ -1728,8 +1725,8 @@ msgid "" "To configure return values on methods of *instances* on the patched class " "you must do this on the :attr:`~Mock.return_value`. For example::" msgstr "" -"若要配置被 patch 的類別的\\ *實例*\\ 方法的回傳值,你必須" -"在 :attr:`~Mock.return_value` 上進行配置。例如: ::" +"若要配置被 patch 的類別的\\ *實例*\\ 方法的回傳值,你必須在 :attr:`~Mock." +"return_value` 上進行配置。例如: ::" #: ../../library/unittest.mock.rst:1521 msgid "" @@ -1870,16 +1867,16 @@ msgstr "" #: ../../library/unittest.mock.rst:1580 msgid "" -"As well as attributes on the created mock attributes, like " -"the :attr:`~Mock.return_value` and :attr:`~Mock.side_effect`, of child mocks " -"can also be configured. These aren't syntactically valid to pass in directly " -"as keyword arguments, but a dictionary with these as keys can still be " -"expanded into a :func:`patch` call using ``**``::" +"As well as attributes on the created mock attributes, like the :attr:`~Mock." +"return_value` and :attr:`~Mock.side_effect`, of child mocks can also be " +"configured. These aren't syntactically valid to pass in directly as keyword " +"arguments, but a dictionary with these as keys can still be expanded into a :" +"func:`patch` call using ``**``::" msgstr "" -"除了被建立的 mock 上的屬性外,還可以配置 child mock " -"的 :attr:`~Mock.return_value` 和 :attr:`~Mock.side_effect`。它們在語法上不能" -"直接作為關鍵字引數傳入,但是以它們作為鍵的字典仍然可以使用 ``**`` 擴充為一" -"個 :func:`patch` 呼叫: ::" +"除了被建立的 mock 上的屬性外,還可以配置 child mock 的 :attr:`~Mock." +"return_value` 和 :attr:`~Mock.side_effect`。它們在語法上不能直接作為關鍵字引" +"數傳入,但是以它們作為鍵的字典仍然可以使用 ``**`` 擴充為一個 :func:`patch` 呼" +"叫: ::" #: ../../library/unittest.mock.rst:1586 msgid "" @@ -1906,8 +1903,8 @@ msgstr "" #: ../../library/unittest.mock.rst:1596 msgid "" "By default, attempting to patch a function in a module (or a method or an " -"attribute in a class) that does not exist will fail " -"with :exc:`AttributeError`::" +"attribute in a class) that does not exist will fail with :exc:" +"`AttributeError`::" msgstr "" "預設情況下,嘗試 patch 模組中不存在的函式(或類別中的方法或屬性)將會失敗,並" "引發 :exc:`AttributeError`: ::" @@ -1979,19 +1976,19 @@ msgstr "" msgid "" ":func:`patch.object` can be used as a decorator, class decorator or a " "context manager. Arguments *new*, *spec*, *create*, *spec_set*, *autospec* " -"and *new_callable* have the same meaning as for :func:`patch`. " -"Like :func:`patch`, :func:`patch.object` takes arbitrary keyword arguments " -"for configuring the mock object it creates." +"and *new_callable* have the same meaning as for :func:`patch`. Like :func:" +"`patch`, :func:`patch.object` takes arbitrary keyword arguments for " +"configuring the mock object it creates." msgstr "" ":func:`patch.object` 可以做為裝飾器、類別裝飾器或情境管理器使用。引數 *new*、" -"*spec*、*create*、*spec_set*、*autospec* 和 *new_callable* 與" -"在 :func:`patch` 中的引數具有相同的意義。與 :func:`patch` 一" -"樣,:func:`patch.object` 接受任意關鍵字引數來配置它所建立的 mock 物件。" +"*spec*、*create*、*spec_set*、*autospec* 和 *new_callable* 與在 :func:" +"`patch` 中的引數具有相同的意義。與 :func:`patch` 一樣,:func:`patch.object` " +"接受任意關鍵字引數來配置它所建立的 mock 物件。" #: ../../library/unittest.mock.rst:1636 msgid "" -"When used as a class decorator :func:`patch.object` honours " -"``patch.TEST_PREFIX`` for choosing which methods to wrap." +"When used as a class decorator :func:`patch.object` honours ``patch." +"TEST_PREFIX`` for choosing which methods to wrap." msgstr "" "當作為類別裝飾器使用時,:func:`patch.object` 會遵循 ``patch.TEST_PREFIX`` 來" "選擇要包裝的方法。" @@ -2031,7 +2028,9 @@ msgid "" "Patch a dictionary, or dictionary like object, and restore the dictionary to " "its original state after the test, where the restored dictionary is a copy " "of the dictionary as it was before the test." -msgstr "Patch 字典或類字典的物件,並在測試後將字典回復到其原本的狀態,其中回復的字典是測試前字典的複本。" +msgstr "" +"Patch 字典或類字典的物件,並在測試後將字典回復到其原本的狀態,其中回復的字典" +"是測試前字典的複本。" #: ../../library/unittest.mock.rst:1667 msgid "" @@ -2082,9 +2081,8 @@ msgstr ":func:`patch.dict` 可以做為情境管理器、裝飾器或類別裝 #: ../../library/unittest.mock.rst:1699 msgid "" -"When used as a class decorator :func:`patch.dict` honours " -"``patch.TEST_PREFIX`` (default to ``'test'``) for choosing which methods to " -"wrap:" +"When used as a class decorator :func:`patch.dict` honours ``patch." +"TEST_PREFIX`` (default to ``'test'``) for choosing which methods to wrap:" msgstr "" "當作為類別裝飾器使用時,:func:`patch.dict` 會遵循 ``patch.TEST_PREFIX``\\ " "(預設為 ``'test'``\\ )來選擇要包裝的方法:" @@ -2119,14 +2117,15 @@ msgid "" ":func:`patch.dict` can be used with dictionary like objects that aren't " "actually dictionaries. At the very minimum they must support item getting, " "setting, deleting and either iteration or membership test. This corresponds " -"to the magic " -"methods :meth:`~object.__getitem__`, :meth:`~object.__setitem__`, :meth:`~object.__delitem__` " -"and either :meth:`~container.__iter__` or :meth:`~object.__contains__`." +"to the magic methods :meth:`~object.__getitem__`, :meth:`~object." +"__setitem__`, :meth:`~object.__delitem__` and either :meth:`~container." +"__iter__` or :meth:`~object.__contains__`." msgstr "" ":func:`patch.dict` 可以與實際上不是字典的類字典物件一起使用。最低限度它們必須" -"支援項目的取得、設定、刪除以及疊代或隸屬資格檢測。這對應到魔術方法中" -"的 :meth:`~object.__getitem__`、:meth:`~object.__setitem__`、:meth:`~object.__delitem__` " -"以及 :meth:`~container.__iter__` 或 :meth:`~object.__contains__`。" +"支援項目的取得、設定、刪除以及疊代或隸屬資格檢測。這對應到魔術方法中的 :meth:" +"`~object.__getitem__`、:meth:`~object.__setitem__`、:meth:`~object." +"__delitem__` 以及 :meth:`~container.__iter__` 或 :meth:`~object." +"__contains__`。" #: ../../library/unittest.mock.rst:1775 msgid "patch.multiple" @@ -2153,12 +2152,12 @@ msgstr "" msgid "" "Use :data:`DEFAULT` as the value if you want :func:`patch.multiple` to " "create mocks for you. In this case the created mocks are passed into a " -"decorated function by keyword, and a dictionary is returned " -"when :func:`patch.multiple` is used as a context manager." +"decorated function by keyword, and a dictionary is returned when :func:" +"`patch.multiple` is used as a context manager." msgstr "" "如果你想要 :func:`patch.multiple` 為你建立 mock,請使用 :data:`DEFAULT` 作為" -"值。在這種情況下,被建立的 mock 會透過關鍵字傳遞到被裝飾的函式中,並且" -"當 :func:`patch.multiple` 作為情境管理器時會回傳字典。" +"值。在這種情況下,被建立的 mock 會透過關鍵字傳遞到被裝飾的函式中,並且當 :" +"func:`patch.multiple` 作為情境管理器時會回傳字典。" #: ../../library/unittest.mock.rst:1791 msgid "" @@ -2168,14 +2167,14 @@ msgid "" "will be applied to *all* patches done by :func:`patch.multiple`." msgstr "" ":func:`patch.multiple` 可以做為裝飾器、類別裝飾器或情境管理器使用。引數 " -"*spec*、*spec_set*、*create*、*autospec* 和 *new_callable* 與" -"在 :func:`patch` 中的引數具有相同的意義。這些引數將應用於" -"由 :func:`patch.multiple` 完成的\\ *所有* patch。" +"*spec*、*spec_set*、*create*、*autospec* 和 *new_callable* 與在 :func:" +"`patch` 中的引數具有相同的意義。這些引數將應用於由 :func:`patch.multiple` 完" +"成的\\ *所有* patch。" #: ../../library/unittest.mock.rst:1796 msgid "" -"When used as a class decorator :func:`patch.multiple` honours " -"``patch.TEST_PREFIX`` for choosing which methods to wrap." +"When used as a class decorator :func:`patch.multiple` honours ``patch." +"TEST_PREFIX`` for choosing which methods to wrap." msgstr "" "當作為類別裝飾器使用時,:func:`patch.multiple` 遵循 ``patch.TEST_PREFIX`` 來" "選擇要包裝的方法。" @@ -2187,9 +2186,9 @@ msgid "" "decorator then the created mocks are passed into the decorated function by " "keyword. ::" msgstr "" -"如果你想要 :func:`patch.multiple` 為你建立 mock,那麼你可以使" -"用 :data:`DEFAULT` 作為值。如果你使用 :func:`patch.multiple` 作為裝飾器,那麼" -"被建立的 mock 將透過關鍵字傳遞到被裝飾的函式中。: ::" +"如果你想要 :func:`patch.multiple` 為你建立 mock,那麼你可以使用 :data:" +"`DEFAULT` 作為值。如果你使用 :func:`patch.multiple` 作為裝飾器,那麼被建立的 " +"mock 將透過關鍵字傳遞到被裝飾的函式中。: ::" #: ../../library/unittest.mock.rst:1803 msgid "" @@ -2290,9 +2289,9 @@ msgid "" "then call :meth:`!start` to put the patch in place and :meth:`!stop` to undo " "it." msgstr "" -"要使用它們,請像平常一樣呼叫 :func:`patch`、:func:`patch.object` " -"或 :func:`patch.dict` ,並保留對回傳的 ``patcher`` 物件的參照。之後你就可以呼" -"叫 :meth:`!start` 將 patch 準備就緒,並呼叫 :meth:`!stop` 來取消 patch。" +"要使用它們,請像平常一樣呼叫 :func:`patch`、:func:`patch.object` 或 :func:" +"`patch.dict` ,並保留對回傳的 ``patcher`` 物件的參照。之後你就可以呼叫 :meth:" +"`!start` 將 patch 準備就緒,並呼叫 :meth:`!stop` 來取消 patch。" #: ../../library/unittest.mock.rst:1849 msgid "" @@ -2372,8 +2371,8 @@ msgstr "" msgid "" "If you use this technique you must ensure that the patching is \"undone\" by " "calling ``stop``. This can be fiddlier than you might think, because if an " -"exception is raised in the ``setUp`` then ``tearDown`` is not " -"called. :meth:`unittest.TestCase.addCleanup` makes this easier::" +"exception is raised in the ``setUp`` then ``tearDown`` is not called. :meth:" +"`unittest.TestCase.addCleanup` makes this easier::" msgstr "" "如果你使用這個技巧,你必須確保透過呼叫 ``stop`` 來 \"取消\" patch。這可能會比" "你想像的還要複雜一點,因為如果有例外在 ``setUp`` 中被引發,則 ``tearDown`` 就" @@ -2409,8 +2408,8 @@ msgstr "作為額外的好處,你不再需要保留對 ``patcher`` 物件的 #: ../../library/unittest.mock.rst:1903 msgid "" -"It is also possible to stop all patches which have been started by " -"using :func:`patch.stopall`." +"It is also possible to stop all patches which have been started by using :" +"func:`patch.stopall`." msgstr "也可以使用 :func:`patch.stopall` 來停止所有已啟動的 patch。" #: ../../library/unittest.mock.rst:1908 @@ -2458,14 +2457,14 @@ msgid "" "the :class:`unittest.TestLoader` finds test methods by default." msgstr "" "所有 patcher 都可以作為類別裝飾器使用。以這種方式使用時,它們包裝了類別上的每" -"個測試方法。Patcher 將 ``'test'`` 開頭的方法認定為測試方法。這" -"與 :class:`unittest.TestLoader` 預設尋找測試方法的方式相同。" +"個測試方法。Patcher 將 ``'test'`` 開頭的方法認定為測試方法。這與 :class:" +"`unittest.TestLoader` 預設尋找測試方法的方式相同。" #: ../../library/unittest.mock.rst:1937 msgid "" "It is possible that you want to use a different prefix for your tests. You " -"can inform the patchers of the different prefix by setting " -"``patch.TEST_PREFIX``::" +"can inform the patchers of the different prefix by setting ``patch." +"TEST_PREFIX``::" msgstr "" "你可能會想為你的測試使用不同的前綴。你可以透過設定 ``patch.TEST_PREFIX`` 來告" "知 patcher 使用不同的前綴: ::" @@ -2580,10 +2579,10 @@ msgstr "" msgid "" "Now we want to test ``some_function`` but we want to mock out ``SomeClass`` " "using :func:`patch`. The problem is that when we import module b, which we " -"will have to do when it imports ``SomeClass`` from module a. If we " -"use :func:`patch` to mock out ``a.SomeClass`` then it will have no effect on " -"our test; module b already has a reference to the *real* ``SomeClass`` and " -"it looks like our patching had no effect." +"will have to do when it imports ``SomeClass`` from module a. If we use :func:" +"`patch` to mock out ``a.SomeClass`` then it will have no effect on our test; " +"module b already has a reference to the *real* ``SomeClass`` and it looks " +"like our patching had no effect." msgstr "" "現在我們想要測試 ``some_function``,但我們想使用 :func:`patch` mock " "``SomeClass``。問題是,當我們 import 模組 b 時(我們必須這樣做),它會從模組 " @@ -2609,10 +2608,10 @@ msgstr "@patch('b.SomeClass')" #: ../../library/unittest.mock.rst:2022 msgid "" "However, consider the alternative scenario where instead of ``from a import " -"SomeClass`` module b does ``import a`` and ``some_function`` uses " -"``a.SomeClass``. Both of these import forms are common. In this case the " -"class we want to patch is being looked up in the module and so we have to " -"patch ``a.SomeClass`` instead::" +"SomeClass`` module b does ``import a`` and ``some_function`` uses ``a." +"SomeClass``. Both of these import forms are common. In this case the class " +"we want to patch is being looked up in the module and so we have to patch " +"``a.SomeClass`` instead::" msgstr "" "然而,考慮另一種情況,其中模組 b 並不是使用 ``from a import SomeClass``,而" "是 ``import a``,然後 ``some_function`` 使用 ``a.SomeClass``。這兩種 import " @@ -2632,14 +2631,14 @@ msgid "" "Both patch_ and patch.object_ correctly patch and restore descriptors: class " "methods, static methods and properties. You should patch these on the " "*class* rather than an instance. They also work with *some* objects that " -"proxy attribute access, like the `django settings object `_." msgstr "" "patch_ 和 patch.object_ 都正確地 patch 和還原描述器:類別方法、靜態方法以及屬" "性。你應該在 *類別* 而不是實例上 patch 它們。它們還可以使用代理屬性存取的\\ *" -"一些*\\ 物件,例如 `django 設定物件 `_。" #: ../../library/unittest.mock.rst:2041 @@ -2652,9 +2651,9 @@ msgstr "Mock 魔術方法" #: ../../library/unittest.mock.rst:2048 msgid "" -":class:`Mock` supports mocking the Python protocol methods, also known " -"as :term:`\"magic methods\" `. This allows mock objects to " -"replace containers or other objects that implement Python protocols." +":class:`Mock` supports mocking the Python protocol methods, also known as :" +"term:`\"magic methods\" `. This allows mock objects to replace " +"containers or other objects that implement Python protocols." msgstr "" ":class:`Mock` 支援 mock Python 協定方法,其也被稱作 :term:`\"魔術方法\" " "`。這允許 mock 物件替換容器或實作 Python 協定的其他物件。" @@ -2681,8 +2680,8 @@ msgstr "" #: ../../library/unittest.mock.rst:2080 msgid "" -"One use case for this is for mocking objects used as context managers in " -"a :keyword:`with` statement:" +"One use case for this is for mocking objects used as context managers in a :" +"keyword:`with` statement:" msgstr "一個用法是在 :keyword:`with` 陳述式中 mock 作為情境管理器使用的物件:" #: ../../library/unittest.mock.rst:2092 @@ -2690,14 +2689,14 @@ msgid "" "Calls to magic methods do not appear in :attr:`~Mock.method_calls`, but they " "are recorded in :attr:`~Mock.mock_calls`." msgstr "" -"對魔術方法的呼叫並不會出現在 :attr:`~Mock.method_calls` 中,它們會被記錄" -"在 :attr:`~Mock.mock_calls` 內。" +"對魔術方法的呼叫並不會出現在 :attr:`~Mock.method_calls` 中,它們會被記錄在 :" +"attr:`~Mock.mock_calls` 內。" #: ../../library/unittest.mock.rst:2097 msgid "" "If you use the *spec* keyword argument to create a mock then attempting to " -"set a magic method that isn't in the spec will raise " -"an :exc:`AttributeError`." +"set a magic method that isn't in the spec will raise an :exc:" +"`AttributeError`." msgstr "" "如果你使用\\ *spec*\\ 關鍵字引數來建立一個 mock,則嘗試設定規格中未包含的魔術" "方法將引發一個 :exc:`AttributeError`。" @@ -2822,11 +2821,11 @@ msgstr "Magic Mock" #: ../../library/unittest.mock.rst:2142 msgid "" -"There are two ``MagicMock`` variants: :class:`MagicMock` " -"and :class:`NonCallableMagicMock`." +"There are two ``MagicMock`` variants: :class:`MagicMock` and :class:" +"`NonCallableMagicMock`." msgstr "" -"``MagicMock`` 有兩個變體::class:`MagicMock` " -"和 :class:`NonCallableMagicMock`。" +"``MagicMock`` 有兩個變體::class:`MagicMock` 和 :class:" +"`NonCallableMagicMock`。" #: ../../library/unittest.mock.rst:2147 msgid "" @@ -2961,13 +2960,13 @@ msgstr "舉例來說:" #: ../../library/unittest.mock.rst:2213 msgid "" "The two equality methods, :meth:`!__eq__` and :meth:`!__ne__`, are special. " -"They do the default equality comparison on identity, using " -"the :attr:`~Mock.side_effect` attribute, unless you change their return " -"value to return something else::" +"They do the default equality comparison on identity, using the :attr:`~Mock." +"side_effect` attribute, unless you change their return value to return " +"something else::" msgstr "" -":meth:`!__eq__` 和 :meth:`!__ne__` 這兩個相等的方法是特別的。它們使" -"用 :attr:`~Mock.side_effect` 屬性對識別性 (identity) 進行預設的相等比較,除非" -"你變更它們的回傳值以回傳其他內容: ::" +":meth:`!__eq__` 和 :meth:`!__ne__` 這兩個相等的方法是特別的。它們使用 :attr:" +"`~Mock.side_effect` 屬性對識別性 (identity) 進行預設的相等比較,除非你變更它" +"們的回傳值以回傳其他內容: ::" #: ../../library/unittest.mock.rst:2218 msgid "" @@ -3091,8 +3090,8 @@ msgstr "" #: ../../library/unittest.mock.rst:2285 msgid "" -"The ``sentinel`` attributes now preserve their identity when they " -"are :mod:`copied ` or :mod:`pickled `." +"The ``sentinel`` attributes now preserve their identity when they are :mod:" +"`copied ` or :mod:`pickled `." msgstr "" "``哨兵``\\ 屬性現在當被\\ :mod:`複製 `\\ 或\\ :mod:`序列化 `\\ " "時會保留其識別性。" @@ -3110,8 +3109,8 @@ msgstr "" #: ../../library/unittest.mock.rst:2294 msgid "" -"In this example we monkey patch ``method`` to return " -"``sentinel.some_object``:" +"In this example we monkey patch ``method`` to return ``sentinel." +"some_object``:" msgstr "" "在這個例子中,我們 monkey patch ``method`` 以回傳 ``sentinel.some_object``:" @@ -3121,13 +3120,13 @@ msgstr "DEFAULT" #: ../../library/unittest.mock.rst:2311 msgid "" -"The :data:`DEFAULT` object is a pre-created sentinel (actually " -"``sentinel.DEFAULT``). It can be used by :attr:`~Mock.side_effect` functions " -"to indicate that the normal return value should be used." +"The :data:`DEFAULT` object is a pre-created sentinel (actually ``sentinel." +"DEFAULT``). It can be used by :attr:`~Mock.side_effect` functions to " +"indicate that the normal return value should be used." msgstr "" -":data:`DEFAULT` 物件是一個預先建立的哨兵(實際上是 " -"``sentinel.DEFAULT``\\ )。它可以被 :attr:`~Mock.side_effect` 函式使用來表示" -"正常的回傳值應該被使用。" +":data:`DEFAULT` 物件是一個預先建立的哨兵(實際上是 ``sentinel." +"DEFAULT``\\ )。它可以被 :attr:`~Mock.side_effect` 函式使用來表示正常的回傳值" +"應該被使用。" #: ../../library/unittest.mock.rst:2317 msgid "call" @@ -3136,13 +3135,14 @@ msgstr "call" #: ../../library/unittest.mock.rst:2321 msgid "" ":func:`call` is a helper object for making simpler assertions, for comparing " -"with :attr:`~Mock.call_args`, :attr:`~Mock.call_args_list`, :attr:`~Mock.mock_calls` " -"and :attr:`~Mock.method_calls`. :func:`call` can also be used " +"with :attr:`~Mock.call_args`, :attr:`~Mock.call_args_list`, :attr:`~Mock." +"mock_calls` and :attr:`~Mock.method_calls`. :func:`call` can also be used " "with :meth:`~Mock.assert_has_calls`." msgstr "" -"與 :attr:`~Mock.call_args`、:attr:`~Mock.call_args_list`、:attr:`~Mock.mock_calls` " -"和 :attr:`~Mock.method_calls` 相比,:func:`call` 是一個用於進行更簡單的斷言的" -"輔助物件。:func:`call` 也可以與 :meth:`~Mock.assert_has_calls` 一起使用。" +"與 :attr:`~Mock.call_args`、:attr:`~Mock.call_args_list`、:attr:`~Mock." +"mock_calls` 和 :attr:`~Mock.method_calls` 相比,:func:`call` 是一個用於進行更" +"簡單的斷言的輔助物件。:func:`call` 也可以與 :meth:`~Mock.assert_has_calls` 一" +"起使用。" #: ../../library/unittest.mock.rst:2334 msgid "" @@ -3174,24 +3174,22 @@ msgid "" "A ``call`` object is either a tuple of (positional args, keyword args) or " "(name, positional args, keyword args) depending on how it was constructed. " "When you construct them yourself this isn't particularly interesting, but " -"the ``call`` objects that are in " -"the :attr:`Mock.call_args`, :attr:`Mock.call_args_list` " -"and :attr:`Mock.mock_calls` attributes can be introspected to get at the " -"individual arguments they contain." +"the ``call`` objects that are in the :attr:`Mock.call_args`, :attr:`Mock." +"call_args_list` and :attr:`Mock.mock_calls` attributes can be introspected " +"to get at the individual arguments they contain." msgstr "" "取決於它的建構方式,一個 ``call`` 物件會是(位置引數, 關鍵字引數)的元組,或" "是 (名稱, 位置引數, 關鍵字引數) 的元組。當你自己建構它們時,這並不是那麼有" -"趣,但是 :attr:`Mock.call_args`、:attr:`Mock.call_args_list` " -"和 :attr:`Mock.mock_calls` 屬性中的 ``call`` 物件可以被內省以取得它們包含的各" -"個引數。" +"趣,但是 :attr:`Mock.call_args`、:attr:`Mock.call_args_list` 和 :attr:`Mock." +"mock_calls` 屬性中的 ``call`` 物件可以被內省以取得它們包含的各個引數。" #: ../../library/unittest.mock.rst:2367 msgid "" -"The ``call`` objects in :attr:`Mock.call_args` " -"and :attr:`Mock.call_args_list` are two-tuples of (positional args, keyword " -"args) whereas the ``call`` objects in :attr:`Mock.mock_calls`, along with " -"ones you construct yourself, are three-tuples of (name, positional args, " -"keyword args)." +"The ``call`` objects in :attr:`Mock.call_args` and :attr:`Mock." +"call_args_list` are two-tuples of (positional args, keyword args) whereas " +"the ``call`` objects in :attr:`Mock.mock_calls`, along with ones you " +"construct yourself, are three-tuples of (name, positional args, keyword " +"args)." msgstr "" ":attr:`Mock.call_args` 和 :attr:`Mock.call_args_list` 中的 ``call`` 物件是" "(位置引數, 關鍵字引數)的二元組,而 :attr:`Mock.mock_calls` 中的 ``call`` 物" @@ -3230,8 +3228,8 @@ msgid "" "If *spec_set* is ``True`` then attempting to set attributes that don't exist " "on the spec object will raise an :exc:`AttributeError`." msgstr "" -"如果 *spec_set* 為 ``True``,則嘗試設定規格物件上不存在的屬性將引" -"發 :exc:`AttributeError`。" +"如果 *spec_set* 為 ``True``,則嘗試設定規格物件上不存在的屬性將引發 :exc:" +"`AttributeError`。" #: ../../library/unittest.mock.rst:2419 msgid "" @@ -3254,8 +3252,8 @@ msgstr "" #: ../../library/unittest.mock.rst:2427 msgid "" -"See :ref:`auto-speccing` for examples of how to use auto-speccing " -"with :func:`create_autospec` and the *autospec* argument to :func:`patch`." +"See :ref:`auto-speccing` for examples of how to use auto-speccing with :func:" +"`create_autospec` and the *autospec* argument to :func:`patch`." msgstr "" "請參閱 :ref:`auto-speccing` 以得知如何以 :func:`create_autospec` 使用自動規格" "以及如何在 :func:`patch` 中使用 *autospec* 引數的範例。" @@ -3265,8 +3263,8 @@ msgid "" ":func:`create_autospec` now returns an :class:`AsyncMock` if the target is " "an async function." msgstr "" -"如果目標是一個非同步函式,:func:`create_autospec` 現在會回傳一" -"個 :class:`AsyncMock`。" +"如果目標是一個非同步函式,:func:`create_autospec` 現在會回傳一個 :class:" +"`AsyncMock`。" #: ../../library/unittest.mock.rst:2438 msgid "ANY" @@ -3285,18 +3283,17 @@ msgstr "" #: ../../library/unittest.mock.rst:2447 msgid "" "To ignore certain arguments you can pass in objects that compare equal to " -"*everything*. Calls to :meth:`~Mock.assert_called_with` " -"and :meth:`~Mock.assert_called_once_with` will then succeed no matter what " -"was passed in." +"*everything*. Calls to :meth:`~Mock.assert_called_with` and :meth:`~Mock." +"assert_called_once_with` will then succeed no matter what was passed in." msgstr "" "要忽略某些引數,你可以傳入對\\ *所有物件*\\ 來說都相等的物件。那麼無論傳入什" -"麼內容,對 :meth:`~Mock.assert_used_with` " -"和 :meth:`~Mock.assert_used_once_with` 的呼叫都會成功。" +"麼內容,對 :meth:`~Mock.assert_used_with` 和 :meth:`~Mock." +"assert_used_once_with` 的呼叫都會成功。" #: ../../library/unittest.mock.rst:2456 msgid "" -":data:`ANY` can also be used in comparisons with call lists " -"like :attr:`~Mock.mock_calls`:" +":data:`ANY` can also be used in comparisons with call lists like :attr:" +"`~Mock.mock_calls`:" msgstr "" ":data:`ANY` 也可以用來與呼叫串列進行比較,例如 :attr:`~Mock.mock_calls`:" @@ -3329,8 +3326,8 @@ msgid "" ":data:`FILTER_DIR` is a module level variable that controls the way mock " "objects respond to :func:`dir`. The default is ``True``, which uses the " "filtering described below, to only show useful members. If you dislike this " -"filtering, or need to switch it off for diagnostic purposes, then set " -"``mock.FILTER_DIR = False``." +"filtering, or need to switch it off for diagnostic purposes, then set ``mock." +"FILTER_DIR = False``." msgstr "" ":data:`FILTER_DIR` 是一個模組級別的變數,用於控制 mock 物件回應 :func:`dir` " "的方式。其預設值為 ``True``,它使用以下描述的過濾方式來只顯示有用的成員。如果" @@ -3432,8 +3429,8 @@ msgid "" "of :const:`FILTER_DIR`." msgstr "" "或者,你可以只使用 ``vars(my_mock)``\\ (實例成員)和 " -"``dir(type(my_mock))``\\ (型別成員)來略過過濾,而不考" -"慮 :const:`FILTER_DIR`。" +"``dir(type(my_mock))``\\ (型別成員)來略過過濾,而不考慮 :const:" +"`FILTER_DIR`。" #: ../../library/unittest.mock.rst:2541 msgid "mock_open" @@ -3458,25 +3455,23 @@ msgstr "" #: ../../library/unittest.mock.rst:2552 msgid "" -"*read_data* is a string for " -"the :meth:`~io.RawIOBase.read`, :meth:`~io.IOBase.readline`, " -"and :meth:`~io.IOBase.readlines` methods of the file handle to return. " -"Calls to those methods will take data from *read_data* until it is " -"depleted. The mock of these methods is pretty simplistic: every time the " -"*mock* is called, the *read_data* is rewound to the start. If you need more " -"control over the data that you are feeding to the tested code you will need " -"to customize this mock for yourself. When that is insufficient, one of the " -"in-memory filesystem packages on `PyPI `_ can offer a " -"realistic filesystem for testing." -msgstr "" -"*read_data* 是檔案處理方" -"法 :meth:`~io.RawIOBase.read`、:meth:`~io.IOBase.readline` " -"和 :meth:`~io.IOBase.readlines` 的回傳字串。對這些方法的呼叫將從 *read_data* " -"取得資料,直到資料耗盡。對這些方法的 mock 非常單純:每次呼叫 *mock* 時," -"*read_data* 都會倒回到起點。如果你需要對提供給測試程式碼的資料進行更多控制," -"你會需要自行客製化這個 mock。如果這樣還不夠,`PyPI `_ 上的" -"其中一個記憶體內檔案系統 (in-memory filesystem) 套件可以提供用於測試的真實檔" -"案系統。" +"*read_data* is a string for the :meth:`~io.RawIOBase.read`, :meth:`~io." +"IOBase.readline`, and :meth:`~io.IOBase.readlines` methods of the file " +"handle to return. Calls to those methods will take data from *read_data* " +"until it is depleted. The mock of these methods is pretty simplistic: every " +"time the *mock* is called, the *read_data* is rewound to the start. If you " +"need more control over the data that you are feeding to the tested code you " +"will need to customize this mock for yourself. When that is insufficient, " +"one of the in-memory filesystem packages on `PyPI `_ can " +"offer a realistic filesystem for testing." +msgstr "" +"*read_data* 是檔案處理方法 :meth:`~io.RawIOBase.read`、:meth:`~io.IOBase." +"readline` 和 :meth:`~io.IOBase.readlines` 的回傳字串。對這些方法的呼叫將從 " +"*read_data* 取得資料,直到資料耗盡。對這些方法的 mock 非常單純:每次呼叫 " +"*mock* 時,*read_data* 都會倒回到起點。如果你需要對提供給測試程式碼的資料進行" +"更多控制,你會需要自行客製化這個 mock。如果這樣還不夠,`PyPI `_ 上的其中一個記憶體內檔案系統 (in-memory filesystem) 套件可以提供用於測" +"試的真實檔案系統。" #: ../../library/unittest.mock.rst:2562 msgid "" @@ -3484,9 +3479,9 @@ msgid "" "The mock of :meth:`~io.RawIOBase.read` changed to consume *read_data* rather " "than returning it on each call." msgstr "" -"新增對 :meth:`~io.IOBase.readline` 和 :meth:`~io.IOBase.readlines` 的支" -"援。:meth:`~io.RawIOBase.read` 的 mock 更改為消耗 *read_data* 而不是在每次呼" -"叫時回傳它。" +"新增對 :meth:`~io.IOBase.readline` 和 :meth:`~io.IOBase.readlines` 的支援。:" +"meth:`~io.RawIOBase.read` 的 mock 更改為消耗 *read_data* 而不是在每次呼叫時回" +"傳它。" #: ../../library/unittest.mock.rst:2567 msgid "*read_data* is now reset on each call to the *mock*." @@ -3519,8 +3514,8 @@ msgstr "" #: ../../library/unittest.mock.rst:2580 msgid "" "The issue is that even if you mock out the call to :func:`open` it is the " -"*returned object* that is used as a context manager (and " -"has :meth:`~object.__enter__` and :meth:`~object.__exit__` called)." +"*returned object* that is used as a context manager (and has :meth:`~object." +"__enter__` and :meth:`~object.__exit__` called)." msgstr "" "問題是,即使你 mock 了對 :func:`open` 的呼叫,它也是作為情境管理器使用的\\ *" "回傳物件*\\ (且其 :meth:`~object.__enter__` 和 :meth:`~ object.__exit__` 已" @@ -3594,8 +3589,8 @@ msgid "" "limits the api of mocks to the api of an original object (the spec), but it " "is recursive (implemented lazily) so that attributes of mocks only have the " "same api as the attributes of the spec. In addition mocked functions / " -"methods have the same call signature as the original so they raise " -"a :exc:`TypeError` if they are called incorrectly." +"methods have the same call signature as the original so they raise a :exc:" +"`TypeError` if they are called incorrectly." msgstr "" "自動規格以 mock 現有的 :attr:`!spec` 功能作為基礎。它將 mock 的 api 限制為原" "始物件(規格)的 api,但它是遞迴的(惰性 (lazily) 實現),因此 mock 的屬性僅" @@ -3666,8 +3661,8 @@ msgstr "" #: ../../library/unittest.mock.rst:2661 msgid "" -"Auto-speccing solves this problem. You can either pass ``autospec=True`` " -"to :func:`patch` / :func:`patch.object` or use the :func:`create_autospec` " +"Auto-speccing solves this problem. You can either pass ``autospec=True`` to :" +"func:`patch` / :func:`patch.object` or use the :func:`create_autospec` " "function to create a mock with a spec. If you use the ``autospec=True`` " "argument to :func:`patch` then the object that is being replaced will be " "used as the spec object. Because the speccing is done \"lazily\" (the spec " @@ -3675,12 +3670,12 @@ msgid "" "complex or deeply nested objects (like modules that import modules that " "import modules) without a big performance hit." msgstr "" -"自動規格解決了這個問題。你可以將 ``autospec=True`` 傳遞" -"給 :func:`patch` / :func:`patch.object` 或使用 :func:`create_autospec` 函式建" -"立帶有規格的 mock。如果你對 :func:`patch` 使用 ``autospec=True`` 引數,則被取" -"代的物件將作為規格物件使用。因為規格是「惰性」完成的(規格是在 mock 被存取時" -"作為屬性被建立的),所以你可以將它與非常複雜或深度巢狀使用的物件(例如連續引" -"用的模組)一起使用,而不會過於影響性能。" +"自動規格解決了這個問題。你可以將 ``autospec=True`` 傳遞給 :func:`patch` / :" +"func:`patch.object` 或使用 :func:`create_autospec` 函式建立帶有規格的 mock。" +"如果你對 :func:`patch` 使用 ``autospec=True`` 引數,則被取代的物件將作為規格" +"物件使用。因為規格是「惰性」完成的(規格是在 mock 被存取時作為屬性被建立" +"的),所以你可以將它與非常複雜或深度巢狀使用的物件(例如連續引用的模組)一起" +"使用,而不會過於影響性能。" #: ../../library/unittest.mock.rst:2670 msgid "Here's an example of it in use::" @@ -3706,9 +3701,9 @@ msgstr "" #: ../../library/unittest.mock.rst:2680 msgid "" -"You can see that :class:`!request.Request` has a spec. :class:`!" -"request.Request` takes two arguments in the constructor (one of which is " -"*self*). Here's what happens if we try to call it incorrectly::" +"You can see that :class:`!request.Request` has a spec. :class:`!request." +"Request` takes two arguments in the constructor (one of which is *self*). " +"Here's what happens if we try to call it incorrectly::" msgstr "" "你可以看到 :class:`!request.Request` 有一個規格。:class:`!request.Request` 在" "建構函式中接受兩個引數(其中之一是 *self*\\ )。如果我們錯誤地呼叫它,會發生" @@ -3782,11 +3777,11 @@ msgstr "" #: ../../library/unittest.mock.rst:2712 msgid "" -"As well as using *autospec* through :func:`patch` there is " -"a :func:`create_autospec` for creating autospecced mocks directly:" +"As well as using *autospec* through :func:`patch` there is a :func:" +"`create_autospec` for creating autospecced mocks directly:" msgstr "" -"除了透過 :func:`patch` 使用 *autospec* 之外,還有一" -"個 :func:`create_autospec` 用於直接建立有自動規格的 mock:" +"除了透過 :func:`patch` 使用 *autospec* 之外,還有一個 :func:" +"`create_autospec` 用於直接建立有自動規格的 mock:" #: ../../library/unittest.mock.rst:2720 msgid "" @@ -4028,11 +4023,11 @@ msgstr "*wraps*" #: ../../library/unittest.mock.rst:2858 msgid "" -"If all three are set, mock will return the value " -"from :attr:`~Mock.side_effect`, ignoring :attr:`~Mock.return_value` and the " -"wrapped object altogether. If any two are set, the one with the higher " -"precedence will return the value. Regardless of the order of which was set " -"first, the order of precedence remains unchanged." +"If all three are set, mock will return the value from :attr:`~Mock." +"side_effect`, ignoring :attr:`~Mock.return_value` and the wrapped object " +"altogether. If any two are set, the one with the higher precedence will " +"return the value. Regardless of the order of which was set first, the order " +"of precedence remains unchanged." msgstr "" "如果這三個都有設定,mock 將會回傳來自 :attr:`~Mock.side_effect` 的值,並忽" "略 :attr:`~Mock.return_value` 和被包裝物件。如果設定了任兩項,則優先順序較高" @@ -4042,8 +4037,8 @@ msgstr "" msgid "" "As ``None`` is the default value of :attr:`~Mock.side_effect`, if you " "reassign its value back to ``None``, the order of precedence will be checked " -"between :attr:`~Mock.return_value` and the wrapped object, " -"ignoring :attr:`~Mock.side_effect`." +"between :attr:`~Mock.return_value` and the wrapped object, ignoring :attr:" +"`~Mock.side_effect`." msgstr "" "由於 ``None`` 是 :attr:`~Mock.side_effect` 的預設值,如果將其值重新賦值回為 " "``None``,則會檢查 :attr:`~Mock.return_value` 和被包裝物件之間的優先順序,忽" @@ -4060,11 +4055,11 @@ msgstr "" #: ../../library/unittest.mock.rst:2894 msgid "" -"When :class:`Mock` wraps an object, the default value " -"of :attr:`~Mock.return_value` will be :data:`DEFAULT`." +"When :class:`Mock` wraps an object, the default value of :attr:`~Mock." +"return_value` will be :data:`DEFAULT`." msgstr "" -"當 :class:`Mock` 包裝一個物件時,:attr:`~Mock.return_value` 的預設值將" -"為 :data:`DEFAULT`。" +"當 :class:`Mock` 包裝一個物件時,:attr:`~Mock.return_value` 的預設值將為 :" +"data:`DEFAULT`。" #: ../../library/unittest.mock.rst:2903 msgid "" diff --git a/library/venv.po b/library/venv.po index 40603b46ef..6d31e24cc2 100644 --- a/library/venv.po +++ b/library/venv.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2025-05-23 10:20+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -40,12 +40,12 @@ msgid "" "environments` and :mod:`site`'s :ref:`virtual environments documentation " "` for more information." msgstr "" -":mod:`!venv` 模組支援建立輕量級的「虛擬環境」,每個虛擬環境都有獨立安裝在" -"其 :mod:`site` 目錄中的一組 Python 套件。虛擬環境是建立在既有的 Python 安裝上" -"(稱為該虛擬環境的「基底」Python)之上,預設會與基底環境中的套件隔離,使得僅" -"能存取明確安裝在虛擬環境中的套件。更多資訊請參閱 :ref:`sys-path-init-virtual-" -"environments` 以及 :mod:`site` 的\\ :ref:`虛擬環境文件 `。" +":mod:`!venv` 模組支援建立輕量級的「虛擬環境」,每個虛擬環境都有獨立安裝在其 :" +"mod:`site` 目錄中的一組 Python 套件。虛擬環境是建立在既有的 Python 安裝上(稱" +"為該虛擬環境的「基底」Python)之上,預設會與基底環境中的套件隔離,使得僅能存" +"取明確安裝在虛擬環境中的套件。更多資訊請參閱 :ref:`sys-path-init-virtual-" +"environments` 以及 :mod:`site` 的\\ :ref:`虛擬環境文件 `。" #: ../../library/venv.rst:32 msgid "" @@ -142,20 +142,20 @@ msgstr "python -m venv /path/to/new/virtual/environment" msgid "" "This creates the target directory (including parent directories as needed) " "and places a :file:`pyvenv.cfg` file in it with a ``home`` key pointing to " -"the Python installation from which the command was run. It also creates " -"a :file:`bin` (or :file:`Scripts` on Windows) subdirectory containing a copy " -"or symlink of the Python executable (as appropriate for the platform or " +"the Python installation from which the command was run. It also creates a :" +"file:`bin` (or :file:`Scripts` on Windows) subdirectory containing a copy or " +"symlink of the Python executable (as appropriate for the platform or " "arguments used at environment creation time). It also creates a :file:`lib/" -"pythonX.Y/site-packages` subdirectory (on Windows, this is :file:`Lib\\site-" -"packages`). If an existing directory is specified, it will be re-used." +"pythonX.Y/site-packages` subdirectory (on Windows, this is :file:`Lib\\" +"\\site-packages`). If an existing directory is specified, it will be re-used." msgstr "" "執行此命令會建立目標目錄(同時也會建立任何還不存在的父目錄)並在目錄中放置一" "個名為 :file:`pyvenv.cfg` 的檔案,其中包含一個指向執行該命令的 Python 安裝路" -"徑的 ``home`` 鍵。它同時會建立一個 :file:`bin` (在 Windows 上" -"為 :file:`Scripts`)子目錄,其中包含一個 Python 二進位檔案的副本/符號連結(根" -"據建立環境時使用的平台或引數而定)。此外,它還會建立一個 :file:`lib/" -"pythonX.Y/site-packages` 子目錄(在 Windows 上為 :file:`Lib\\site-" -"packages`)。如果指定的目錄已存在,則將重新使用該目錄。" +"徑的 ``home`` 鍵。它同時會建立一個 :file:`bin` (在 Windows 上為 :file:" +"`Scripts`)子目錄,其中包含一個 Python 二進位檔案的副本/符號連結(根據建立環" +"境時使用的平台或引數而定)。此外,它還會建立一個 :file:`lib/pythonX.Y/site-" +"packages` 子目錄(在 Windows 上為 :file:`Lib\\\\site-packages`)。如果指定的目" +"錄已存在,則將重新使用該目錄。" #: ../../library/venv.rst:84 msgid "" @@ -297,8 +297,8 @@ msgid "" "script by setting the execution policy for the user. You can do this by " "issuing the following PowerShell command:" msgstr "" -"在 Microsoft Windows 上,可能需要通過設置使用者的執行策略來啟用 " -"``Activate.ps1`` 腳本。你可以發出以下 PowerShell 命令來執行此操作:" +"在 Microsoft Windows 上,可能需要通過設置使用者的執行策略來啟用 ``Activate." +"ps1`` 腳本。你可以發出以下 PowerShell 命令來執行此操作:" #: ../../library/venv.rst:186 msgid "" @@ -347,18 +347,17 @@ msgstr "虛擬環境如何運作" #: ../../library/venv.rst:210 msgid "" -"When a Python interpreter is running from a virtual " -"environment, :data:`sys.prefix` and :data:`sys.exec_prefix` point to the " -"directories of the virtual environment, whereas :data:`sys.base_prefix` " -"and :data:`sys.base_exec_prefix` point to those of the base Python used to " -"create the environment. It is sufficient to check ``sys.prefix != " -"sys.base_prefix`` to determine if the current interpreter is running from a " -"virtual environment." +"When a Python interpreter is running from a virtual environment, :data:`sys." +"prefix` and :data:`sys.exec_prefix` point to the directories of the virtual " +"environment, whereas :data:`sys.base_prefix` and :data:`sys." +"base_exec_prefix` point to those of the base Python used to create the " +"environment. It is sufficient to check ``sys.prefix != sys.base_prefix`` to " +"determine if the current interpreter is running from a virtual environment." msgstr "" -"當 Python 直譯器跑在虛擬環境時,:data:`sys.prefix` " -"和 :data:`sys.exec_prefix` 會指向虛擬環境的目錄,而 :data:`sys.base_prefix` " -"和 :data:`sys.base_exec_prefix` 會指向建立虛擬環境的基礎 Python 的目錄。檢查 " -"``sys.prefix != sys.base_prefix`` 就可以確定目前的直譯器是否跑在虛擬環境中。" +"當 Python 直譯器跑在虛擬環境時,:data:`sys.prefix` 和 :data:`sys." +"exec_prefix` 會指向虛擬環境的目錄,而 :data:`sys.base_prefix` 和 :data:`sys." +"base_exec_prefix` 會指向建立虛擬環境的基礎 Python 的目錄。檢查 ``sys.prefix !" +"= sys.base_prefix`` 就可以確定目前的直譯器是否跑在虛擬環境中。" #: ../../library/venv.rst:219 msgid "" @@ -468,21 +467,20 @@ msgstr "" #: ../../library/venv.rst:257 msgid "" "In order to achieve this, scripts installed into virtual environments have a " -"\"shebang\" line which points to the environment's Python " -"interpreter, :samp:`#!/{}/bin/python`. This means that the " -"script will run with that interpreter regardless of the value " -"of :envvar:`PATH`. On Windows, \"shebang\" line processing is supported if " -"you have the :ref:`launcher` installed. Thus, double-clicking an installed " -"script in a Windows Explorer window should run it with the correct " -"interpreter without the environment needing to be activated or on " -"the :envvar:`PATH`." +"\"shebang\" line which points to the environment's Python interpreter, :samp:" +"`#!/{}/bin/python`. This means that the script will run with " +"that interpreter regardless of the value of :envvar:`PATH`. On Windows, " +"\"shebang\" line processing is supported if you have the :ref:`launcher` " +"installed. Thus, double-clicking an installed script in a Windows Explorer " +"window should run it with the correct interpreter without the environment " +"needing to be activated or on the :envvar:`PATH`." msgstr "" "為了實現這一點,安裝在虛擬環境中的腳本會有一個 \"shebang\" 列,此列指向該環境" -"的 Python 直譯器 :samp:`#!/{}/bin/python`。這代表無" -"論 :envvar:`PATH` 的值為何,該腳本都會在直譯器上運行。在 Windows 上,如果你安" -"裝了 :ref:`launcher`,則支援 \"shebang\" 列處理。因此,在 Windows 檔案總管" -"(Windows Explorer)中雙擊已安裝的腳本,應該可以在沒有啟用環境或將其加" -"入 :envvar:`PATH` 的情況下正確地運行。" +"的 Python 直譯器 :samp:`#!/{}/bin/python`。這代表無論 :envvar:" +"`PATH` 的值為何,該腳本都會在直譯器上運行。在 Windows 上,如果你安裝了 :ref:" +"`launcher`,則支援 \"shebang\" 列處理。因此,在 Windows 檔案總管(Windows " +"Explorer)中雙擊已安裝的腳本,應該可以在沒有啟用環境或將其加入 :envvar:" +"`PATH` 的情況下正確地運行。" #: ../../library/venv.rst:266 msgid "" @@ -513,12 +511,11 @@ msgid "" msgstr "" "因為安裝在環境中的腳本不應該預期該環境已經被啟動,所以它們的 shebang 列會包含" "環境直譯器的絕對路徑。因此,在一般情況下,環境本質上是不可攜帶的。你應該使用" -"一個簡單的方法來重新建立一個環境(例如:如果你有一個名為 " -"``requirements.txt`` 的需求檔案,你可以使用環境的 ``pip install -r " -"requirements.txt`` 來安裝環境所需的所有套件)。如果出於某種原因,你需要將環境" -"移至新位置,你應該在所需位置重新建立它,並刪除舊位置的環境。如果你移動環境是" -"因為移動了其父目錄,你應該在新位置重新建立環境。否則,安裝在該環境中的軟體可" -"能無法正常運作。" +"一個簡單的方法來重新建立一個環境(例如:如果你有一個名為 ``requirements." +"txt`` 的需求檔案,你可以使用環境的 ``pip install -r requirements.txt`` 來安裝" +"環境所需的所有套件)。如果出於某種原因,你需要將環境移至新位置,你應該在所需" +"位置重新建立它,並刪除舊位置的環境。如果你移動環境是因為移動了其父目錄,你應" +"該在新位置重新建立環境。否則,安裝在該環境中的軟體可能無法正常運作。" #: ../../library/venv.rst:286 msgid "" @@ -537,8 +534,8 @@ msgstr "API" msgid "" "The high-level method described above makes use of a simple API which " "provides mechanisms for third-party virtual environment creators to " -"customize environment creation according to their needs, " -"the :class:`EnvBuilder` class." +"customize environment creation according to their needs, the :class:" +"`EnvBuilder` class." msgstr "" "上述提到的高階 method(方法)透過簡單的 API 使用, 為第三方虛擬環境建立者提供" "可以依據他們需求來建立環境的客製化機制: :class:`EnvBuilder` class。" @@ -684,13 +681,12 @@ msgstr "" #: ../../library/venv.rst:377 msgid "" -"Each of the " -"methods :meth:`ensure_directories`, :meth:`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` " -"and :meth:`post_setup` can be overridden." +"Each of the methods :meth:`ensure_directories`, :meth:" +"`create_configuration`, :meth:`setup_python`, :meth:`setup_scripts` and :" +"meth:`post_setup` can be overridden." msgstr "" -"每個 " -"methods :meth:`ensure_directories`、:meth:`create_configuration`、:meth:`setup_python`、:meth:`setup_scripts` " -"及 :meth:`post_setup` 都可以被覆寫。" +"每個 methods :meth:`ensure_directories`、:meth:`create_configuration`、:meth:" +"`setup_python`、:meth:`setup_scripts` 及 :meth:`post_setup` 都可以被覆寫。" #: ../../library/venv.rst:383 msgid "" @@ -702,9 +698,9 @@ msgid "" "subdirectories will be recreated." msgstr "" "建立還不存在的環境目錄及必要的子目錄,並回傳一個情境物件(context object)。" -"這個情境物件只是一個屬性 (例如:路徑) 的所有者,可被其他 method 使用。如" -"果 :class:`EnvBuilder` 已被建立且帶有 ``clear=True`` 的引數,該環境目錄下的內" -"容將被清空,以及所有必要的子目錄將被重新建立。" +"這個情境物件只是一個屬性 (例如:路徑) 的所有者,可被其他 method 使用。如果 :" +"class:`EnvBuilder` 已被建立且帶有 ``clear=True`` 的引數,該環境目錄下的內容將" +"被清空,以及所有必要的子目錄將被重新建立。" #: ../../library/venv.rst:390 msgid "" @@ -719,16 +715,16 @@ msgid "" "``env_dir`` - The location of the virtual environment. Used for " "``__VENV_DIR__`` in activation scripts (see :meth:`install_scripts`)." msgstr "" -"``env_dir`` —— 虛擬環境的位置。用於啟用腳本中的 ``__VENV_DIR__``\\ (參" -"見 :meth:`install_scripts`)。" +"``env_dir`` —— 虛擬環境的位置。用於啟用腳本中的 ``__VENV_DIR__``\\ (參見 :" +"meth:`install_scripts`)。" #: ../../library/venv.rst:396 msgid "" "``env_name`` - The name of the virtual environment. Used for " "``__VENV_NAME__`` in activation scripts (see :meth:`install_scripts`)." msgstr "" -"``env_name`` —— 虛擬環境的名稱。用於啟用腳本中的 ``__VENV_NAME__``\\ (參" -"見 :meth:`install_scripts`)。" +"``env_name`` —— 虛擬環境的名稱。用於啟用腳本中的 ``__VENV_NAME__``\\ (參見 :" +"meth:`install_scripts`)。" #: ../../library/venv.rst:399 msgid "" @@ -771,8 +767,8 @@ msgstr "" #: ../../library/venv.rst:416 msgid "" "``env_exe`` - The name of the Python interpreter in the virtual environment. " -"Used for ``__VENV_PYTHON__`` in activation scripts " -"(see :meth:`install_scripts`)." +"Used for ``__VENV_PYTHON__`` in activation scripts (see :meth:" +"`install_scripts`)." msgstr "" "``env_exe`` —— 虛擬環境中 Python 直譯器的名稱。用於啟用腳本中的 " "``__VENV_PYTHON__``\\ (參見 :meth:`install_scripts`)。" @@ -927,9 +923,9 @@ msgid "" "instead of :meth:`setup_scripts`. This was not the case in 3.7.2. When using " "symlinks, the original executables will be linked." msgstr "" -"Windows會在 :meth:`setup_python` 中複製重新導向腳本,而非" -"在 :meth:`setup_scripts` 中進行。這在 3.7.2 中並非如此。若使用符號連結,則會" -"連結至原始的可執行檔。" +"Windows會在 :meth:`setup_python` 中複製重新導向腳本,而非在 :meth:" +"`setup_scripts` 中進行。這在 3.7.2 中並非如此。若使用符號連結,則會連結至原始" +"的可執行檔。" #: ../../library/venv.rst:514 msgid "There is also a module-level convenience function:" @@ -1035,8 +1031,8 @@ msgid "" " \"\"\"\n" " Read lines from a subprocess' output stream and either pass to a " "progress\n" -" callable (if specified) or write progress information to " -"sys.stderr.\n" +" callable (if specified) or write progress information to sys." +"stderr.\n" " \"\"\"\n" " progress = self.progress\n" " while True:\n" @@ -1097,8 +1093,8 @@ msgid "" " url = \"https://bootstrap.pypa.io/ez_setup.py\"\n" " self.install_script(context, 'setuptools', url)\n" " # clear up the setuptools archive which gets downloaded\n" -" pred = lambda o: o.startswith('setuptools-') and " -"o.endswith('.tar.gz')\n" +" pred = lambda o: o.startswith('setuptools-') and o.endswith('.tar." +"gz')\n" " files = filter(pred, os.listdir(context.bin_path))\n" " for f in files:\n" " f = os.path.join(context.bin_path, f)\n" @@ -1214,8 +1210,8 @@ msgstr "" " 'stdout' 與 'stderr' 則分別表示從子行程輸出資料串流中\n" " 讀取的輸出內容,該子行程用於安裝應用程式。\n" "\n" -" 若未指定可呼叫物件,則預設的進度資訊會輸出至 " -"sys.stderr。\n" +" 若未指定可呼叫物件,則預設的進度資訊會輸出至 sys." +"stderr。\n" " \"\"\"\n" "\n" " def __init__(self, *args, **kwargs):\n" @@ -1302,8 +1298,8 @@ msgstr "" " url = \"https://bootstrap.pypa.io/ez_setup.py\"\n" " self.install_script(context, 'setuptools', url)\n" " # 清除已下載的 setuptools 檔案\n" -" pred = lambda o: o.startswith('setuptools-') and " -"o.endswith('.tar.gz')\n" +" pred = lambda o: o.startswith('setuptools-') and o.endswith('.tar." +"gz')\n" " files = filter(pred, os.listdir(context.bin_path))\n" " for f in files:\n" " f = os.path.join(context.bin_path, f)\n" diff --git a/library/warnings.po b/library/warnings.po index ab4a15267c..cc91874e97 100644 --- a/library/warnings.po +++ b/library/warnings.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2025-07-14 13:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -42,19 +42,19 @@ msgstr "" #: ../../library/warnings.rst:18 msgid "" "Python programmers issue warnings by calling the :func:`warn` function " -"defined in this module. (C programmers use :c:func:`PyErr_WarnEx`; " -"see :ref:`exceptionhandling` for details)." +"defined in this module. (C programmers use :c:func:`PyErr_WarnEx`; see :ref:" +"`exceptionhandling` for details)." msgstr "" "Python 程式設計師可以透過呼叫此模組中定義的 :func:`warn` 函式來發出警告。(C " -"語言的程式設計師則使用 :c:func:`PyErr_WarnEx`;詳情請參" -"閱 :ref:`exceptionhandling`)。" +"語言的程式設計師則使用 :c:func:`PyErr_WarnEx`;詳情請參閱 :ref:" +"`exceptionhandling`)。" #: ../../library/warnings.rst:22 msgid "" "Warning messages are normally written to :data:`sys.stderr`, but their " "disposition can be changed flexibly, from ignoring all warnings to turning " -"them into exceptions. The disposition of warnings can vary based on " -"the :ref:`warning category `, the text of the warning " +"them into exceptions. The disposition of warnings can vary based on the :" +"ref:`warning category `, the text of the warning " "message, and the source location where it is issued. Repetitions of a " "particular warning for the same source location are typically suppressed." msgstr "" @@ -75,11 +75,11 @@ msgstr "" #: ../../library/warnings.rst:33 msgid "" -"The determination whether to issue a warning message is controlled by " -"the :ref:`warning filter `, which is a sequence of matching " -"rules and actions. Rules can be added to the filter by " -"calling :func:`filterwarnings` and reset to its default state by " -"calling :func:`resetwarnings`." +"The determination whether to issue a warning message is controlled by the :" +"ref:`warning filter `, which is a sequence of matching rules " +"and actions. Rules can be added to the filter by calling :func:" +"`filterwarnings` and reset to its default state by calling :func:" +"`resetwarnings`." msgstr "" "是否要發出警告訊息是由 :ref:`警告過濾器 ` 所控制,它是一連串" "的匹配規則和動作。可以透過呼叫 :func:`filterwarnings` 來新增規則到過濾器中," @@ -364,10 +364,10 @@ msgstr "只印出第一次出現的匹配警告,不論位置" #: ../../library/warnings.rst:160 msgid "" "*message* is a string containing a regular expression that the start of the " -"warning message must match, case-insensitively. In :option:`-W` " -"and :envvar:`PYTHONWARNINGS`, *message* is a literal string that the start " -"of the warning message must contain (case-insensitively), ignoring any " -"whitespace at the start or end of *message*." +"warning message must match, case-insensitively. In :option:`-W` and :envvar:" +"`PYTHONWARNINGS`, *message* is a literal string that the start of the " +"warning message must contain (case-insensitively), ignoring any whitespace " +"at the start or end of *message*." msgstr "" "*message* 是一個包含正規表示式的字串,警告訊息的開頭必須與其匹配(不區分大小" "寫)。在 :option:`-W` 和 :envvar:`PYTHONWARNINGS` 中,*message* 是一個字面字" @@ -466,10 +466,10 @@ msgid "" "module parses these when it is first imported (invalid options are ignored, " "after printing a message to :data:`sys.stderr`)." msgstr "" -"警告過濾器由傳遞給 Python 直譯器命令列的 :option:`-W` 選項" -"和 :envvar:`PYTHONWARNINGS` 環境變數初始化。直譯器會將所有提供條目的引數未經" -"直譯地儲存在 :data:`sys.warnoptions` 中;:mod:`warnings` 模組在首次引入時會剖" -"析這些引數(無效選項會被忽略,並在向 :data:`sys.stderr` 印出一條訊息後)。" +"警告過濾器由傳遞給 Python 直譯器命令列的 :option:`-W` 選項和 :envvar:" +"`PYTHONWARNINGS` 環境變數初始化。直譯器會將所有提供條目的引數未經直譯地儲存" +"在 :data:`sys.warnoptions` 中;:mod:`warnings` 模組在首次引入時會剖析這些引數" +"(無效選項會被忽略,並在向 :data:`sys.stderr` 印出一條訊息後)。" #: ../../library/warnings.rst:210 msgid "" @@ -484,11 +484,11 @@ msgstr "action:message:category:module:line" #: ../../library/warnings.rst:215 msgid "" "The meaning of each of these fields is as described in :ref:`warning-" -"filter`. When listing multiple filters on a single line (as " -"for :envvar:`PYTHONWARNINGS`), the individual filters are separated by " -"commas and the filters listed later take precedence over those listed before " -"them (as they're applied left-to-right, and the most recently applied " -"filters take precedence over earlier ones)." +"filter`. When listing multiple filters on a single line (as for :envvar:" +"`PYTHONWARNINGS`), the individual filters are separated by commas and the " +"filters listed later take precedence over those listed before them (as " +"they're applied left-to-right, and the most recently applied filters take " +"precedence over earlier ones)." msgstr "" "這些欄位中每一個的含義都如 :ref:`warning-filter` 中所述。當在單一行中列出多個" "過濾器時(例如 :envvar:`PYTHONWARNINGS`),個別的過濾器會以逗號分隔,且後面列" @@ -566,8 +566,8 @@ msgstr "在 :ref:`偵錯建置 ` 中,預設警告過濾器串列 #: ../../library/warnings.rst:255 msgid "" -":exc:`DeprecationWarning` is now ignored by default in addition " -"to :exc:`PendingDeprecationWarning`." +":exc:`DeprecationWarning` is now ignored by default in addition to :exc:" +"`PendingDeprecationWarning`." msgstr "" "除了 :exc:`PendingDeprecationWarning` 之外,:exc:`DeprecationWarning` 現在也" "預設被忽略。" @@ -597,10 +597,10 @@ msgstr "覆寫預設過濾器" msgid "" "Developers of applications written in Python may wish to hide *all* Python " "level warnings from their users by default, and only display them when " -"running tests or otherwise working on the application. " -"The :data:`sys.warnoptions` attribute used to pass filter configurations to " -"the interpreter can be used as a marker to indicate whether or not warnings " -"should be disabled::" +"running tests or otherwise working on the application. The :data:`sys." +"warnoptions` attribute used to pass filter configurations to the interpreter " +"can be used as a marker to indicate whether or not warnings should be " +"disabled::" msgstr "" "以 Python 編寫的應用程式的開發者可能希望預設對其使用者隱藏 *所有* Python 層級" "的警告,並且只在執行測試或以其他方式處理應用程式時才顯示它們。用於將過濾器設" @@ -679,8 +679,8 @@ msgid "" "to suppress the warning using the :class:`catch_warnings` context manager::" msgstr "" "如果你正在使用的程式碼,你知道它會引發一個警告(例如一個已棄用的函式),但你" -"不想看到這個警告(即使警告已透過命令列明確設定),那麼可以使" -"用 :class:`catch_warnings` 情境管理器來抑制該警告: ::" +"不想看到這個警告(即使警告已透過命令列明確設定),那麼可以使用 :class:" +"`catch_warnings` 情境管理器來抑制該警告: ::" #: ../../library/warnings.rst:317 msgid "" @@ -854,8 +854,8 @@ msgstr "" "是 :option:`!-W default` 的簡寫)或在環境中設定 ``PYTHONWARNINGS=default`` 來" "檢查應用程式是否使用了已棄用的介面。這會為所有警告啟用預設處理,包括那些預設" "被忽略的警告。要更改對遇到的警告所採取的動作,你可以更改傳遞給 :option:`-W` " -"的引數(例如 :option:`!-W error`)。有關更多可能性的詳細資訊,請參" -"閱 :option:`-W` 旗標。" +"的引數(例如 :option:`!-W error`)。有關更多可能性的詳細資訊,請參閱 :option:" +"`-W` 旗標。" #: ../../library/warnings.rst:418 msgid "Available Functions" @@ -948,16 +948,16 @@ msgstr "" #: ../../library/warnings.rst:462 msgid "" "This makes the warning refer to both the ``example.lower.one_way()`` and " -"``package.higher.another_way()`` call sites only from calling code living " +"``example.higher.another_way()`` call sites only from calling code living " "outside of ``example`` package." msgstr "" -"這使得警告只會從存在於 ``example`` 套件之外的呼叫程式碼中,指向 " -"``example.lower.one_way()`` 和 ``package.higher.another_way()`` 的呼叫點。" +"這使得警告只會從存在於 ``example`` 套件之外的呼叫程式碼中,指向 ``example." +"lower.one_way()`` 和 ``example.higher.another_way()`` 的呼叫點。" #: ../../library/warnings.rst:466 ../../library/warnings.rst:492 msgid "" -"*source*, if supplied, is the destroyed object which emitted " -"a :exc:`ResourceWarning`." +"*source*, if supplied, is the destroyed object which emitted a :exc:" +"`ResourceWarning`." msgstr "*source*\\ (如果提供)是發出 :exc:`ResourceWarning` 的已銷毀物件。" #: ../../library/warnings.rst:469 @@ -982,8 +982,8 @@ msgstr "" "這是一個 :func:`warn` 功能的低階介面,明確傳入訊息、類別、檔名和行號,以及可" "選的模組名稱和註冊表(應為模組的 ``__warningregistry__`` 字典)。模組名稱預設" "為去掉 ``.py`` 的檔名;如果沒有傳入註冊表,警告將永遠不會被抑制。*message* 必" -"須是字串,*category* 必須是 :exc:`Warning` 的子類別,或者 *message* 可以" -"是 :exc:`Warning` 的實例,在這種情況下 *category* 將被忽略。" +"須是字串,*category* 必須是 :exc:`Warning` 的子類別,或者 *message* 可以是 :" +"exc:`Warning` 的實例,在這種情況下 *category* 將被忽略。" #: ../../library/warnings.rst:487 msgid "" @@ -1005,28 +1005,28 @@ msgid "" "Write a warning to a file. The default implementation calls " "``formatwarning(message, category, filename, lineno, line)`` and writes the " "resulting string to *file*, which defaults to :data:`sys.stderr`. You may " -"replace this function with any callable by assigning to " -"``warnings.showwarning``. *line* is a line of source code to be included in " -"the warning message; if *line* is not supplied, :func:`showwarning` will try " -"to read the line specified by *filename* and *lineno*." +"replace this function with any callable by assigning to ``warnings." +"showwarning``. *line* is a line of source code to be included in the warning " +"message; if *line* is not supplied, :func:`showwarning` will try to read the " +"line specified by *filename* and *lineno*." msgstr "" "將警告寫入一個檔案。預設實作會呼叫 ``formatwarning(message, category, " -"filename, lineno, line)`` 並將結果字串寫入 *file*,預設" -"為 :data:`sys.stderr`。你可以透過賦值給 ``warnings.showwarning`` 來用任何可呼" -"叫物件取代此函式。*line* 是要包含在警告訊息中的一行原始碼;如果未提供 " -"*line*,:func:`showwarning` 將嘗試讀取由 *filename* 和 *lineno* 指定的行。" +"filename, lineno, line)`` 並將結果字串寫入 *file*,預設為 :data:`sys." +"stderr`。你可以透過賦值給 ``warnings.showwarning`` 來用任何可呼叫物件取代此函" +"式。*line* 是要包含在警告訊息中的一行原始碼;如果未提供 *line*,:func:" +"`showwarning` 將嘗試讀取由 *filename* 和 *lineno* 指定的行。" #: ../../library/warnings.rst:512 msgid "" "Format a warning the standard way. This returns a string which may contain " "embedded newlines and ends in a newline. *line* is a line of source code to " -"be included in the warning message; if *line* is not " -"supplied, :func:`formatwarning` will try to read the line specified by " -"*filename* and *lineno*." +"be included in the warning message; if *line* is not supplied, :func:" +"`formatwarning` will try to read the line specified by *filename* and " +"*lineno*." msgstr "" "以標準方式格式化警告。這會回傳一個可能包含嵌入換行符並以換行符結尾的字串。" -"*line* 是要包含在警告訊息中的一行原始碼;如果未提供 " -"*line*,:func:`formatwarning` 將嘗試讀取由 *filename* 和 *lineno* 指定的行。" +"*line* 是要包含在警告訊息中的一行原始碼;如果未提供 *line*,:func:" +"`formatwarning` 將嘗試讀取由 *filename* 和 *lineno* 指定的行。" #: ../../library/warnings.rst:521 msgid "" @@ -1048,10 +1048,10 @@ msgstr "" #: ../../library/warnings.rst:533 msgid "" "Insert a simple entry into the list of :ref:`warnings filter specifications " -"`. The meaning of the function parameters is as " -"for :func:`filterwarnings`, but regular expressions are not needed as the " -"filter inserted always matches any message in any module as long as the " -"category and line number match." +"`. The meaning of the function parameters is as for :func:" +"`filterwarnings`, but regular expressions are not needed as the filter " +"inserted always matches any message in any module as long as the category " +"and line number match." msgstr "" "在 :ref:`警告過濾器規格 ` 串列中插入一個簡單的條目。函式參數" "的含義與 :func:`filterwarnings` 相同,但不需要正規表示式,因為只要類別和行號" @@ -1063,8 +1063,8 @@ msgid "" "to :func:`filterwarnings`, including that of the :option:`-W` command line " "options and calls to :func:`simplefilter`." msgstr "" -"重設警告過濾器。這會捨棄所有先前對 :func:`filterwarnings` 的呼叫效果,包" -"括 :option:`-W` 命令列選項和對 :func:`simplefilter` 的呼叫。" +"重設警告過濾器。這會捨棄所有先前對 :func:`filterwarnings` 的呼叫效果,包括 :" +"option:`-W` 命令列選項和對 :func:`simplefilter` 的呼叫。" #: ../../library/warnings.rst:549 msgid "Decorator to indicate that a class, function or overload is deprecated." @@ -1077,9 +1077,9 @@ msgid "" "` will also generate a diagnostic on usage of the " "deprecated object." msgstr "" -"當此裝飾器應用於一個物件時,在使用該物件時,可能會在 runtime 發出棄用警" -"告。:term:`靜態型別檢查器 ` 也會在使用已棄用物件時產生診" -"斷訊息。" +"當此裝飾器應用於一個物件時,在使用該物件時,可能會在 runtime 發出棄用警告。:" +"term:`靜態型別檢查器 ` 也會在使用已棄用物件時產生診斷訊" +"息。" #: ../../library/warnings.rst:556 msgid "Usage::" @@ -1143,9 +1143,9 @@ msgstr "" msgid "" "The deprecation message passed to the decorator is saved in the " "``__deprecated__`` attribute on the decorated object. If applied to an " -"overload, the decorator must be after the :func:`@overload " -"` decorator for the attribute to exist on the overload as " -"returned by :func:`typing.get_overloads`." +"overload, the decorator must be after the :func:`@overload ` decorator for the attribute to exist on the overload as returned " +"by :func:`typing.get_overloads`." msgstr "" "傳遞給裝飾器的棄用訊息會儲存在被裝飾物件的 ``__deprecated__`` 屬性中。如果應" "用於重載,裝飾器必須在 :func:`@overload ` 裝飾器之後,這樣屬" @@ -1162,20 +1162,19 @@ msgstr "可用的情境管理器" #: ../../library/warnings.rst:602 msgid "" "A context manager that copies and, upon exit, restores the warnings filter " -"and the :func:`showwarning` function. If the *record* argument " -"is :const:`False` (the default) the context manager returns :class:`None` on " -"entry. If *record* is :const:`True`, a list is returned that is " -"progressively populated with objects as seen by a custom :func:`showwarning` " -"function (which also suppresses output to ``sys.stdout``). Each object in " -"the list has attributes with the same names as the arguments " -"to :func:`showwarning`." +"and the :func:`showwarning` function. If the *record* argument is :const:" +"`False` (the default) the context manager returns :class:`None` on entry. If " +"*record* is :const:`True`, a list is returned that is progressively " +"populated with objects as seen by a custom :func:`showwarning` function " +"(which also suppresses output to ``sys.stdout``). Each object in the list " +"has attributes with the same names as the arguments to :func:`showwarning`." msgstr "" "一個情境管理器,它會複製並在退出時恢復警告過濾器和 :func:`showwarning` 函式。" -"如果 *record* 引數為 :const:`False`\\ (預設值),情境管理器在進入時回" -"傳 :class:`None`。如果 *record* 為 :const:`True`,則會回傳一個串列,該串列會" -"由自訂的 :func:`showwarning` 函式(該函式也會抑制對 ``sys.stdout`` 的輸出)所" -"看到的物件逐步填充。串列中的每個物件都具有與 :func:`showwarning` 的引數同名的" -"屬性。" +"如果 *record* 引數為 :const:`False`\\ (預設值),情境管理器在進入時回傳 :" +"class:`None`。如果 *record* 為 :const:`True`,則會回傳一個串列,該串列會由自" +"訂的 :func:`showwarning` 函式(該函式也會抑制對 ``sys.stdout`` 的輸出)所看到" +"的物件逐步填充。串列中的每個物件都具有與 :func:`showwarning` 的引數同名的屬" +"性。" #: ../../library/warnings.rst:611 msgid "" @@ -1211,23 +1210,23 @@ msgstr "情境管理器的並行安全性" #: ../../library/warnings.rst:640 msgid "" -"The behavior of :class:`catch_warnings` context manager depends on " -"the :data:`sys.flags.context_aware_warnings` flag. If the flag is true, the " -"context manager behaves in a concurrent-safe fashion and otherwise not. " -"Concurrent-safe means that it is both thread-safe and safe to use " -"within :ref:`asyncio coroutines ` and tasks. Being thread-safe " -"means that behavior is predictable in a multi-threaded program. The flag " -"defaults to true for free-threaded builds and false otherwise." +"The behavior of :class:`catch_warnings` context manager depends on the :data:" +"`sys.flags.context_aware_warnings` flag. If the flag is true, the context " +"manager behaves in a concurrent-safe fashion and otherwise not. Concurrent-" +"safe means that it is both thread-safe and safe to use within :ref:`asyncio " +"coroutines ` and tasks. Being thread-safe means that behavior is " +"predictable in a multi-threaded program. The flag defaults to true for free-" +"threaded builds and false otherwise." msgstr "" #: ../../library/warnings.rst:648 msgid "" -"If the :data:`~sys.flags.context_aware_warnings` flag is false, " -"then :class:`catch_warnings` will modify the global attributes of " -"the :mod:`warnings` module. This is not safe if used within a concurrent " -"program (using multiple threads or using asyncio coroutines). For example, " -"if two or more threads use the :class:`catch_warnings` class at the same " -"time, the behavior is undefined." +"If the :data:`~sys.flags.context_aware_warnings` flag is false, then :class:" +"`catch_warnings` will modify the global attributes of the :mod:`warnings` " +"module. This is not safe if used within a concurrent program (using " +"multiple threads or using asyncio coroutines). For example, if two or more " +"threads use the :class:`catch_warnings` class at the same time, the behavior " +"is undefined." msgstr "" #: ../../library/warnings.rst:655 @@ -1258,21 +1257,21 @@ msgstr "" #: ../../library/warnings.rst:671 msgid "" "The :data:`~sys.flags.context_aware_warnings` flag can be set the :option:`-" -"X context_aware_warnings<-X>` command-line option or by " -"the :envvar:`PYTHON_CONTEXT_AWARE_WARNINGS` environment variable." +"X context_aware_warnings<-X>` command-line option or by the :envvar:" +"`PYTHON_CONTEXT_AWARE_WARNINGS` environment variable." msgstr "" #: ../../library/warnings.rst:677 msgid "" "It is likely that most programs that desire thread-safe behaviour of the " -"warnings module will also want to set " -"the :data:`~sys.flags.thread_inherit_context` flag to true. That flag " -"causes threads created by :class:`threading.Thread` to start with a copy of " -"the context variables from the thread starting it. When true, the context " -"established by :class:`catch_warnings` in one thread will also apply to new " -"threads started by it. If false, new threads will start with an empty " -"warnings context variable, meaning that any filtering that was established " -"by a :class:`catch_warnings` context manager will no longer be active." +"warnings module will also want to set the :data:`~sys.flags." +"thread_inherit_context` flag to true. That flag causes threads created by :" +"class:`threading.Thread` to start with a copy of the context variables from " +"the thread starting it. When true, the context established by :class:" +"`catch_warnings` in one thread will also apply to new threads started by " +"it. If false, new threads will start with an empty warnings context " +"variable, meaning that any filtering that was established by a :class:" +"`catch_warnings` context manager will no longer be active." msgstr "" #: ../../library/warnings.rst:690 @@ -1292,9 +1291,9 @@ msgstr "warnings (警告)" #~ "filter specifications. This means the context manager is modifying " #~ "global state and therefore is not thread-safe." #~ msgstr "" -#~ ":class:`catch_warnings` 管理器的工作原理是替換然後再恢復模組" -#~ "的 :func:`showwarning` 函式和內部過濾器規格串列。這意味著情境管理器正在修" -#~ "改全域狀態,因此不是執行緒安全的。" +#~ ":class:`catch_warnings` 管理器的工作原理是替換然後再恢復模組的 :func:" +#~ "`showwarning` 函式和內部過濾器規格串列。這意味著情境管理器正在修改全域狀" +#~ "態,因此不是執行緒安全的。" #~ msgid "Base category for warnings about dubious syntactic features." #~ msgstr "關於可疑語法功能的警告的基底類別。" diff --git a/library/zipfile.po b/library/zipfile.po index e6324e7476..1e26865390 100644 --- a/library/zipfile.po +++ b/library/zipfile.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2025-06-26 20:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -79,12 +79,12 @@ msgstr "" #: ../../library/zipfile.rst:58 msgid "" -"Class that implements a subset of the interface provided " -"by :class:`pathlib.Path`, including the " -"full :class:`importlib.resources.abc.Traversable` interface." +"Class that implements a subset of the interface provided by :class:`pathlib." +"Path`, including the full :class:`importlib.resources.abc.Traversable` " +"interface." msgstr "" -"實作了 :class:`pathlib.Path` 所提供介面子集的類別,包括完整" -"的 :class:`importlib.resources.abc.Traversable` 介面。" +"實作了 :class:`pathlib.Path` 所提供介面子集的類別,包括完整的 :class:" +"`importlib.resources.abc.Traversable` 介面。" #: ../../library/zipfile.rst:68 msgid "Class for creating ZIP archives containing Python libraries." @@ -98,14 +98,14 @@ msgid "" "module will not need to create these, but only use those created by this " "module. *filename* should be the full name of the archive member, and " "*date_time* should be a tuple containing six fields which describe the time " -"of the last modification to the file; the fields are described in " -"section :ref:`zipinfo-objects`." +"of the last modification to the file; the fields are described in section :" +"ref:`zipinfo-objects`." msgstr "" -"用於表示封存檔案中成員資訊的類別。此類別的實例由 :class:`ZipFile` 物件" -"的 :meth:`.getinfo` 和 :meth:`.infolist` 方法回傳。大多數 :mod:`zipfile` 模組" -"的使用者不需要建立這些實例,而只需使用本模組所建立的。*filename* 應為封存成員" -"的完整名稱,而 *date_time* 應為一個包含六個欄位的元組,用以描述檔案的最後修改" -"時間;這些欄位在 :ref:`zipinfo-objects` 章節中有所描述。" +"用於表示封存檔案中成員資訊的類別。此類別的實例由 :class:`ZipFile` 物件的 :" +"meth:`.getinfo` 和 :meth:`.infolist` 方法回傳。大多數 :mod:`zipfile` 模組的使" +"用者不需要建立這些實例,而只需使用本模組所建立的。*filename* 應為封存成員的完" +"整名稱,而 *date_time* 應為一個包含六個欄位的元組,用以描述檔案的最後修改時" +"間;這些欄位在 :ref:`zipinfo-objects` 章節中有所描述。" #: ../../library/zipfile.rst:82 msgid "" @@ -151,29 +151,30 @@ msgstr "用於常用的 ZIP 壓縮方法的數值常數。這需要 :mod:`zlib` #: ../../library/zipfile.rst:120 msgid "" -"The numeric constant for the BZIP2 compression method. This requires " -"the :mod:`bz2` module." +"The numeric constant for the BZIP2 compression method. This requires the :" +"mod:`bz2` module." msgstr "用於 BZIP2 壓縮方法的數值常數。這需要 :mod:`bz2` 模組。" #: ../../library/zipfile.rst:127 msgid "" -"The numeric constant for the LZMA compression method. This requires " -"the :mod:`lzma` module." +"The numeric constant for the LZMA compression method. This requires the :" +"mod:`lzma` module." msgstr "用於 LZMA 壓縮方法的數值常數。這需要 :mod:`lzma` 模組。" #: ../../library/zipfile.rst:134 msgid "" -"The numeric constant for Zstandard compression. This requires " -"the :mod:`compression.zstd` module." -msgstr "用於 Zstandard 壓縮方法的數值常數。這需要 :mod:`compression.zstd` 模組。" +"The numeric constant for Zstandard compression. This requires the :mod:" +"`compression.zstd` module." +msgstr "" +"用於 Zstandard 壓縮方法的數值常數。這需要 :mod:`compression.zstd` 模組。" #: ../../library/zipfile.rst:139 msgid "" "In APPNOTE 6.3.7, the method ID ``20`` was assigned to Zstandard " "compression. This was changed in APPNOTE 6.3.8 to method ID ``93`` to avoid " -"conflicts, with method ID ``20`` being deprecated. For compatibility, " -"the :mod:`!zipfile` module reads both method IDs but will only write data " -"with method ID ``93``." +"conflicts, with method ID ``20`` being deprecated. For compatibility, the :" +"mod:`!zipfile` module reads both method IDs but will only write data with " +"method ID ``93``." msgstr "" #: ../../library/zipfile.rst:149 @@ -184,9 +185,9 @@ msgid "" "these compression methods, and may either refuse to process the ZIP file " "altogether, or fail to extract individual files." msgstr "" -"ZIP 檔案格式規範自 2001 年起已包含對 bzip2 壓縮的支援、自 2006 年起支援 " -"LZMA 壓縮、自 2020 年起支援 Zstandard 壓縮。然而某些工具(包括舊版的 Python)" -"不支援這些壓縮方法,可能會完全拒絕處理該 ZIP 檔案,或無法解壓縮個別檔案。" +"ZIP 檔案格式規範自 2001 年起已包含對 bzip2 壓縮的支援、自 2006 年起支援 LZMA " +"壓縮、自 2020 年起支援 Zstandard 壓縮。然而某些工具(包括舊版的 Python)不支" +"援這些壓縮方法,可能會完全拒絕處理該 ZIP 檔案,或無法解壓縮個別檔案。" #: ../../library/zipfile.rst:157 msgid "`PKZIP Application Note`_" @@ -236,31 +237,30 @@ msgid "" msgstr "" "*mode* 參數應為 ``'r'`` 來讀取一個現有檔案、``'w'`` 來清空並寫入一個新檔案、" "``'a'`` 來附加到一個現有檔案,或 ``'x'`` 來獨佔性地建立並寫入一個新檔案。如" -"果 *mode* 為 ``'x'`` 且 *file* 指向一個現有檔案,將會引" -"發 :exc:`FileExistsError`。如果 *mode* 為 ``'a'`` 且 *file* 指向一個現有的 " -"ZIP 檔案,則會將額外的檔案加入其中。如果 *file* 並非指向一個 ZIP 檔案,則一個" -"新的 ZIP 封存檔案會被附加到該檔案之後。這適用於將一個 ZIP 封存檔案附加到另一" -"個檔案(例如 :file:`python.exe`)。如果 *mode* 為 ``'a'`` 且檔案完全不存在," -"它會被建立。如果 *mode* 為 ``'r'`` 或 ``'a'``,該檔案應為可定位的 " -"(seekable)。" +"果 *mode* 為 ``'x'`` 且 *file* 指向一個現有檔案,將會引發 :exc:" +"`FileExistsError`。如果 *mode* 為 ``'a'`` 且 *file* 指向一個現有的 ZIP 檔案," +"則會將額外的檔案加入其中。如果 *file* 並非指向一個 ZIP 檔案,則一個新的 ZIP " +"封存檔案會被附加到該檔案之後。這適用於將一個 ZIP 封存檔案附加到另一個檔案(例" +"如 :file:`python.exe`)。如果 *mode* 為 ``'a'`` 且檔案完全不存在,它會被建" +"立。如果 *mode* 為 ``'r'`` 或 ``'a'``,該檔案應為可定位的 (seekable)。" #: ../../library/zipfile.rst:191 msgid "" "*compression* is the ZIP compression method to use when writing the archive, " -"and should " -"be :const:`ZIP_STORED`, :const:`ZIP_DEFLATED`, :const:`ZIP_BZIP2`, :const:`ZIP_LZMA`, " -"or :const:`ZIP_ZSTANDARD`; unrecognized values will " -"cause :exc:`NotImplementedError` to be raised. " -"If :const:`ZIP_DEFLATED`, :const:`ZIP_BZIP2`, :const:`ZIP_LZMA`, " -"or :const:`ZIP_ZSTANDARD` is specified but the corresponding module " -"(:mod:`zlib`, :mod:`bz2`, :mod:`lzma`, or :mod:`compression.zstd`) is not " -"available, :exc:`RuntimeError` is raised. The default is :const:`ZIP_STORED`." -msgstr "" -"*compression* 是寫入封存檔案時要使用的 ZIP 壓縮方法,應" -"為 :const:`ZIP_STORED`、:const:`ZIP_DEFLATED`、:const:`ZIP_BZIP2`、" -":const:`ZIP_LZMA` 或 :const:`ZIP_ZSTANDARD`;無法識別的值將導致引發 :exc:`NotImplementedError`。如果" -"指定了 :const:`ZIP_DEFLATED`、:const:`ZIP_BZIP2`、:const:`ZIP_LZMA` 或 :const:`ZIP_ZSTANDARD`,但對應" -"的模組(:mod:`zlib`、:mod:`bz2`、:mod:`lzma` 或 :mod:`compression.zstd`)不可用,則會引" +"and should be :const:`ZIP_STORED`, :const:`ZIP_DEFLATED`, :const:" +"`ZIP_BZIP2`, :const:`ZIP_LZMA`, or :const:`ZIP_ZSTANDARD`; unrecognized " +"values will cause :exc:`NotImplementedError` to be raised. If :const:" +"`ZIP_DEFLATED`, :const:`ZIP_BZIP2`, :const:`ZIP_LZMA`, or :const:" +"`ZIP_ZSTANDARD` is specified but the corresponding module (:mod:`zlib`, :mod:" +"`bz2`, :mod:`lzma`, or :mod:`compression.zstd`) is not available, :exc:" +"`RuntimeError` is raised. The default is :const:`ZIP_STORED`." +msgstr "" +"*compression* 是寫入封存檔案時要使用的 ZIP 壓縮方法,應為 :const:" +"`ZIP_STORED`、:const:`ZIP_DEFLATED`、:const:`ZIP_BZIP2`、:const:`ZIP_LZMA` " +"或 :const:`ZIP_ZSTANDARD`;無法識別的值將導致引發 :exc:" +"`NotImplementedError`。如果指定了 :const:`ZIP_DEFLATED`、:const:" +"`ZIP_BZIP2`、:const:`ZIP_LZMA` 或 :const:`ZIP_ZSTANDARD`,但對應的模組(:mod:" +"`zlib`、:mod:`bz2`、:mod:`lzma` 或 :mod:`compression.zstd`)不可用,則會引" "發 :exc:`RuntimeError`。預設為 :const:`ZIP_STORED`。" #: ../../library/zipfile.rst:200 @@ -277,25 +277,24 @@ msgstr "" #: ../../library/zipfile.rst:205 msgid "" "The *compresslevel* parameter controls the compression level to use when " -"writing files to the archive. When using :const:`ZIP_STORED` " -"or :const:`ZIP_LZMA` it has no effect. When using :const:`ZIP_DEFLATED` " -"integers ``0`` through ``9`` are accepted (see :class:`zlib " -"` for more information). When using :const:`ZIP_BZIP2` " -"integers ``1`` through ``9`` are accepted (see :class:`bz2 ` " -"for more information). When using :const:`ZIP_ZSTANDARD` integers " -"``-131072`` through ``22`` are commonly accepted " -"(see :attr:`CompressionParameter.compression_level " -"` for more on " -"retrieving valid values and their meaning)." -msgstr "" -"*compresslevel* 參數控制寫入檔案到封存時使用的壓縮層級。當使" -"用 :const:`ZIP_STORED` 或 :const:`ZIP_LZMA` 時,它沒有效果。當使" -"用 :const:`ZIP_DEFLATED` 時,接受整數 ``0`` 到 ``9``\\ (更多資訊請參" -"閱 :class:`zlib `)。當使用 :const:`ZIP_BZIP2` 時,接受整" -"數 ``1`` 到 ``9``\\ (更多資訊請參閱 :class:`bz2 `)。當" -"使用 :const:`ZIP_ZSTANDARD` 時,通常接受整數 ``-131072`` 到 ``22``\\ (" -"更多關於檢索有效值及其含義,請參閱 :attr:`CompressionParameter.compression_level " -"`)。" +"writing files to the archive. When using :const:`ZIP_STORED` or :const:" +"`ZIP_LZMA` it has no effect. When using :const:`ZIP_DEFLATED` integers ``0`` " +"through ``9`` are accepted (see :class:`zlib ` for more " +"information). When using :const:`ZIP_BZIP2` integers ``1`` through ``9`` are " +"accepted (see :class:`bz2 ` for more information). When using :" +"const:`ZIP_ZSTANDARD` integers ``-131072`` through ``22`` are commonly " +"accepted (see :attr:`CompressionParameter.compression_level ` for more on retrieving valid " +"values and their meaning)." +msgstr "" +"*compresslevel* 參數控制寫入檔案到封存時使用的壓縮層級。當使用 :const:" +"`ZIP_STORED` 或 :const:`ZIP_LZMA` 時,它沒有效果。當使用 :const:" +"`ZIP_DEFLATED` 時,接受整數 ``0`` 到 ``9``\\ (更多資訊請參閱 :class:`zlib " +"`)。當使用 :const:`ZIP_BZIP2` 時,接受整數 ``1`` 到 " +"``9``\\ (更多資訊請參閱 :class:`bz2 `)。當使用 :const:" +"`ZIP_ZSTANDARD` 時,通常接受整數 ``-131072`` 到 ``22``\\ (更多關於檢索有效值" +"及其含義,請參閱 :attr:`CompressionParameter.compression_level `)。" #: ../../library/zipfile.rst:217 ../../library/zipfile.rst:799 msgid "" @@ -319,9 +318,9 @@ msgstr "" #: ../../library/zipfile.rst:227 msgid "" -"If the file is created with mode ``'w'``, ``'x'`` or ``'a'`` and " -"then :meth:`closed ` without adding any files to the archive, the " -"appropriate ZIP structures for an empty archive will be written to the file." +"If the file is created with mode ``'w'``, ``'x'`` or ``'a'`` and then :meth:" +"`closed ` without adding any files to the archive, the appropriate " +"ZIP structures for an empty archive will be written to the file." msgstr "" "如果檔案以 ``'w'``、``'x'`` 或 ``'a'`` 模式建立,然後在沒有向封存檔案中加入任" "何檔案的情況下 :meth:`關閉 `,則適用於空封存檔案的 ZIP 結構將被寫入檔" @@ -447,18 +446,18 @@ msgid "" "Access a member of the archive as a binary file-like object. *name* can be " "either the name of a file within the archive or a :class:`ZipInfo` object. " "The *mode* parameter, if included, must be ``'r'`` (the default) or " -"``'w'``. *pwd* is the password used to decrypt encrypted ZIP files as " -"a :class:`bytes` object." +"``'w'``. *pwd* is the password used to decrypt encrypted ZIP files as a :" +"class:`bytes` object." msgstr "" "以二進位類檔案物件的形式存取封存檔案中的一個成員。*name* 可以是封存檔案內的檔" "案名稱,或是一個 :class:`ZipInfo` 物件。*mode* 參數如果包含,則必須是 " -"``'r'``\\ (預設值)或 ``'w'``。*pwd* 是用於解密加密 ZIP 檔案的密碼,為一" -"個 :class:`bytes` 物件。" +"``'r'``\\ (預設值)或 ``'w'``。*pwd* 是用於解密加密 ZIP 檔案的密碼,為一個 :" +"class:`bytes` 物件。" #: ../../library/zipfile.rst:315 msgid "" -":meth:`~ZipFile.open` is also a context manager and therefore supports " -"the :keyword:`with` statement::" +":meth:`~ZipFile.open` is also a context manager and therefore supports the :" +"keyword:`with` statement::" msgstr "" ":meth:`~ZipFile.open` 也是一個情境管理器,因此支援 :keyword:`with` 陳述" "式: ::" @@ -476,24 +475,27 @@ msgstr "" #: ../../library/zipfile.rst:322 msgid "" "With *mode* ``'r'`` the file-like object (``ZipExtFile``) is read-only and " -"provides the following " -"methods: :meth:`~io.BufferedIOBase.read`, :meth:`~io.IOBase.readline`, :meth:`~io.IOBase.readlines`, :meth:`~io.IOBase.seek`, :meth:`~io.IOBase.tell`, :meth:`~container.__iter__`, :meth:`~iterator.__next__`. " -"These objects can operate independently of the ZipFile." +"provides the following methods: :meth:`~io.BufferedIOBase.read`, :meth:`~io." +"IOBase.readline`, :meth:`~io.IOBase.readlines`, :meth:`~io.IOBase.seek`, :" +"meth:`~io.IOBase.tell`, :meth:`~container.__iter__`, :meth:`~iterator." +"__next__`. These objects can operate independently of the ZipFile." msgstr "" "在 *mode* 為 ``'r'`` 時,該類檔案物件(``ZipExtFile``)是唯讀的,並提供以下方" -"法::meth:`~io.BufferedIOBase.read`、:meth:`~io.IOBase.readline`、:meth:`~io.IOBase.readlines`、:meth:`~io.IOBase.seek`、:meth:`~io.IOBase.tell`、:meth:`~container.__iter__`、:meth:`~iterator.__next__`。" -"這些物件可以獨立於 ZipFile 運作。" +"法::meth:`~io.BufferedIOBase.read`、:meth:`~io.IOBase.readline`、:meth:`~io." +"IOBase.readlines`、:meth:`~io.IOBase.seek`、:meth:`~io.IOBase.tell`、:meth:" +"`~container.__iter__`、:meth:`~iterator.__next__`。這些物件可以獨立於 " +"ZipFile 運作。" #: ../../library/zipfile.rst:329 msgid "" -"With ``mode='w'``, a writable file handle is returned, which supports " -"the :meth:`~io.BufferedIOBase.write` method. While a writable file handle " -"is open, attempting to read or write other files in the ZIP file will raise " -"a :exc:`ValueError`." +"With ``mode='w'``, a writable file handle is returned, which supports the :" +"meth:`~io.BufferedIOBase.write` method. While a writable file handle is " +"open, attempting to read or write other files in the ZIP file will raise a :" +"exc:`ValueError`." msgstr "" -"在 ``mode='w'`` 時,會回傳一個可寫的檔案控點 (file handle),它支" -"援 :meth:`~io.BufferedIOBase.write` 方法。當一個可寫的檔案控點開啟時,嘗試讀" -"取或寫入 ZIP 檔案中的其他檔案將會引發 :exc:`ValueError`。" +"在 ``mode='w'`` 時,會回傳一個可寫的檔案控點 (file handle),它支援 :meth:" +"`~io.BufferedIOBase.write` 方法。當一個可寫的檔案控點開啟時,嘗試讀取或寫入 " +"ZIP 檔案中的其他檔案將會引發 :exc:`ValueError`。" #: ../../library/zipfile.rst:334 msgid "" @@ -524,17 +526,17 @@ msgid "" "filename or a :class:`ZipInfo` object. You will appreciate this when trying " "to read a ZIP file that contains members with duplicate names." msgstr "" -":meth:`.open`、:meth:`read` 和 :meth:`extract` 方法可以接受一個檔名或一" -"個 :class:`ZipInfo` 物件。當你嘗試讀取一個包含重複名稱成員的 ZIP 檔案時,你會" -"發現這很有用。" +":meth:`.open`、:meth:`read` 和 :meth:`extract` 方法可以接受一個檔名或一個 :" +"class:`ZipInfo` 物件。當你嘗試讀取一個包含重複名稱成員的 ZIP 檔案時,你會發現" +"這很有用。" #: ../../library/zipfile.rst:350 msgid "" "Removed support of ``mode='U'``. Use :class:`io.TextIOWrapper` for reading " "compressed text files in :term:`universal newlines` mode." msgstr "" -"移除了對 ``mode='U'`` 的支援。請使用 :class:`io.TextIOWrapper` " -"以 :term:`universal newlines` 模式讀取壓縮的文字檔。" +"移除了對 ``mode='U'`` 的支援。請使用 :class:`io.TextIOWrapper` 以 :term:" +"`universal newlines` 模式讀取壓縮的文字檔。" #: ../../library/zipfile.rst:354 msgid "" @@ -568,10 +570,10 @@ msgid "" "to extract to. *member* can be a filename or a :class:`ZipInfo` object. " "*pwd* is the password used for encrypted files as a :class:`bytes` object." msgstr "" -"從封存檔案中解壓縮一個成員到目前工作目錄;*member* 必須是其完整名稱或一" -"個 :class:`ZipInfo` 物件。其檔案資訊會被盡可能精確地解壓縮。*path* 指定一個不" -"同的目錄來解壓縮。*member* 可以是一個檔名或一個 :class:`ZipInfo` 物件。*pwd* " -"是用於加密檔案的密碼,為一個 :class:`bytes` 物件。" +"從封存檔案中解壓縮一個成員到目前工作目錄;*member* 必須是其完整名稱或一個 :" +"class:`ZipInfo` 物件。其檔案資訊會被盡可能精確地解壓縮。*path* 指定一個不同的" +"目錄來解壓縮。*member* 可以是一個檔名或一個 :class:`ZipInfo` 物件。*pwd* 是用" +"於加密檔案的密碼,為一個 :class:`bytes` 物件。" #: ../../library/zipfile.rst:377 msgid "Returns the normalized path created (a directory or new file)." @@ -629,8 +631,8 @@ msgstr "" #: ../../library/zipfile.rst:412 msgid "" -"Calling :meth:`extractall` on a closed ZipFile will raise " -"a :exc:`ValueError`. Previously, a :exc:`RuntimeError` was raised." +"Calling :meth:`extractall` on a closed ZipFile will raise a :exc:" +"`ValueError`. Previously, a :exc:`RuntimeError` was raised." msgstr "" "在一個已關閉的 ZipFile 上呼叫 :meth:`extractall` 將會引發 :exc:`ValueError`。" "先前,會引發一個 :exc:`RuntimeError`。" @@ -652,18 +654,18 @@ msgid "" "open for read or append. *pwd* is the password used for encrypted files as " "a :class:`bytes` object and, if specified, overrides the default password " "set with :meth:`setpassword`. Calling :meth:`read` on a ZipFile that uses a " -"compression method other " -"than :const:`ZIP_STORED`, :const:`ZIP_DEFLATED`, :const:`ZIP_BZIP2`, :const:`ZIP_LZMA`, " -"or :const:`ZIP_ZSTANDARD` will raise a :exc:`NotImplementedError`. An error " -"will also be raised if the corresponding compression module is not available." -msgstr "" -"回傳封存檔案中 *name* 檔案的位元組。*name* 是封存檔案中檔案的名稱,或是一" -"個 :class:`ZipInfo` 物件。封存檔案必須以讀取或附加模式開啟。*pwd* 是用於加密" -"檔案的密碼,為一個 :class:`bytes` 物件,如果指定,將會覆寫" -"用 :meth:`setpassword` 設定的預設密碼。在一個使" -"用 :const:`ZIP_STORED`、:const:`ZIP_DEFLATED`、:const:`ZIP_BZIP2`、" -":const:`ZIP_LZMA` 或 :const:`ZIP_ZSTANDARD` 以外壓縮方法的 ZipFile 上呼叫 :meth:`read` 將會引" -"發 :exc:`NotImplementedError`。如果對應的壓縮模組不可用,也會引發一個錯誤。" +"compression method other than :const:`ZIP_STORED`, :const:`ZIP_DEFLATED`, :" +"const:`ZIP_BZIP2`, :const:`ZIP_LZMA`, or :const:`ZIP_ZSTANDARD` will raise " +"a :exc:`NotImplementedError`. An error will also be raised if the " +"corresponding compression module is not available." +msgstr "" +"回傳封存檔案中 *name* 檔案的位元組。*name* 是封存檔案中檔案的名稱,或是一個 :" +"class:`ZipInfo` 物件。封存檔案必須以讀取或附加模式開啟。*pwd* 是用於加密檔案" +"的密碼,為一個 :class:`bytes` 物件,如果指定,將會覆寫用 :meth:`setpassword` " +"設定的預設密碼。在一個使用 :const:`ZIP_STORED`、:const:`ZIP_DEFLATED`、:" +"const:`ZIP_BZIP2`、:const:`ZIP_LZMA` 或 :const:`ZIP_ZSTANDARD` 以外壓縮方法" +"的 ZipFile 上呼叫 :meth:`read` 將會引發 :exc:`NotImplementedError`。如果對應" +"的壓縮模組不可用,也會引發一個錯誤。" #: ../../library/zipfile.rst:442 msgid "" @@ -761,12 +763,12 @@ msgid "" "name, the date and time is set to the current date and time. The archive " "must be opened with mode ``'w'``, ``'x'`` or ``'a'``." msgstr "" -"將一個檔案寫入封存檔案。內容為 *data*,它可以是一個 :class:`str` 或一" -"個 :class:`bytes` 實例;如果它是一個 :class:`str`,它會先被編碼為 UTF-8。" -"*zinfo_or_arcname* 是它在封存檔案中將被賦予的檔案名稱,或是一" -"個 :class:`ZipInfo` 實例。如果它是一個實例,則至少必須給定檔名、日期和時間。" -"如果它是一個名稱,則日期和時間被設為目前的日期和時間。封存檔案必須以 " -"``'w'``、``'x'`` 或 ``'a'`` 模式開啟。" +"將一個檔案寫入封存檔案。內容為 *data*,它可以是一個 :class:`str` 或一個 :" +"class:`bytes` 實例;如果它是一個 :class:`str`,它會先被編碼為 UTF-8。" +"*zinfo_or_arcname* 是它在封存檔案中將被賦予的檔案名稱,或是一個 :class:" +"`ZipInfo` 實例。如果它是一個實例,則至少必須給定檔名、日期和時間。如果它是一" +"個名稱,則日期和時間被設為目前的日期和時間。封存檔案必須以 ``'w'``、``'x'`` " +"或 ``'a'`` 模式開啟。" #: ../../library/zipfile.rst:509 msgid "" @@ -800,9 +802,8 @@ msgid "" "ZipFile will raise a :exc:`ValueError`. Previously, a :exc:`RuntimeError` " "was raised." msgstr "" -"在以 ``'r'`` 模式建立的 ZipFile 或一個已關閉的 ZipFile 上呼" -"叫 :meth:`writestr` 將會引發 :exc:`ValueError`。先前,會引發一" -"個 :exc:`RuntimeError`。" +"在以 ``'r'`` 模式建立的 ZipFile 或一個已關閉的 ZipFile 上呼叫 :meth:" +"`writestr` 將會引發 :exc:`ValueError`。先前,會引發一個 :exc:`RuntimeError`。" #: ../../library/zipfile.rst:531 msgid "" @@ -853,12 +854,12 @@ msgstr "Path 物件" #: ../../library/zipfile.rst:569 msgid "" -"Construct a Path object from a ``root`` zipfile (which may be " -"a :class:`ZipFile` instance or ``file`` suitable for passing to " -"the :class:`ZipFile` constructor)." +"Construct a Path object from a ``root`` zipfile (which may be a :class:" +"`ZipFile` instance or ``file`` suitable for passing to the :class:`ZipFile` " +"constructor)." msgstr "" -"從一個 ``root`` zipfile(它可以是一個 :class:`ZipFile` 實例或一個適合傳遞" -"給 :class:`ZipFile` 建構函式的 ``file``)建構一個 Path 物件。" +"從一個 ``root`` zipfile(它可以是一個 :class:`ZipFile` 實例或一個適合傳遞給 :" +"class:`ZipFile` 建構函式的 ``file``)建構一個 Path 物件。" #: ../../library/zipfile.rst:573 msgid "" @@ -881,8 +882,8 @@ msgstr "" ":class:`Path` 類別不會清理 ZIP 封存檔案內的檔名。與 :meth:`ZipFile.extract` " "和 :meth:`ZipFile.extractall` 方法不同,呼叫者有責任驗證或清理檔名,以防止路" "徑遍歷漏洞(例如,包含 \"..\" 或絕對路徑的檔名)。在處理不受信任的封存檔案" -"時,請考慮使用 :func:`os.path.abspath` 解析檔名,並使" -"用 :func:`os.path.commonpath` 與目標目錄進行核對。" +"時,請考慮使用 :func:`os.path.abspath` 解析檔名,並使用 :func:`os.path." +"commonpath` 與目標目錄進行核對。" #: ../../library/zipfile.rst:585 msgid "" @@ -901,9 +902,9 @@ msgstr "最後的路徑元件。" msgid "" "Invoke :meth:`ZipFile.open` on the current path. Allows opening for read or " "write, text or binary through supported modes: 'r', 'w', 'rb', 'wb'. " -"Positional and keyword arguments are passed through " -"to :class:`io.TextIOWrapper` when opened as text and ignored otherwise. " -"``pwd`` is the ``pwd`` parameter to :meth:`ZipFile.open`." +"Positional and keyword arguments are passed through to :class:`io." +"TextIOWrapper` when opened as text and ignored otherwise. ``pwd`` is the " +"``pwd`` parameter to :meth:`ZipFile.open`." msgstr "" "在目前路徑上呼叫 :meth:`ZipFile.open`。允許透過支援的模式 " "'r'、'w'、'rb'、'wb' 以讀取或寫入、文字或二進位模式開啟。當以文字模式開啟時," @@ -919,12 +920,12 @@ msgstr "新增了對 open 的文字和二進位模式的支援。預設模式現 msgid "" "The ``encoding`` parameter can be supplied as a positional argument without " "causing a :exc:`TypeError`. As it could in 3.9. Code needing to be " -"compatible with unpatched 3.10 and 3.11 versions must pass " -"all :class:`io.TextIOWrapper` arguments, ``encoding`` included, as keywords." +"compatible with unpatched 3.10 and 3.11 versions must pass all :class:`io." +"TextIOWrapper` arguments, ``encoding`` included, as keywords." msgstr "" "``encoding`` 參數可以作為位置引數提供,而不會導致 :exc:`TypeError`,就像在 " -"3.9 中一樣。需要與未修補的 3.10 和 3.11 版本相容的程式碼,必須將所" -"有 :class:`io.TextIOWrapper` 引數,包括 ``encoding``,作為關鍵字傳遞。" +"3.9 中一樣。需要與未修補的 3.10 和 3.11 版本相容的程式碼,必須將所有 :class:" +"`io.TextIOWrapper` 引數,包括 ``encoding``,作為關鍵字傳遞。" #: ../../library/zipfile.rst:617 msgid "Enumerate the children of the current directory." @@ -984,8 +985,8 @@ msgid "" "passed through to :class:`io.TextIOWrapper` (except ``buffer``, which is " "implied by the context)." msgstr "" -"將目前檔案讀取為 unicode 文字。位置引數和關鍵字引數會被傳遞" -"給 :class:`io.TextIOWrapper`\\ (但 ``buffer`` 會根據情境隱式處理)。" +"將目前檔案讀取為 unicode 文字。位置引數和關鍵字引數會被傳遞給 :class:`io." +"TextIOWrapper`\\ (但 ``buffer`` 會根據情境隱式處理)。" #: ../../library/zipfile.rst:678 msgid "Read the current file as bytes." @@ -1016,8 +1017,8 @@ msgstr "在 3.10 之前,``joinpath`` 沒有文件記載,且只接受一個 #: ../../library/zipfile.rst:693 msgid "" "The :pypi:`zipp` project provides backports of the latest path object " -"functionality to older Pythons. Use ``zipp.Path`` in place of " -"``zipfile.Path`` for early access to changes." +"functionality to older Pythons. Use ``zipp.Path`` in place of ``zipfile." +"Path`` for early access to changes." msgstr "" ":pypi:`zipp` 專案為舊版 Python 提供了最新的 path 物件功能的向後移植版本。使" "用 ``zipp.Path`` 來取代 ``zipfile.Path`` 以提早使用變更。" @@ -1028,8 +1029,8 @@ msgstr "PyZipFile 物件" #: ../../library/zipfile.rst:703 msgid "" -"The :class:`PyZipFile` constructor takes the same parameters as " -"the :class:`ZipFile` constructor, and one additional parameter, *optimize*." +"The :class:`PyZipFile` constructor takes the same parameters as the :class:" +"`ZipFile` constructor, and one additional parameter, *optimize*." msgstr "" ":class:`PyZipFile` 建構函式接受與 :class:`ZipFile` 建構函式相同的參數,以及一" "個額外的參數 *optimize*。" @@ -1074,17 +1075,17 @@ msgid "" "information). If *pathname* is a file that does not end with :file:`.py`, " "a :exc:`RuntimeError` will be raised. If it is a directory, and the " "directory is not a package directory, then all the files :file:`\\*.pyc` are " -"added at the top level. If the directory is a package directory, then " -"all :file:`\\*.pyc` are added under the package name as a file path, and if " -"any subdirectories are package directories, all of these are added " -"recursively in sorted order." -msgstr "" -"如果 *pathname* 是一個檔案,檔名必須以 :file:`.py` 結尾,且只有(對應" -"的 :file:`\\*.pyc`)檔案會被加到頂層(沒有路徑資訊)。如果 *pathname* 是一個" -"不以 :file:`.py` 結尾的檔案,將會引發 :exc:`RuntimeError`。如果它是一個目錄," -"且該目錄不是一個套件目錄,則所有 :file:`\\*.pyc` 檔案都會被加到頂層。如果該目" -"錄是一個套件目錄,則所有 :file:`\\*.pyc` 都會以檔案路徑的形式被加到套件名稱" -"下,且如果任何子目錄是套件目錄,所有這些都會以排序後的順序遞迴地加入。" +"added at the top level. If the directory is a package directory, then all :" +"file:`\\*.pyc` are added under the package name as a file path, and if any " +"subdirectories are package directories, all of these are added recursively " +"in sorted order." +msgstr "" +"如果 *pathname* 是一個檔案,檔名必須以 :file:`.py` 結尾,且只有(對應的 :" +"file:`\\*.pyc`)檔案會被加到頂層(沒有路徑資訊)。如果 *pathname* 是一個不" +"以 :file:`.py` 結尾的檔案,將會引發 :exc:`RuntimeError`。如果它是一個目錄,且" +"該目錄不是一個套件目錄,則所有 :file:`\\*.pyc` 檔案都會被加到頂層。如果該目錄" +"是一個套件目錄,則所有 :file:`\\*.pyc` 都會以檔案路徑的形式被加到套件名稱下," +"且如果任何子目錄是套件目錄,所有這些都會以排序後的順序遞迴地加入。" #: ../../library/zipfile.rst:739 msgid "*basename* is intended for internal use only." @@ -1162,8 +1163,8 @@ msgid "" "and :meth:`.infolist` methods of :class:`ZipFile` objects. Each object " "stores information about a single member of the ZIP archive." msgstr "" -":class:`ZipInfo` 類別的實例由 :class:`ZipFile` 物件的 :meth:`.getinfo` " -"和 :meth:`.infolist` 方法回傳。每個物件儲存關於 ZIP 封存檔案單一成員的資訊。" +":class:`ZipInfo` 類別的實例由 :class:`ZipFile` 物件的 :meth:`.getinfo` 和 :" +"meth:`.infolist` 方法回傳。每個物件儲存關於 ZIP 封存檔案單一成員的資訊。" #: ../../library/zipfile.rst:784 msgid "" @@ -1219,79 +1220,98 @@ msgstr "封存檔案中檔案的名稱。" #: ../../library/zipfile.rst:832 msgid "" "The time and date of the last modification to the archive member. This is a " -"tuple of six values:" +"tuple of six values representing the \"last [modified] file time\" and " +"\"last [modified] file date\" fields from the ZIP file's central directory." msgstr "" -"封存成員的最後修改時間和日期。這是一個包含六個值的元組:" +"封存成員的最後修改時間和日期。這是一個包含六個值的元組,代表 ZIP 檔案中" +"中央目錄的「最後 [修改] 檔案時間」和「最後 [修改] 檔案日期」欄位。" #: ../../library/zipfile.rst:836 +msgid "The tuple contains:" +msgstr "該元組包含:" + +#: ../../library/zipfile.rst:839 msgid "Index" msgstr "索引" -#: ../../library/zipfile.rst:836 +#: ../../library/zipfile.rst:839 msgid "Value" msgstr "值" -#: ../../library/zipfile.rst:838 +#: ../../library/zipfile.rst:841 msgid "``0``" msgstr "``0``" -#: ../../library/zipfile.rst:838 +#: ../../library/zipfile.rst:841 msgid "Year (>= 1980)" msgstr "年(>= 1980)" -#: ../../library/zipfile.rst:840 +#: ../../library/zipfile.rst:843 msgid "``1``" msgstr "``1``" -#: ../../library/zipfile.rst:840 +#: ../../library/zipfile.rst:843 msgid "Month (one-based)" msgstr "月(從 1 開始)" -#: ../../library/zipfile.rst:842 +#: ../../library/zipfile.rst:845 msgid "``2``" msgstr "``2``" -#: ../../library/zipfile.rst:842 +#: ../../library/zipfile.rst:845 msgid "Day of month (one-based)" msgstr "日(從 1 開始)" -#: ../../library/zipfile.rst:844 +#: ../../library/zipfile.rst:847 msgid "``3``" msgstr "``3``" -#: ../../library/zipfile.rst:844 +#: ../../library/zipfile.rst:847 msgid "Hours (zero-based)" msgstr "時(從 0 開始)" -#: ../../library/zipfile.rst:846 +#: ../../library/zipfile.rst:849 msgid "``4``" msgstr "``4``" -#: ../../library/zipfile.rst:846 +#: ../../library/zipfile.rst:849 msgid "Minutes (zero-based)" msgstr "分(從 0 開始)" -#: ../../library/zipfile.rst:848 +#: ../../library/zipfile.rst:851 msgid "``5``" msgstr "``5``" -#: ../../library/zipfile.rst:848 +#: ../../library/zipfile.rst:851 msgid "Seconds (zero-based)" msgstr "秒(從 0 開始)" -#: ../../library/zipfile.rst:853 -msgid "The ZIP file format does not support timestamps before 1980." -msgstr "ZIP 檔案格式不支援 1980 年以前的時間戳記。" +#: ../../library/zipfile.rst:856 +msgid "" +"The ZIP format supports multiple timestamp fields in different locations " +"(central directory, extra fields for NTFS/UNIX systems, etc.). This " +"attribute specifically returns the timestamp from the central directory. The " +"central directory timestamp format in ZIP files does not support timestamps " +"before 1980. While some extra field formats (such as UNIX timestamps) can " +"represent earlier dates, this attribute only returns the central directory " +"timestamp." +msgstr "" -#: ../../library/zipfile.rst:858 +#: ../../library/zipfile.rst:863 +msgid "" +"The central directory timestamp is interpreted as representing local time, " +"rather than UTC time, to match the behavior of other zip tools." +msgstr "" + +#: ../../library/zipfile.rst:869 msgid "Type of compression for the archive member." msgstr "封存成員的壓縮型別。" -#: ../../library/zipfile.rst:863 +#: ../../library/zipfile.rst:874 msgid "Comment for the individual archive member as a :class:`bytes` object." msgstr "個別封存成員的註解,為一個 :class:`bytes` 物件。" -#: ../../library/zipfile.rst:868 +#: ../../library/zipfile.rst:879 msgid "" "Expansion field data. The `PKZIP Application Note`_ contains some comments " "on the internal structure of the data contained in this :class:`bytes` " @@ -1300,146 +1320,145 @@ msgstr "" "擴充欄位資料。`PKZIP Application Note`_ 包含一些關於此 :class:`bytes` 物件中" "所含資料內部結構的註解。" -#: ../../library/zipfile.rst:875 +#: ../../library/zipfile.rst:886 msgid "System which created ZIP archive." msgstr "建立 ZIP 封存檔案的系統。" -#: ../../library/zipfile.rst:880 +#: ../../library/zipfile.rst:891 msgid "PKZIP version which created ZIP archive." msgstr "建立 ZIP 封存檔案的 PKZIP 版本。" -#: ../../library/zipfile.rst:885 +#: ../../library/zipfile.rst:896 msgid "PKZIP version needed to extract archive." msgstr "解壓縮封存檔案所需的 PKZIP 版本。" -#: ../../library/zipfile.rst:890 +#: ../../library/zipfile.rst:901 msgid "Must be zero." msgstr "必須為零。" -#: ../../library/zipfile.rst:895 +#: ../../library/zipfile.rst:906 msgid "ZIP flag bits." msgstr "ZIP 旗標位元。" -#: ../../library/zipfile.rst:900 +#: ../../library/zipfile.rst:911 msgid "Volume number of file header." msgstr "檔案標頭的磁碟空間編號。" -#: ../../library/zipfile.rst:905 +#: ../../library/zipfile.rst:916 msgid "Internal attributes." msgstr "內部屬性。" -#: ../../library/zipfile.rst:910 +#: ../../library/zipfile.rst:921 msgid "External file attributes." msgstr "外部檔案屬性。" -#: ../../library/zipfile.rst:915 +#: ../../library/zipfile.rst:926 msgid "Byte offset to the file header." msgstr "到檔案標頭的位元組偏移量。" -#: ../../library/zipfile.rst:920 +#: ../../library/zipfile.rst:931 msgid "CRC-32 of the uncompressed file." msgstr "未壓縮檔案的 CRC-32。" -#: ../../library/zipfile.rst:925 +#: ../../library/zipfile.rst:936 msgid "Size of the compressed data." msgstr "壓縮資料的大小。" -#: ../../library/zipfile.rst:930 +#: ../../library/zipfile.rst:941 msgid "Size of the uncompressed file." msgstr "未壓縮檔案的大小。" -#: ../../library/zipfile.rst:937 +#: ../../library/zipfile.rst:948 msgid "Command-Line Interface" msgstr "命令列介面" -#: ../../library/zipfile.rst:939 +#: ../../library/zipfile.rst:950 msgid "" "The :mod:`zipfile` module provides a simple command-line interface to " "interact with ZIP archives." msgstr "" ":mod:`zipfile` 模組提供了一個簡單的命令列介面,用以與 ZIP 封存檔案互動。" -#: ../../library/zipfile.rst:942 +#: ../../library/zipfile.rst:953 msgid "" -"If you want to create a new ZIP archive, specify its name after " -"the :option:`-c` option and then list the filename(s) that should be " -"included:" +"If you want to create a new ZIP archive, specify its name after the :option:" +"`-c` option and then list the filename(s) that should be included:" msgstr "" "如果你想建立一個新的 ZIP 封存檔案,請在 :option:`-c` 選項後指定其名稱,然後列" "出應包含的檔名:" -#: ../../library/zipfile.rst:945 +#: ../../library/zipfile.rst:956 msgid "$ python -m zipfile -c monty.zip spam.txt eggs.txt" msgstr "$ python -m zipfile -c monty.zip spam.txt eggs.txt" -#: ../../library/zipfile.rst:949 +#: ../../library/zipfile.rst:960 msgid "Passing a directory is also acceptable:" msgstr "傳遞一個目錄也是可以的:" -#: ../../library/zipfile.rst:951 +#: ../../library/zipfile.rst:962 msgid "$ python -m zipfile -c monty.zip life-of-brian_1979/" msgstr "$ python -m zipfile -c monty.zip life-of-brian_1979/" -#: ../../library/zipfile.rst:955 +#: ../../library/zipfile.rst:966 msgid "" -"If you want to extract a ZIP archive into the specified directory, use " -"the :option:`-e` option:" +"If you want to extract a ZIP archive into the specified directory, use the :" +"option:`-e` option:" msgstr "" "如果你想將一個 ZIP 封存檔案解壓縮到指定的目錄,請使用 :option:`-e` 選項:" -#: ../../library/zipfile.rst:958 +#: ../../library/zipfile.rst:969 msgid "$ python -m zipfile -e monty.zip target-dir/" msgstr "$ python -m zipfile -e monty.zip target-dir/" -#: ../../library/zipfile.rst:962 +#: ../../library/zipfile.rst:973 msgid "For a list of the files in a ZIP archive, use the :option:`-l` option:" msgstr "要列出 ZIP 封存檔案中的檔案,請使用 :option:`-l` 選項:" -#: ../../library/zipfile.rst:964 +#: ../../library/zipfile.rst:975 msgid "$ python -m zipfile -l monty.zip" msgstr "$ python -m zipfile -l monty.zip" -#: ../../library/zipfile.rst:970 +#: ../../library/zipfile.rst:981 msgid "Command-line options" msgstr "命令列選項" -#: ../../library/zipfile.rst:975 +#: ../../library/zipfile.rst:986 msgid "List files in a zipfile." msgstr "列出 zipfile 中的檔案。" -#: ../../library/zipfile.rst:980 +#: ../../library/zipfile.rst:991 msgid "Create zipfile from source files." msgstr "從來源檔案建立 zipfile。" -#: ../../library/zipfile.rst:985 +#: ../../library/zipfile.rst:996 msgid "Extract zipfile into target directory." msgstr "將 zipfile 解壓縮到目標目錄。" -#: ../../library/zipfile.rst:990 +#: ../../library/zipfile.rst:1001 msgid "Test whether the zipfile is valid or not." msgstr "測試 zipfile 是否有效。" -#: ../../library/zipfile.rst:994 +#: ../../library/zipfile.rst:1005 msgid "" -"Specify encoding of member names for :option:`-l`, :option:`-e` " -"and :option:`-t`." +"Specify encoding of member names for :option:`-l`, :option:`-e` and :option:" +"`-t`." msgstr "為 :option:`-l`、:option:`-e` 和 :option:`-t` 指定成員名稱的編碼。" -#: ../../library/zipfile.rst:1001 +#: ../../library/zipfile.rst:1012 msgid "Decompression pitfalls" msgstr "解壓縮的陷阱" -#: ../../library/zipfile.rst:1003 +#: ../../library/zipfile.rst:1014 msgid "" "The extraction in zipfile module might fail due to some pitfalls listed " "below." msgstr "zipfile 模組中的解壓縮可能會由於下面列出的一些陷阱而失敗。" -#: ../../library/zipfile.rst:1006 +#: ../../library/zipfile.rst:1017 msgid "From file itself" msgstr "來自檔案本身" -#: ../../library/zipfile.rst:1008 +#: ../../library/zipfile.rst:1019 msgid "" "Decompression may fail due to incorrect password / CRC checksum / ZIP format " "or unsupported compression method / decryption." @@ -1447,11 +1466,11 @@ msgstr "" "解壓縮可能由於不正確的密碼 / CRC 校驗和 / ZIP 格式或不支援的壓縮方法 / 解密而" "失敗。" -#: ../../library/zipfile.rst:1012 +#: ../../library/zipfile.rst:1023 msgid "File System limitations" msgstr "檔案系統限制" -#: ../../library/zipfile.rst:1014 +#: ../../library/zipfile.rst:1025 msgid "" "Exceeding limitations on different file systems can cause decompression " "failed. Such as allowable characters in the directory entries, length of the " @@ -1461,11 +1480,11 @@ msgstr "" "超出不同檔案系統的限制可能導致解壓縮失敗。例如目錄條目中允許的字元、檔名長" "度、路徑名長度、單一檔案的大小以及檔案數量等。" -#: ../../library/zipfile.rst:1021 +#: ../../library/zipfile.rst:1032 msgid "Resources limitations" msgstr "資源限制" -#: ../../library/zipfile.rst:1023 +#: ../../library/zipfile.rst:1034 msgid "" "The lack of memory or disk volume would lead to decompression failed. For " "example, decompression bombs (aka `ZIP bomb`_) apply to zipfile library that " @@ -1474,11 +1493,11 @@ msgstr "" "記憶體或磁碟空間不足會導致解壓縮失敗。例如,解壓縮炸彈(又稱 `ZIP bomb`_)適" "用於 zipfile 函式庫,可能導致磁碟空間耗盡。" -#: ../../library/zipfile.rst:1028 +#: ../../library/zipfile.rst:1039 msgid "Interruption" msgstr "中斷" -#: ../../library/zipfile.rst:1030 +#: ../../library/zipfile.rst:1041 msgid "" "Interruption during the decompression, such as pressing control-C or killing " "the decompression process may result in incomplete decompression of the " @@ -1487,11 +1506,11 @@ msgstr "" "在解壓縮過程中斷,例如按下 control-C 或終止解壓縮過程,可能導致封存檔案解壓縮" "不完整。" -#: ../../library/zipfile.rst:1034 +#: ../../library/zipfile.rst:1045 msgid "Default behaviors of extraction" msgstr "解壓縮的預設行為" -#: ../../library/zipfile.rst:1036 +#: ../../library/zipfile.rst:1047 msgid "" "Not knowing the default extraction behaviors can cause unexpected " "decompression results. For example, when extracting the same archive twice, " @@ -1499,3 +1518,6 @@ msgid "" msgstr "" "不了解預設的解壓縮行為可能導致非預期的解壓縮結果。例如,當兩次解壓縮同一個封" "存檔案時,它會不經詢問就覆寫檔案。" + +#~ msgid "The ZIP file format does not support timestamps before 1980." +#~ msgstr "ZIP 檔案格式不支援 1980 年以前的時間戳記。" diff --git a/reference/compound_stmts.po b/reference/compound_stmts.po index 4b3a5146d2..1d7fd59b4b 100644 --- a/reference/compound_stmts.po +++ b/reference/compound_stmts.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-10 20:44+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -33,10 +33,10 @@ msgstr "" msgid "" "The :keyword:`if`, :keyword:`while` and :keyword:`for` statements implement " "traditional control flow constructs. :keyword:`try` specifies exception " -"handlers and/or cleanup code for a group of statements, while " -"the :keyword:`with` statement allows the execution of initialization and " -"finalization code around a block of code. Function and class definitions " -"are also syntactically compound statements." +"handlers and/or cleanup code for a group of statements, while the :keyword:" +"`with` statement allows the execution of initialization and finalization " +"code around a block of code. Function and class definitions are also " +"syntactically compound statements." msgstr "" #: ../../reference/compound_stmts.rst:26 @@ -78,8 +78,8 @@ msgid "" "Note that statements always end in a ``NEWLINE`` possibly followed by a " "``DEDENT``. Also note that optional continuation clauses always begin with " "a keyword that cannot start a statement, thus there are no ambiguities (the " -"'dangling :keyword:`else`' problem is solved in Python by requiring " -"nested :keyword:`if` statements to be indented)." +"'dangling :keyword:`else`' problem is solved in Python by requiring nested :" +"keyword:`if` statements to be indented)." msgstr "" #: ../../reference/compound_stmts.rst:75 @@ -127,9 +127,9 @@ msgstr "" #: ../../reference/compound_stmts.rst:133 msgid "" "A :keyword:`break` statement executed in the first suite terminates the loop " -"without executing the :keyword:`!else` clause's suite. " -"A :keyword:`continue` statement executed in the first suite skips the rest " -"of the suite and goes back to testing the expression." +"without executing the :keyword:`!else` clause's suite. A :keyword:" +"`continue` statement executed in the first suite skips the rest of the suite " +"and goes back to testing the expression." msgstr "" #: ../../reference/compound_stmts.rst:142 @@ -147,20 +147,19 @@ msgid "" "The :token:`~python-grammar:starred_expression_list` expression is evaluated " "once; it should yield an :term:`iterable` object. An :term:`iterator` is " "created for that iterable. The first item provided by the iterator is then " -"assigned to the target list using the standard rules for assignments " -"(see :ref:`assignment`), and the suite is executed. This repeats for each " -"item provided by the iterator. When the iterator is exhausted, the suite in " -"the :keyword:`!else` clause, if present, is executed, and the loop " -"terminates." +"assigned to the target list using the standard rules for assignments (see :" +"ref:`assignment`), and the suite is executed. This repeats for each item " +"provided by the iterator. When the iterator is exhausted, the suite in the :" +"keyword:`!else` clause, if present, is executed, and the loop terminates." msgstr "" #: ../../reference/compound_stmts.rst:173 msgid "" "A :keyword:`break` statement executed in the first suite terminates the loop " -"without executing the :keyword:`!else` clause's suite. " -"A :keyword:`continue` statement executed in the first suite skips the rest " -"of the suite and continues with the next item, or with the :keyword:`!else` " -"clause if there is no next item." +"without executing the :keyword:`!else` clause's suite. A :keyword:" +"`continue` statement executed in the first suite skips the rest of the suite " +"and continues with the next item, or with the :keyword:`!else` clause if " +"there is no next item." msgstr "" #: ../../reference/compound_stmts.rst:179 @@ -204,9 +203,9 @@ msgstr "" #: ../../reference/compound_stmts.rst:231 msgid "" -"Additional information on exceptions can be found in " -"section :ref:`exceptions`, and information on using the :keyword:`raise` " -"statement to generate exceptions may be found in section :ref:`raise`." +"Additional information on exceptions can be found in section :ref:" +"`exceptions`, and information on using the :keyword:`raise` statement to " +"generate exceptions may be found in section :ref:`raise`." msgstr "" #: ../../reference/compound_stmts.rst:235 @@ -260,13 +259,13 @@ msgstr "" #: ../../reference/compound_stmts.rst:270 msgid "" "When a matching :keyword:`!except` clause is found, the exception is " -"assigned to the target specified after the :keyword:`!as` keyword in " -"that :keyword:`!except` clause, if present, and the :keyword:`!except` " -"clause's suite is executed. All :keyword:`!except` clauses must have an " -"executable block. When the end of this block is reached, execution continues " -"normally after the entire :keyword:`try` statement. (This means that if two " -"nested handlers exist for the same exception, and the exception occurs in " -"the :keyword:`!try` clause of the inner handler, the outer handler will not " +"assigned to the target specified after the :keyword:`!as` keyword in that :" +"keyword:`!except` clause, if present, and the :keyword:`!except` clause's " +"suite is executed. All :keyword:`!except` clauses must have an executable " +"block. When the end of this block is reached, execution continues normally " +"after the entire :keyword:`try` statement. (This means that if two nested " +"handlers exist for the same exception, and the exception occurs in the :" +"keyword:`!try` clause of the inner handler, the outer handler will not " "handle the exception.)" msgstr "" @@ -364,15 +363,15 @@ msgstr ":keyword:`!except*` 子句" #: ../../reference/compound_stmts.rst:338 msgid "" -"The :keyword:`!except*` clause(s) are used for " -"handling :exc:`ExceptionGroup`\\s. The exception type for matching is " -"interpreted as in the case of :keyword:`except`, but in the case of " -"exception groups we can have partial matches when the type matches some of " -"the exceptions in the group. This means that multiple :keyword:`!except*` " -"clauses can execute, each handling part of the exception group. Each clause " -"executes at most once and handles an exception group of all matching " -"exceptions. Each exception in the group is handled by at most " -"one :keyword:`!except*` clause, the first that matches it. ::" +"The :keyword:`!except*` clause(s) are used for handling :exc:" +"`ExceptionGroup`\\s. The exception type for matching is interpreted as in " +"the case of :keyword:`except`, but in the case of exception groups we can " +"have partial matches when the type matches some of the exceptions in the " +"group. This means that multiple :keyword:`!except*` clauses can execute, " +"each handling part of the exception group. Each clause executes at most once " +"and handles an exception group of all matching exceptions. Each exception " +"in the group is handled by at most one :keyword:`!except*` clause, the first " +"that matches it. ::" msgstr "" #: ../../reference/compound_stmts.rst:348 @@ -436,8 +435,8 @@ msgstr "" #: ../../reference/compound_stmts.rst:387 msgid "" "It is not possible to mix :keyword:`except` and :keyword:`!except*` in the " -"same :keyword:`try`. :keyword:`break`, :keyword:`continue` " -"and :keyword:`return` cannot appear in an :keyword:`!except*` clause." +"same :keyword:`try`. The :keyword:`break`, :keyword:`continue`, and :keyword:" +"`return` statements cannot appear in an :keyword:`!except*` clause." msgstr "" #: ../../reference/compound_stmts.rst:402 @@ -447,10 +446,10 @@ msgstr ":keyword:`!else` 子句" #: ../../reference/compound_stmts.rst:404 msgid "" "The optional :keyword:`!else` clause is executed if the control flow leaves " -"the :keyword:`try` suite, no exception was raised, and " -"no :keyword:`return`, :keyword:`continue`, or :keyword:`break` statement was " -"executed. Exceptions in the :keyword:`!else` clause are not handled by the " -"preceding :keyword:`except` clauses." +"the :keyword:`try` suite, no exception was raised, and no :keyword:" +"`return`, :keyword:`continue`, or :keyword:`break` statement was executed. " +"Exceptions in the :keyword:`!else` clause are not handled by the preceding :" +"keyword:`except` clauses." msgstr "" #: ../../reference/compound_stmts.rst:416 @@ -459,17 +458,16 @@ msgstr ":keyword:`!finally` 子句" #: ../../reference/compound_stmts.rst:418 msgid "" -"If :keyword:`!finally` is present, it specifies a 'cleanup' handler. " -"The :keyword:`try` clause is executed, including any :keyword:`except` " -"and :keyword:`else ` clauses. If an exception occurs in any of " -"the clauses and is not handled, the exception is temporarily saved. " -"The :keyword:`!finally` clause is executed. If there is a saved exception " -"it is re-raised at the end of the :keyword:`!finally` clause. If " -"the :keyword:`!finally` clause raises another exception, the saved exception " -"is set as the context of the new exception. If the :keyword:`!finally` " -"clause executes a :keyword:`return`, :keyword:`break` or :keyword:`continue` " -"statement, the saved exception is discarded. For example, this function " -"returns 42." +"If :keyword:`!finally` is present, it specifies a 'cleanup' handler. The :" +"keyword:`try` clause is executed, including any :keyword:`except` and :" +"keyword:`else ` clauses. If an exception occurs in any of the " +"clauses and is not handled, the exception is temporarily saved. The :keyword:" +"`!finally` clause is executed. If there is a saved exception it is re-" +"raised at the end of the :keyword:`!finally` clause. If the :keyword:`!" +"finally` clause raises another exception, the saved exception is set as the " +"context of the new exception. If the :keyword:`!finally` clause executes a :" +"keyword:`return`, :keyword:`break` or :keyword:`continue` statement, the " +"saved exception is discarded. For example, this function returns 42." msgstr "" #: ../../reference/compound_stmts.rst:431 @@ -525,15 +523,15 @@ msgstr "" #: ../../reference/compound_stmts.rst:464 msgid "" -"Prior to Python 3.8, a :keyword:`continue` statement was illegal in " -"the :keyword:`!finally` clause due to a problem with the implementation." +"Prior to Python 3.8, a :keyword:`continue` statement was illegal in the :" +"keyword:`!finally` clause due to a problem with the implementation." msgstr "" #: ../../reference/compound_stmts.rst:468 msgid "" -"The compiler emits a :exc:`SyntaxWarning` when " -"a :keyword:`return`, :keyword:`break` or :keyword:`continue` appears in " -"a :keyword:`!finally` block (see :pep:`765`)." +"The compiler emits a :exc:`SyntaxWarning` when a :keyword:`return`, :keyword:" +"`break` or :keyword:`continue` appears in a :keyword:`!finally` block (see :" +"pep:`765`)." msgstr "" #: ../../reference/compound_stmts.rst:478 @@ -544,8 +542,8 @@ msgstr ":keyword:`!with` 陳述式" msgid "" "The :keyword:`with` statement is used to wrap the execution of a block with " "methods defined by a context manager (see section :ref:`context-managers`). " -"This allows common :keyword:`try`...\\ :keyword:`except`..." -"\\ :keyword:`finally` usage patterns to be encapsulated for convenient reuse." +"This allows common :keyword:`try`...\\ :keyword:`except`...\\ :keyword:" +"`finally` usage patterns to be encapsulated for convenient reuse." msgstr "" #: ../../reference/compound_stmts.rst:497 @@ -556,8 +554,8 @@ msgstr "" #: ../../reference/compound_stmts.rst:499 msgid "" -"The context expression (the expression given in the :token:`~python-" -"grammar:with_item`) is evaluated to obtain a context manager." +"The context expression (the expression given in the :token:`~python-grammar:" +"with_item`) is evaluated to obtain a context manager." msgstr "" #: ../../reference/compound_stmts.rst:502 @@ -581,11 +579,11 @@ msgstr "" #: ../../reference/compound_stmts.rst:513 msgid "" -"The :keyword:`with` statement guarantees that if " -"the :meth:`~object.__enter__` method returns without an error, " -"then :meth:`~object.__exit__` will always be called. Thus, if an error " -"occurs during the assignment to the target list, it will be treated the same " -"as an error occurring within the suite would be. See step 7 below." +"The :keyword:`with` statement guarantees that if the :meth:`~object." +"__enter__` method returns without an error, then :meth:`~object.__exit__` " +"will always be called. Thus, if an error occurs during the assignment to the " +"target list, it will be treated the same as an error occurring within the " +"suite would be. See step 7 below." msgstr "" #: ../../reference/compound_stmts.rst:519 @@ -596,16 +594,16 @@ msgstr "" msgid "" "The context manager's :meth:`~object.__exit__` method is invoked. If an " "exception caused the suite to be exited, its type, value, and traceback are " -"passed as arguments to :meth:`~object.__exit__`. Otherwise, " -"three :const:`None` arguments are supplied." +"passed as arguments to :meth:`~object.__exit__`. Otherwise, three :const:" +"`None` arguments are supplied." msgstr "" #: ../../reference/compound_stmts.rst:526 msgid "" -"If the suite was exited due to an exception, and the return value from " -"the :meth:`~object.__exit__` method was false, the exception is reraised. " -"If the return value was true, the exception is suppressed, and execution " -"continues with the statement following the :keyword:`with` statement." +"If the suite was exited due to an exception, and the return value from the :" +"meth:`~object.__exit__` method was false, the exception is reraised. If the " +"return value was true, the exception is suppressed, and execution continues " +"with the statement following the :keyword:`with` statement." msgstr "" #: ../../reference/compound_stmts.rst:531 @@ -673,8 +671,8 @@ msgstr "" #: ../../reference/compound_stmts.rst:559 msgid "" -"With more than one item, the context managers are processed as if " -"multiple :keyword:`with` statements were nested::" +"With more than one item, the context managers are processed as if multiple :" +"keyword:`with` statements were nested::" msgstr "" #: ../../reference/compound_stmts.rst:562 @@ -1053,8 +1051,8 @@ msgstr "" #: ../../reference/compound_stmts.rst:855 msgid "" -"The rule ``strings`` and the token ``NUMBER`` are defined in " -"the :doc:`standard Python grammar <./grammar>`. Triple-quoted strings are " +"The rule ``strings`` and the token ``NUMBER`` are defined in the :doc:" +"`standard Python grammar <./grammar>`. Triple-quoted strings are " "supported. Raw strings and byte strings are supported. :ref:`f-strings` " "and :ref:`t-strings` are not supported." msgstr "" @@ -1084,8 +1082,8 @@ msgstr "" #: ../../reference/compound_stmts.rst:878 msgid "" "A single underscore ``_`` is not a capture pattern (this is what ``!'_'`` " -"expresses). It is instead treated as a :token:`~python-" -"grammar:wildcard_pattern`." +"expresses). It is instead treated as a :token:`~python-grammar:" +"wildcard_pattern`." msgstr "" #: ../../reference/compound_stmts.rst:882 @@ -1146,8 +1144,8 @@ msgstr "" #: ../../reference/compound_stmts.rst:927 msgid "" -"In simple terms ``NAME1.NAME2`` will succeed only if `` == " -"NAME1.NAME2``" +"In simple terms ``NAME1.NAME2`` will succeed only if `` == NAME1." +"NAME2``" msgstr "" #: ../../reference/compound_stmts.rst:931 @@ -1407,14 +1405,14 @@ msgstr "" #: ../../reference/compound_stmts.rst:1103 msgid "" -"If ``name_or_attr`` is not an instance of the builtin :class:`type` , " -"raise :exc:`TypeError`." +"If ``name_or_attr`` is not an instance of the builtin :class:`type` , raise :" +"exc:`TypeError`." msgstr "" #: ../../reference/compound_stmts.rst:1106 msgid "" -"If the subject value is not an instance of ``name_or_attr`` (tested " -"via :func:`isinstance`), the class pattern fails." +"If the subject value is not an instance of ``name_or_attr`` (tested via :" +"func:`isinstance`), the class pattern fails." msgstr "" #: ../../reference/compound_stmts.rst:1109 @@ -1480,14 +1478,14 @@ msgstr "" #: ../../reference/compound_stmts.rst:1142 msgid "" -"If the returned value is not a tuple, the conversion fails " -"and :exc:`TypeError` is raised." +"If the returned value is not a tuple, the conversion fails and :exc:" +"`TypeError` is raised." msgstr "" #: ../../reference/compound_stmts.rst:1145 msgid "" -"If there are more positional patterns than " -"``len(cls.__match_args__)``, :exc:`TypeError` is raised." +"If there are more positional patterns than ``len(cls.__match_args__)``, :exc:" +"`TypeError` is raised." msgstr "" #: ../../reference/compound_stmts.rst:1148 @@ -1608,8 +1606,8 @@ msgstr "函式定義" #: ../../reference/compound_stmts.rst:1217 msgid "" -"A function definition defines a user-defined function object (see " -"section :ref:`types`):" +"A function definition defines a user-defined function object (see section :" +"ref:`types`):" msgstr "" #: ../../reference/compound_stmts.rst:1239 @@ -1669,9 +1667,9 @@ msgstr "" #: ../../reference/compound_stmts.rst:1269 msgid "" -"Functions may be decorated with any valid :token:`~python-" -"grammar:assignment_expression`. Previously, the grammar was much more " -"restrictive; see :pep:`614` for details." +"Functions may be decorated with any valid :token:`~python-grammar:" +"assignment_expression`. Previously, the grammar was much more restrictive; " +"see :pep:`614` for details." msgstr "" #: ../../reference/compound_stmts.rst:1274 @@ -1721,21 +1719,26 @@ msgid "" " penguin.append(\"property of the zoo\")\n" " return penguin" msgstr "" +"def whats_on_the_telly(penguin=None):\n" +" if penguin is None:\n" +" penguin = []\n" +" penguin.append(\"property of the zoo\")\n" +" return penguin" #: ../../reference/compound_stmts.rst:1318 msgid "" -"Function call semantics are described in more detail in " -"section :ref:`calls`. A function call always assigns values to all " -"parameters mentioned in the parameter list, either from positional " -"arguments, from keyword arguments, or from default values. If the form " -"\"``*identifier``\" is present, it is initialized to a tuple receiving any " -"excess positional parameters, defaulting to the empty tuple. If the form " -"\"``**identifier``\" is present, it is initialized to a new ordered mapping " -"receiving any excess keyword arguments, defaulting to a new empty mapping of " -"the same type. Parameters after \"``*``\" or \"``*identifier``\" are " -"keyword-only parameters and may only be passed by keyword arguments. " -"Parameters before \"``/``\" are positional-only parameters and may only be " -"passed by positional arguments." +"Function call semantics are described in more detail in section :ref:" +"`calls`. A function call always assigns values to all parameters mentioned " +"in the parameter list, either from positional arguments, from keyword " +"arguments, or from default values. If the form \"``*identifier``\" is " +"present, it is initialized to a tuple receiving any excess positional " +"parameters, defaulting to the empty tuple. If the form \"``**identifier``\" " +"is present, it is initialized to a new ordered mapping receiving any excess " +"keyword arguments, defaulting to a new empty mapping of the same type. " +"Parameters after \"``*``\" or \"``*identifier``\" are keyword-only " +"parameters and may only be passed by keyword arguments. Parameters before " +"\"``/``\" are positional-only parameters and may only be passed by " +"positional arguments." msgstr "" #: ../../reference/compound_stmts.rst:1330 @@ -1770,8 +1773,8 @@ msgid "" "described in section :ref:`lambda`. Note that the lambda expression is " "merely a shorthand for a simplified function definition; a function defined " "in a \":keyword:`def`\" statement can be passed around or assigned to " -"another name just like a function defined by a lambda expression. The " -"\":keyword:`!def`\" form is actually more powerful since it allows the " +"another name just like a function defined by a lambda expression. The \":" +"keyword:`!def`\" form is actually more powerful since it allows the " "execution of multiple statements and annotations." msgstr "" @@ -1869,14 +1872,14 @@ msgstr "" #: ../../reference/compound_stmts.rst:1426 msgid "" -"The class's suite is then executed in a new execution frame " -"(see :ref:`naming`), using a newly created local namespace and the original " -"global namespace. (Usually, the suite contains mostly function " -"definitions.) When the class's suite finishes execution, its execution " -"frame is discarded but its local namespace is saved. [#]_ A class object is " -"then created using the inheritance list for the base classes and the saved " -"local namespace for the attribute dictionary. The class name is bound to " -"this class object in the original local namespace." +"The class's suite is then executed in a new execution frame (see :ref:" +"`naming`), using a newly created local namespace and the original global " +"namespace. (Usually, the suite contains mostly function definitions.) When " +"the class's suite finishes execution, its execution frame is discarded but " +"its local namespace is saved. [#]_ A class object is then created using the " +"inheritance list for the base classes and the saved local namespace for the " +"attribute dictionary. The class name is bound to this class object in the " +"original local namespace." msgstr "" #: ../../reference/compound_stmts.rst:1435 @@ -1923,9 +1926,9 @@ msgstr "" #: ../../reference/compound_stmts.rst:1459 msgid "" -"Classes may be decorated with any valid :token:`~python-" -"grammar:assignment_expression`. Previously, the grammar was much more " -"restrictive; see :pep:`614` for details." +"Classes may be decorated with any valid :token:`~python-grammar:" +"assignment_expression`. Previously, the grammar was much more restrictive; " +"see :pep:`614` for details." msgstr "" #: ../../reference/compound_stmts.rst:1464 @@ -1933,8 +1936,8 @@ msgid "" "A list of :ref:`type parameters ` may be given in square " "brackets immediately after the class's name. This indicates to static type " "checkers that the class is generic. At runtime, the type parameters can be " -"retrieved from the class's :attr:`~type.__type_params__` attribute. " -"See :ref:`generic-classes` for more." +"retrieved from the class's :attr:`~type.__type_params__` attribute. See :ref:" +"`generic-classes` for more." msgstr "" #: ../../reference/compound_stmts.rst:1473 @@ -2178,9 +2181,9 @@ msgstr "" #: ../../reference/compound_stmts.rst:1648 msgid "" -":ref:`Functions ` (including :ref:`coroutines `), :ref:`classes ` and :ref:`type aliases ` may contain a " -"type parameter list::" +":ref:`Functions ` (including :ref:`coroutines `), :ref:" +"`classes ` and :ref:`type aliases ` may contain a type " +"parameter list::" msgstr "" #: ../../reference/compound_stmts.rst:1652 @@ -2237,9 +2240,8 @@ msgstr "" #: ../../reference/compound_stmts.rst:1681 msgid "" -"Generic functions, classes, and type aliases have " -"a :attr:`~definition.__type_params__` attribute listing their type " -"parameters." +"Generic functions, classes, and type aliases have a :attr:`~definition." +"__type_params__` attribute listing their type parameters." msgstr "" #: ../../reference/compound_stmts.rst:1684 @@ -2382,8 +2384,8 @@ msgid "" "Here ``annotation-def`` indicates an :ref:`annotation scope `, which is not actually bound to any name at runtime. (One other " "liberty is taken in the translation: the syntax does not go through " -"attribute access on the :mod:`typing` module, but creates an instance " -"of :data:`typing.TypeVar` directly.)" +"attribute access on the :mod:`typing` module, but creates an instance of :" +"data:`typing.TypeVar` directly.)" msgstr "" #: ../../reference/compound_stmts.rst:1763 @@ -2411,8 +2413,8 @@ msgstr "" #: ../../reference/compound_stmts.rst:1774 msgid "" -"Except for the :ref:`lazy evaluation ` of " -"the :class:`~typing.TypeVar` bound, this is equivalent to::" +"Except for the :ref:`lazy evaluation ` of the :class:" +"`~typing.TypeVar` bound, this is equivalent to::" msgstr "" #: ../../reference/compound_stmts.rst:1777 @@ -2475,9 +2477,9 @@ msgstr "" #: ../../reference/compound_stmts.rst:1818 msgid "" -"Here again ``annotation-def`` (not a real keyword) indicates " -"an :ref:`annotation scope `, and the name " -"``TYPE_PARAMS_OF_Bag`` is not actually bound at runtime." +"Here again ``annotation-def`` (not a real keyword) indicates an :ref:" +"`annotation scope `, and the name ``TYPE_PARAMS_OF_Bag`` " +"is not actually bound at runtime." msgstr "" #: ../../reference/compound_stmts.rst:1822 @@ -2595,8 +2597,8 @@ msgid "" "this is not enforced by the language, and in general annotations may contain " "arbitrary expressions. The presence of annotations does not change the " "runtime semantics of the code, except if some mechanism is used that " -"introspects and uses the annotations (such as :mod:`dataclasses` " -"or :func:`functools.singledispatch`)." +"introspects and uses the annotations (such as :mod:`dataclasses` or :func:" +"`functools.singledispatch`)." msgstr "" #: ../../reference/compound_stmts.rst:1890 @@ -2630,9 +2632,9 @@ msgstr "" msgid "" "This future statement will be deprecated and removed in a future version of " "Python, but not before Python 3.13 reaches its end of life (see :pep:`749`). " -"When it is used, introspection tools " -"like :func:`annotationlib.get_annotations` and :func:`typing.get_type_hints` " -"are less likely to be able to resolve annotations at runtime." +"When it is used, introspection tools like :func:`annotationlib." +"get_annotations` and :func:`typing.get_type_hints` are less likely to be " +"able to resolve annotations at runtime." msgstr "" #: ../../reference/compound_stmts.rst:1911 @@ -2641,9 +2643,9 @@ msgstr "註解" #: ../../reference/compound_stmts.rst:1912 msgid "" -"The exception is propagated to the invocation stack unless there is " -"a :keyword:`finally` clause which happens to raise another exception. That " -"new exception causes the old one to be lost." +"The exception is propagated to the invocation stack unless there is a :" +"keyword:`finally` clause which happens to raise another exception. That new " +"exception causes the old one to be lost." msgstr "" #: ../../reference/compound_stmts.rst:1916 @@ -2715,8 +2717,8 @@ msgstr "" #: ../../reference/compound_stmts.rst:1942 msgid "" -"The standard library classes :class:`dict` " -"and :class:`types.MappingProxyType` are mappings." +"The standard library classes :class:`dict` and :class:`types." +"MappingProxyType` are mappings." msgstr "" #: ../../reference/compound_stmts.rst:1945 diff --git a/reference/datamodel.po b/reference/datamodel.po index 0097c0fda5..2d2bbd0293 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-10 20:44+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2024-09-24 19:03+0900\n" "Last-Translator: Kisaragi Hiu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -66,8 +66,8 @@ msgid "" msgstr "" "一個物件的型別決定了該物件所支援的操作(例如「它有長度嗎?」),也同時定義該" "型別的物件能夠擁有的數值。:func:`type` 函式會回傳一個物件的型別(而該型別本身" -"也是一個物件)。如同它的識別性,一個物件的型別 (:dfn:`type`) 也是不可變的。" -"\\ [#]_" +"也是一個物件)。如同它的識別性,一個物件的型別 (:dfn:`type`) 也是不可變" +"的。\\ [#]_" #: ../../reference/datamodel.rst:50 msgid "" @@ -137,9 +137,9 @@ msgid "" "is garbage-collected, but since garbage collection is not guaranteed to " "happen, such objects also provide an explicit way to release the external " "resource, usually a :meth:`!close` method. Programs are strongly recommended " -"to explicitly close such objects. The :keyword:`try`..." -"\\ :keyword:`finally` statement and the :keyword:`with` statement provide " -"convenient ways to do this." +"to explicitly close such objects. The :keyword:`try`...\\ :keyword:" +"`finally` statement and the :keyword:`with` statement provide convenient " +"ways to do this." msgstr "" "某些物件包含對於「外部」資源的參照,像是開啟的檔案或是視窗。基本上這些資源會" "在物件被回收時釋放,但因為垃圾回收不保證會發生,這種物件也會提供明確釋放外部" @@ -241,10 +241,10 @@ msgid "" "will then try the reflected operation, or some other fallback, depending on " "the operator.) It should not be evaluated in a boolean context." msgstr "" -"這個型別只有一個數值。只有一個物件有這個數值。這個物件由內建名" -"稱 :data:`NotImplemented` 存取。數字方法和 rich comparison 方法應該在沒有為所" -"提供的運算元實作該操作的時候回傳這個數值。(直譯器接下來則會依運算子嘗試反轉" -"的操作或是其他的後備方案。)它不應該在預期布林值的情境中被計算。" +"這個型別只有一個數值。只有一個物件有這個數值。這個物件由內建名稱 :data:" +"`NotImplemented` 存取。數字方法和 rich comparison 方法應該在沒有為所提供的運" +"算元實作該操作的時候回傳這個數值。(直譯器接下來則會依運算子嘗試反轉的操作或" +"是其他的後備方案。)它不應該在預期布林值的情境中被計算。" #: ../../reference/datamodel.rst:172 msgid "See :ref:`implementing-the-arithmetic-operations` for more details." @@ -256,13 +256,13 @@ msgstr "" #: ../../reference/datamodel.rst:179 msgid "" -"Evaluating :data:`NotImplemented` in a boolean context now raises " -"a :exc:`TypeError`. It previously evaluated to :const:`True` and emitted " -"a :exc:`DeprecationWarning` since Python 3.9." +"Evaluating :data:`NotImplemented` in a boolean context now raises a :exc:" +"`TypeError`. It previously evaluated to :const:`True` and emitted a :exc:" +"`DeprecationWarning` since Python 3.9." msgstr "" "在預期布林值的情境中計算 :data:`NotImplemented` 現在會引發 :exc:`TypeError`。" -"它先前會計算為 :const:`True`,並自 Python 3.9 起會發" -"出 :exc:`DeprecationWarning`。" +"它先前會計算為 :const:`True`,並自 Python 3.9 起會發出 :exc:" +"`DeprecationWarning`。" #: ../../reference/datamodel.rst:186 ../../reference/datamodel.rst:187 msgid "Ellipsis" @@ -292,8 +292,8 @@ msgstr "" #: ../../reference/datamodel.rst:207 msgid "" -"The string representations of the numeric classes, computed " -"by :meth:`~object.__repr__` and :meth:`~object.__str__`, have the following " +"The string representations of the numeric classes, computed by :meth:" +"`~object.__repr__` and :meth:`~object.__str__`, have the following " "properties:" msgstr "" @@ -467,9 +467,9 @@ msgid "" "The built-in function :func:`ord` converts a code point from its string form " "to an integer in the range ``0 - 10FFFF``; :func:`chr` converts an integer " "in the range ``0 - 10FFFF`` to the corresponding length ``1`` string " -"object. :meth:`str.encode` can be used to convert a :class:`str` " -"to :class:`bytes` using the given text encoding, and :meth:`bytes.decode` " -"can be used to achieve the opposite." +"object. :meth:`str.encode` can be used to convert a :class:`str` to :class:" +"`bytes` using the given text encoding, and :meth:`bytes.decode` can be used " +"to achieve the opposite." msgstr "" #: ../../reference/datamodel.rst:367 @@ -495,8 +495,8 @@ msgid "" "A bytes object is an immutable array. The items are 8-bit bytes, " "represented by integers in the range 0 <= x < 256. Bytes literals (like " "``b'abc'``) and the built-in :func:`bytes` constructor can be used to create " -"bytes objects. Also, bytes objects can be decoded to strings via " -"the :meth:`~bytes.decode` method." +"bytes objects. Also, bytes objects can be decoded to strings via the :meth:" +"`~bytes.decode` method." msgstr "" #: ../../reference/datamodel.rst:391 @@ -506,8 +506,8 @@ msgstr "可變序列" #: ../../reference/datamodel.rst:400 msgid "" "Mutable sequences can be changed after they are created. The subscription " -"and slicing notations can be used as the target of assignment " -"and :keyword:`del` (delete) statements." +"and slicing notations can be used as the target of assignment and :keyword:" +"`del` (delete) statements." msgstr "" #: ../../reference/datamodel.rst:408 @@ -537,8 +537,8 @@ msgstr "位元組陣列" #: ../../reference/datamodel.rst:423 msgid "" -"A bytearray object is a mutable array. They are created by the built-" -"in :func:`bytearray` constructor. Aside from being mutable (and hence " +"A bytearray object is a mutable array. They are created by the built-in :" +"func:`bytearray` constructor. Aside from being mutable (and hence " "unhashable), byte arrays otherwise provide the same interface and " "functionality as immutable :class:`bytes` objects." msgstr "" @@ -576,8 +576,8 @@ msgstr "Set(集合)" #: ../../reference/datamodel.rst:454 msgid "" "These represent a mutable set. They are created by the built-in :func:`set` " -"constructor and can be modified afterwards by several methods, such " -"as :meth:`add `." +"constructor and can be modified afterwards by several methods, such as :meth:" +"`add `." msgstr "" #: ../../reference/datamodel.rst:459 @@ -586,10 +586,9 @@ msgstr "Frozen set(凍結集合)" #: ../../reference/datamodel.rst:462 msgid "" -"These represent an immutable set. They are created by the built-" -"in :func:`frozenset` constructor. As a frozenset is immutable " -"and :term:`hashable`, it can be used again as an element of another set, or " -"as a dictionary key." +"These represent an immutable set. They are created by the built-in :func:" +"`frozenset` constructor. As a frozenset is immutable and :term:`hashable`, " +"it can be used again as an element of another set, or as a dictionary key." msgstr "" #: ../../reference/datamodel.rst:469 @@ -658,8 +657,8 @@ msgstr "可呼叫型別" #: ../../reference/datamodel.rst:530 msgid "" -"These are the types to which the function call operation (see " -"section :ref:`calls`) can be applied:" +"These are the types to which the function call operation (see section :ref:" +"`calls`) can be applied:" msgstr "" #: ../../reference/datamodel.rst:537 @@ -690,9 +689,9 @@ msgstr "含義" #: ../../reference/datamodel.rst:564 msgid "" -"A reference to the :class:`dictionary ` that holds the " -"function's :ref:`global variables ` -- the global namespace of the " -"module in which the function was defined." +"A reference to the :class:`dictionary ` that holds the function's :ref:" +"`global variables ` -- the global namespace of the module in which " +"the function was defined." msgstr "" #: ../../reference/datamodel.rst:569 @@ -722,8 +721,8 @@ msgstr "函式的文件字串,若不可用則為 ``None``。" #: ../../reference/datamodel.rst:603 msgid "" -"The function's name. See also: :attr:`__name__ attributes " -"`." +"The function's name. See also: :attr:`__name__ attributes `." msgstr "" #: ../../reference/datamodel.rst:607 @@ -753,23 +752,23 @@ msgstr "代表編譯函式主體的\\ :ref:`程式碼物件 `。" #: ../../reference/datamodel.rst:626 msgid "" -"The namespace supporting arbitrary function attributes. See " -"also: :attr:`__dict__ attributes `." +"The namespace supporting arbitrary function attributes. See also: :attr:" +"`__dict__ attributes `." msgstr "" #: ../../reference/datamodel.rst:630 msgid "" "A :class:`dictionary ` containing annotations of :term:`parameters " "`. The keys of the dictionary are the parameter names, and " -"``'return'`` for the return annotation, if provided. See " -"also: :attr:`object.__annotations__`." +"``'return'`` for the return annotation, if provided. See also: :attr:`object." +"__annotations__`." msgstr "" #: ../../reference/datamodel.rst:636 ../../reference/datamodel.rst:1105 #: ../../reference/datamodel.rst:1249 msgid "" -"Annotations are now :ref:`lazily evaluated `. " -"See :pep:`649`." +"Annotations are now :ref:`lazily evaluated `. See :pep:" +"`649`." msgstr "" #: ../../reference/datamodel.rst:641 @@ -780,14 +779,14 @@ msgstr "" #: ../../reference/datamodel.rst:647 msgid "" -"A :class:`dictionary ` containing defaults for keyword-" -"only :term:`parameters `." +"A :class:`dictionary ` containing defaults for keyword-only :term:" +"`parameters `." msgstr "" #: ../../reference/datamodel.rst:651 msgid "" -"A :class:`tuple` containing the :ref:`type parameters ` of " -"a :ref:`generic function `." +"A :class:`tuple` containing the :ref:`type parameters ` of a :" +"ref:`generic function `." msgstr "" #: ../../reference/datamodel.rst:656 @@ -807,8 +806,8 @@ msgstr "" #: ../../reference/datamodel.rst:667 msgid "" "Additional information about a function's definition can be retrieved from " -"its :ref:`code object ` (accessible via " -"the :attr:`~function.__code__` attribute)." +"its :ref:`code object ` (accessible via the :attr:`~function." +"__code__` attribute)." msgstr "" #: ../../reference/datamodel.rst:675 @@ -837,15 +836,15 @@ msgstr "" #: ../../reference/datamodel.rst:704 msgid "" -"The method's documentation (same as :attr:`method.__func__.__doc__ " -"`). A :class:`string ` if the original function had a " +"The method's documentation (same as :attr:`method.__func__.__doc__ `). A :class:`string ` if the original function had a " "docstring, else ``None``." msgstr "" #: ../../reference/datamodel.rst:710 msgid "" -"The name of the method (same as :attr:`method.__func__.__name__ " -"`)" +"The name of the method (same as :attr:`method.__func__.__name__ `)" msgstr "" #: ../../reference/datamodel.rst:714 @@ -863,44 +862,43 @@ msgstr "" msgid "" "User-defined method objects may be created when getting an attribute of a " "class (perhaps via an instance of that class), if that attribute is a user-" -"defined :ref:`function object ` or " -"a :class:`classmethod` object." +"defined :ref:`function object ` or a :class:" +"`classmethod` object." msgstr "" #: ../../reference/datamodel.rst:727 msgid "" -"When an instance method object is created by retrieving a user-" -"defined :ref:`function object ` from a class via one of " -"its instances, its :attr:`~method.__self__` attribute is the instance, and " -"the method object is said to be *bound*. The new " -"method's :attr:`~method.__func__` attribute is the original function object." +"When an instance method object is created by retrieving a user-defined :ref:" +"`function object ` from a class via one of its " +"instances, its :attr:`~method.__self__` attribute is the instance, and the " +"method object is said to be *bound*. The new method's :attr:`~method." +"__func__` attribute is the original function object." msgstr "" #: ../../reference/datamodel.rst:733 msgid "" -"When an instance method object is created by retrieving " -"a :class:`classmethod` object from a class or instance, " -"its :attr:`~method.__self__` attribute is the class itself, and " -"its :attr:`~method.__func__` attribute is the function object underlying the " -"class method." +"When an instance method object is created by retrieving a :class:" +"`classmethod` object from a class or instance, its :attr:`~method.__self__` " +"attribute is the class itself, and its :attr:`~method.__func__` attribute is " +"the function object underlying the class method." msgstr "" #: ../../reference/datamodel.rst:738 msgid "" -"When an instance method object is called, the underlying function " -"(:attr:`~method.__func__`) is called, inserting the class instance " -"(:attr:`~method.__self__`) in front of the argument list. For instance, " -"when :class:`!C` is a class which contains a definition for a " -"function :meth:`!f`, and ``x`` is an instance of :class:`!C`, calling " -"``x.f(1)`` is equivalent to calling ``C.f(x, 1)``." +"When an instance method object is called, the underlying function (:attr:" +"`~method.__func__`) is called, inserting the class instance (:attr:`~method." +"__self__`) in front of the argument list. For instance, when :class:`!C` is " +"a class which contains a definition for a function :meth:`!f`, and ``x`` is " +"an instance of :class:`!C`, calling ``x.f(1)`` is equivalent to calling ``C." +"f(x, 1)``." msgstr "" #: ../../reference/datamodel.rst:745 msgid "" "When an instance method object is derived from a :class:`classmethod` " "object, the \"class instance\" stored in :attr:`~method.__self__` will " -"actually be the class itself, so that calling either ``x.f(1)`` or " -"``C.f(1)`` is equivalent to calling ``f(C,1)`` where ``f`` is the underlying " +"actually be the class itself, so that calling either ``x.f(1)`` or ``C." +"f(1)`` is equivalent to calling ``f(C,1)`` where ``f`` is the underlying " "function." msgstr "" @@ -917,15 +915,15 @@ msgstr "產生器函式" #: ../../reference/datamodel.rst:763 msgid "" -"A function or method which uses the :keyword:`yield` statement (see " -"section :ref:`yield`) is called a :dfn:`generator function`. Such a " -"function, when called, always returns an :term:`iterator` object which can " -"be used to execute the body of the function: calling the " -"iterator's :meth:`iterator.__next__` method will cause the function to " -"execute until it provides a value using the :keyword:`!yield` statement. " -"When the function executes a :keyword:`return` statement or falls off the " -"end, a :exc:`StopIteration` exception is raised and the iterator will have " -"reached the end of the set of values to be returned." +"A function or method which uses the :keyword:`yield` statement (see section :" +"ref:`yield`) is called a :dfn:`generator function`. Such a function, when " +"called, always returns an :term:`iterator` object which can be used to " +"execute the body of the function: calling the iterator's :meth:`iterator." +"__next__` method will cause the function to execute until it provides a " +"value using the :keyword:`!yield` statement. When the function executes a :" +"keyword:`return` statement or falls off the end, a :exc:`StopIteration` " +"exception is raised and the iterator will have reached the end of the set of " +"values to be returned." msgstr "" #: ../../reference/datamodel.rst:775 @@ -935,10 +933,10 @@ msgstr "Coroutine(協程)函式" #: ../../reference/datamodel.rst:780 msgid "" "A function or method which is defined using :keyword:`async def` is called " -"a :dfn:`coroutine function`. Such a function, when called, returns " -"a :term:`coroutine` object. It may contain :keyword:`await` expressions, as " -"well as :keyword:`async with` and :keyword:`async for` statements. See also " -"the :ref:`coroutine-objects` section." +"a :dfn:`coroutine function`. Such a function, when called, returns a :term:" +"`coroutine` object. It may contain :keyword:`await` expressions, as well " +"as :keyword:`async with` and :keyword:`async for` statements. See also the :" +"ref:`coroutine-objects` section." msgstr "" #: ../../reference/datamodel.rst:788 @@ -956,13 +954,13 @@ msgstr "" #: ../../reference/datamodel.rst:800 msgid "" -"Calling the asynchronous iterator's :meth:`aiterator.__anext__ " -"` method will return an :term:`awaitable` which when " -"awaited will execute until it provides a value using the :keyword:`yield` " -"expression. When the function executes an empty :keyword:`return` statement " -"or falls off the end, a :exc:`StopAsyncIteration` exception is raised and " -"the asynchronous iterator will have reached the end of the set of values to " -"be yielded." +"Calling the asynchronous iterator's :meth:`aiterator.__anext__ ` method will return an :term:`awaitable` which when awaited will " +"execute until it provides a value using the :keyword:`yield` expression. " +"When the function executes an empty :keyword:`return` statement or falls off " +"the end, a :exc:`StopAsyncIteration` exception is raised and the " +"asynchronous iterator will have reached the end of the set of values to be " +"yielded." msgstr "" #: ../../reference/datamodel.rst:813 @@ -976,17 +974,17 @@ msgid "" "standard built-in module). The number and type of the arguments are " "determined by the C function. Special read-only attributes:" msgstr "" -"一個內建函式物件是一個 C 函式的 wrapper。內建函式的範例有 :func:`len` " -"和 :func:`math.sin`\\ (\\ :mod:`math` 是一個標準的內建模組)。內建函式的引數" -"數量與其型別由其包裝的 C 函式所決定。特殊唯讀屬性:" +"一個內建函式物件是一個 C 函式的 wrapper。內建函式的範例有 :func:`len` 和 :" +"func:`math.sin`\\ (\\ :mod:`math` 是一個標準的內建模組)。內建函式的引數數量" +"與其型別由其包裝的 C 函式所決定。特殊唯讀屬性:" #: ../../reference/datamodel.rst:825 msgid "" ":attr:`!__doc__` is the function's documentation string, or ``None`` if " "unavailable. See :attr:`function.__doc__`." msgstr "" -":attr:`!__doc__` 是函式的文件字串,若不可用則為 ``None``。請" -"見 :attr:`function.__doc__`。" +":attr:`!__doc__` 是函式的文件字串,若不可用則為 ``None``。請見 :attr:" +"`function.__doc__`。" #: ../../reference/datamodel.rst:827 msgid "" @@ -1012,10 +1010,10 @@ msgid "" "This is really a different disguise of a built-in function, this time " "containing an object passed to the C function as an implicit extra " "argument. An example of a built-in method is ``alist.append()``, assuming " -"*alist* is a list object. In this case, the special read-only " -"attribute :attr:`!__self__` is set to the object denoted by *alist*. (The " -"attribute has the same semantics as it does with :attr:`other instance " -"methods `.)" +"*alist* is a list object. In this case, the special read-only attribute :" +"attr:`!__self__` is set to the object denoted by *alist*. (The attribute has " +"the same semantics as it does with :attr:`other instance methods `.)" msgstr "" #: ../../reference/datamodel.rst:854 @@ -1026,8 +1024,8 @@ msgstr "" msgid "" "Classes are callable. These objects normally act as factories for new " "instances of themselves, but variations are possible for class types that " -"override :meth:`~object.__new__`. The arguments of the call are passed " -"to :meth:`!__new__` and, in the typical case, to :meth:`~object.__init__` to " +"override :meth:`~object.__new__`. The arguments of the call are passed to :" +"meth:`!__new__` and, in the typical case, to :meth:`~object.__init__` to " "initialize the new instance." msgstr "" @@ -1037,8 +1035,8 @@ msgstr "類別實例" #: ../../reference/datamodel.rst:866 msgid "" -"Instances of arbitrary classes can be made callable by defining " -"a :meth:`~object.__call__` method in their class." +"Instances of arbitrary classes can be made callable by defining a :meth:" +"`~object.__call__` method in their class." msgstr "" #: ../../reference/datamodel.rst:873 @@ -1048,16 +1046,16 @@ msgstr "模組" #: ../../reference/datamodel.rst:879 msgid "" "Modules are a basic organizational unit of Python code, and are created by " -"the :ref:`import system ` as invoked either by " -"the :keyword:`import` statement, or by calling functions such " -"as :func:`importlib.import_module` and built-in :func:`__import__`. A " -"module object has a namespace implemented by a :class:`dictionary ` " -"object (this is the dictionary referenced by " -"the :attr:`~function.__globals__` attribute of functions defined in the " -"module). Attribute references are translated to lookups in this dictionary, " -"e.g., ``m.x`` is equivalent to ``m.__dict__[\"x\"]``. A module object does " -"not contain the code object used to initialize the module (since it isn't " -"needed once the initialization is done)." +"the :ref:`import system ` as invoked either by the :keyword:" +"`import` statement, or by calling functions such as :func:`importlib." +"import_module` and built-in :func:`__import__`. A module object has a " +"namespace implemented by a :class:`dictionary ` object (this is the " +"dictionary referenced by the :attr:`~function.__globals__` attribute of " +"functions defined in the module). Attribute references are translated to " +"lookups in this dictionary, e.g., ``m.x`` is equivalent to ``m." +"__dict__[\"x\"]``. A module object does not contain the code object used to " +"initialize the module (since it isn't needed once the initialization is " +"done)." msgstr "" #: ../../reference/datamodel.rst:892 @@ -1111,6 +1109,15 @@ msgid "" ">>> typing.__name__, typing.__spec__.name\n" "('keyboard_smashing', 'spelling')" msgstr "" +">>> import typing\n" +">>> typing.__name__, typing.__spec__.name\n" +"('typing', 'typing')\n" +">>> typing.__spec__.name = 'spelling'\n" +">>> typing.__name__, typing.__spec__.name\n" +"('typing', 'spelling')\n" +">>> typing.__name__ = 'keyboard_smashing'\n" +">>> typing.__name__, typing.__spec__.name\n" +"('keyboard_smashing', 'spelling')" #: ../../reference/datamodel.rst:949 msgid "" @@ -1121,8 +1128,8 @@ msgstr "" #: ../../reference/datamodel.rst:952 msgid "" "This attribute must be set to the fully qualified name of the module. It is " -"expected to match the value of :attr:`module.__spec__.name " -"`." +"expected to match the value of :attr:`module.__spec__.name `." msgstr "" #: ../../reference/datamodel.rst:958 @@ -1143,9 +1150,9 @@ msgstr "" msgid "" "If the module is top-level (that is, not a part of any specific package) " "then the attribute should be set to ``''`` (the empty string). Otherwise, it " -"should be set to the name of the module's package (which can be equal " -"to :attr:`module.__name__` if the module itself is a package). " -"See :pep:`366` for further details." +"should be set to the name of the module's package (which can be equal to :" +"attr:`module.__name__` if the module itself is a package). See :pep:`366` " +"for further details." msgstr "" #: ../../reference/datamodel.rst:975 @@ -1160,9 +1167,9 @@ msgstr "" #: ../../reference/datamodel.rst:981 msgid "" "It is **strongly** recommended that you use :attr:`module.__spec__.parent " -"` instead of :attr:`!" -"module.__package__`. :attr:`__package__` is now only used as a fallback " -"if :attr:`!__spec__.parent` is not set, and this fallback path is deprecated." +"` instead of :attr:`!module." +"__package__`. :attr:`__package__` is now only used as a fallback if :attr:`!" +"__spec__.parent` is not set, and this fallback path is deprecated." msgstr "" #: ../../reference/datamodel.rst:987 ../../reference/datamodel.rst:1028 @@ -1174,18 +1181,17 @@ msgstr "" #: ../../reference/datamodel.rst:992 msgid "" -"The value of :attr:`!__package__` is expected to be the same " -"as :attr:`__spec__.parent " -"`. :attr:`__package__` is now only " -"used as a fallback during import resolution if :attr:`!__spec__.parent` is " -"not defined." +"The value of :attr:`!__package__` is expected to be the same as :attr:" +"`__spec__.parent `. :attr:" +"`__package__` is now only used as a fallback during import resolution if :" +"attr:`!__spec__.parent` is not defined." msgstr "" #: ../../reference/datamodel.rst:998 msgid "" ":exc:`ImportWarning` is raised if an import resolution falls back to :attr:`!" -"__package__` instead of :attr:`__spec__.parent " -"`." +"__package__` instead of :attr:`__spec__.parent `." msgstr "" #: ../../reference/datamodel.rst:1003 @@ -1215,16 +1221,16 @@ msgstr "" #: ../../reference/datamodel.rst:1019 msgid "" ":attr:`!__loader__` defaults to ``None`` for modules created dynamically " -"using the :class:`types.ModuleType` constructor; " -"use :func:`importlib.util.module_from_spec` instead to ensure the attribute " -"is set to a :term:`loader` object." +"using the :class:`types.ModuleType` constructor; use :func:`importlib.util." +"module_from_spec` instead to ensure the attribute is set to a :term:`loader` " +"object." msgstr "" #: ../../reference/datamodel.rst:1024 msgid "" "It is **strongly** recommended that you use :attr:`module.__spec__.loader " -"` instead of :attr:`!" -"module.__loader__`." +"` instead of :attr:`!module." +"__loader__`." msgstr "" #: ../../reference/datamodel.rst:1033 @@ -1248,10 +1254,9 @@ msgstr "" #: ../../reference/datamodel.rst:1046 msgid "" -"It is **strongly** recommended that you " -"use :attr:`module.__spec__.submodule_search_locations " -"` instead " -"of :attr:`!module.__path__`." +"It is **strongly** recommended that you use :attr:`module.__spec__." +"submodule_search_locations ` instead of :attr:`!module.__path__`." msgstr "" #: ../../reference/datamodel.rst:1053 @@ -1284,18 +1289,18 @@ msgstr "" #: ../../reference/datamodel.rst:1071 msgid "" "Note that :attr:`!__cached__` may be set even if :attr:`!__file__` is not " -"set. However, that scenario is quite atypical. Ultimately, " -"the :term:`loader` is what makes use of the module spec provided by " -"the :term:`finder` (from which :attr:`!__file__` and :attr:`!__cached__` are " -"derived). So if a loader can load from a cached module but otherwise does " -"not load from a file, that atypical scenario may be appropriate." +"set. However, that scenario is quite atypical. Ultimately, the :term:" +"`loader` is what makes use of the module spec provided by the :term:`finder` " +"(from which :attr:`!__file__` and :attr:`!__cached__` are derived). So if a " +"loader can load from a cached module but otherwise does not load from a " +"file, that atypical scenario may be appropriate." msgstr "" #: ../../reference/datamodel.rst:1078 msgid "" "It is **strongly** recommended that you use :attr:`module.__spec__.cached " -"` instead of :attr:`!" -"module.__cached__`." +"` instead of :attr:`!module." +"__cached__`." msgstr "" #: ../../reference/datamodel.rst:1082 @@ -1318,8 +1323,8 @@ msgstr "" #: ../../reference/datamodel.rst:1096 msgid "" -"The module's documentation string, or ``None`` if unavailable. See " -"also: :attr:`__doc__ attributes `." +"The module's documentation string, or ``None`` if unavailable. See also: :" +"attr:`__doc__ attributes `." msgstr "" "模組的文件字串,若不可用則為 ``None``。請見 :attr:`__doc__ attributes " "`。" @@ -1327,8 +1332,8 @@ msgstr "" #: ../../reference/datamodel.rst:1101 msgid "" "A dictionary containing :term:`variable annotations ` " -"collected during module body execution. For best practices on working " -"with :attr:`!__annotations__`, see :mod:`annotationlib`." +"collected during module body execution. For best practices on working with :" +"attr:`!__annotations__`, see :mod:`annotationlib`." msgstr "" #: ../../reference/datamodel.rst:1111 @@ -1366,25 +1371,25 @@ msgstr "" #: ../../reference/datamodel.rst:1141 msgid "" -"Custom class types are typically created by class definitions (see " -"section :ref:`class`). A class has a namespace implemented by a dictionary " -"object. Class attribute references are translated to lookups in this " -"dictionary, e.g., ``C.x`` is translated to ``C.__dict__[\"x\"]`` (although " -"there are a number of hooks which allow for other means of locating " -"attributes). When the attribute name is not found there, the attribute " -"search continues in the base classes. This search of the base classes uses " -"the C3 method resolution order which behaves correctly even in the presence " -"of 'diamond' inheritance structures where there are multiple inheritance " -"paths leading back to a common ancestor. Additional details on the C3 MRO " -"used by Python can be found at :ref:`python_2.3_mro`." +"Custom class types are typically created by class definitions (see section :" +"ref:`class`). A class has a namespace implemented by a dictionary object. " +"Class attribute references are translated to lookups in this dictionary, e." +"g., ``C.x`` is translated to ``C.__dict__[\"x\"]`` (although there are a " +"number of hooks which allow for other means of locating attributes). When " +"the attribute name is not found there, the attribute search continues in the " +"base classes. This search of the base classes uses the C3 method resolution " +"order which behaves correctly even in the presence of 'diamond' inheritance " +"structures where there are multiple inheritance paths leading back to a " +"common ancestor. Additional details on the C3 MRO used by Python can be " +"found at :ref:`python_2.3_mro`." msgstr "" #: ../../reference/datamodel.rst:1162 msgid "" "When a class attribute reference (for class :class:`!C`, say) would yield a " -"class method object, it is transformed into an instance method object " -"whose :attr:`~method.__self__` attribute is :class:`!C`. When it would yield " -"a :class:`staticmethod` object, it is transformed into the object wrapped by " +"class method object, it is transformed into an instance method object whose :" +"attr:`~method.__self__` attribute is :class:`!C`. When it would yield a :" +"class:`staticmethod` object, it is transformed into the object wrapped by " "the static method object. See section :ref:`descriptors` for another way in " "which attributes retrieved from a class may differ from those actually " "contained in its :attr:`~object.__dict__`." @@ -1408,8 +1413,8 @@ msgstr "特殊屬性" #: ../../reference/datamodel.rst:1202 msgid "" -"The class's name. See also: :attr:`__name__ attributes " -"`." +"The class's name. See also: :attr:`__name__ attributes `." msgstr "" #: ../../reference/datamodel.rst:1206 @@ -1425,8 +1430,8 @@ msgstr "" #: ../../reference/datamodel.rst:1213 msgid "" "A :class:`mapping proxy ` providing a read-only view " -"of the class's namespace. See also: :attr:`__dict__ attributes " -"`." +"of the class's namespace. See also: :attr:`__dict__ attributes `." msgstr "" #: ../../reference/datamodel.rst:1218 @@ -1474,14 +1479,14 @@ msgstr "" #: ../../reference/datamodel.rst:1254 msgid "" "The :term:`annotate function` for this class, or ``None`` if the class has " -"no annotations. See also: :attr:`__annotate__ attributes " -"`." +"no annotations. See also: :attr:`__annotate__ attributes `." msgstr "" #: ../../reference/datamodel.rst:1261 msgid "" -"A :class:`tuple` containing the :ref:`type parameters ` of " -"a :ref:`generic class `." +"A :class:`tuple` containing the :ref:`type parameters ` of a :" +"ref:`generic class `." msgstr "" #: ../../reference/datamodel.rst:1267 @@ -1493,8 +1498,8 @@ msgstr "" #: ../../reference/datamodel.rst:1273 msgid "" "The line number of the first line of the class definition, including " -"decorators. Setting the :attr:`~type.__module__` attribute removes " -"the :attr:`!__firstlineno__` item from the type's dictionary." +"decorators. Setting the :attr:`~type.__module__` attribute removes the :attr:" +"`!__firstlineno__` item from the type's dictionary." msgstr "" #: ../../reference/datamodel.rst:1281 @@ -1556,16 +1561,16 @@ msgid "" "\"Classes\". See section :ref:`descriptors` for another way in which " "attributes of a class retrieved via its instances may differ from the " "objects actually stored in the class's :attr:`~object.__dict__`. If no " -"class attribute is found, and the object's class has " -"a :meth:`~object.__getattr__` method, that is called to satisfy the lookup." +"class attribute is found, and the object's class has a :meth:`~object." +"__getattr__` method, that is called to satisfy the lookup." msgstr "" #: ../../reference/datamodel.rst:1335 msgid "" "Attribute assignments and deletions update the instance's dictionary, never " -"a class's dictionary. If the class has a :meth:`~object.__setattr__` " -"or :meth:`~object.__delattr__` method, this is called instead of updating " -"the instance dictionary directly." +"a class's dictionary. If the class has a :meth:`~object.__setattr__` or :" +"meth:`~object.__delattr__` method, this is called instead of updating the " +"instance dictionary directly." msgstr "" #: ../../reference/datamodel.rst:1345 @@ -1593,9 +1598,9 @@ msgstr "" msgid "" "A :term:`file object` represents an open file. Various shortcuts are " "available to create file objects: the :func:`open` built-in function, and " -"also :func:`os.popen`, :func:`os.fdopen`, and " -"the :meth:`~socket.socket.makefile` method of socket objects (and perhaps by " -"other functions or methods provided by extension modules)." +"also :func:`os.popen`, :func:`os.fdopen`, and the :meth:`~socket.socket." +"makefile` method of socket objects (and perhaps by other functions or " +"methods provided by extension modules)." msgstr "" #: ../../reference/datamodel.rst:1388 @@ -1623,15 +1628,14 @@ msgstr "程式碼物件" #: ../../reference/datamodel.rst:1414 msgid "" -"Code objects represent *byte-compiled* executable Python code, " -"or :term:`bytecode`. The difference between a code object and a function " -"object is that the function object contains an explicit reference to the " -"function's globals (the module in which it was defined), while a code object " -"contains no context; also the default argument values are stored in the " -"function object, not in the code object (because they represent values " -"calculated at run-time). Unlike function objects, code objects are " -"immutable and contain no references (directly or indirectly) to mutable " -"objects." +"Code objects represent *byte-compiled* executable Python code, or :term:" +"`bytecode`. The difference between a code object and a function object is " +"that the function object contains an explicit reference to the function's " +"globals (the module in which it was defined), while a code object contains " +"no context; also the default argument values are stored in the function " +"object, not in the code object (because they represent values calculated at " +"run-time). Unlike function objects, code objects are immutable and contain " +"no references (directly or indirectly) to mutable objects." msgstr "" #: ../../reference/datamodel.rst:1448 @@ -1744,17 +1748,17 @@ msgid "" "``0x04`` is set if the function uses the ``*arguments`` syntax to accept an " "arbitrary number of positional arguments; bit ``0x08`` is set if the " "function uses the ``**keywords`` syntax to accept arbitrary keyword " -"arguments; bit ``0x20`` is set if the function is a generator. " -"See :ref:`inspect-module-co-flags` for details on the semantics of each " -"flags that might be present." +"arguments; bit ``0x20`` is set if the function is a generator. See :ref:" +"`inspect-module-co-flags` for details on the semantics of each flags that " +"might be present." msgstr "" #: ../../reference/datamodel.rst:1530 msgid "" "Future feature declarations (for example, ``from __future__ import " "division``) also use bits in :attr:`~codeobject.co_flags` to indicate " -"whether a code object was compiled with a particular feature enabled. " -"See :attr:`~__future__._Feature.compiler_flag`." +"whether a code object was compiled with a particular feature enabled. See :" +"attr:`~__future__._Feature.compiler_flag`." msgstr "" #: ../../reference/datamodel.rst:1534 @@ -1764,10 +1768,10 @@ msgstr "" #: ../../reference/datamodel.rst:1538 msgid "" -"If a code object represents a function and has a docstring, " -"the :data:`~inspect.CO_HAS_DOCSTRING` bit is set " -"in :attr:`~codeobject.co_flags` and the first item " -"in :attr:`~codeobject.co_consts` is the docstring of the function." +"If a code object represents a function and has a docstring, the :data:" +"`~inspect.CO_HAS_DOCSTRING` bit is set in :attr:`~codeobject.co_flags` and " +"the first item in :attr:`~codeobject.co_consts` is the docstring of the " +"function." msgstr "" #: ../../reference/datamodel.rst:1544 @@ -1830,9 +1834,9 @@ msgstr "" #: ../../reference/datamodel.rst:1581 msgid "" -"Returns an iterator that yields information about successive ranges " -"of :term:`bytecode`\\s. Each item yielded is a ``(start, end, " -"lineno)`` :class:`tuple`:" +"Returns an iterator that yields information about successive ranges of :term:" +"`bytecode`\\s. Each item yielded is a ``(start, end, lineno)`` :class:" +"`tuple`:" msgstr "" #: ../../reference/datamodel.rst:1585 @@ -1849,9 +1853,9 @@ msgstr "" #: ../../reference/datamodel.rst:1589 msgid "" -"``lineno`` is an :class:`int` representing the line number of " -"the :term:`bytecode` range, or ``None`` if the bytecodes in the given range " -"have no line number" +"``lineno`` is an :class:`int` representing the line number of the :term:" +"`bytecode` range, or ``None`` if the bytecodes in the given range have no " +"line number" msgstr "" #: ../../reference/datamodel.rst:1593 @@ -1875,8 +1879,8 @@ msgstr "" #: ../../reference/datamodel.rst:1600 msgid "" -"The last :class:`tuple` yielded will have ``end`` equal to the size of " -"the :term:`bytecode`." +"The last :class:`tuple` yielded will have ``end`` equal to the size of the :" +"term:`bytecode`." msgstr "" #: ../../reference/datamodel.rst:1603 @@ -1924,8 +1928,8 @@ msgstr "" #: ../../reference/datamodel.rst:1653 msgid "" "The :ref:`code object ` being executed in this frame. " -"Accessing this attribute raises an :ref:`auditing event ` " -"``object.__getattr__`` with arguments ``obj`` and ``\"f_code\"``." +"Accessing this attribute raises an :ref:`auditing event ` ``object." +"__getattr__`` with arguments ``obj`` and ``\"f_code\"``." msgstr "" "在這個 frame 中執行的\\ :ref:`程式碼物件 (code object) `。存取" "這個屬性會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核事件 " @@ -1955,8 +1959,8 @@ msgstr "" #: ../../reference/datamodel.rst:1675 msgid "" -"The \"precise instruction\" of the frame object (this is an index into " -"the :term:`bytecode` string of the :ref:`code object `)" +"The \"precise instruction\" of the frame object (this is an index into the :" +"term:`bytecode` string of the :ref:`code object `)" msgstr "" #: ../../reference/datamodel.rst:1680 @@ -2042,18 +2046,18 @@ msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " "inserted in front of the current traceback. When an exception handler is " -"entered, the stack trace is made available to the program. (See " -"section :ref:`try`.) It is accessible as the third item of the tuple " -"returned by :func:`sys.exc_info`, and as " -"the :attr:`~BaseException.__traceback__` attribute of the caught exception." +"entered, the stack trace is made available to the program. (See section :ref:" +"`try`.) It is accessible as the third item of the tuple returned by :func:" +"`sys.exc_info`, and as the :attr:`~BaseException.__traceback__` attribute of " +"the caught exception." msgstr "" #: ../../reference/datamodel.rst:1773 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " -"interactive, it is also made available to the user " -"as :data:`sys.last_traceback`." +"interactive, it is also made available to the user as :data:`sys." +"last_traceback`." msgstr "" #: ../../reference/datamodel.rst:1778 @@ -2070,8 +2074,8 @@ msgstr "" #: ../../reference/datamodel.rst:1796 msgid "" -"Accessing this attribute raises an :ref:`auditing event ` " -"``object.__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." +"Accessing this attribute raises an :ref:`auditing event ` ``object." +"__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." msgstr "" "存取此屬性會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" @@ -2115,9 +2119,9 @@ msgstr "" #: ../../reference/datamodel.rst:1839 msgid "" -"Special read-only attributes: :attr:`~slice.start` is the lower " -"bound; :attr:`~slice.stop` is the upper bound; :attr:`~slice.step` is the " -"step value; each is ``None`` if omitted. These attributes can have any type." +"Special read-only attributes: :attr:`~slice.start` is the lower bound; :attr:" +"`~slice.stop` is the upper bound; :attr:`~slice.step` is the step value; " +"each is ``None`` if omitted. These attributes can have any type." msgstr "" #: ../../reference/datamodel.rst:1843 @@ -2159,8 +2163,8 @@ msgid "" "another object that alters the way in which that object is retrieved from " "classes and class instances. The behaviour of class method objects upon such " "retrieval is described above, under :ref:`\"instance methods\" `. Class method objects are created by the built-" -"in :func:`classmethod` constructor." +"methods>`. Class method objects are created by the built-in :func:" +"`classmethod` constructor." msgstr "" #: ../../reference/datamodel.rst:1880 @@ -2173,21 +2177,21 @@ msgid "" "(such as arithmetic operations or subscripting and slicing) by defining " "methods with special names. This is Python's approach to :dfn:`operator " "overloading`, allowing classes to define their own behavior with respect to " -"language operators. For instance, if a class defines a method " -"named :meth:`~object.__getitem__`, and ``x`` is an instance of this class, " -"then ``x[i]`` is roughly equivalent to ``type(x).__getitem__(x, i)``. " -"Except where mentioned, attempts to execute an operation raise an exception " -"when no appropriate method is defined (typically :exc:`AttributeError` " -"or :exc:`TypeError`)." +"language operators. For instance, if a class defines a method named :meth:" +"`~object.__getitem__`, and ``x`` is an instance of this class, then ``x[i]`` " +"is roughly equivalent to ``type(x).__getitem__(x, i)``. Except where " +"mentioned, attempts to execute an operation raise an exception when no " +"appropriate method is defined (typically :exc:`AttributeError` or :exc:" +"`TypeError`)." msgstr "" #: ../../reference/datamodel.rst:1897 msgid "" "Setting a special method to ``None`` indicates that the corresponding " -"operation is not available. For example, if a class " -"sets :meth:`~object.__iter__` to ``None``, the class is not iterable, so " -"calling :func:`iter` on its instances will raise a :exc:`TypeError` (without " -"falling back to :meth:`~object.__getitem__`). [#]_" +"operation is not available. For example, if a class sets :meth:`~object." +"__iter__` to ``None``, the class is not iterable, so calling :func:`iter` on " +"its instances will raise a :exc:`TypeError` (without falling back to :meth:" +"`~object.__getitem__`). [#]_" msgstr "" #: ../../reference/datamodel.rst:1903 @@ -2266,10 +2270,10 @@ msgstr "" #: ../../reference/datamodel.rst:1969 msgid "" "Called when the instance is about to be destroyed. This is also called a " -"finalizer or (improperly) a destructor. If a base class has " -"a :meth:`__del__` method, the derived class's :meth:`__del__` method, if " -"any, must explicitly call it to ensure proper deletion of the base class " -"part of the instance." +"finalizer or (improperly) a destructor. If a base class has a :meth:" +"`__del__` method, the derived class's :meth:`__del__` method, if any, must " +"explicitly call it to ensure proper deletion of the base class part of the " +"instance." msgstr "" #: ../../reference/datamodel.rst:1975 @@ -2310,7 +2314,7 @@ msgstr "" #: ../../reference/datamodel.rst:2004 msgid "Documentation for the :mod:`gc` module." -msgstr "" +msgstr ":mod:`gc` 模組的文件。" #: ../../reference/datamodel.rst:2008 msgid "" @@ -2324,8 +2328,8 @@ msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " "lock or invoke any other blocking resource, it may deadlock as the resource " -"may already be taken by the code that gets interrupted to " -"execute :meth:`__del__`." +"may already be taken by the code that gets interrupted to execute :meth:" +"`__del__`." msgstr "" #: ../../reference/datamodel.rst:2018 @@ -2346,10 +2350,9 @@ msgid "" "like a valid Python expression that could be used to recreate an object with " "the same value (given an appropriate environment). If this is not possible, " "a string of the form ``<...some useful description...>`` should be returned. " -"The return value must be a string object. If a class " -"defines :meth:`__repr__` but not :meth:`__str__`, then :meth:`__repr__` is " -"also used when an \"informal\" string representation of instances of that " -"class is required." +"The return value must be a string object. If a class defines :meth:" +"`__repr__` but not :meth:`__str__`, then :meth:`__repr__` is also used when " +"an \"informal\" string representation of instances of that class is required." msgstr "" #: ../../reference/datamodel.rst:2042 @@ -2383,8 +2386,8 @@ msgstr "" #: ../../reference/datamodel.rst:2073 msgid "" "Called by :ref:`bytes ` to compute a byte-string representation " -"of an object. This should return a :class:`bytes` object. " -"The :class:`object` class itself does not provide this method." +"of an object. This should return a :class:`bytes` object. The :class:" +"`object` class itself does not provide this method." msgstr "" #: ../../reference/datamodel.rst:2085 @@ -2429,10 +2432,10 @@ msgstr "" #: ../../reference/datamodel.rst:2122 msgid "" "These are the so-called \"rich comparison\" methods. The correspondence " -"between operator symbols and method names is as follows: ``xy`` calls " -"``x.__gt__(y)``, and ``x>=y`` calls ``x.__ge__(y)``." +"between operator symbols and method names is as follows: ``xy`` calls ``x.__gt__(y)``, and ``x>=y`` " +"calls ``x.__ge__(y)``." msgstr "" #: ../../reference/datamodel.rst:2128 @@ -2448,15 +2451,14 @@ msgstr "" #: ../../reference/datamodel.rst:2135 msgid "" -"By default, ``object`` implements :meth:`__eq__` by using ``is``, " -"returning :data:`NotImplemented` in the case of a false comparison: ``True " -"if x is y else NotImplemented``. For :meth:`__ne__`, by default it delegates " -"to :meth:`__eq__` and inverts the result unless it is :data:`!" -"NotImplemented`. There are no other implied relationships among the " -"comparison operators or default implementations; for example, the truth of " -"``(x` such as :class:`int`, :class:`bytes`, " -"and :class:`tuple`." +"` such as :class:`int`, :class:`bytes`, and :class:" +"`tuple`." msgstr "" #: ../../reference/datamodel.rst:2634 @@ -3074,8 +3075,8 @@ msgstr "" msgid "" "If a :class:`dictionary ` is used to assign *__slots__*, the " "dictionary keys will be used as the slot names. The values of the dictionary " -"can be used to provide per-attribute docstrings that will be recognised " -"by :func:`inspect.getdoc` and displayed in the output of :func:`help`." +"can be used to provide per-attribute docstrings that will be recognised by :" +"func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" #: ../../reference/datamodel.rst:2641 @@ -3105,13 +3106,12 @@ msgstr "" #: ../../reference/datamodel.rst:2660 msgid "" -"Whenever a class inherits from another " -"class, :meth:`~object.__init_subclass__` is called on the parent class. This " -"way, it is possible to write classes which change the behavior of " -"subclasses. This is closely related to class decorators, but where class " -"decorators only affect the specific class they're applied to, " -"``__init_subclass__`` solely applies to future subclasses of the class " -"defining the method." +"Whenever a class inherits from another class, :meth:`~object." +"__init_subclass__` is called on the parent class. This way, it is possible " +"to write classes which change the behavior of subclasses. This is closely " +"related to class decorators, but where class decorators only affect the " +"specific class they're applied to, ``__init_subclass__`` solely applies to " +"future subclasses of the class defining the method." msgstr "" #: ../../reference/datamodel.rst:2669 @@ -3183,9 +3183,9 @@ msgstr "" #: ../../reference/datamodel.rst:2711 msgid "" -"If the class variable is assigned after the class is " -"created, :meth:`__set_name__` will not be called automatically. If " -"needed, :meth:`__set_name__` can be called directly::" +"If the class variable is assigned after the class is created, :meth:" +"`__set_name__` will not be called automatically. If needed, :meth:" +"`__set_name__` can be called directly::" msgstr "" #: ../../reference/datamodel.rst:2715 @@ -3277,14 +3277,14 @@ msgstr "" #: ../../reference/datamodel.rst:2772 msgid "" -"If a base that appears in a class definition is not an instance " -"of :class:`type`, then an :meth:`!__mro_entries__` method is searched on the " -"base. If an :meth:`!__mro_entries__` method is found, the base is " -"substituted with the result of a call to :meth:`!__mro_entries__` when " -"creating the class. The method is called with the original bases tuple " -"passed to the *bases* parameter, and must return a tuple of classes that " -"will be used instead of the base. The returned tuple may be empty: in these " -"cases, the original base is ignored." +"If a base that appears in a class definition is not an instance of :class:" +"`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " +"an :meth:`!__mro_entries__` method is found, the base is substituted with " +"the result of a call to :meth:`!__mro_entries__` when creating the class. " +"The method is called with the original bases tuple passed to the *bases* " +"parameter, and must return a tuple of classes that will be used instead of " +"the base. The returned tuple may be empty: in these cases, the original base " +"is ignored." msgstr "" #: ../../reference/datamodel.rst:2783 @@ -3301,8 +3301,8 @@ msgstr ":func:`types.get_original_bases`" #: ../../reference/datamodel.rst:2787 msgid "" -"Retrieve a class's \"original bases\" prior to modifications " -"by :meth:`~object.__mro_entries__`." +"Retrieve a class's \"original bases\" prior to modifications by :meth:" +"`~object.__mro_entries__`." msgstr "" #: ../../reference/datamodel.rst:2790 @@ -3329,8 +3329,8 @@ msgstr "" #: ../../reference/datamodel.rst:2802 msgid "" -"if an explicit metaclass is given and it is *not* an instance " -"of :func:`type`, then it is used directly as the metaclass;" +"if an explicit metaclass is given and it is *not* an instance of :func:" +"`type`, then it is used directly as the metaclass;" msgstr "" #: ../../reference/datamodel.rst:2804 @@ -3417,10 +3417,10 @@ msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " "created by the compiler if any methods in a class body refer to either " -"``__class__`` or ``super``. This allows the zero argument form " -"of :func:`super` to correctly identify the class being defined based on " -"lexical scoping, while the class or instance that was used to make the " -"current call is identified based on the first argument passed to the method." +"``__class__`` or ``super``. This allows the zero argument form of :func:" +"`super` to correctly identify the class being defined based on lexical " +"scoping, while the class or instance that was used to make the current call " +"is identified based on the first argument passed to the method." msgstr "" #: ../../reference/datamodel.rst:2883 @@ -3498,8 +3498,8 @@ msgstr "" #: ../../reference/datamodel.rst:2927 msgid "" -"The following methods are used to override the default behavior of " -"the :func:`isinstance` and :func:`issubclass` built-in functions." +"The following methods are used to override the default behavior of the :func:" +"`isinstance` and :func:`issubclass` built-in functions." msgstr "" #: ../../reference/datamodel.rst:2930 @@ -3538,11 +3538,11 @@ msgstr "" #: ../../reference/datamodel.rst:2957 msgid "" -"Includes the specification for customizing :func:`isinstance` " -"and :func:`issubclass` behavior through :meth:`~type.__instancecheck__` " -"and :meth:`~type.__subclasscheck__`, with motivation for this functionality " -"in the context of adding Abstract Base Classes (see the :mod:`abc` module) " -"to the language." +"Includes the specification for customizing :func:`isinstance` and :func:" +"`issubclass` behavior through :meth:`~type.__instancecheck__` and :meth:" +"`~type.__subclasscheck__`, with motivation for this functionality in the " +"context of adding Abstract Base Classes (see the :mod:`abc` module) to the " +"language." msgstr "" #: ../../reference/datamodel.rst:2965 @@ -3575,8 +3575,8 @@ msgstr "" #: ../../reference/datamodel.rst:2980 msgid "" -":ref:`Generics`, :ref:`user-defined generics` " -"and :class:`typing.Generic`" +":ref:`Generics`, :ref:`user-defined generics` and :" +"class:`typing.Generic`" msgstr "" #: ../../reference/datamodel.rst:2981 @@ -3600,8 +3600,8 @@ msgstr "" #: ../../reference/datamodel.rst:2992 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " -"method. As such, there is no need for it to be decorated " -"with :func:`@classmethod` when it is defined." +"method. As such, there is no need for it to be decorated with :func:" +"`@classmethod` when it is defined." msgstr "" #: ../../reference/datamodel.rst:2998 @@ -3619,10 +3619,9 @@ msgstr "" msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " -"standard library class that already " -"implements :meth:`~object.__class_getitem__`, or inherit " -"from :class:`typing.Generic`, which has its own implementation of " -"``__class_getitem__()``." +"standard library class that already implements :meth:`~object." +"__class_getitem__`, or inherit from :class:`typing.Generic`, which has its " +"own implementation of ``__class_getitem__()``." msgstr "" #: ../../reference/datamodel.rst:3010 @@ -3650,9 +3649,8 @@ msgstr "" #: ../../reference/datamodel.rst:3029 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " -"follows something like the following process to decide " -"whether :meth:`~object.__getitem__` or :meth:`~object.__class_getitem__` " -"should be called::" +"follows something like the following process to decide whether :meth:" +"`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" #: ../../reference/datamodel.rst:3034 @@ -3685,10 +3683,10 @@ msgstr "" msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " -"the :class:`type` class as their metaclass. :class:`type` does not " -"define :meth:`~object.__getitem__`, meaning that expressions such as " -"``list[int]``, ``dict[str, float]`` and ``tuple[str, bytes]`` all result " -"in :meth:`~object.__class_getitem__` being called::" +"the :class:`type` class as their metaclass. :class:`type` does not define :" +"meth:`~object.__getitem__`, meaning that expressions such as ``list[int]``, " +"``dict[str, float]`` and ``tuple[str, bytes]`` all result in :meth:`~object." +"__class_getitem__` being called::" msgstr "" #: ../../reference/datamodel.rst:3064 @@ -3708,10 +3706,9 @@ msgstr "" #: ../../reference/datamodel.rst:3076 msgid "" -"However, if a class has a custom metaclass that " -"defines :meth:`~object.__getitem__`, subscribing the class may result in " -"different behaviour. An example of this can be found in the :mod:`enum` " -"module::" +"However, if a class has a custom metaclass that defines :meth:`~object." +"__getitem__`, subscribing the class may result in different behaviour. An " +"example of this can be found in the :mod:`enum` module::" msgstr "" #: ../../reference/datamodel.rst:3080 @@ -3740,9 +3737,9 @@ msgstr "" #: ../../reference/datamodel.rst:3100 msgid "" -"Introducing :meth:`~object.__class_getitem__`, and outlining when " -"a :ref:`subscription` results in ``__class_getitem__()`` " -"being called instead of :meth:`~object.__getitem__`" +"Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" +"`subscription` results in ``__class_getitem__()`` being " +"called instead of :meth:`~object.__getitem__`" msgstr "" #: ../../reference/datamodel.rst:3108 @@ -3764,39 +3761,50 @@ msgstr "" msgid "" "The following methods can be defined to implement container objects. None of " "them are provided by the :class:`object` class itself. Containers usually " -"are :term:`sequences ` (such as :class:`lists ` " -"or :class:`tuples `) or :term:`mappings ` " -"(like :term:`dictionaries `), but can represent other containers " -"as well. The first set of methods is used either to emulate a sequence or " -"to emulate a mapping; the difference is that for a sequence, the allowable " -"keys should be the integers *k* for which ``0 <= k < N`` where *N* is the " -"length of the sequence, or :class:`slice` objects, which define a range of " -"items. It is also recommended that mappings provide the methods :meth:`!" -"keys`, :meth:`!values`, :meth:`!items`, :meth:`!get`, :meth:`!" -"clear`, :meth:`!setdefault`, :meth:`!pop`, :meth:`!popitem`, :meth:`!copy`, " -"and :meth:`!update` behaving similar to those for Python's " -"standard :class:`dictionary ` objects. The :mod:`collections.abc` " -"module provides a :class:`~collections.abc.MutableMapping` :term:`abstract " -"base class` to help create those methods from a base set " -"of :meth:`~object.__getitem__`, :meth:`~object.__setitem__`, :meth:`~object.__delitem__`, " -"and :meth:`!keys`. Mutable sequences should provide " -"methods :meth:`~sequence.append`, :meth:`~sequence.count`, :meth:`~sequence.index`, :meth:`~sequence.extend`, :meth:`~sequence.insert`, :meth:`~sequence.pop`, :meth:`~sequence.remove`, :meth:`~sequence.reverse` " -"and :meth:`!sort`, like Python standard :class:`list` objects. Finally, " -"sequence types should implement addition (meaning concatenation) and " -"multiplication (meaning repetition) by defining the " -"methods :meth:`~object.__add__`, :meth:`~object.__radd__`, :meth:`~object.__iadd__`, :meth:`~object.__mul__`, :meth:`~object.__rmul__` " -"and :meth:`~object.__imul__` described below; they should not define other " -"numerical operators. It is recommended that both mappings and sequences " -"implement the :meth:`~object.__contains__` method to allow efficient use of " -"the ``in`` operator; for mappings, ``in`` should search the mapping's keys; " -"for sequences, it should search through the values. It is further " -"recommended that both mappings and sequences implement " -"the :meth:`~object.__iter__` method to allow efficient iteration through the " -"container; for mappings, :meth:`!__iter__` should iterate through the " -"object's keys; for sequences, it should iterate through the values." -msgstr "" - -#: ../../reference/datamodel.rst:3168 +"are :term:`sequences ` (such as :class:`lists ` or :class:" +"`tuples `) or :term:`mappings ` (like :term:`dictionaries " +"`), but can represent other containers as well. The first set " +"of methods is used either to emulate a sequence or to emulate a mapping; the " +"difference is that for a sequence, the allowable keys should be the integers " +"*k* for which ``0 <= k < N`` where *N* is the length of the sequence, or :" +"class:`slice` objects, which define a range of items. It is also " +"recommended that mappings provide the methods :meth:`!keys`, :meth:`!" +"values`, :meth:`!items`, :meth:`!get`, :meth:`!clear`, :meth:`!setdefault`, :" +"meth:`!pop`, :meth:`!popitem`, :meth:`!copy`, and :meth:`!update` behaving " +"similar to those for Python's standard :class:`dictionary ` objects. " +"The :mod:`collections.abc` module provides a :class:`~collections.abc." +"MutableMapping` :term:`abstract base class` to help create those methods " +"from a base set of :meth:`~object.__getitem__`, :meth:`~object." +"__setitem__`, :meth:`~object.__delitem__`, and :meth:`!keys`." +msgstr "" + +#: ../../reference/datamodel.rst:3144 +msgid "" +"Mutable sequences should provide methods :meth:`~sequence.append`, :meth:" +"`~sequence.clear`, :meth:`~sequence.count`, :meth:`~sequence.extend`, :meth:" +"`~sequence.index`, :meth:`~sequence.insert`, :meth:`~sequence.pop`, :meth:" +"`~sequence.remove`, and :meth:`~sequence.reverse`, like Python standard :" +"class:`list` objects. Finally, sequence types should implement addition " +"(meaning concatenation) and multiplication (meaning repetition) by defining " +"the methods :meth:`~object.__add__`, :meth:`~object.__radd__`, :meth:" +"`~object.__iadd__`, :meth:`~object.__mul__`, :meth:`~object.__rmul__` and :" +"meth:`~object.__imul__` described below; they should not define other " +"numerical operators." +msgstr "" + +#: ../../reference/datamodel.rst:3156 +msgid "" +"It is recommended that both mappings and sequences implement the :meth:" +"`~object.__contains__` method to allow efficient use of the ``in`` operator; " +"for mappings, ``in`` should search the mapping's keys; for sequences, it " +"should search through the values. It is further recommended that both " +"mappings and sequences implement the :meth:`~object.__iter__` method to " +"allow efficient iteration through the container; for mappings, :meth:`!" +"__iter__` should iterate through the object's keys; for sequences, it should " +"iterate through the values." +msgstr "" + +#: ../../reference/datamodel.rst:3171 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -3804,97 +3812,96 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:3175 +#: ../../reference/datamodel.rst:3178 msgid "" "In CPython, the length is required to be at most :data:`sys.maxsize`. If the " -"length is larger than :data:`!sys.maxsize` some features (such " -"as :func:`len`) may raise :exc:`OverflowError`. To prevent raising :exc:`!" -"OverflowError` by truth value testing, an object must define " -"a :meth:`~object.__bool__` method." +"length is larger than :data:`!sys.maxsize` some features (such as :func:" +"`len`) may raise :exc:`OverflowError`. To prevent raising :exc:`!" +"OverflowError` by truth value testing, an object must define a :meth:" +"`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:3184 +#: ../../reference/datamodel.rst:3187 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " -"The length must be an integer ``>=`` 0. The return value may also " -"be :data:`NotImplemented`, which is treated the same as if the " -"``__length_hint__`` method didn't exist at all. This method is purely an " -"optimization and is never required for correctness." +"The length must be an integer ``>=`` 0. The return value may also be :data:" +"`NotImplemented`, which is treated the same as if the ``__length_hint__`` " +"method didn't exist at all. This method is purely an optimization and is " +"never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:3198 +#: ../../reference/datamodel.rst:3201 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:3200 +#: ../../reference/datamodel.rst:3203 msgid "a[1:2] = b" msgstr "a[1:2] = b" -#: ../../reference/datamodel.rst:3202 +#: ../../reference/datamodel.rst:3205 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:3204 +#: ../../reference/datamodel.rst:3207 msgid "a[slice(1, 2, None)] = b" msgstr "a[slice(1, 2, None)] = b" -#: ../../reference/datamodel.rst:3206 +#: ../../reference/datamodel.rst:3209 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:3211 +#: ../../reference/datamodel.rst:3214 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " -"the accepted keys should be integers. Optionally, they may " -"support :class:`slice` objects as well. Negative index support is also " -"optional. If *key* is of an inappropriate type, :exc:`TypeError` may be " -"raised; if *key* is a value outside the set of indexes for the sequence " -"(after any special interpretation of negative values), :exc:`IndexError` " -"should be raised. For :term:`mapping` types, if *key* is missing (not in the " -"container), :exc:`KeyError` should be raised." +"the accepted keys should be integers. Optionally, they may support :class:" +"`slice` objects as well. Negative index support is also optional. If *key* " +"is of an inappropriate type, :exc:`TypeError` may be raised; if *key* is a " +"value outside the set of indexes for the sequence (after any special " +"interpretation of negative values), :exc:`IndexError` should be raised. For :" +"term:`mapping` types, if *key* is missing (not in the container), :exc:" +"`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:3223 +#: ../../reference/datamodel.rst:3226 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:3228 +#: ../../reference/datamodel.rst:3231 msgid "" -"When :ref:`subscripting` a *class*, the special class " -"method :meth:`~object.__class_getitem__` may be called instead of " -"``__getitem__()``. See :ref:`classgetitem-versus-getitem` for more details." +"When :ref:`subscripting` a *class*, the special class method :" +"meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " +"See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:3236 +#: ../../reference/datamodel.rst:3239 msgid "" -"Called to implement assignment to ``self[key]``. Same note as " -"for :meth:`__getitem__`. This should only be implemented for mappings if " -"the objects support changes to the values for keys, or if new keys can be " -"added, or for sequences if elements can be replaced. The same exceptions " -"should be raised for improper *key* values as for the :meth:`__getitem__` " -"method." +"Called to implement assignment to ``self[key]``. Same note as for :meth:" +"`__getitem__`. This should only be implemented for mappings if the objects " +"support changes to the values for keys, or if new keys can be added, or for " +"sequences if elements can be replaced. The same exceptions should be raised " +"for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:3245 +#: ../../reference/datamodel.rst:3248 msgid "" -"Called to implement deletion of ``self[key]``. Same note as " -"for :meth:`__getitem__`. This should only be implemented for mappings if " -"the objects support removal of keys, or for sequences if elements can be " -"removed from the sequence. The same exceptions should be raised for " -"improper *key* values as for the :meth:`__getitem__` method." +"Called to implement deletion of ``self[key]``. Same note as for :meth:" +"`__getitem__`. This should only be implemented for mappings if the objects " +"support removal of keys, or for sequences if elements can be removed from " +"the sequence. The same exceptions should be raised for improper *key* " +"values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:3254 +#: ../../reference/datamodel.rst:3257 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:3260 +#: ../../reference/datamodel.rst:3263 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3902,23 +3909,23 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:3268 +#: ../../reference/datamodel.rst:3271 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:3272 +#: ../../reference/datamodel.rst:3275 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " -"built-in will fall back to using the sequence protocol (:meth:`__len__` " -"and :meth:`__getitem__`). Objects that support the sequence protocol should " -"only provide :meth:`__reversed__` if they can provide an implementation that " -"is more efficient than the one provided by :func:`reversed`." +"built-in will fall back to using the sequence protocol (:meth:`__len__` and :" +"meth:`__getitem__`). Objects that support the sequence protocol should only " +"provide :meth:`__reversed__` if they can provide an implementation that is " +"more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:3279 +#: ../../reference/datamodel.rst:3282 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3926,14 +3933,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:3286 +#: ../../reference/datamodel.rst:3289 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:3290 +#: ../../reference/datamodel.rst:3293 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3941,11 +3948,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:3299 +#: ../../reference/datamodel.rst:3302 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:3301 +#: ../../reference/datamodel.rst:3304 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3953,56 +3960,55 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:3327 +#: ../../reference/datamodel.rst:3330 msgid "" "These methods are called to implement the binary arithmetic operations " -"(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, " -"``%``, :func:`divmod`, :func:`pow`, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|" -"``). For instance, to evaluate the expression ``x + y``, where *x* is an " -"instance of a class that has an :meth:`__add__` method, ``type(x).__add__(x, " -"y)`` is called. The :meth:`__divmod__` method should be the equivalent to " -"using :meth:`__floordiv__` and :meth:`__mod__`; it should not be related " -"to :meth:`__truediv__`. Note that :meth:`__pow__` should be defined to " -"accept an optional third argument if the three-argument version of the built-" -"in :func:`pow` function is to be supported." +"(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" +"`pow`, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``). For instance, to " +"evaluate the expression ``x + y``, where *x* is an instance of a class that " +"has an :meth:`__add__` method, ``type(x).__add__(x, y)`` is called. The :" +"meth:`__divmod__` method should be the equivalent to using :meth:" +"`__floordiv__` and :meth:`__mod__`; it should not be related to :meth:" +"`__truediv__`. Note that :meth:`__pow__` should be defined to accept an " +"optional third argument if the three-argument version of the built-in :func:" +"`pow` function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:3338 +#: ../../reference/datamodel.rst:3341 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return :data:`NotImplemented`." msgstr "" -#: ../../reference/datamodel.rst:3361 +#: ../../reference/datamodel.rst:3364 msgid "" "These methods are called to implement the binary arithmetic operations " -"(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, " -"``%``, :func:`divmod`, :func:`pow`, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|" -"``) with reflected (swapped) operands. These functions are only called if " -"the operands are of different types, when the left operand does not support " -"the corresponding operation [#]_, or the right operand's class is derived " -"from the left operand's class. [#]_ For instance, to evaluate the expression " -"``x - y``, where *y* is an instance of a class that has an :meth:`__rsub__` " -"method, ``type(y).__rsub__(y, x)`` is called if ``type(x).__sub__(x, y)`` " -"returns :data:`NotImplemented` or ``type(y)`` is a subclass of ``type(x)``. " -"[#]_" +"(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" +"`pow`, ``**``, ``<<``, ``>>``, ``&``, ``^``, ``|``) with reflected (swapped) " +"operands. These functions are only called if the operands are of different " +"types, when the left operand does not support the corresponding operation " +"[#]_, or the right operand's class is derived from the left operand's class. " +"[#]_ For instance, to evaluate the expression ``x - y``, where *y* is an " +"instance of a class that has an :meth:`__rsub__` method, ``type(y)." +"__rsub__(y, x)`` is called if ``type(x).__sub__(x, y)`` returns :data:" +"`NotImplemented` or ``type(y)`` is a subclass of ``type(x)``. [#]_" msgstr "" -#: ../../reference/datamodel.rst:3372 +#: ../../reference/datamodel.rst:3375 msgid "" "Note that :meth:`__rpow__` should be defined to accept an optional third " "argument if the three-argument version of the built-in :func:`pow` function " "is to be supported." msgstr "" -#: ../../reference/datamodel.rst:3378 +#: ../../reference/datamodel.rst:3381 msgid "" "Three-argument :func:`pow` now try calling :meth:`~object.__rpow__` if " "necessary. Previously it was only called in two-argument :func:`!pow` and " "the binary power operator." msgstr "" -#: ../../reference/datamodel.rst:3384 +#: ../../reference/datamodel.rst:3387 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -4011,7 +4017,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:3404 +#: ../../reference/datamodel.rst:3407 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -4020,28 +4026,28 @@ msgid "" "but does not have to be, *self*). If a specific method is not defined, or " "if that method returns :data:`NotImplemented`, the augmented assignment " "falls back to the normal methods. For instance, if *x* is an instance of a " -"class with an :meth:`__iadd__` method, ``x += y`` is equivalent to ``x = " -"x.__iadd__(y)`` . If :meth:`__iadd__` does not exist, or if " -"``x.__iadd__(y)`` returns :data:`!NotImplemented`, ``x.__add__(y)`` and " -"``y.__radd__(x)`` are considered, as with the evaluation of ``x + y``. In " -"certain situations, augmented assignment can result in unexpected errors " -"(see :ref:`faq-augmented-assignment-tuple-error`), but this behavior is in " -"fact part of the data model." +"class with an :meth:`__iadd__` method, ``x += y`` is equivalent to ``x = x." +"__iadd__(y)`` . If :meth:`__iadd__` does not exist, or if ``x.__iadd__(y)`` " +"returns :data:`!NotImplemented`, ``x.__add__(y)`` and ``y.__radd__(x)`` are " +"considered, as with the evaluation of ``x + y``. In certain situations, " +"augmented assignment can result in unexpected errors (see :ref:`faq-" +"augmented-assignment-tuple-error`), but this behavior is in fact part of the " +"data model." msgstr "" -#: ../../reference/datamodel.rst:3427 +#: ../../reference/datamodel.rst:3430 msgid "" -"Called to implement the unary arithmetic operations (``-``, " -"``+``, :func:`abs` and ``~``)." +"Called to implement the unary arithmetic operations (``-``, ``+``, :func:" +"`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:3440 +#: ../../reference/datamodel.rst:3443 msgid "" -"Called to implement the built-in functions :func:`complex`, :func:`int` " -"and :func:`float`. Should return a value of the appropriate type." +"Called to implement the built-in functions :func:`complex`, :func:`int` and :" +"func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:3447 +#: ../../reference/datamodel.rst:3450 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -4050,14 +4056,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:3453 +#: ../../reference/datamodel.rst:3456 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:3465 +#: ../../reference/datamodel.rst:3468 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -4066,16 +4072,16 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:3471 +#: ../../reference/datamodel.rst:3474 msgid "" ":func:`int` no longer delegates to the :meth:`~object.__trunc__` method." msgstr "" -#: ../../reference/datamodel.rst:3478 +#: ../../reference/datamodel.rst:3481 msgid "With Statement Context Managers" msgstr "With 陳述式的情境管理器" -#: ../../reference/datamodel.rst:3480 +#: ../../reference/datamodel.rst:3483 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -4085,34 +4091,34 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:3491 +#: ../../reference/datamodel.rst:3494 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:3494 +#: ../../reference/datamodel.rst:3497 msgid "" "For more information on context managers, see :ref:`typecontextmanager`. " "The :class:`object` class itself does not provide the context manager " "methods." msgstr "" -#: ../../reference/datamodel.rst:3500 +#: ../../reference/datamodel.rst:3503 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:3507 +#: ../../reference/datamodel.rst:3510 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:3511 +#: ../../reference/datamodel.rst:3514 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -4120,27 +4126,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:3515 +#: ../../reference/datamodel.rst:3518 msgid "" "Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:3521 +#: ../../reference/datamodel.rst:3524 msgid ":pep:`343` - The \"with\" statement" msgstr ":pep:`343` - \"with\" 陳述式" -#: ../../reference/datamodel.rst:3522 +#: ../../reference/datamodel.rst:3525 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3529 +#: ../../reference/datamodel.rst:3532 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:3531 +#: ../../reference/datamodel.rst:3534 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -4148,7 +4154,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:3538 +#: ../../reference/datamodel.rst:3541 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -4157,29 +4163,29 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:3544 +#: ../../reference/datamodel.rst:3547 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " "MyClass(left=x, center=y)``. Note that the number of arguments in the " "pattern must be smaller than or equal to the number of elements in " -"*__match_args__*; if it is larger, the pattern match attempt will raise " -"a :exc:`TypeError`." +"*__match_args__*; if it is larger, the pattern match attempt will raise a :" +"exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:3554 +#: ../../reference/datamodel.rst:3557 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:3555 +#: ../../reference/datamodel.rst:3558 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:3561 +#: ../../reference/datamodel.rst:3564 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:3563 +#: ../../reference/datamodel.rst:3566 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -4187,61 +4193,60 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:3568 +#: ../../reference/datamodel.rst:3571 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:3573 +#: ../../reference/datamodel.rst:3576 msgid "" -"Called when a buffer is requested from *self* (for example, by " -"the :class:`memoryview` constructor). The *flags* argument is an integer " -"representing the kind of buffer requested, affecting for example whether the " -"returned buffer is read-only or writable. :class:`inspect.BufferFlags` " -"provides a convenient way to interpret the flags. The method must return " -"a :class:`memoryview` object." +"Called when a buffer is requested from *self* (for example, by the :class:" +"`memoryview` constructor). The *flags* argument is an integer representing " +"the kind of buffer requested, affecting for example whether the returned " +"buffer is read-only or writable. :class:`inspect.BufferFlags` provides a " +"convenient way to interpret the flags. The method must return a :class:" +"`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3582 +#: ../../reference/datamodel.rst:3585 msgid "" -"Called when a buffer is no longer needed. The *buffer* argument is " -"a :class:`memoryview` object that was previously returned " -"by :meth:`~object.__buffer__`. The method must release any resources " -"associated with the buffer. This method should return ``None``. Buffer " -"objects that do not need to perform any cleanup are not required to " -"implement this method." +"Called when a buffer is no longer needed. The *buffer* argument is a :class:" +"`memoryview` object that was previously returned by :meth:`~object." +"__buffer__`. The method must release any resources associated with the " +"buffer. This method should return ``None``. Buffer objects that do not need " +"to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3593 +#: ../../reference/datamodel.rst:3596 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3594 +#: ../../reference/datamodel.rst:3597 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3596 +#: ../../reference/datamodel.rst:3599 msgid ":class:`collections.abc.Buffer`" msgstr ":class:`collections.abc.Buffer`" -#: ../../reference/datamodel.rst:3597 +#: ../../reference/datamodel.rst:3600 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3600 +#: ../../reference/datamodel.rst:3603 msgid "Annotations" msgstr "" -#: ../../reference/datamodel.rst:3602 +#: ../../reference/datamodel.rst:3605 msgid "" "Functions, classes, and modules may contain :term:`annotations " "`, which are a way to associate information (usually :term:`type " "hints `) with a symbol." msgstr "" -#: ../../reference/datamodel.rst:3608 +#: ../../reference/datamodel.rst:3611 msgid "" "This attribute contains the annotations for an object. It is :ref:`lazily " "evaluated `, so accessing the attribute may execute " @@ -4249,59 +4254,59 @@ msgid "" "attribute is set to a dictionary mapping from variable names to annotations." msgstr "" -#: ../../reference/datamodel.rst:3613 +#: ../../reference/datamodel.rst:3616 msgid "Annotations are now lazily evaluated." msgstr "" -#: ../../reference/datamodel.rst:3618 +#: ../../reference/datamodel.rst:3621 msgid "" "An :term:`annotate function`. Returns a new dictionary object mapping " "attribute/parameter names to their annotation values." msgstr "" -#: ../../reference/datamodel.rst:3621 +#: ../../reference/datamodel.rst:3624 msgid "" "Takes a format parameter specifying the format in which annotations values " "should be provided. It must be a member of the :class:`annotationlib.Format` " "enum, or an integer with a value corresponding to a member of the enum." msgstr "" -#: ../../reference/datamodel.rst:3625 +#: ../../reference/datamodel.rst:3628 msgid "" -"If an annotate function doesn't support the requested format, it must " -"raise :exc:`NotImplementedError`. Annotate functions must always " -"support :attr:`~annotationlib.Format.VALUE` format; they must not " -"raise :exc:`NotImplementedError()` when called with this format." +"If an annotate function doesn't support the requested format, it must raise :" +"exc:`NotImplementedError`. Annotate functions must always support :attr:" +"`~annotationlib.Format.VALUE` format; they must not raise :exc:" +"`NotImplementedError()` when called with this format." msgstr "" -#: ../../reference/datamodel.rst:3630 +#: ../../reference/datamodel.rst:3633 msgid "" "When called with :attr:`~annotationlib.Format.VALUE` format, an annotate " "function may raise :exc:`NameError`; it must not raise :exc:`!NameError` " "when called requesting any other format." msgstr "" -#: ../../reference/datamodel.rst:3633 +#: ../../reference/datamodel.rst:3636 msgid "" "If an object does not have any annotations, :attr:`~object.__annotate__` " "should preferably be set to ``None`` (it can’t be deleted), rather than set " "to a function that returns an empty dict." msgstr "" -#: ../../reference/datamodel.rst:3640 +#: ../../reference/datamodel.rst:3643 msgid ":pep:`649` --- Deferred evaluation of annotation using descriptors" msgstr "" -#: ../../reference/datamodel.rst:3641 +#: ../../reference/datamodel.rst:3644 msgid "" "Introduces lazy evaluation of annotations and the ``__annotate__`` function." msgstr "" -#: ../../reference/datamodel.rst:3647 +#: ../../reference/datamodel.rst:3650 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3649 +#: ../../reference/datamodel.rst:3652 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -4309,7 +4314,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3654 +#: ../../reference/datamodel.rst:3657 msgid "" ">>> class C:\n" "... pass\n" @@ -4331,7 +4336,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: object of type 'C' has no len()" -#: ../../reference/datamodel.rst:3664 +#: ../../reference/datamodel.rst:3667 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -4340,7 +4345,7 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3671 +#: ../../reference/datamodel.rst:3674 msgid "" ">>> 1 .__hash__() == hash(1)\n" "True\n" @@ -4356,14 +4361,14 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: descriptor '__hash__' of 'int' object needs an argument" -#: ../../reference/datamodel.rst:3678 +#: ../../reference/datamodel.rst:3681 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:3682 +#: ../../reference/datamodel.rst:3685 msgid "" ">>> type(1).__hash__(1) == hash(1)\n" "True\n" @@ -4375,14 +4380,14 @@ msgstr "" ">>> type(int).__hash__(int) == hash(int)\n" "True" -#: ../../reference/datamodel.rst:3687 +#: ../../reference/datamodel.rst:3690 msgid "" "In addition to bypassing any instance attributes in the interest of " -"correctness, implicit special method lookup generally also bypasses " -"the :meth:`~object.__getattribute__` method even of the object's metaclass::" +"correctness, implicit special method lookup generally also bypasses the :" +"meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:3691 +#: ../../reference/datamodel.rst:3694 msgid "" ">>> class Meta(type):\n" "... def __getattribute__(*args):\n" @@ -4407,7 +4412,7 @@ msgid "" "10" msgstr "" -#: ../../reference/datamodel.rst:3713 +#: ../../reference/datamodel.rst:3716 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -4416,106 +4421,103 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3724 +#: ../../reference/datamodel.rst:3727 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3728 +#: ../../reference/datamodel.rst:3731 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3730 +#: ../../reference/datamodel.rst:3733 msgid "" -"An :term:`awaitable` object generally implements " -"an :meth:`~object.__await__` method. :term:`Coroutine objects ` " -"returned from :keyword:`async def` functions are awaitable." +"An :term:`awaitable` object generally implements an :meth:`~object." +"__await__` method. :term:`Coroutine objects ` returned from :" +"keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:3736 +#: ../../reference/datamodel.rst:3739 msgid "" "The :term:`generator iterator` objects returned from generators decorated " -"with :func:`types.coroutine` are also awaitable, but they do not " -"implement :meth:`~object.__await__`." +"with :func:`types.coroutine` are also awaitable, but they do not implement :" +"meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:3742 +#: ../../reference/datamodel.rst:3745 msgid "" -"Must return an :term:`iterator`. Should be used to " -"implement :term:`awaitable` objects. For instance, :class:`asyncio.Future` " -"implements this method to be compatible with the :keyword:`await` " -"expression. The :class:`object` class itself is not awaitable and does not " -"provide this method." +"Must return an :term:`iterator`. Should be used to implement :term:" +"`awaitable` objects. For instance, :class:`asyncio.Future` implements this " +"method to be compatible with the :keyword:`await` expression. The :class:" +"`object` class itself is not awaitable and does not provide this method." msgstr "" -#: ../../reference/datamodel.rst:3750 +#: ../../reference/datamodel.rst:3753 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " -"specific to the implementation of the asynchronous execution framework " -"(e.g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." +"specific to the implementation of the asynchronous execution framework (e." +"g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3758 +#: ../../reference/datamodel.rst:3761 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3764 +#: ../../reference/datamodel.rst:3767 msgid "Coroutine Objects" msgstr "協程物件" -#: ../../reference/datamodel.rst:3766 +#: ../../reference/datamodel.rst:3769 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " "and iterating over the result. When the coroutine has finished executing " -"and returns, the iterator raises :exc:`StopIteration`, and the " -"exception's :attr:`~StopIteration.value` attribute holds the return value. " -"If the coroutine raises an exception, it is propagated by the iterator. " -"Coroutines should not directly raise unhandled :exc:`StopIteration` " -"exceptions." +"and returns, the iterator raises :exc:`StopIteration`, and the exception's :" +"attr:`~StopIteration.value` attribute holds the return value. If the " +"coroutine raises an exception, it is propagated by the iterator. Coroutines " +"should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3774 +#: ../../reference/datamodel.rst:3777 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:3778 +#: ../../reference/datamodel.rst:3781 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3784 +#: ../../reference/datamodel.rst:3787 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " -"is equivalent to advancing the iterator returned " -"by :meth:`~object.__await__`. If *value* is not ``None``, this method " -"delegates to the :meth:`~generator.send` method of the iterator that caused " -"the coroutine to suspend. The result (return value, :exc:`StopIteration`, " -"or other exception) is the same as when iterating over the :meth:`!" -"__await__` return value, described above." +"is equivalent to advancing the iterator returned by :meth:`~object." +"__await__`. If *value* is not ``None``, this method delegates to the :meth:" +"`~generator.send` method of the iterator that caused the coroutine to " +"suspend. The result (return value, :exc:`StopIteration`, or other " +"exception) is the same as when iterating over the :meth:`!__await__` return " +"value, described above." msgstr "" -#: ../../reference/datamodel.rst:3795 +#: ../../reference/datamodel.rst:3798 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " "coroutine to suspend, if it has such a method. Otherwise, the exception is " -"raised at the suspension point. The result (return " -"value, :exc:`StopIteration`, or other exception) is the same as when " -"iterating over the :meth:`~object.__await__` return value, described above. " -"If the exception is not caught in the coroutine, it propagates back to the " -"caller." +"raised at the suspension point. The result (return value, :exc:" +"`StopIteration`, or other exception) is the same as when iterating over the :" +"meth:`~object.__await__` return value, described above. If the exception is " +"not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3806 +#: ../../reference/datamodel.rst:3809 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3811 +#: ../../reference/datamodel.rst:3814 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -4525,46 +4527,46 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3819 +#: ../../reference/datamodel.rst:3822 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3825 +#: ../../reference/datamodel.rst:3828 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3827 +#: ../../reference/datamodel.rst:3830 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3830 +#: ../../reference/datamodel.rst:3833 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3832 ../../reference/datamodel.rst:3881 +#: ../../reference/datamodel.rst:3835 ../../reference/datamodel.rst:3884 msgid "The :class:`object` class itself does not provide these methods." msgstr "" -#: ../../reference/datamodel.rst:3837 +#: ../../reference/datamodel.rst:3840 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3841 +#: ../../reference/datamodel.rst:3844 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3844 +#: ../../reference/datamodel.rst:3847 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3846 +#: ../../reference/datamodel.rst:3849 msgid "" "class Reader:\n" " async def readline(self):\n" @@ -4592,53 +4594,53 @@ msgstr "" " raise StopAsyncIteration\n" " return val" -#: ../../reference/datamodel.rst:3861 +#: ../../reference/datamodel.rst:3864 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3866 +#: ../../reference/datamodel.rst:3869 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " -"asynchronous iterator object. Returning anything else will result in " -"a :exc:`TypeError` error." +"asynchronous iterator object. Returning anything else will result in a :exc:" +"`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3874 +#: ../../reference/datamodel.rst:3877 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3876 +#: ../../reference/datamodel.rst:3879 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3879 +#: ../../reference/datamodel.rst:3882 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3885 +#: ../../reference/datamodel.rst:3888 msgid "" "Semantically similar to :meth:`~object.__enter__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3890 +#: ../../reference/datamodel.rst:3893 msgid "" "Semantically similar to :meth:`~object.__exit__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3893 +#: ../../reference/datamodel.rst:3896 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3895 +#: ../../reference/datamodel.rst:3898 msgid "" "class AsyncContextManager:\n" " async def __aenter__(self):\n" @@ -4654,26 +4656,27 @@ msgstr "" " async def __aexit__(self, exc_type, exc, tb):\n" " await log('exiting context')" -#: ../../reference/datamodel.rst:3906 +#: ../../reference/datamodel.rst:3909 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3907 +#: ../../reference/datamodel.rst:3910 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3911 +#: ../../reference/datamodel.rst:3914 msgid "" -"The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object.__reversed__`, :meth:`~object.__contains__`, :meth:`~object.__class_getitem__` " -"and :meth:`~os.PathLike.__fspath__` methods have special handling for this. " -"Others will still raise a :exc:`TypeError`, but may do so by relying on the " -"behavior that ``None`` is not callable." +"The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." +"__reversed__`, :meth:`~object.__contains__`, :meth:`~object." +"__class_getitem__` and :meth:`~os.PathLike.__fspath__` methods have special " +"handling for this. Others will still raise a :exc:`TypeError`, but may do so " +"by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3918 +#: ../../reference/datamodel.rst:3921 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns :data:`NotImplemented`. Do not set the method to ``None`` if " @@ -4681,14 +4684,14 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3924 +#: ../../reference/datamodel.rst:3927 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method (such as :meth:`~object.__add__`) fails then the operation is not " "supported, which is why the reflected method is not called." msgstr "" -#: ../../reference/datamodel.rst:3928 +#: ../../reference/datamodel.rst:3931 msgid "" "If the right operand's type is a subclass of the left operand's type, the " "reflected method having precedence allows subclasses to override their " @@ -4711,7 +4714,7 @@ msgstr "" #: ../../reference/datamodel.rst:1313 ../../reference/datamodel.rst:1340 #: ../../reference/datamodel.rst:1412 ../../reference/datamodel.rst:1520 #: ../../reference/datamodel.rst:1628 ../../reference/datamodel.rst:1745 -#: ../../reference/datamodel.rst:2170 ../../reference/datamodel.rst:3194 +#: ../../reference/datamodel.rst:2170 ../../reference/datamodel.rst:3197 msgid "object" msgstr "object(物件)" @@ -4725,9 +4728,9 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:1369 ../../reference/datamodel.rst:1828 #: ../../reference/datamodel.rst:2071 ../../reference/datamodel.rst:2077 #: ../../reference/datamodel.rst:2170 ../../reference/datamodel.rst:2732 -#: ../../reference/datamodel.rst:3164 ../../reference/datamodel.rst:3322 -#: ../../reference/datamodel.rst:3357 ../../reference/datamodel.rst:3425 -#: ../../reference/datamodel.rst:3435 ../../reference/datamodel.rst:3463 +#: ../../reference/datamodel.rst:3167 ../../reference/datamodel.rst:3325 +#: ../../reference/datamodel.rst:3360 ../../reference/datamodel.rst:3428 +#: ../../reference/datamodel.rst:3438 ../../reference/datamodel.rst:3466 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -4821,7 +4824,7 @@ msgstr "..." #: ../../reference/datamodel.rst:187 msgid "ellipsis literal" -msgstr "ellipsis literal(刪節號)" +msgstr "ellipsis literal(刪節號字面值)" #: ../../reference/datamodel.rst:199 ../../reference/datamodel.rst:1340 msgid "numeric" @@ -4860,12 +4863,12 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:288 ../../reference/datamodel.rst:3435 +#: ../../reference/datamodel.rst:288 ../../reference/datamodel.rst:3438 msgid "complex" msgstr "complex(複數)" #: ../../reference/datamodel.rst:301 ../../reference/datamodel.rst:432 -#: ../../reference/datamodel.rst:471 ../../reference/datamodel.rst:3164 +#: ../../reference/datamodel.rst:471 ../../reference/datamodel.rst:3167 msgid "len" msgstr "len" @@ -4958,7 +4961,7 @@ msgstr "assignment(賦值)" #: ../../reference/datamodel.rst:393 ../../reference/datamodel.rst:875 #: ../../reference/datamodel.rst:1782 ../../reference/datamodel.rst:1964 -#: ../../reference/datamodel.rst:3487 +#: ../../reference/datamodel.rst:3490 msgid "statement" msgstr "statement(陳述式)" @@ -5130,7 +5133,7 @@ msgstr "generator(產生器)" msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:777 ../../reference/datamodel.rst:3720 +#: ../../reference/datamodel.rst:777 ../../reference/datamodel.rst:3723 msgid "coroutine" msgstr "coroutine(協程)" @@ -5514,7 +5517,7 @@ msgstr "try" msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1828 ../../reference/datamodel.rst:3194 +#: ../../reference/datamodel.rst:1828 ../../reference/datamodel.rst:3197 msgid "slice" msgstr "slice(切片)" @@ -5654,38 +5657,38 @@ msgstr "__class__ (方法 cell)" msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:3164 +#: ../../reference/datamodel.rst:3167 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:3322 ../../reference/datamodel.rst:3357 +#: ../../reference/datamodel.rst:3325 ../../reference/datamodel.rst:3360 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:3322 ../../reference/datamodel.rst:3357 +#: ../../reference/datamodel.rst:3325 ../../reference/datamodel.rst:3360 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:3425 +#: ../../reference/datamodel.rst:3428 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:3435 +#: ../../reference/datamodel.rst:3438 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:3435 +#: ../../reference/datamodel.rst:3438 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:3463 +#: ../../reference/datamodel.rst:3466 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:3487 +#: ../../reference/datamodel.rst:3490 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:3487 +#: ../../reference/datamodel.rst:3490 msgid "context manager" msgstr "context manager(情境管理器)" diff --git a/reference/lexical_analysis.po b/reference/lexical_analysis.po index f2ddf07d1b..77097686ef 100644 --- a/reference/lexical_analysis.po +++ b/reference/lexical_analysis.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -23,18 +23,18 @@ msgstr "詞法分析" #: ../../reference/lexical_analysis.rst:10 msgid "" -"A Python program is read by a *parser*. Input to the parser is a stream " -"of :term:`tokens `, generated by the *lexical analyzer* (also known " -"as the *tokenizer*). This chapter describes how the lexical analyzer breaks " -"a file into tokens." +"A Python program is read by a *parser*. Input to the parser is a stream of :" +"term:`tokens `, generated by the *lexical analyzer* (also known as " +"the *tokenizer*). This chapter describes how the lexical analyzer breaks a " +"file into tokens." msgstr "" #: ../../reference/lexical_analysis.rst:15 msgid "" "Python reads program text as Unicode code points; the encoding of a source " -"file can be given by an encoding declaration and defaults to UTF-8, " -"see :pep:`3120` for details. If the source file cannot be decoded, " -"a :exc:`SyntaxError` is raised." +"file can be given by an encoding declaration and defaults to UTF-8, see :pep:" +"`3120` for details. If the source file cannot be decoded, a :exc:" +"`SyntaxError` is raised." msgstr "" #: ../../reference/lexical_analysis.rst:24 @@ -51,12 +51,12 @@ msgstr "" #: ../../reference/lexical_analysis.rst:38 msgid "" -"The end of a logical line is represented by the " -"token :data:`~token.NEWLINE`. Statements cannot cross logical line " -"boundaries except where :data:`!NEWLINE` is allowed by the syntax (e.g., " -"between statements in compound statements). A logical line is constructed " -"from one or more *physical lines* by following the :ref:`explicit ` or :ref:`implicit ` *line joining* rules." +"The end of a logical line is represented by the token :data:`~token." +"NEWLINE`. Statements cannot cross logical line boundaries except where :data:" +"`!NEWLINE` is allowed by the syntax (e.g., between statements in compound " +"statements). A logical line is constructed from one or more *physical lines* " +"by following the :ref:`explicit ` or :ref:`implicit " +"` *line joining* rules." msgstr "" #: ../../reference/lexical_analysis.rst:49 @@ -216,6 +216,10 @@ msgid "" " 'Juli', 'Augustus', 'September', # for the months\n" " 'Oktober', 'November', 'December'] # of the year" msgstr "" +"month_names = ['Januari', 'Februari', 'Maart', # 這些是\n" +" 'April', 'Mei', 'Juni', # 荷蘭文的\n" +" 'Juli', 'Augustus', 'September', # 一年之中\n" +" 'Oktober', 'November', 'December'] # 月份名稱" #: ../../reference/lexical_analysis.rst:172 msgid "" @@ -288,9 +292,8 @@ msgstr "" #: ../../reference/lexical_analysis.rst:230 msgid "" -"The indentation levels of consecutive lines are used to " -"generate :data:`~token.INDENT` and :data:`~token.DEDENT` tokens, using a " -"stack, as follows." +"The indentation levels of consecutive lines are used to generate :data:" +"`~token.INDENT` and :data:`~token.DEDENT` tokens, using a stack, as follows." msgstr "" #: ../../reference/lexical_analysis.rst:234 @@ -302,10 +305,10 @@ msgid "" "the stack. If it is equal, nothing happens. If it is larger, it is pushed on " "the stack, and one :data:`!INDENT` token is generated. If it is smaller, it " "*must* be one of the numbers occurring on the stack; all numbers on the " -"stack that are larger are popped off, and for each number popped off " -"a :data:`!DEDENT` token is generated. At the end of the file, a :data:`!" -"DEDENT` token is generated for each number remaining on the stack that is " -"larger than zero." +"stack that are larger are popped off, and for each number popped off a :data:" +"`!DEDENT` token is generated. At the end of the file, a :data:`!DEDENT` " +"token is generated for each number remaining on the stack that is larger " +"than zero." msgstr "" #: ../../reference/lexical_analysis.rst:245 @@ -372,8 +375,8 @@ msgstr "" #: ../../reference/lexical_analysis.rst:293 msgid "" -"At the end of non-interactive input, the lexical analyzer generates " -"an :data:`~token.ENDMARKER` token." +"At the end of non-interactive input, the lexical analyzer generates an :data:" +"`~token.ENDMARKER` token." msgstr "" #: ../../reference/lexical_analysis.rst:300 @@ -382,15 +385,14 @@ msgstr "" #: ../../reference/lexical_analysis.rst:302 msgid "" -"Besides :data:`~token.NEWLINE`, :data:`~token.INDENT` " -"and :data:`~token.DEDENT`, the following categories of tokens exist: " -"*identifiers* and *keywords* (:data:`~token.NAME`), *literals* (such " -"as :data:`~token.NUMBER` and :data:`~token.STRING`), and other symbols " -"(*operators* and *delimiters*, :data:`~token.OP`). Whitespace characters " -"(other than logical line terminators, discussed earlier) are not tokens, but " -"serve to delimit tokens. Where ambiguity exists, a token comprises the " -"longest possible string that forms a legal token, when read from left to " -"right." +"Besides :data:`~token.NEWLINE`, :data:`~token.INDENT` and :data:`~token." +"DEDENT`, the following categories of tokens exist: *identifiers* and " +"*keywords* (:data:`~token.NAME`), *literals* (such as :data:`~token.NUMBER` " +"and :data:`~token.STRING`), and other symbols (*operators* and " +"*delimiters*, :data:`~token.OP`). Whitespace characters (other than logical " +"line terminators, discussed earlier) are not tokens, but serve to delimit " +"tokens. Where ambiguity exists, a token comprises the longest possible " +"string that forms a legal token, when read from left to right." msgstr "" #: ../../reference/lexical_analysis.rst:316 @@ -498,8 +500,8 @@ msgstr "" #: ../../reference/lexical_analysis.rst:358 msgid "" -"```` - another explicit set of characters in " -"`PropList.txt`_ to support backwards compatibility" +"```` - another explicit set of characters in `PropList." +"txt`_ to support backwards compatibility" msgstr "" #: ../../reference/lexical_analysis.rst:361 @@ -510,8 +512,8 @@ msgstr "" #: ../../reference/lexical_analysis.rst:364 msgid "" -"These sets are based on the Unicode standard annex `UAX-31`_. See " -"also :pep:`3131` for further details." +"These sets are based on the Unicode standard annex `UAX-31`_. See also :pep:" +"`3131` for further details." msgstr "" #: ../../reference/lexical_analysis.rst:367 @@ -616,16 +618,16 @@ msgstr "``_``" #: ../../reference/lexical_analysis.rst:457 msgid "" -"In a ``case`` pattern within a :keyword:`match` statement, ``_`` is " -"a :ref:`soft keyword ` that denotes a :ref:`wildcard " -"`." +"In a ``case`` pattern within a :keyword:`match` statement, ``_`` is a :ref:" +"`soft keyword ` that denotes a :ref:`wildcard `." msgstr "" #: ../../reference/lexical_analysis.rst:461 msgid "" "Separately, the interactive interpreter makes the result of the last " -"evaluation available in the variable ``_``. (It is stored in " -"the :mod:`builtins` module, alongside built-in functions like ``print``.)" +"evaluation available in the variable ``_``. (It is stored in the :mod:" +"`builtins` module, alongside built-in functions like ``print``.)" msgstr "" #: ../../reference/lexical_analysis.rst:466 @@ -681,8 +683,8 @@ msgstr "" #: ../../reference/lexical_analysis.rst:501 msgid "" -"In terms of lexical analysis, Python has :ref:`string, bytes ` " -"and :ref:`numeric ` literals." +"In terms of lexical analysis, Python has :ref:`string, bytes ` and :" +"ref:`numeric ` literals." msgstr "" #: ../../reference/lexical_analysis.rst:504 @@ -707,6 +709,8 @@ msgid "" "\"spam\"\n" "'eggs'" msgstr "" +"\"spam\"\n" +"'eggs'" #: ../../reference/lexical_analysis.rst:525 msgid "" @@ -720,6 +724,8 @@ msgid "" "'Say \"Hello\", please.'\n" "\"Don't do that!\"" msgstr "" +"'Say \"Hello\", please.'\n" +"\"Don't do that!\"" #: ../../reference/lexical_analysis.rst:534 msgid "" @@ -729,10 +735,10 @@ msgstr "" #: ../../reference/lexical_analysis.rst:537 msgid "" -"Inside a string literal, the backslash (``\\``) character introduces " -"an :dfn:`escape sequence`, which has special meaning depending on the " -"character after the backslash. For example, ``\\\"`` denotes the double " -"quote character, and does *not* end the string:" +"Inside a string literal, the backslash (``\\``) character introduces an :dfn:" +"`escape sequence`, which has special meaning depending on the character " +"after the backslash. For example, ``\\\"`` denotes the double quote " +"character, and does *not* end the string:" msgstr "" #: ../../reference/lexical_analysis.rst:543 @@ -845,8 +851,8 @@ msgstr "" #: ../../reference/lexical_analysis.rst:610 msgid "" "Support for the unicode legacy literal (``u'value'``) was reintroduced to " -"simplify the maintenance of dual Python 2.x and 3.x codebases. " -"See :pep:`414` for more information." +"simplify the maintenance of dual Python 2.x and 3.x codebases. See :pep:" +"`414` for more information." msgstr "" #: ../../reference/lexical_analysis.rst:616 @@ -897,7 +903,7 @@ msgstr "``\\``\\ " #: ../../reference/lexical_analysis.rst:675 msgid ":ref:`string-escape-ignore`" -msgstr "" +msgstr ":ref:`string-escape-ignore`" #: ../../reference/lexical_analysis.rst:676 msgid "``\\\\``" @@ -985,7 +991,7 @@ msgstr ":samp:`\\\\\\\\{ooo}`" #: ../../reference/lexical_analysis.rst:697 msgid ":ref:`string-escape-oct`" -msgstr "" +msgstr ":ref:`string-escape-oct`" #: ../../reference/lexical_analysis.rst:698 msgid ":samp:`\\\\x{hh}`" @@ -993,7 +999,7 @@ msgstr ":samp:`\\\\x{hh}`" #: ../../reference/lexical_analysis.rst:699 msgid ":ref:`string-escape-hex`" -msgstr "" +msgstr ":ref:`string-escape-hex`" #: ../../reference/lexical_analysis.rst:700 msgid ":samp:`\\\\N\\\\{{name}\\\\}`" @@ -1001,7 +1007,7 @@ msgstr ":samp:`\\\\N\\\\{{name}\\\\}`" #: ../../reference/lexical_analysis.rst:701 msgid ":ref:`string-escape-named`" -msgstr "" +msgstr ":ref:`string-escape-named`" #: ../../reference/lexical_analysis.rst:702 msgid ":samp:`\\\\u{xxxx}`" @@ -1102,15 +1108,15 @@ msgstr "" #: ../../reference/lexical_analysis.rst:755 msgid "" -"Octal escapes with value larger than ``0o377`` (255) produce " -"a :exc:`DeprecationWarning`." +"Octal escapes with value larger than ``0o377`` (255) produce a :exc:" +"`DeprecationWarning`." msgstr "" #: ../../reference/lexical_analysis.rst:759 msgid "" -"Octal escapes with value larger than ``0o377`` (255) produce " -"a :exc:`SyntaxWarning`. In a future Python version they will raise " -"a :exc:`SyntaxError`." +"Octal escapes with value larger than ``0o377`` (255) produce a :exc:" +"`SyntaxWarning`. In a future Python version they will raise a :exc:" +"`SyntaxError`." msgstr "" #: ../../reference/lexical_analysis.rst:767 @@ -1245,8 +1251,8 @@ msgid "" ":dfn:`Bytes literals` are always prefixed with '``b``' or '``B``'; they " "produce an instance of the :class:`bytes` type instead of the :class:`str` " "type. They may only contain ASCII characters; bytes with a numeric value of " -"128 or greater must be expressed with escape sequences " -"(typically :ref:`string-escape-hex` or :ref:`string-escape-oct`):" +"128 or greater must be expressed with escape sequences (typically :ref:" +"`string-escape-hex` or :ref:`string-escape-oct`):" msgstr "" #: ../../reference/lexical_analysis.rst:861 @@ -1550,22 +1556,20 @@ msgstr "" #: ../../reference/lexical_analysis.rst:1099 msgid "" "The :func:`format` protocol is not used. Instead, the format specifier and " -"conversions (if any) are passed to a " -"new :class:`~string.templatelib.Interpolation` object that is created for " -"each evaluated expression. It is up to code that processes the " -"resulting :class:`~string.templatelib.Template` object to decide how to " -"handle format specifiers and conversions." +"conversions (if any) are passed to a new :class:`~string.templatelib." +"Interpolation` object that is created for each evaluated expression. It is " +"up to code that processes the resulting :class:`~string.templatelib." +"Template` object to decide how to handle format specifiers and conversions." msgstr "" #: ../../reference/lexical_analysis.rst:1106 msgid "" "Format specifiers containing nested replacement fields are evaluated " -"eagerly, prior to being passed to " -"the :class:`~string.templatelib.Interpolation` object. For instance, an " -"interpolation of the form ``{amount:.{precision}f}`` will evaluate the inner " -"expression ``{precision}`` to determine the value of the ``format_spec`` " -"attribute. If ``precision`` were to be ``2``, the resulting format specifier " -"would be ``'.2f'``." +"eagerly, prior to being passed to the :class:`~string.templatelib." +"Interpolation` object. For instance, an interpolation of the form ``{amount:." +"{precision}f}`` will evaluate the inner expression ``{precision}`` to " +"determine the value of the ``format_spec`` attribute. If ``precision`` were " +"to be ``2``, the resulting format specifier would be ``'.2f'``." msgstr "" #: ../../reference/lexical_analysis.rst:1114 @@ -1574,10 +1578,10 @@ msgid "" "text of the expression is appended to the literal string that precedes the " "relevant interpolation. This includes the equals sign and any surrounding " "whitespace. The :class:`!Interpolation` instance for the expression will be " -"created as normal, except " -"that :attr:`~string.templatelib.Interpolation.conversion` will be set to " -"'``r``' (:func:`repr`) by default. If an explicit conversion or format " -"specifier are provided, this will override the default behaviour." +"created as normal, except that :attr:`~string.templatelib.Interpolation." +"conversion` will be set to '``r``' (:func:`repr`) by default. If an explicit " +"conversion or format specifier are provided, this will override the default " +"behaviour." msgstr "" #: ../../reference/lexical_analysis.rst:1128 @@ -1618,6 +1622,9 @@ msgid "" "3\n" "2147483647" msgstr "" +"7\n" +"3\n" +"2147483647" #: ../../reference/lexical_analysis.rst:1169 msgid "" @@ -1627,7 +1634,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:1172 msgid "7922816251426433759354395033679228162514264337593543950336" -msgstr "" +msgstr "7922816251426433759354395033679228162514264337593543950336" #: ../../reference/lexical_analysis.rst:1174 msgid "" @@ -1642,6 +1649,9 @@ msgid "" "100000000000\n" "1_00_00_00_00_000" msgstr "" +"100_000_000_000\n" +"100000000000\n" +"1_00_00_00_00_000" #: ../../reference/lexical_analysis.rst:1182 msgid "" @@ -1666,6 +1676,12 @@ msgid "" "0xdeadbeef\n" "0xDead_Beef" msgstr "" +"0b100110111\n" +"0b_1110_0101\n" +"0o177\n" +"0o377\n" +"0xdeadbeef\n" +"0xDead_Beef" #: ../../reference/lexical_analysis.rst:1197 msgid "" @@ -1697,8 +1713,8 @@ msgstr "浮點數常數 (Floating-point literals)" #: ../../reference/lexical_analysis.rst:1236 msgid "" -"Floating-point (float) literals, such as ``3.14`` or ``1.5``, " -"denote :ref:`approximations of real numbers `." +"Floating-point (float) literals, such as ``3.14`` or ``1.5``, denote :ref:" +"`approximations of real numbers `." msgstr "" #: ../../reference/lexical_analysis.rst:1239 @@ -1712,6 +1728,8 @@ msgid "" "2.71828\n" "4.0" msgstr "" +"2.71828\n" +"4.0" #: ../../reference/lexical_analysis.rst:1245 msgid "" @@ -1730,6 +1748,8 @@ msgid "" "96_485.332_123\n" "3.14_15_93" msgstr "" +"96_485.332_123\n" +"3.14_15_93" #: ../../reference/lexical_analysis.rst:1254 msgid "Either of these parts, but not both, can be empty. For example::" @@ -1740,6 +1760,8 @@ msgid "" "10. # (equivalent to 10.0)\n" ".001 # (equivalent to 0.001)" msgstr "" +"10. # (相當於 10.0)\n" +".001 # (相當於 0.001)" #: ../../reference/lexical_analysis.rst:1259 msgid "" @@ -1767,6 +1789,8 @@ msgid "" "1e3 # (equivalent to 1.e3 and 1.0e3)\n" "0e0 # (equivalent to 0.)" msgstr "" +"1e3 # (相當於 1.e3 和 1.0e3)\n" +"0e0 # (相當於 0.)" #: ../../reference/lexical_analysis.rst:1274 msgid "" @@ -1794,7 +1818,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:1308 msgid "3+4.2j" -msgstr "" +msgstr "3+4.2j" #: ../../reference/lexical_analysis.rst:1310 msgid "" @@ -1806,7 +1830,7 @@ msgstr "" #: ../../reference/lexical_analysis.rst:1316 msgid "3 + 4.2j" -msgstr "" +msgstr "3 + 4.2j" #: ../../reference/lexical_analysis.rst:1318 msgid "" @@ -1851,6 +1875,9 @@ msgid "" "0j\n" "1000000000000000000000000j # equivalent to 1e+24j" msgstr "" +"10j\n" +"0j\n" +"1000000000000000000000000j # 相當於 1e+24j" #: ../../reference/lexical_analysis.rst:1341 msgid "" @@ -1867,88 +1894,52 @@ msgid "" "definition:" msgstr "" -#: ../../reference/lexical_analysis.rst:1357 -msgid "Operators" -msgstr "" - -#: ../../reference/lexical_analysis.rst:1361 -msgid "The following tokens are operators:" -msgstr "" - -#: ../../reference/lexical_analysis.rst:1363 -msgid "" -"+ - * ** / // % @\n" -"<< >> & | ^ ~ :=\n" -"< > <= >= == !=" -msgstr "" -"+ - * ** / // % @\n" -"<< >> & | ^ ~ :=\n" -"< > <= >= == !=" - -#: ../../reference/lexical_analysis.rst:1374 -msgid "Delimiters" -msgstr "" - -#: ../../reference/lexical_analysis.rst:1378 -msgid "The following tokens serve as delimiters in the grammar:" +#: ../../reference/lexical_analysis.rst:1359 +msgid "Operators and delimiters" msgstr "" -#: ../../reference/lexical_analysis.rst:1380 +#: ../../reference/lexical_analysis.rst:1365 msgid "" -"( ) [ ] { }\n" -", : ! . ; @ =" -msgstr "" -"( ) [ ] { }\n" -", : ! . ; @ =" - -#: ../../reference/lexical_analysis.rst:1385 -msgid "The period can also occur in floating-point and imaginary literals." +"The following grammar defines :dfn:`operator` and :dfn:`delimiter` tokens, " +"that is, the generic :data:`~token.OP` token type. A :ref:`list of these " +"tokens and their names ` is also available in " +"the :mod:`!token` module documentation." msgstr "" -#: ../../reference/lexical_analysis.rst:1389 +#: ../../reference/lexical_analysis.rst:1394 msgid "" -"A sequence of three periods has a special meaning as an :py:data:`Ellipsis` " -"literal:" +"Generally, *operators* are used to combine :ref:`expressions `, " +"while *delimiters* serve other purposes. However, there is no clear, formal " +"distinction between the two categories." msgstr "" -#: ../../reference/lexical_analysis.rst:1392 -msgid "..." -msgstr "..." - -#: ../../reference/lexical_analysis.rst:1396 +#: ../../reference/lexical_analysis.rst:1398 msgid "" -"The following *augmented assignment operators* serve lexically as " -"delimiters, but also perform an operation:" +"Some tokens can serve as either operators or delimiters, depending on usage. " +"For example, ``*`` is both the multiplication operator and a delimiter used " +"for sequence unpacking, and ``@`` is both the matrix multiplication and a " +"delimiter that introduces decorators." msgstr "" -#: ../../reference/lexical_analysis.rst:1399 +#: ../../reference/lexical_analysis.rst:1403 msgid "" -"-> += -= *= /= //= %=\n" -"@= &= |= ^= >>= <<= **=" +"For some tokens, the distinction is unclear. For example, some people " +"consider ``.``, ``(``, and ``)`` to be delimiters, while others see the :py:" +"func:`getattr` operator and the function call operator(s)." msgstr "" -"-> += -= *= /= //= %=\n" -"@= &= |= ^= >>= <<= **=" -#: ../../reference/lexical_analysis.rst:1404 +#: ../../reference/lexical_analysis.rst:1407 msgid "" -"The following printing ASCII characters have special meaning as part of " -"other tokens or are otherwise significant to the lexical analyzer:" +"Some of Python's operators, like ``and``, ``or``, and ``not in``, use :ref:" +"`keyword ` tokens rather than \"symbols\" (operator tokens)." msgstr "" -#: ../../reference/lexical_analysis.rst:1407 -msgid "' \" # \\" -msgstr "' \" # \\" - -#: ../../reference/lexical_analysis.rst:1411 +#: ../../reference/lexical_analysis.rst:1410 msgid "" -"The following printing ASCII characters are not used in Python. Their " -"occurrence outside string literals and comments is an unconditional error:" +"A sequence of three consecutive periods (``...``) has a special meaning as " +"an :py:data:`Ellipsis` literal." msgstr "" -#: ../../reference/lexical_analysis.rst:1414 -msgid "$ ? `" -msgstr "$ ? `" - #: ../../reference/lexical_analysis.rst:8 msgid "lexical analysis" msgstr "lexical analysis(詞法分析)" @@ -2357,88 +2348,10 @@ msgstr "e" msgid "j" msgstr "j" -#: ../../reference/lexical_analysis.rst:1359 +#: ../../reference/lexical_analysis.rst:1361 msgid "operators" msgstr "operators(運算子)" -#: ../../reference/lexical_analysis.rst:1376 +#: ../../reference/lexical_analysis.rst:1361 msgid "delimiters" msgstr "delimiters(分隔符號)" - -#~ msgid "*Lu* - uppercase letters" -#~ msgstr "*Lu* - 大寫字母" - -#~ msgid "*Ll* - lowercase letters" -#~ msgstr "*Ll* - 小寫字母" - -#~ msgid "*Lo* - other letters" -#~ msgstr "*Lo* - 其他字母" - -#~ msgid "*Nd* - decimal numbers" -#~ msgstr "*Nd* - 十進位數字" - -#~ msgid "Notes" -#~ msgstr "註解" - -#~ msgid "\\(1)" -#~ msgstr "\\(1)" - -#~ msgid "Single quote (``'``)" -#~ msgstr "單引號 (``'``)" - -#~ msgid "Double quote (``\"``)" -#~ msgstr "雙引號 (``\"``)" - -#~ msgid "(2,4)" -#~ msgstr "(2,4)" - -#~ msgid "(3,4)" -#~ msgstr "(3,4)" - -#~ msgid "\\(5)" -#~ msgstr "\\(5)" - -#~ msgid "\\(6)" -#~ msgstr "\\(6)" - -#~ msgid "\\(7)" -#~ msgstr "\\(7)" - -#~ msgid "Notes:" -#~ msgstr "註解:" - -#~ msgid "" -#~ "7 2147483647 0o177 0b100110111\n" -#~ "3 79228162514264337593543950336 0o377 0xdeadbeef\n" -#~ " 100_000_000_000 0b_1110_0101" -#~ msgstr "" -#~ "7 2147483647 0o177 0b100110111\n" -#~ "3 79228162514264337593543950336 0o377 0xdeadbeef\n" -#~ " 100_000_000_000 0b_1110_0101" - -#~ msgid "Some examples of floating-point literals::" -#~ msgstr "一些浮點數常數的範例: ::" - -#~ msgid "3.14 10. .001 1e100 3.14e-10 0e0 3.14_15_93" -#~ msgstr "3.14 10. .001 1e100 3.14e-10 0e0 3.14_15_93" - -#~ msgid "Footnotes" -#~ msgstr "註解" - -#~ msgid "Unicode Consortium" -#~ msgstr "Unicode Consortium" - -#~ msgid "raw string" -#~ msgstr "raw string(原始字串)" - -#~ msgid "``\\ooo``" -#~ msgstr "``\\ooo``" - -#~ msgid "``\\xhh``" -#~ msgstr "``\\xhh``" - -#~ msgid "``\\N{name}``" -#~ msgstr "``\\N{name}``" - -#~ msgid "``\\uxxxx``" -#~ msgstr "``\\uxxxx``" diff --git a/reference/simple_stmts.po b/reference/simple_stmts.po index 6c65954724..c06e84e396 100644 --- a/reference/simple_stmts.po +++ b/reference/simple_stmts.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-17 00:13+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -203,9 +203,9 @@ msgid "" "must yield an integer. If it is negative, the sequence's length is added to " "it. The resulting value must be a nonnegative integer less than the " "sequence's length, and the sequence is asked to assign the assigned object " -"to its item with that index. If the index is out of " -"range, :exc:`IndexError` is raised (assignment to a subscripted sequence " -"cannot add new items to a list)." +"to its item with that index. If the index is out of range, :exc:" +"`IndexError` is raised (assignment to a subscripted sequence cannot add new " +"items to a list)." msgstr "" #: ../../reference/simple_stmts.rst:211 @@ -379,8 +379,8 @@ msgid "" "If the right hand side is present, an annotated assignment performs the " "actual assignment as if there was no annotation present. If the right hand " "side is not present for an expression target, then the interpreter evaluates " -"the target except for the last :meth:`~object.__setitem__` " -"or :meth:`~object.__setattr__` call." +"the target except for the last :meth:`~object.__setitem__` or :meth:`~object." +"__setattr__` call." msgstr "" #: ../../reference/simple_stmts.rst:359 @@ -460,11 +460,11 @@ msgid "" "refer to the built-in variables with those names. In the current " "implementation, the built-in variable ``__debug__`` is ``True`` under normal " "circumstances, ``False`` when optimization is requested (command line " -"option :option:`-O`). The current code generator emits no code for " -"an :keyword:`assert` statement when optimization is requested at compile " -"time. Note that it is unnecessary to include the source code for the " -"expression that failed in the error message; it will be displayed as part of " -"the stack trace." +"option :option:`-O`). The current code generator emits no code for an :" +"keyword:`assert` statement when optimization is requested at compile time. " +"Note that it is unnecessary to include the source code for the expression " +"that failed in the error message; it will be displayed as part of the stack " +"trace." msgstr "" #: ../../reference/simple_stmts.rst:418 @@ -511,8 +511,8 @@ msgstr "" msgid "" "Deletion of a name removes the binding of that name from the local or global " "namespace, depending on whether the name occurs in a :keyword:`global` " -"statement in the same code block. If the name is unbound, " -"a :exc:`NameError` exception will be raised." +"statement in the same code block. Trying to delete an unbound name raises " +"a :exc:`NameError` exception." msgstr "" #: ../../reference/simple_stmts.rst:473 @@ -562,17 +562,16 @@ msgstr "" msgid "" "In a generator function, the :keyword:`return` statement indicates that the " "generator is done and will cause :exc:`StopIteration` to be raised. The " -"returned value (if any) is used as an argument to " -"construct :exc:`StopIteration` and becomes the :attr:`StopIteration.value` " -"attribute." +"returned value (if any) is used as an argument to construct :exc:" +"`StopIteration` and becomes the :attr:`StopIteration.value` attribute." msgstr "" #: ../../reference/simple_stmts.rst:515 msgid "" "In an asynchronous generator function, an empty :keyword:`return` statement " -"indicates that the asynchronous generator is done and will " -"cause :exc:`StopAsyncIteration` to be raised. A non-empty :keyword:`!" -"return` statement is a syntax error in an asynchronous generator function." +"indicates that the asynchronous generator is done and will cause :exc:" +"`StopAsyncIteration` to be raised. A non-empty :keyword:`!return` statement " +"is a syntax error in an asynchronous generator function." msgstr "" #: ../../reference/simple_stmts.rst:523 @@ -609,8 +608,8 @@ msgstr "" #: ../../reference/simple_stmts.rst:548 msgid "" -"Yield expressions and statements are only used when defining " -"a :term:`generator` function, and are only used in the body of the generator " +"Yield expressions and statements are only used when defining a :term:" +"`generator` function, and are only used in the body of the generator " "function. Using :keyword:`yield` in a function definition is sufficient to " "cause that definition to create a generator function instead of a normal " "function." @@ -618,8 +617,8 @@ msgstr "" #: ../../reference/simple_stmts.rst:553 msgid "" -"For full details of :keyword:`yield` semantics, refer to " -"the :ref:`yieldexpr` section." +"For full details of :keyword:`yield` semantics, refer to the :ref:" +"`yieldexpr` section." msgstr "" #: ../../reference/simple_stmts.rst:559 @@ -637,15 +636,15 @@ msgstr "" #: ../../reference/simple_stmts.rst:575 msgid "" "Otherwise, :keyword:`raise` evaluates the first expression as the exception " -"object. It must be either a subclass or an instance " -"of :class:`BaseException`. If it is a class, the exception instance will be " -"obtained when needed by instantiating the class with no arguments." +"object. It must be either a subclass or an instance of :class:" +"`BaseException`. If it is a class, the exception instance will be obtained " +"when needed by instantiating the class with no arguments." msgstr "" #: ../../reference/simple_stmts.rst:580 msgid "" -"The :dfn:`type` of the exception is the exception instance's class, " -"the :dfn:`value` is the instance itself." +"The :dfn:`type` of the exception is the exception instance's class, the :dfn:" +"`value` is the instance itself." msgstr "" #: ../../reference/simple_stmts.rst:585 @@ -715,8 +714,8 @@ msgstr "" #: ../../reference/simple_stmts.rst:626 msgid "" "A similar mechanism works implicitly if a new exception is raised when an " -"exception is already being handled. An exception may be handled when " -"an :keyword:`except` or :keyword:`finally` clause, or a :keyword:`with` " +"exception is already being handled. An exception may be handled when an :" +"keyword:`except` or :keyword:`finally` clause, or a :keyword:`with` " "statement, is used. The previous exception is then attached as the new " "exception's :attr:`~BaseException.__context__` attribute:" msgstr "" @@ -787,9 +786,9 @@ msgstr "" #: ../../reference/simple_stmts.rst:666 msgid "" -"Additional information on exceptions can be found in " -"section :ref:`exceptions`, and information about handling exceptions is in " -"section :ref:`try`." +"Additional information on exceptions can be found in section :ref:" +"`exceptions`, and information about handling exceptions is in section :ref:" +"`try`." msgstr "" #: ../../reference/simple_stmts.rst:669 @@ -816,8 +815,8 @@ msgstr ":keyword:`!break` 陳述式" #: ../../reference/simple_stmts.rst:695 msgid "" -":keyword:`break` may only occur syntactically nested in a :keyword:`for` " -"or :keyword:`while` loop, but not nested in a function or class definition " +":keyword:`break` may only occur syntactically nested in a :keyword:`for` or :" +"keyword:`while` loop, but not nested in a function or class definition " "within that loop." msgstr "" @@ -875,8 +874,8 @@ msgstr "" #: ../../reference/simple_stmts.rst:768 msgid "" -"define a name or names in the local namespace for the scope where " -"the :keyword:`import` statement occurs." +"define a name or names in the local namespace for the scope where the :" +"keyword:`import` statement occurs." msgstr "" #: ../../reference/simple_stmts.rst:771 @@ -905,8 +904,8 @@ msgstr "" #: ../../reference/simple_stmts.rst:789 msgid "" -"If the module name is followed by :keyword:`!as`, then the name " -"following :keyword:`!as` is bound directly to the imported module." +"If the module name is followed by :keyword:`!as`, then the name following :" +"keyword:`!as` is bound directly to the imported module." msgstr "" #: ../../reference/simple_stmts.rst:791 @@ -968,10 +967,10 @@ msgid "" "import foo # foo imported and bound locally\n" "import foo.bar.baz # foo, foo.bar, and foo.bar.baz imported, foo " "bound locally\n" -"import foo.bar.baz as fbb # foo, foo.bar, and foo.bar.baz imported, " -"foo.bar.baz bound as fbb\n" -"from foo.bar import baz # foo, foo.bar, and foo.bar.baz imported, " -"foo.bar.baz bound as baz\n" +"import foo.bar.baz as fbb # foo, foo.bar, and foo.bar.baz imported, foo.bar." +"baz bound as fbb\n" +"from foo.bar import baz # foo, foo.bar, and foo.bar.baz imported, foo.bar." +"baz bound as baz\n" "from foo import attr # foo imported and foo.attr bound as attr" msgstr "" @@ -1028,8 +1027,8 @@ msgstr "" #: ../../reference/simple_stmts.rst:871 msgid "" "Raises an :ref:`auditing event ` ``import`` with arguments " -"``module``, ``filename``, ``sys.path``, ``sys.meta_path``, " -"``sys.path_hooks``." +"``module``, ``filename``, ``sys.path``, ``sys.meta_path``, ``sys." +"path_hooks``." msgstr "" "引發一個附帶引數 ``module``、``filename``、``sys.path``、``sys.meta_path``、" "``sys.path_hooks`` 的\\ :ref:`稽核事件 ` ``import``。" @@ -1137,11 +1136,11 @@ msgstr "" #: ../../reference/simple_stmts.rst:941 msgid "" -"Code compiled by calls to the built-in functions :func:`exec` " -"and :func:`compile` that occur in a module :mod:`!M` containing a future " -"statement will, by default, use the new syntax or semantics associated with " -"the future statement. This can be controlled by optional arguments " -"to :func:`compile` --- see the documentation of that function for details." +"Code compiled by calls to the built-in functions :func:`exec` and :func:" +"`compile` that occur in a module :mod:`!M` containing a future statement " +"will, by default, use the new syntax or semantics associated with the future " +"statement. This can be controlled by optional arguments to :func:`compile` " +"--- see the documentation of that function for details." msgstr "" #: ../../reference/simple_stmts.rst:947 @@ -1188,8 +1187,8 @@ msgid "" "string or code object supplied to the built-in :func:`exec` function does " "not affect the code block *containing* the function call, and code contained " "in such a string is unaffected by :keyword:`!global` statements in the code " -"containing the function call. The same applies to the :func:`eval` " -"and :func:`compile` functions." +"containing the function call. The same applies to the :func:`eval` and :" +"func:`compile` functions." msgstr "" #: ../../reference/simple_stmts.rst:998 @@ -1204,8 +1203,8 @@ msgid "" "identifiers to refer to names previously bound in nonlocal scopes. It allows " "encapsulated code to rebind such nonlocal identifiers. If a name is bound " "in more than one nonlocal scope, the nearest binding is used. If a name is " -"not bound in any nonlocal scope, or if there is no nonlocal scope, " -"a :exc:`SyntaxError` is raised." +"not bound in any nonlocal scope, or if there is no nonlocal scope, a :exc:" +"`SyntaxError` is raised." msgstr "" #: ../../reference/simple_stmts.rst:1015 @@ -1226,8 +1225,8 @@ msgstr "" #: ../../reference/simple_stmts.rst:1024 msgid "" "**Programmer's note:** :keyword:`nonlocal` is a directive to the parser and " -"applies only to code parsed along with it. See the note for " -"the :keyword:`global` statement." +"applies only to code parsed along with it. See the note for the :keyword:" +"`global` statement." msgstr "" #: ../../reference/simple_stmts.rst:1032 @@ -1269,9 +1268,9 @@ msgstr "" msgid "" "The value of the type alias is evaluated in the annotation scope. It is not " "evaluated when the type alias is created, but only when the value is " -"accessed through the type alias's :attr:`!__value__` attribute " -"(see :ref:`lazy-evaluation`). This allows the type alias to refer to names " -"that are not yet defined." +"accessed through the type alias's :attr:`!__value__` attribute (see :ref:" +"`lazy-evaluation`). This allows the type alias to refer to names that are " +"not yet defined." msgstr "" #: ../../reference/simple_stmts.rst:1061 diff --git a/tutorial/controlflow.po b/tutorial/controlflow.po index 31f47ad667..d7ece618b1 100644 --- a/tutorial/controlflow.po +++ b/tutorial/controlflow.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-10 20:44+0800\n" +"POT-Creation-Date: 2025-09-12 00:14+0000\n" "PO-Revision-Date: 2022-07-24 14:52+0800\n" "Last-Translator: Steven Hsu \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -77,9 +77,9 @@ msgstr "" msgid "" "There can be zero or more :keyword:`elif` parts, and the :keyword:`else` " "part is optional. The keyword ':keyword:`!elif`' is short for 'else if', " -"and is useful to avoid excessive indentation. An :keyword:`!" -"if` ... :keyword:`!elif` ... :keyword:`!elif` ... sequence is a substitute " -"for the ``switch`` or ``case`` statements found in other languages." +"and is useful to avoid excessive indentation. An :keyword:`!if` ... :" +"keyword:`!elif` ... :keyword:`!elif` ... sequence is a substitute for the " +"``switch`` or ``case`` statements found in other languages." msgstr "" "在陳述式中,可以沒有或有許多個 :keyword:`elif` 敘述,且 :keyword:`else` 敘述" "並不是必要的。關鍵字 :keyword:`!elif` 是「else if」的縮寫,用來避免過多的縮" @@ -104,10 +104,10 @@ msgid "" "The :keyword:`for` statement in Python differs a bit from what you may be " "used to in C or Pascal. Rather than always iterating over an arithmetic " "progression of numbers (like in Pascal), or giving the user the ability to " -"define both the iteration step and halting condition (as C), " -"Python's :keyword:`!for` statement iterates over the items of any sequence " -"(a list or a string), in the order that they appear in the sequence. For " -"example (no pun intended):" +"define both the iteration step and halting condition (as C), Python's :" +"keyword:`!for` statement iterates over the items of any sequence (a list or " +"a string), in the order that they appear in the sequence. For example (no " +"pun intended):" msgstr "" "在 Python 中的 :keyword:`for` 陳述式有點不同於在 C 或 Pascal 中的慣用方式。相" "較於只能疊代 (iterate) 一個等差數列(如 Pascal),或給予使用者定義疊代步驟與" @@ -179,9 +179,8 @@ msgstr ":func:`range` 函式" #: ../../tutorial/controlflow.rst:96 msgid "" -"If you do need to iterate over a sequence of numbers, the built-in " -"function :func:`range` comes in handy. It generates arithmetic " -"progressions::" +"If you do need to iterate over a sequence of numbers, the built-in function :" +"func:`range` comes in handy. It generates arithmetic progressions::" msgstr "" "如果你需要疊代一個數列的話,使用內建 :func:`range` 函式就很方便。它可以生成一" "等差數列: ::" @@ -301,9 +300,9 @@ msgstr "" msgid "" "We say such an object is :term:`iterable`, that is, suitable as a target for " "functions and constructs that expect something from which they can obtain " -"successive items until the supply is exhausted. We have seen that " -"the :keyword:`for` statement is such a construct, while an example of a " -"function that takes an iterable is :func:`sum`::" +"successive items until the supply is exhausted. We have seen that the :" +"keyword:`for` statement is such a construct, while an example of a function " +"that takes an iterable is :func:`sum`::" msgstr "" "我們稱這樣的物件為 :term:`iterable`\\ (可疊代物件),意即能作為函式及架構中" "可以一直取得項目直到取盡的對象。我們已經了解 :keyword:`for` 陳述式就是如此的" @@ -323,8 +322,8 @@ msgid "" "arguments. In chapter :ref:`tut-structures`, we will discuss in more detail " "about :func:`list`." msgstr "" -"待會我們可以看到更多回傳 iterable 和使用 iterable 為引數的函式。在" -"\\ :ref:`tut-structures`\\ 章節中,我們會討論更多關於 :func:`list` 的細節。" +"待會我們可以看到更多回傳 iterable 和使用 iterable 為引數的函式。在\\ :ref:" +"`tut-structures`\\ 章節中,我們會討論更多關於 :func:`list` 的細節。" #: ../../tutorial/controlflow.rst:164 msgid ":keyword:`!break` and :keyword:`!continue` Statements" @@ -332,11 +331,11 @@ msgstr ":keyword:`!break` 和 :keyword:`!continue` 陳述式" #: ../../tutorial/controlflow.rst:166 msgid "" -"The :keyword:`break` statement breaks out of the innermost " -"enclosing :keyword:`for` or :keyword:`while` loop::" +"The :keyword:`break` statement breaks out of the innermost enclosing :" +"keyword:`for` or :keyword:`while` loop::" msgstr "" -":keyword:`break` 陳述式,終止包含它的最內部 :keyword:`for` " -"或 :keyword:`while` 迴圈: ::" +":keyword:`break` 陳述式,終止包含它的最內部 :keyword:`for` 或 :keyword:" +"`while` 迴圈: ::" #: ../../tutorial/controlflow.rst:169 msgid "" @@ -412,8 +411,8 @@ msgid "" "clause executes." msgstr "" "在 :keyword:`!for` 或 :keyword:`!while` 迴圈中,:keyword:`!break` 陳述句可能" -"與 :keyword:`!else` 子句配對。如果迴圈完成而沒有執行 :keyword:`!" -"break`,:keyword:`!else` 子句會被執行。" +"與 :keyword:`!else` 子句配對。如果迴圈完成而沒有執行 :keyword:`!break`,:" +"keyword:`!else` 子句會被執行。" #: ../../tutorial/controlflow.rst:208 msgid "" @@ -512,17 +511,17 @@ msgid "" "occurs. For more on the ``try`` statement and exceptions, see :ref:`tut-" "handling`." msgstr "" -"當 ``else`` 子句用於迴圈時,相較於搭配 ``if`` 陳述式使用,它的行為" -"與 :keyword:`try` 陳述式中的 ``else`` 子句更為相似:``try`` 陳述式的 " -"``else`` 子句在沒有發生例外 (exception) 時執行,而迴圈的 ``else`` 子句在沒有" -"任何 ``break`` 發生時執行。更多有關 ``try`` 陳述式和例外的介紹,見" -"\\ :ref:`tut-handling`。" +"當 ``else`` 子句用於迴圈時,相較於搭配 ``if`` 陳述式使用,它的行為與 :" +"keyword:`try` 陳述式中的 ``else`` 子句更為相似:``try`` 陳述式的 ``else`` 子" +"句在沒有發生例外 (exception) 時執行,而迴圈的 ``else`` 子句在沒有任何 " +"``break`` 發生時執行。更多有關 ``try`` 陳述式和例外的介紹,見\\ :ref:`tut-" +"handling`。" -#: ../../tutorial/controlflow.rst:257 +#: ../../tutorial/controlflow.rst:258 msgid ":keyword:`!pass` Statements" msgstr ":keyword:`!pass` 陳述式" -#: ../../tutorial/controlflow.rst:259 +#: ../../tutorial/controlflow.rst:260 msgid "" "The :keyword:`pass` statement does nothing. It can be used when a statement " "is required syntactically but the program requires no action. For example::" @@ -530,7 +529,7 @@ msgstr "" ":keyword:`pass` 陳述式不執行任何動作。它可用在語法上需要一個陳述式但程式不需" "要執行任何動作的時候。例如: ::" -#: ../../tutorial/controlflow.rst:262 +#: ../../tutorial/controlflow.rst:263 msgid "" ">>> while True:\n" "... pass # Busy-wait for keyboard interrupt (Ctrl+C)\n" @@ -540,11 +539,11 @@ msgstr "" "... pass # 忙碌等待鍵盤中斷 (Ctrl+C)\n" "..." -#: ../../tutorial/controlflow.rst:266 +#: ../../tutorial/controlflow.rst:267 msgid "This is commonly used for creating minimal classes::" msgstr "這經常用於建立簡單的 class(類別): ::" -#: ../../tutorial/controlflow.rst:268 +#: ../../tutorial/controlflow.rst:269 msgid "" ">>> class MyEmptyClass:\n" "... pass\n" @@ -554,7 +553,7 @@ msgstr "" "... pass\n" "..." -#: ../../tutorial/controlflow.rst:272 +#: ../../tutorial/controlflow.rst:273 msgid "" "Another place :keyword:`pass` can be used is as a place-holder for a " "function or conditional body when you are working on new code, allowing you " @@ -564,7 +563,7 @@ msgstr "" ":keyword:`pass` 亦可作為一個函式或條件判斷主體的預留位置,在你撰寫新的程式碼" "時讓你保持在更抽象的思維層次。:keyword:`!pass` 會直接被忽略: ::" -#: ../../tutorial/controlflow.rst:276 +#: ../../tutorial/controlflow.rst:277 msgid "" ">>> def initlog(*args):\n" "... pass # Remember to implement this!\n" @@ -574,11 +573,24 @@ msgstr "" "... pass # 記得要實作這個!\n" "..." -#: ../../tutorial/controlflow.rst:284 +#: ../../tutorial/controlflow.rst:281 +msgid "" +"For this last case, many people use the ellipsis literal :code:`...` instead " +"of :code:`pass`. This use has no special meaning to Python, and is not part " +"of the language definition (you could use any constant expression here), " +"but :code:`...` is used conventionally as a placeholder body as well. See :" +"ref:`bltin-ellipsis-object`." +msgstr "" +"在最後這個例子中,許多人會使用刪節號字面值 :code:`...` 來取代 :code:`pass`。" +"這種用法對 Python 並沒有特殊的意義,且並非語言定義的一部分(你也可以在這裡" +"使用任何常數運算式),但 :code:`...` 也慣例上被用作預留主體 (placeholder body)。" +"見 :ref:`bltin-ellipsis-object`。" + +#: ../../tutorial/controlflow.rst:291 msgid ":keyword:`!match` Statements" msgstr ":keyword:`!match` 陳述式" -#: ../../tutorial/controlflow.rst:286 +#: ../../tutorial/controlflow.rst:293 msgid "" "A :keyword:`match` statement takes an expression and compares its value to " "successive patterns given as one or more case blocks. This is superficially " @@ -595,14 +607,14 @@ msgstr "" "行,而它也可以將成分(序列元素或物件屬性)從值中提取到變數中。如果沒有任何的 " "case 匹配成功,則不會執行任何的分支。" -#: ../../tutorial/controlflow.rst:295 +#: ../../tutorial/controlflow.rst:302 msgid "" "The simplest form compares a subject value against one or more literals::" msgstr "" "最簡單的形式,是將一個主題值 (subject value) 與一個或多個字面值 (literal) 進" "行比較: ::" -#: ../../tutorial/controlflow.rst:297 +#: ../../tutorial/controlflow.rst:304 msgid "" "def http_error(status):\n" " match status:\n" @@ -626,7 +638,7 @@ msgstr "" " case _:\n" " return \"Something's wrong with the internet\"" -#: ../../tutorial/controlflow.rst:308 +#: ../../tutorial/controlflow.rst:315 msgid "" "Note the last block: the \"variable name\" ``_`` acts as a *wildcard* and " "never fails to match." @@ -634,12 +646,12 @@ msgstr "" "請注意最後一段:「變數名稱」\\ ``_`` 是作為\\ *通用字元 (wildcard)*\\ 的角" "色,且永遠不會匹配失敗。" -#: ../../tutorial/controlflow.rst:311 +#: ../../tutorial/controlflow.rst:318 msgid "" "You can combine several literals in a single pattern using ``|`` (\"or\")::" msgstr "你可以使用 ``|``\\ (「或」)來將多個字面值組合在單一模式中: ::" -#: ../../tutorial/controlflow.rst:313 +#: ../../tutorial/controlflow.rst:320 msgid "" "case 401 | 403 | 404:\n" " return \"Not allowed\"" @@ -647,14 +659,14 @@ msgstr "" "case 401 | 403 | 404:\n" " return \"Not allowed\"" -#: ../../tutorial/controlflow.rst:316 +#: ../../tutorial/controlflow.rst:323 msgid "" "Patterns can look like unpacking assignments, and can be used to bind " "variables::" msgstr "" "模式可以看起來像是拆解賦值 (unpacking assignment),且可以用來連結變數: ::" -#: ../../tutorial/controlflow.rst:319 +#: ../../tutorial/controlflow.rst:326 msgid "" "# point is an (x, y) tuple\n" "match point:\n" @@ -682,7 +694,7 @@ msgstr "" " case _:\n" " raise ValueError(\"Not a point\")" -#: ../../tutorial/controlflow.rst:332 +#: ../../tutorial/controlflow.rst:339 msgid "" "Study that one carefully! The first pattern has two literals, and can be " "thought of as an extension of the literal pattern shown above. But the next " @@ -696,7 +708,7 @@ msgstr "" "(bind)* 了來自主題 (``point``) 的一個值。第四個模式會擷取兩個值,這使得它在概" "念上類似於拆解賦值 ``(x, y) = point``。" -#: ../../tutorial/controlflow.rst:339 +#: ../../tutorial/controlflow.rst:346 msgid "" "If you are using classes to structure your data you can use the class name " "followed by an argument list resembling a constructor, but with the ability " @@ -705,7 +717,7 @@ msgstr "" "如果你要用 class 來結構化你的資料,你可以使用該 class 的名稱加上一個引數列" "表,類似一個建構式 (constructor),但它能夠將屬性擷取到變數中: ::" -#: ../../tutorial/controlflow.rst:343 +#: ../../tutorial/controlflow.rst:350 msgid "" "class Point:\n" " def __init__(self, x, y):\n" @@ -743,7 +755,7 @@ msgstr "" " case _:\n" " print(\"Not a point\")" -#: ../../tutorial/controlflow.rst:361 +#: ../../tutorial/controlflow.rst:368 msgid "" "You can use positional parameters with some builtin classes that provide an " "ordering for their attributes (e.g. dataclasses). You can also define a " @@ -757,7 +769,7 @@ msgstr "" "``__match_args__``,來定義模式中屬性們的特定位置。如果它被設定為 (\"x\", " "\"y\"),則以下的模式都是等價的(且都會將屬性 ``y`` 連結到變數 ``var``): ::" -#: ../../tutorial/controlflow.rst:367 +#: ../../tutorial/controlflow.rst:374 msgid "" "Point(1, var)\n" "Point(1, y=var)\n" @@ -769,13 +781,13 @@ msgstr "" "Point(x=1, y=var)\n" "Point(y=var, x=1)" -#: ../../tutorial/controlflow.rst:372 +#: ../../tutorial/controlflow.rst:379 msgid "" "A recommended way to read patterns is to look at them as an extended form of " "what you would put on the left of an assignment, to understand which " "variables would be set to what. Only the standalone names (like ``var`` " -"above) are assigned to by a match statement. Dotted names (like " -"``foo.bar``), attribute names (the ``x=`` and ``y=`` above) or class names " +"above) are assigned to by a match statement. Dotted names (like ``foo." +"bar``), attribute names (the ``x=`` and ``y=`` above) or class names " "(recognized by the \"(...)\" next to them like ``Point`` above) are never " "assigned to." msgstr "" @@ -785,7 +797,7 @@ msgstr "" "的 ``x=`` 及 ``y=``)或 class 名稱(由它們後面的 \"(...)\" 被辨識,如上面的 " "``Point``)則永遠無法被賦值。" -#: ../../tutorial/controlflow.rst:379 +#: ../../tutorial/controlflow.rst:386 msgid "" "Patterns can be arbitrarily nested. For example, if we have a short list of " "Points, with ``__match_args__`` added, we could match it like this::" @@ -793,7 +805,7 @@ msgstr "" "模式可以任意地被巢套 (nested)。例如,如果我們有一個由某些點所組成的簡短 " "list,我們就可以像這樣加入 ``__match_args__`` 來對它進行匹配: ::" -#: ../../tutorial/controlflow.rst:382 +#: ../../tutorial/controlflow.rst:389 msgid "" "class Point:\n" " __match_args__ = ('x', 'y')\n" @@ -831,7 +843,7 @@ msgstr "" " case _:\n" " print(\"Something else\")" -#: ../../tutorial/controlflow.rst:400 +#: ../../tutorial/controlflow.rst:407 msgid "" "We can add an ``if`` clause to a pattern, known as a \"guard\". If the " "guard is false, ``match`` goes on to try the next case block. Note that " @@ -841,7 +853,7 @@ msgstr "" "則 ``match`` 會繼續嘗試下一個 case 區塊。請注意,值的擷取會發生在防護的評估之" "前: ::" -#: ../../tutorial/controlflow.rst:404 +#: ../../tutorial/controlflow.rst:411 msgid "" "match point:\n" " case Point(x, y) if x == y:\n" @@ -855,11 +867,11 @@ msgstr "" " case Point(x, y):\n" " print(f\"Not on the diagonal\")" -#: ../../tutorial/controlflow.rst:410 +#: ../../tutorial/controlflow.rst:417 msgid "Several other key features of this statement:" msgstr "此種陳述式的其他幾個重要特色:" -#: ../../tutorial/controlflow.rst:412 +#: ../../tutorial/controlflow.rst:419 msgid "" "Like unpacking assignments, tuple and list patterns have exactly the same " "meaning and actually match arbitrary sequences. An important exception is " @@ -868,7 +880,7 @@ msgstr "" "與拆解賦值的情況類似,tuple(元組)和 list 模式具有完全相同的意義,而且實際上" "可以匹配任意的序列。一個重要的例外,是它們不能匹配疊代器 (iterator) 或字串。" -#: ../../tutorial/controlflow.rst:416 +#: ../../tutorial/controlflow.rst:423 msgid "" "Sequence patterns support extended unpacking: ``[x, y, *rest]`` and ``(x, y, " "*rest)`` work similar to unpacking assignments. The name after ``*`` may " @@ -880,7 +892,7 @@ msgstr "" "``_``,所以 ``(x, y, *_)`` 會匹配一個至少兩項的序列,且不會連結那兩項以外的其" "餘項。" -#: ../../tutorial/controlflow.rst:421 +#: ../../tutorial/controlflow.rst:428 msgid "" "Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the " "``\"bandwidth\"`` and ``\"latency\"`` values from a dictionary. Unlike " @@ -892,15 +904,15 @@ msgstr "" "式不同,額外的鍵 (key) 會被忽略。一種像是 ``**rest`` 的拆解方式,也是可被支援" "的。(但 ``**_`` 則是多餘的做法,所以它並不被允許。)" -#: ../../tutorial/controlflow.rst:426 +#: ../../tutorial/controlflow.rst:433 msgid "Subpatterns may be captured using the ``as`` keyword::" msgstr "使用關鍵字 ``as`` 可以擷取子模式 (subpattern): ::" -#: ../../tutorial/controlflow.rst:428 +#: ../../tutorial/controlflow.rst:435 msgid "case (Point(x1, y1), Point(x2, y2) as p2): ..." msgstr "case (Point(x1, y1), Point(x2, y2) as p2): ..." -#: ../../tutorial/controlflow.rst:430 +#: ../../tutorial/controlflow.rst:437 msgid "" "will capture the second element of the input as ``p2`` (as long as the input " "is a sequence of two points)" @@ -908,7 +920,7 @@ msgstr "" "將會擷取輸入的第二個元素作為 ``p2``\\ (只要該輸入是一個由兩個點所組成的序" "列)。" -#: ../../tutorial/controlflow.rst:433 +#: ../../tutorial/controlflow.rst:440 msgid "" "Most literals are compared by equality, however the singletons ``True``, " "``False`` and ``None`` are compared by identity." @@ -916,7 +928,7 @@ msgstr "" "大部分的字面值是藉由相等性 (equality) 來比較,但是單例物件 (singleton) " "``True``、``False`` 和 ``None`` 是藉由標識值 (identity) 來比較。" -#: ../../tutorial/controlflow.rst:436 +#: ../../tutorial/controlflow.rst:443 msgid "" "Patterns may use named constants. These must be dotted names to prevent " "them from being interpreted as capture variable::" @@ -924,7 +936,7 @@ msgstr "" "模式可以使用附名常數 (named constant)。這些模式必須是點分隔名稱,以免它們被解" "釋為擷取變數: ::" -#: ../../tutorial/controlflow.rst:439 +#: ../../tutorial/controlflow.rst:446 msgid "" "from enum import Enum\n" "class Color(Enum):\n" @@ -958,24 +970,24 @@ msgstr "" " case Color.BLUE:\n" " print(\"I'm feeling the blues :(\")" -#: ../../tutorial/controlflow.rst:455 +#: ../../tutorial/controlflow.rst:462 msgid "" -"For a more detailed explanation and additional examples, you can look " -"into :pep:`636` which is written in a tutorial format." +"For a more detailed explanation and additional examples, you can look into :" +"pep:`636` which is written in a tutorial format." msgstr "" "關於更詳細的解釋和其他範例,你可以閱讀 :pep:`636`,它是以教學的格式編寫而成。" -#: ../../tutorial/controlflow.rst:461 +#: ../../tutorial/controlflow.rst:468 msgid "Defining Functions" msgstr "定義函式 (function)" -#: ../../tutorial/controlflow.rst:463 +#: ../../tutorial/controlflow.rst:470 msgid "" "We can create a function that writes the Fibonacci series to an arbitrary " "boundary::" msgstr "我們可以建立一個函式來產生費式數列到任何一個上界: ::" -#: ../../tutorial/controlflow.rst:466 +#: ../../tutorial/controlflow.rst:473 msgid "" ">>> def fib(n): # write Fibonacci series less than n\n" "... \"\"\"Print a Fibonacci series less than n.\"\"\"\n" @@ -1001,7 +1013,7 @@ msgstr "" ">>> fib(2000)\n" "0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597" -#: ../../tutorial/controlflow.rst:483 +#: ../../tutorial/controlflow.rst:490 msgid "" "The keyword :keyword:`def` introduces a function *definition*. It must be " "followed by the function name and the parenthesized list of formal " @@ -1011,15 +1023,15 @@ msgstr "" "關鍵字 :keyword:`def` 介紹一個函式的\\ *定義*。它之後必須連著該函式的名稱和置" "於括號之中的一串參數。自下一行起,所有縮排的陳述式成為該函式的主體。" -#: ../../tutorial/controlflow.rst:488 +#: ../../tutorial/controlflow.rst:495 msgid "" "The first statement of the function body can optionally be a string literal; " -"this string literal is the function's documentation string, " -"or :dfn:`docstring`. (More about docstrings can be found in the " -"section :ref:`tut-docstrings`.) There are tools which use docstrings to " -"automatically produce online or printed documentation, or to let the user " -"interactively browse through code; it's good practice to include docstrings " -"in code that you write, so make a habit of it." +"this string literal is the function's documentation string, or :dfn:" +"`docstring`. (More about docstrings can be found in the section :ref:`tut-" +"docstrings`.) There are tools which use docstrings to automatically produce " +"online or printed documentation, or to let the user interactively browse " +"through code; it's good practice to include docstrings in code that you " +"write, so make a habit of it." msgstr "" "一個函式的第一個陳述式可以是一個字串文本;該字串文本被視為該函式的說明文件字" "串,即 :dfn:`docstring`。(關於 docstring 的細節請參見\\ :ref:`tut-" @@ -1027,7 +1039,7 @@ msgstr "" "件,或讓使用者能以互動的方式在原始碼中瀏覽文件。在原始碼中加入 docstring 是個" "好慣例,應該養成這樣的習慣。" -#: ../../tutorial/controlflow.rst:495 +#: ../../tutorial/controlflow.rst:502 msgid "" "The *execution* of a function introduces a new symbol table used for the " "local variables of the function. More precisely, all variable assignments " @@ -1045,10 +1057,10 @@ msgstr "" "域符號表。然而,在引用一個變數時,會先從區域符號表開始搜尋,其次為外層函式的" "區域符號表,其次為全域符號表 (global symbol table),最後為所有內建的名稱。因" "此,在函式中,全域變數及外層函式變數雖然可以被引用,但無法被直接賦值(除非全" -"域變數是在 :keyword:`global` 陳述式中被定義,或外層函式變數" -"在 :keyword:`nonlocal` 陳述式中被定義)。" +"域變數是在 :keyword:`global` 陳述式中被定義,或外層函式變數在 :keyword:" +"`nonlocal` 陳述式中被定義)。" -#: ../../tutorial/controlflow.rst:506 +#: ../../tutorial/controlflow.rst:513 msgid "" "The actual parameters (arguments) to a function call are introduced in the " "local symbol table of the called function when it is called; thus, arguments " @@ -1062,7 +1074,7 @@ msgstr "" "永遠是一個物件的\\ *參照 (reference)*,而不是該物件的值)。 [#]_ 當一個函式呼" "叫別的函式或遞迴呼叫它自己時,在被呼叫的函式中會建立一個新的區域符號表。" -#: ../../tutorial/controlflow.rst:513 +#: ../../tutorial/controlflow.rst:520 msgid "" "A function definition associates the function name with the function object " "in the current symbol table. The interpreter recognizes the object pointed " @@ -1073,7 +1085,7 @@ msgstr "" "直譯器辨識為使用者自定函式 (user-defined function)。該值可以被指定給別的變數" "名,使該變數名也可以被當作函式使用。這是常見的重新命名方式: ::" -#: ../../tutorial/controlflow.rst:518 +#: ../../tutorial/controlflow.rst:525 msgid "" ">>> fib\n" "\n" @@ -1087,22 +1099,22 @@ msgstr "" ">>> f(100)\n" "0 1 1 2 3 5 8 13 21 34 55 89" -#: ../../tutorial/controlflow.rst:524 +#: ../../tutorial/controlflow.rst:531 msgid "" "Coming from other languages, you might object that ``fib`` is not a function " "but a procedure since it doesn't return a value. In fact, even functions " "without a :keyword:`return` statement do return a value, albeit a rather " "boring one. This value is called ``None`` (it's a built-in name). Writing " "the value ``None`` is normally suppressed by the interpreter if it would be " -"the only value written. You can see it if you really want to " -"using :func:`print`::" +"the only value written. You can see it if you really want to using :func:" +"`print`::" msgstr "" "如果你是來自別的語言,你可能不同意 ``fib`` 是個函式,而是個程序 (procedure)," "因為它並沒有回傳值。實際上,即使一個函式缺少一個 :keyword:`return` 陳述式,它" "亦有一個固定的回傳值。這個值稱為 ``None``\\ (它是一個內建名稱)。在直譯器中" "單獨使用 ``None`` 時,通常不會被顯示。你可以使用 :func:`print` 來看到它: ::" -#: ../../tutorial/controlflow.rst:531 +#: ../../tutorial/controlflow.rst:538 msgid "" ">>> fib(0)\n" ">>> print(fib(0))\n" @@ -1112,13 +1124,13 @@ msgstr "" ">>> print(fib(0))\n" "None" -#: ../../tutorial/controlflow.rst:535 +#: ../../tutorial/controlflow.rst:542 msgid "" "It is simple to write a function that returns a list of the numbers of the " "Fibonacci series, instead of printing it::" msgstr "如果要寫一個函式回傳費式數列的 list 而不是直接印出它,這也很容易: ::" -#: ../../tutorial/controlflow.rst:538 +#: ../../tutorial/controlflow.rst:545 msgid "" ">>> def fib2(n): # return Fibonacci series up to n\n" "... \"\"\"Return a list containing the Fibonacci series up to n.\"\"\"\n" @@ -1146,21 +1158,21 @@ msgstr "" ">>> f100 # 寫出結果\n" "[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]" -#: ../../tutorial/controlflow.rst:551 +#: ../../tutorial/controlflow.rst:558 msgid "This example, as usual, demonstrates some new Python features:" msgstr "這個例子一樣示範了一些新的 Python 特性:" -#: ../../tutorial/controlflow.rst:553 +#: ../../tutorial/controlflow.rst:560 msgid "" -"The :keyword:`return` statement returns with a value from a " -"function. :keyword:`!return` without an expression argument returns " -"``None``. Falling off the end of a function also returns ``None``." +"The :keyword:`return` statement returns with a value from a function. :" +"keyword:`!return` without an expression argument returns ``None``. Falling " +"off the end of a function also returns ``None``." msgstr "" ":keyword:`return` 陳述式會讓一個函式回傳一個值。單獨使用 :keyword:`!return` " "不外加一個運算式作為引數時會回傳 ``None``。一個函式執行到結束也會回傳 " "``None``。" -#: ../../tutorial/controlflow.rst:557 +#: ../../tutorial/controlflow.rst:564 msgid "" "The statement ``result.append(a)`` calls a *method* of the list object " "``result``. A method is a function that 'belongs' to an object and is named " @@ -1168,10 +1180,10 @@ msgid "" "expression), and ``methodname`` is the name of a method that is defined by " "the object's type. Different types define different methods. Methods of " "different types may have the same name without causing ambiguity. (It is " -"possible to define your own object types and methods, using *classes*, " -"see :ref:`tut-classes`) The method :meth:`~list.append` shown in the example " -"is defined for list objects; it adds a new element at the end of the list. " -"In this example it is equivalent to ``result = result + [a]``, but more " +"possible to define your own object types and methods, using *classes*, see :" +"ref:`tut-classes`) The method :meth:`~list.append` shown in the example is " +"defined for list objects; it adds a new element at the end of the list. In " +"this example it is equivalent to ``result = result + [a]``, but more " "efficient." msgstr "" "``result.append(a)`` 陳述式呼叫了一個 list 物件 ``result`` 的 *method(方法)" @@ -1183,22 +1195,22 @@ msgstr "" "method 定義在 list 物件中;它會在該 list 的末端加入一個新的元素。這個例子等同" "於 ``result = result + [a]``,但更有效率。" -#: ../../tutorial/controlflow.rst:572 +#: ../../tutorial/controlflow.rst:579 msgid "More on Defining Functions" msgstr "深入了解函式定義" -#: ../../tutorial/controlflow.rst:574 +#: ../../tutorial/controlflow.rst:581 msgid "" "It is also possible to define functions with a variable number of arguments. " "There are three forms, which can be combined." msgstr "" "定義函式時使用的引數 (argument) 數量是可變的。總共有三種可以組合使用的形式。" -#: ../../tutorial/controlflow.rst:581 +#: ../../tutorial/controlflow.rst:588 msgid "Default Argument Values" msgstr "預設引數值" -#: ../../tutorial/controlflow.rst:583 +#: ../../tutorial/controlflow.rst:590 msgid "" "The most useful form is to specify a default value for one or more " "arguments. This creates a function that can be called with fewer arguments " @@ -1207,7 +1219,7 @@ msgstr "" "為一個或多個引數指定預設值是很有用的方式。函式建立後,可以用比定義時更少的引" "數呼叫該函式。例如: ::" -#: ../../tutorial/controlflow.rst:587 +#: ../../tutorial/controlflow.rst:594 msgid "" "def ask_ok(prompt, retries=4, reminder='Please try again!'):\n" " while True:\n" @@ -1233,22 +1245,22 @@ msgstr "" " raise ValueError('invalid user response')\n" " print(reminder)" -#: ../../tutorial/controlflow.rst:599 +#: ../../tutorial/controlflow.rst:606 msgid "This function can be called in several ways:" msgstr "該函式可以用以下幾種方式被呼叫:" -#: ../../tutorial/controlflow.rst:601 +#: ../../tutorial/controlflow.rst:608 msgid "" "giving only the mandatory argument: ``ask_ok('Do you really want to quit?')``" msgstr "只給必要引數:``ask_ok('Do you really want to quit?')``" -#: ../../tutorial/controlflow.rst:603 +#: ../../tutorial/controlflow.rst:610 msgid "" "giving one of the optional arguments: ``ask_ok('OK to overwrite the file?', " "2)``" msgstr "給予一個選擇性引數:``ask_ok('OK to overwrite the file?', 2)``" -#: ../../tutorial/controlflow.rst:605 +#: ../../tutorial/controlflow.rst:612 msgid "" "or even giving all arguments: ``ask_ok('OK to overwrite the file?', 2, 'Come " "on, only yes or no!')``" @@ -1256,19 +1268,19 @@ msgstr "" "給予所有引數:``ask_ok('OK to overwrite the file?', 2, 'Come on, only yes or " "no!')``" -#: ../../tutorial/controlflow.rst:608 +#: ../../tutorial/controlflow.rst:615 msgid "" "This example also introduces the :keyword:`in` keyword. This tests whether " "or not a sequence contains a certain value." msgstr "此例也使用了關鍵字 :keyword:`in`,用於測試序列中是否包含某個特定值。" -#: ../../tutorial/controlflow.rst:611 +#: ../../tutorial/controlflow.rst:618 msgid "" "The default values are evaluated at the point of function definition in the " "*defining* scope, so that ::" msgstr "預設值是在函式定義當下,於\\ *定義時*\\ 的作用域中求值,所以: ::" -#: ../../tutorial/controlflow.rst:614 +#: ../../tutorial/controlflow.rst:621 msgid "" "i = 5\n" "\n" @@ -1286,11 +1298,11 @@ msgstr "" "i = 6\n" "f()" -#: ../../tutorial/controlflow.rst:622 +#: ../../tutorial/controlflow.rst:629 msgid "will print ``5``." msgstr "將會輸出 ``5``。" -#: ../../tutorial/controlflow.rst:624 +#: ../../tutorial/controlflow.rst:631 msgid "" "**Important warning:** The default value is evaluated only once. This makes " "a difference when the default is a mutable object such as a list, " @@ -1301,7 +1313,7 @@ msgstr "" "(字典)或許多類別實例時,會產生不同的結果。例如,以下函式於後續呼叫時會累積" "曾經傳遞的引數: ::" -#: ../../tutorial/controlflow.rst:629 +#: ../../tutorial/controlflow.rst:636 msgid "" "def f(a, L=[]):\n" " L.append(a)\n" @@ -1319,11 +1331,11 @@ msgstr "" "print(f(2))\n" "print(f(3))" -#: ../../tutorial/controlflow.rst:637 +#: ../../tutorial/controlflow.rst:644 msgid "This will print ::" msgstr "將會輸出: ::" -#: ../../tutorial/controlflow.rst:639 +#: ../../tutorial/controlflow.rst:646 msgid "" "[1]\n" "[1, 2]\n" @@ -1333,13 +1345,13 @@ msgstr "" "[1, 2]\n" "[1, 2, 3]" -#: ../../tutorial/controlflow.rst:643 +#: ../../tutorial/controlflow.rst:650 msgid "" "If you don't want the default to be shared between subsequent calls, you can " "write the function like this instead::" msgstr "如果不想在後續呼叫之間共用預設值,應以如下方式編寫函式:" -#: ../../tutorial/controlflow.rst:646 +#: ../../tutorial/controlflow.rst:653 msgid "" "def f(a, L=None):\n" " if L is None:\n" @@ -1353,11 +1365,11 @@ msgstr "" " L.append(a)\n" " return L" -#: ../../tutorial/controlflow.rst:656 +#: ../../tutorial/controlflow.rst:663 msgid "Keyword Arguments" msgstr "關鍵字引數" -#: ../../tutorial/controlflow.rst:658 +#: ../../tutorial/controlflow.rst:665 msgid "" "Functions can also be called using :term:`keyword arguments ` of the form ``kwarg=value``. For instance, the following " @@ -1366,7 +1378,7 @@ msgstr "" "函式也可以使用\\ :term:`關鍵字引數 `,以 ``kwarg=value`` 的" "形式呼叫。舉例來說,以下函式: ::" -#: ../../tutorial/controlflow.rst:661 +#: ../../tutorial/controlflow.rst:668 msgid "" "def parrot(voltage, state='a stiff', action='voom', type='Norwegian Blue'):\n" " print(\"-- This parrot wouldn't\", action, end=' ')\n" @@ -1380,7 +1392,7 @@ msgstr "" " print(\"-- Lovely plumage, the\", type)\n" " print(\"-- It's\", state, \"!\")" -#: ../../tutorial/controlflow.rst:667 +#: ../../tutorial/controlflow.rst:674 msgid "" "accepts one required argument (``voltage``) and three optional arguments " "(``state``, ``action``, and ``type``). This function can be called in any " @@ -1389,7 +1401,7 @@ msgstr "" "接受一個必要引數 (``voltage``) 和三個選擇性引數 (``state``,``action``,和 " "``type``)。該函式可用下列任一方式呼叫: ::" -#: ../../tutorial/controlflow.rst:671 +#: ../../tutorial/controlflow.rst:678 msgid "" "parrot(1000) # 1 positional " "argument\n" @@ -1409,11 +1421,11 @@ msgstr "" "parrot('a thousand', state='pushing up the daisies') # 1 個位置引數、1 個關" "鍵字引數\n" -#: ../../tutorial/controlflow.rst:678 +#: ../../tutorial/controlflow.rst:685 msgid "but all the following calls would be invalid::" msgstr "但以下呼叫方式都無效: ::" -#: ../../tutorial/controlflow.rst:680 +#: ../../tutorial/controlflow.rst:687 msgid "" "parrot() # required argument missing\n" "parrot(voltage=5.0, 'dead') # non-keyword argument after a keyword " @@ -1426,7 +1438,7 @@ msgstr "" "parrot(110, voltage=220) # 同一個引數有重複值\n" "parrot(actor='John Cleese') # 未知的關鍵字引數" -#: ../../tutorial/controlflow.rst:685 +#: ../../tutorial/controlflow.rst:692 msgid "" "In a function call, keyword arguments must follow positional arguments. All " "the keyword arguments passed must match one of the arguments accepted by the " @@ -1442,7 +1454,7 @@ msgstr "" "則也包括必要引數,(\\ ``parrot(voltage=1000)`` 也有效)。一個引數不可多次被" "賦值,下面就是一個因此限制而無效的例子: ::" -#: ../../tutorial/controlflow.rst:693 +#: ../../tutorial/controlflow.rst:700 msgid "" ">>> def function(a):\n" "... pass\n" @@ -1460,7 +1472,7 @@ msgstr "" " File \"\", line 1, in \n" "TypeError: function() got multiple values for argument 'a'" -#: ../../tutorial/controlflow.rst:701 +#: ../../tutorial/controlflow.rst:708 msgid "" "When a final formal parameter of the form ``**name`` is present, it receives " "a dictionary (see :ref:`typesmapping`) containing all keyword arguments " @@ -1470,13 +1482,13 @@ msgid "" "positional arguments beyond the formal parameter list. (``*name`` must " "occur before ``**name``.) For example, if we define a function like this::" msgstr "" -"當最後一個參數為 ``**name`` 形式時,它接收一個 dictionary(字典,詳" -"見 :ref:`typesmapping`\\ ),該字典包含所有可對應形式參數以外的關鍵字引數。" +"當最後一個參數為 ``**name`` 形式時,它接收一個 dictionary(字典,詳見 :ref:" +"`typesmapping`\\ ),該字典包含所有可對應形式參數以外的關鍵字引數。" "``**name`` 可以與 ``*name`` 參數(下一小節介紹)組合使用,``*name`` 接收一" "個 :ref:`tuple `,該 tuple 包含一般參數以外的位置引數(\\ " "``*name`` 必須出現在 ``**name`` 前面)。例如,若我們定義這樣的函式: ::" -#: ../../tutorial/controlflow.rst:709 +#: ../../tutorial/controlflow.rst:716 msgid "" "def cheeseshop(kind, *arguments, **keywords):\n" " print(\"-- Do you have any\", kind, \"?\")\n" @@ -1496,11 +1508,11 @@ msgstr "" " for kw in keywords:\n" " print(kw, \":\", keywords[kw])" -#: ../../tutorial/controlflow.rst:718 +#: ../../tutorial/controlflow.rst:725 msgid "It could be called like this::" msgstr "它可以被如此呼叫: ::" -#: ../../tutorial/controlflow.rst:720 +#: ../../tutorial/controlflow.rst:727 msgid "" "cheeseshop(\"Limburger\", \"It's very runny, sir.\",\n" " \"It's really very, VERY runny, sir.\",\n" @@ -1514,11 +1526,11 @@ msgstr "" " client=\"John Cleese\",\n" " sketch=\"Cheese Shop Sketch\")" -#: ../../tutorial/controlflow.rst:726 +#: ../../tutorial/controlflow.rst:733 msgid "and of course it would print:" msgstr "輸出結果如下: ::" -#: ../../tutorial/controlflow.rst:728 +#: ../../tutorial/controlflow.rst:735 msgid "" "-- Do you have any Limburger ?\n" "-- I'm sorry, we're all out of Limburger\n" @@ -1538,17 +1550,17 @@ msgstr "" "client : John Cleese\n" "sketch : Cheese Shop Sketch" -#: ../../tutorial/controlflow.rst:739 +#: ../../tutorial/controlflow.rst:746 msgid "" "Note that the order in which the keyword arguments are printed is guaranteed " "to match the order in which they were provided in the function call." msgstr "注意,關鍵字引數的輸出順序與呼叫函式時被提供的順序必定一致。" -#: ../../tutorial/controlflow.rst:743 +#: ../../tutorial/controlflow.rst:750 msgid "Special parameters" msgstr "特殊參數" -#: ../../tutorial/controlflow.rst:745 +#: ../../tutorial/controlflow.rst:752 msgid "" "By default, arguments may be passed to a Python function either by position " "or explicitly by keyword. For readability and performance, it makes sense to " @@ -1560,11 +1572,11 @@ msgstr "" "及效能,限制引數的傳遞方式是合理的,如此,開發者只需查看函式定義,即可確定各" "項目是按位置,按位置或關鍵字,還是按關鍵字傳遞。" -#: ../../tutorial/controlflow.rst:751 +#: ../../tutorial/controlflow.rst:758 msgid "A function definition may look like:" msgstr "函式定義可能如以下樣式:" -#: ../../tutorial/controlflow.rst:753 +#: ../../tutorial/controlflow.rst:760 msgid "" "def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):\n" " ----------- ---------- ----------\n" @@ -1580,7 +1592,7 @@ msgstr "" " | - Keyword only\n" " -- Positional only" -#: ../../tutorial/controlflow.rst:762 +#: ../../tutorial/controlflow.rst:769 msgid "" "where ``/`` and ``*`` are optional. If used, these symbols indicate the kind " "of parameter by how the arguments may be passed to the function: positional-" @@ -1591,22 +1603,22 @@ msgstr "" "類:僅限位置、位置或關鍵字、僅限關鍵字。關鍵字參數也稱為附名參數 (named " "parameters)。" -#: ../../tutorial/controlflow.rst:769 +#: ../../tutorial/controlflow.rst:776 msgid "Positional-or-Keyword Arguments" msgstr "位置或關鍵字引數 (Positional-or-Keyword Arguments)" -#: ../../tutorial/controlflow.rst:771 +#: ../../tutorial/controlflow.rst:778 msgid "" "If ``/`` and ``*`` are not present in the function definition, arguments may " "be passed to a function by position or by keyword." msgstr "" "若函式定義中未使用 ``/`` 和 ``*`` 時,引數可以按位置或關鍵字傳遞給函式。" -#: ../../tutorial/controlflow.rst:776 +#: ../../tutorial/controlflow.rst:783 msgid "Positional-Only Parameters" msgstr "僅限位置參數 (Positional-Only Parameters)" -#: ../../tutorial/controlflow.rst:778 +#: ../../tutorial/controlflow.rst:785 msgid "" "Looking at this in a bit more detail, it is possible to mark certain " "parameters as *positional-only*. If *positional-only*, the parameters' order " @@ -1621,17 +1633,17 @@ msgstr "" "``\\ (斜線)之前。``/`` 用於在邏輯上分開僅限位置參數與其餘參數。如果函式定義" "中沒有 ``/``,則表示沒有任何僅限位置參數。" -#: ../../tutorial/controlflow.rst:786 +#: ../../tutorial/controlflow.rst:793 msgid "" "Parameters following the ``/`` may be *positional-or-keyword* or *keyword-" "only*." msgstr "``/`` 後面的參數可以是\\ *位置或關鍵字*\\ 或\\ *僅限關鍵字*\\ 參數。" -#: ../../tutorial/controlflow.rst:790 +#: ../../tutorial/controlflow.rst:797 msgid "Keyword-Only Arguments" msgstr "僅限關鍵字引數 (Keyword-Only Arguments)" -#: ../../tutorial/controlflow.rst:792 +#: ../../tutorial/controlflow.rst:799 msgid "" "To mark parameters as *keyword-only*, indicating the parameters must be " "passed by keyword argument, place an ``*`` in the arguments list just before " @@ -1640,17 +1652,17 @@ msgstr "" "要把參數標記為\\ *僅限關鍵字*,表明參數必須以關鍵字引數傳遞,必須在引數列表中" "第一個\\ *僅限關鍵字*\\ 參數前放上 ``*``。" -#: ../../tutorial/controlflow.rst:798 +#: ../../tutorial/controlflow.rst:805 msgid "Function Examples" msgstr "函式範例" -#: ../../tutorial/controlflow.rst:800 +#: ../../tutorial/controlflow.rst:807 msgid "" "Consider the following example function definitions paying close attention " "to the markers ``/`` and ``*``::" msgstr "請看以下的函式定義範例,注意 ``/`` 和 ``*`` 記號: ::" -#: ../../tutorial/controlflow.rst:803 +#: ../../tutorial/controlflow.rst:810 msgid "" ">>> def standard_arg(arg):\n" "... print(arg)\n" @@ -1676,7 +1688,7 @@ msgstr "" ">>> def combined_example(pos_only, /, standard, *, kwd_only):\n" "... print(pos_only, standard, kwd_only)" -#: ../../tutorial/controlflow.rst:816 +#: ../../tutorial/controlflow.rst:823 msgid "" "The first function definition, ``standard_arg``, the most familiar form, " "places no restrictions on the calling convention and arguments may be passed " @@ -1685,7 +1697,7 @@ msgstr "" "第一個函式定義 ``standard_arg`` 是我們最熟悉的形式,對呼叫方式沒有任何限制," "可以按位置或關鍵字傳遞引數: ::" -#: ../../tutorial/controlflow.rst:820 +#: ../../tutorial/controlflow.rst:827 msgid "" ">>> standard_arg(2)\n" "2\n" @@ -1699,14 +1711,14 @@ msgstr "" ">>> standard_arg(arg=2)\n" "2" -#: ../../tutorial/controlflow.rst:826 +#: ../../tutorial/controlflow.rst:833 msgid "" "The second function ``pos_only_arg`` is restricted to only use positional " "parameters as there is a ``/`` in the function definition::" msgstr "" "第二個函式 ``pos_only_arg`` 的函式定義中有 ``/``,因此僅限使用位置參數: ::" -#: ../../tutorial/controlflow.rst:829 +#: ../../tutorial/controlflow.rst:836 msgid "" ">>> pos_only_arg(1)\n" "1\n" @@ -1726,14 +1738,14 @@ msgstr "" "TypeError: pos_only_arg() got some positional-only arguments passed as " "keyword arguments: 'arg'" -#: ../../tutorial/controlflow.rst:837 +#: ../../tutorial/controlflow.rst:844 msgid "" "The third function ``kwd_only_arg`` only allows keyword arguments as " "indicated by a ``*`` in the function definition::" msgstr "" "第三個函式 ``kwd_only_arg`` 的函式定義透過 ``*`` 表明僅限關鍵字引數: ::" -#: ../../tutorial/controlflow.rst:840 +#: ../../tutorial/controlflow.rst:847 msgid "" ">>> kwd_only_arg(3)\n" "Traceback (most recent call last):\n" @@ -1751,13 +1763,13 @@ msgstr "" ">>> kwd_only_arg(arg=3)\n" "3" -#: ../../tutorial/controlflow.rst:848 +#: ../../tutorial/controlflow.rst:855 msgid "" "And the last uses all three calling conventions in the same function " "definition::" msgstr "最後一個函式在同一個函式定義中,使用了全部三種呼叫方式: ::" -#: ../../tutorial/controlflow.rst:851 +#: ../../tutorial/controlflow.rst:858 msgid "" ">>> combined_example(1, 2, 3)\n" "Traceback (most recent call last):\n" @@ -1793,7 +1805,7 @@ msgstr "" "TypeError: combined_example() got some positional-only arguments passed as " "keyword arguments: 'pos_only'" -#: ../../tutorial/controlflow.rst:868 +#: ../../tutorial/controlflow.rst:875 msgid "" "Finally, consider this function definition which has a potential collision " "between the positional argument ``name`` and ``**kwds`` which has ``name`` " @@ -1802,7 +1814,7 @@ msgstr "" "最後,請看這個函式定義,如果 ``**kwds`` 內有 ``name`` 這個鍵,可能與位置引數 " "``name`` 產生潛在衝突: ::" -#: ../../tutorial/controlflow.rst:870 +#: ../../tutorial/controlflow.rst:877 msgid "" "def foo(name, **kwds):\n" " return 'name' in kwds" @@ -1810,7 +1822,7 @@ msgstr "" "def foo(name, **kwds):\n" " return 'name' in kwds" -#: ../../tutorial/controlflow.rst:873 +#: ../../tutorial/controlflow.rst:880 msgid "" "There is no possible call that will make it return ``True`` as the keyword " "``'name'`` will always bind to the first parameter. For example::" @@ -1818,7 +1830,7 @@ msgstr "" "呼叫該函式不可能回傳 ``True``,因為關鍵字 ``'name'`` 永遠是連結在第一個參數。" "例如: ::" -#: ../../tutorial/controlflow.rst:876 +#: ../../tutorial/controlflow.rst:883 msgid "" ">>> foo(1, **{'name': 2})\n" "Traceback (most recent call last):\n" @@ -1832,7 +1844,7 @@ msgstr "" "TypeError: foo() got multiple values for argument 'name'\n" ">>>" -#: ../../tutorial/controlflow.rst:882 +#: ../../tutorial/controlflow.rst:889 msgid "" "But using ``/`` (positional only arguments), it is possible since it allows " "``name`` as a positional argument and ``'name'`` as a key in the keyword " @@ -1841,7 +1853,7 @@ msgstr "" "使用 ``/``\\ (僅限位置引數)後,就可以了。函式定義會允許 ``name`` 當作位置引" "數,而 ``'name'`` 也可以當作關鍵字引數中的鍵: ::" -#: ../../tutorial/controlflow.rst:884 +#: ../../tutorial/controlflow.rst:891 msgid "" ">>> def foo(name, /, **kwds):\n" "... return 'name' in kwds\n" @@ -1855,31 +1867,31 @@ msgstr "" ">>> foo(1, **{'name': 2})\n" "True" -#: ../../tutorial/controlflow.rst:890 +#: ../../tutorial/controlflow.rst:897 msgid "" "In other words, the names of positional-only parameters can be used in " "``**kwds`` without ambiguity." msgstr "換句話說,僅限位置參數的名稱可以在 ``**kwds`` 中使用,而不產生歧義。" -#: ../../tutorial/controlflow.rst:895 +#: ../../tutorial/controlflow.rst:902 msgid "Recap" msgstr "回顧" -#: ../../tutorial/controlflow.rst:897 +#: ../../tutorial/controlflow.rst:904 msgid "" "The use case will determine which parameters to use in the function " "definition::" msgstr "此用例決定哪些參數可以用於函式定義: ::" -#: ../../tutorial/controlflow.rst:899 +#: ../../tutorial/controlflow.rst:906 msgid "def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):" msgstr "def f(pos1, pos2, /, pos_or_kwd, *, kwd1, kwd2):" -#: ../../tutorial/controlflow.rst:901 +#: ../../tutorial/controlflow.rst:908 msgid "As guidance:" msgstr "說明:" -#: ../../tutorial/controlflow.rst:903 +#: ../../tutorial/controlflow.rst:910 msgid "" "Use positional-only if you want the name of the parameters to not be " "available to the user. This is useful when parameter names have no real " @@ -1891,7 +1903,7 @@ msgstr "" "想控制引數在函式呼叫的排列順序,或同時使用位置參數和任意關鍵字時,這種方式很" "有用。" -#: ../../tutorial/controlflow.rst:908 +#: ../../tutorial/controlflow.rst:915 msgid "" "Use keyword-only when names have meaning and the function definition is more " "understandable by being explicit with names or you want to prevent users " @@ -1900,7 +1912,7 @@ msgstr "" "當參數名稱有意義,且明確的名稱可讓函式定義更易理解,或是你不希望使用者依賴引" "數被傳遞時的位置時,請使用僅限關鍵字。" -#: ../../tutorial/controlflow.rst:911 +#: ../../tutorial/controlflow.rst:918 msgid "" "For an API, use positional-only to prevent breaking API changes if the " "parameter's name is modified in the future." @@ -1908,11 +1920,11 @@ msgstr "" "對於應用程式介面 (API),使用僅限位置,以防止未來參數名稱被修改時造成 API 的中" "斷性變更。" -#: ../../tutorial/controlflow.rst:917 +#: ../../tutorial/controlflow.rst:924 msgid "Arbitrary Argument Lists" msgstr "任意引數列表 (Arbitrary Argument Lists)" -#: ../../tutorial/controlflow.rst:922 +#: ../../tutorial/controlflow.rst:929 msgid "" "Finally, the least frequently used option is to specify that a function can " "be called with an arbitrary number of arguments. These arguments will be " @@ -1923,7 +1935,7 @@ msgstr "" "數會被包裝進一個 tuple 中(詳見 :ref:`tut-tuples`\\ )。在可變數量的引數之" "前,可能有零個或多個普通引數: ::" -#: ../../tutorial/controlflow.rst:927 +#: ../../tutorial/controlflow.rst:934 msgid "" "def write_multiple_items(file, separator, *args):\n" " file.write(separator.join(args))" @@ -1931,7 +1943,7 @@ msgstr "" "def write_multiple_items(file, separator, *args):\n" " file.write(separator.join(args))" -#: ../../tutorial/controlflow.rst:931 +#: ../../tutorial/controlflow.rst:938 msgid "" "Normally, these *variadic* arguments will be last in the list of formal " "parameters, because they scoop up all remaining input arguments that are " @@ -1943,7 +1955,7 @@ msgstr "" "以把所有傳遞給函式的剩餘輸入引數都撈起來。出現在 ``*args`` 參數後面的任何參數" "必須是「僅限關鍵字」引數,意即它們只能作為關鍵字引數,而不能用作位置引數。 ::" -#: ../../tutorial/controlflow.rst:937 +#: ../../tutorial/controlflow.rst:944 msgid "" ">>> def concat(*args, sep=\"/\"):\n" "... return sep.join(args)\n" @@ -1961,11 +1973,11 @@ msgstr "" ">>> concat(\"earth\", \"mars\", \"venus\", sep=\".\")\n" "'earth.mars.venus'" -#: ../../tutorial/controlflow.rst:948 +#: ../../tutorial/controlflow.rst:955 msgid "Unpacking Argument Lists" msgstr "拆解引數列表(Unpacking Argument Lists)" -#: ../../tutorial/controlflow.rst:950 +#: ../../tutorial/controlflow.rst:957 msgid "" "The reverse situation occurs when the arguments are already in a list or " "tuple but need to be unpacked for a function call requiring separate " @@ -1979,7 +1991,7 @@ msgstr "" "的 *start* 和 *stop* 引數。如果這些引數不是分開的,則要在呼叫函式時,用 " "``*`` 運算子把引數們從 list 或 tuple 中拆解出來: ::" -#: ../../tutorial/controlflow.rst:957 +#: ../../tutorial/controlflow.rst:964 msgid "" ">>> list(range(3, 6)) # normal call with separate arguments\n" "[3, 4, 5]\n" @@ -1994,13 +2006,13 @@ msgstr "" ">>> list(range(*args)) # 以從串列解包而得的引數呼叫\n" "[3, 4, 5]" -#: ../../tutorial/controlflow.rst:966 +#: ../../tutorial/controlflow.rst:973 msgid "" "In the same fashion, dictionaries can deliver keyword arguments with the " "``**``\\ -operator::" msgstr "同樣地,dictionary(字典)可以用 ``**`` 運算子傳遞關鍵字引數: ::" -#: ../../tutorial/controlflow.rst:969 +#: ../../tutorial/controlflow.rst:976 msgid "" ">>> def parrot(voltage, state='a stiff', action='voom'):\n" "... print(\"-- This parrot wouldn't\", action, end=' ')\n" @@ -2024,11 +2036,11 @@ msgstr "" "-- This parrot wouldn't VOOM if you put four million volts through it. E's " "bleedin' demised !" -#: ../../tutorial/controlflow.rst:982 +#: ../../tutorial/controlflow.rst:989 msgid "Lambda Expressions" msgstr "Lambda 運算式" -#: ../../tutorial/controlflow.rst:984 +#: ../../tutorial/controlflow.rst:991 msgid "" "Small anonymous functions can be created with the :keyword:`lambda` keyword. " "This function returns the sum of its two arguments: ``lambda a, b: a+b``. " @@ -2043,7 +2055,7 @@ msgstr "" "能是單一運算式。在語義上,它就是一個普通函式定義的語法糖 (syntactic sugar)。" "與巢狀函式定義一樣,lambda 函式可以從包含它的作用域中引用變數: ::" -#: ../../tutorial/controlflow.rst:992 +#: ../../tutorial/controlflow.rst:999 msgid "" ">>> def make_incrementor(n):\n" "... return lambda x: x + n\n" @@ -2063,18 +2075,17 @@ msgstr "" ">>> f(1)\n" "43" -#: ../../tutorial/controlflow.rst:1001 +#: ../../tutorial/controlflow.rst:1008 msgid "" "The above example uses a lambda expression to return a function. Another " -"use is to pass a small function as an argument. For " -"instance, :meth:`list.sort` takes a sorting key function *key* which can be " -"a lambda function::" +"use is to pass a small function as an argument. For instance, :meth:`list." +"sort` takes a sorting key function *key* which can be a lambda function::" msgstr "" "上面的例子用 lambda 運算式回傳了一個函式。另外的用法是傳遞一個小函式當作引" "數。舉例來說,:meth:`list.sort` 接受一個鍵排序函式 *key*,這個函式可以是 " "lambda 函式: ::" -#: ../../tutorial/controlflow.rst:1005 +#: ../../tutorial/controlflow.rst:1012 msgid "" ">>> pairs = [(1, 'one'), (2, 'two'), (3, 'three'), (4, 'four')]\n" ">>> pairs.sort(key=lambda pair: pair[1])\n" @@ -2086,17 +2097,17 @@ msgstr "" ">>> pairs\n" "[(4, 'four'), (1, 'one'), (3, 'three'), (2, 'two')]" -#: ../../tutorial/controlflow.rst:1014 +#: ../../tutorial/controlflow.rst:1021 msgid "Documentation Strings" msgstr "說明文件字串 (Documentation Strings)" -#: ../../tutorial/controlflow.rst:1021 +#: ../../tutorial/controlflow.rst:1028 msgid "" "Here are some conventions about the content and formatting of documentation " "strings." msgstr "以下是關於說明文件字串內容和格式的慣例。" -#: ../../tutorial/controlflow.rst:1024 +#: ../../tutorial/controlflow.rst:1031 msgid "" "The first line should always be a short, concise summary of the object's " "purpose. For brevity, it should not explicitly state the object's name or " @@ -2108,7 +2119,7 @@ msgstr "" "的名稱或型別,因為有其他方法可以達到相同目的(除非該名稱剛好是一個描述函式運" "算的動詞)。這一行應以大寫字母開頭,以句號結尾。" -#: ../../tutorial/controlflow.rst:1030 +#: ../../tutorial/controlflow.rst:1037 msgid "" "If there are more lines in the documentation string, the second line should " "be blank, visually separating the summary from the rest of the description. " @@ -2118,7 +2129,7 @@ msgstr "" "文件字串為多行時,第二行應為空白行,在視覺上將摘要與其餘描述分開。後面幾行可" "包含一或多個段落,描述此物件的呼叫慣例、副作用等。" -#: ../../tutorial/controlflow.rst:1035 +#: ../../tutorial/controlflow.rst:1042 msgid "" "The Python parser does not strip indentation from multi-line string literals " "in Python, so tools that process documentation have to strip indentation if " @@ -2140,11 +2151,11 @@ msgstr "" "出現了,這些行的全部前導空白字元都應被去除。展開 tab 鍵後(通常為八個空格)," "應測試空白字元量是否等價。" -#: ../../tutorial/controlflow.rst:1047 +#: ../../tutorial/controlflow.rst:1054 msgid "Here is an example of a multi-line docstring::" msgstr "下面是多行說明字串的一個範例: ::" -#: ../../tutorial/controlflow.rst:1049 +#: ../../tutorial/controlflow.rst:1056 msgid "" ">>> def my_function():\n" "... \"\"\"Do nothing, but document it.\n" @@ -2170,11 +2181,11 @@ msgstr "" "\n" "No, really, it doesn't do anything." -#: ../../tutorial/controlflow.rst:1065 +#: ../../tutorial/controlflow.rst:1072 msgid "Function Annotations" msgstr "函式註釋 (Function Annotations)" -#: ../../tutorial/controlflow.rst:1073 +#: ../../tutorial/controlflow.rst:1080 msgid "" ":ref:`Function annotations ` are completely optional metadata " "information about the types used by user-defined functions (see :pep:`3107` " @@ -2183,26 +2194,25 @@ msgstr "" ":ref:`函式註釋 `\\ 是選擇性的元資料(metadata)資訊,描述使用者定義" "函式所使用的型別(更多資訊詳見 :pep:`3107` 和 :pep:`484`\\ )。" -#: ../../tutorial/controlflow.rst:1077 +#: ../../tutorial/controlflow.rst:1084 msgid "" -":term:`Annotations ` are stored in " -"the :attr:`~object.__annotations__` attribute of the function as a " -"dictionary and have no effect on any other part of the function. Parameter " -"annotations are defined by a colon after the parameter name, followed by an " -"expression evaluating to the value of the annotation. Return annotations " -"are defined by a literal ``->``, followed by an expression, between the " -"parameter list and the colon denoting the end of the :keyword:`def` " -"statement. The following example has a required argument, an optional " -"argument, and the return value annotated::" +":term:`Annotations ` are stored in the :attr:`~object." +"__annotations__` attribute of the function as a dictionary and have no " +"effect on any other part of the function. Parameter annotations are defined " +"by a colon after the parameter name, followed by an expression evaluating to " +"the value of the annotation. Return annotations are defined by a literal ``-" +">``, followed by an expression, between the parameter list and the colon " +"denoting the end of the :keyword:`def` statement. The following example has " +"a required argument, an optional argument, and the return value annotated::" msgstr "" ":term:`註釋 `\\ 以 dictionary(字典)的形式存放在函式" -"的 :attr:`~object.__annotations__` 屬性中,且不會影響函式的任何其他部分。參數註釋的" -"定義方式是在參數名稱後加一個冒號,冒號後面跟著一個對註釋求值的運算式。回傳註" -"釋的定義方式是在參數列表和 :keyword:`def` 陳述式結尾的冒號中間,用一個 ``-" -">`` 文字接著一個運算式。以下範例註釋了一個必要引數、一個選擇性引數,以及回傳" -"值: ::" +"的 :attr:`~object.__annotations__` 屬性中,且不會影響函式的任何其他部分。參數" +"註釋的定義方式是在參數名稱後加一個冒號,冒號後面跟著一個對註釋求值的運算式。" +"回傳註釋的定義方式是在參數列表和 :keyword:`def` 陳述式結尾的冒號中間,用一個 " +"``->`` 文字接著一個運算式。以下範例註釋了一個必要引數、一個選擇性引數,以及回" +"傳值: ::" -#: ../../tutorial/controlflow.rst:1086 +#: ../../tutorial/controlflow.rst:1093 msgid "" ">>> def f(ham: str, eggs: str = 'eggs') -> str:\n" "... print(\"Annotations:\", f.__annotations__)\n" @@ -2226,11 +2236,11 @@ msgstr "" "Arguments: spam eggs\n" "'spam and eggs'" -#: ../../tutorial/controlflow.rst:1099 +#: ../../tutorial/controlflow.rst:1106 msgid "Intermezzo: Coding Style" msgstr "間奏曲:程式碼風格 (Coding Style)" -#: ../../tutorial/controlflow.rst:1104 +#: ../../tutorial/controlflow.rst:1111 msgid "" "Now that you are about to write longer, more complex pieces of Python, it is " "a good time to talk about *coding style*. Most languages can be written (or " @@ -2243,7 +2253,7 @@ msgstr "" "式比其他的更具可讀性。能讓其他人輕鬆閱讀你的程式碼永遠是一個好主意,而使用優" "良的編碼樣式對此有極大的幫助。" -#: ../../tutorial/controlflow.rst:1110 +#: ../../tutorial/controlflow.rst:1117 msgid "" "For Python, :pep:`8` has emerged as the style guide that most projects " "adhere to; it promotes a very readable and eye-pleasing coding style. Every " @@ -2253,11 +2263,11 @@ msgstr "" "對於 Python,大多數的專案都遵循 :pep:`8` 的樣式指南;它推行的編碼樣式相當可讀" "且賞心悅目。每個 Python 開發者都應該花點時間研讀;這裡是該指南的核心重點:" -#: ../../tutorial/controlflow.rst:1115 +#: ../../tutorial/controlflow.rst:1122 msgid "Use 4-space indentation, and no tabs." msgstr "用 4 個空格縮排,不要用 tab 鍵。" -#: ../../tutorial/controlflow.rst:1117 +#: ../../tutorial/controlflow.rst:1124 msgid "" "4 spaces are a good compromise between small indentation (allows greater " "nesting depth) and large indentation (easier to read). Tabs introduce " @@ -2266,11 +2276,11 @@ msgstr "" "4 個空格是小縮排(容許更大的巢套深度)和大縮排(較易閱讀)之間的折衷方案。" "Tab 鍵會造成混亂,最好別用。" -#: ../../tutorial/controlflow.rst:1121 +#: ../../tutorial/controlflow.rst:1128 msgid "Wrap lines so that they don't exceed 79 characters." msgstr "換行,使一行不超過 79 個字元。" -#: ../../tutorial/controlflow.rst:1123 +#: ../../tutorial/controlflow.rst:1130 msgid "" "This helps users with small displays and makes it possible to have several " "code files side-by-side on larger displays." @@ -2278,21 +2288,21 @@ msgstr "" "換行能讓使用小顯示器的使用者方便閱讀,也可以在較大顯示器上並排陳列多個程式碼" "檔案。" -#: ../../tutorial/controlflow.rst:1126 +#: ../../tutorial/controlflow.rst:1133 msgid "" "Use blank lines to separate functions and classes, and larger blocks of code " "inside functions." msgstr "用空行分隔函式和 class(類別),及函式內較大塊的程式碼。" -#: ../../tutorial/controlflow.rst:1129 +#: ../../tutorial/controlflow.rst:1136 msgid "When possible, put comments on a line of their own." msgstr "如果可以,把註解放在單獨一行。" -#: ../../tutorial/controlflow.rst:1131 +#: ../../tutorial/controlflow.rst:1138 msgid "Use docstrings." msgstr "使用說明字串。" -#: ../../tutorial/controlflow.rst:1133 +#: ../../tutorial/controlflow.rst:1140 msgid "" "Use spaces around operators and after commas, but not directly inside " "bracketing constructs: ``a = f(1, 2) + g(3, 4)``." @@ -2300,7 +2310,7 @@ msgstr "" "運算子前後、逗號後要加空格,但不要直接放在括號內側:``a = f(1, 2) + g(3, " "4)``。" -#: ../../tutorial/controlflow.rst:1136 +#: ../../tutorial/controlflow.rst:1143 msgid "" "Name your classes and functions consistently; the convention is to use " "``UpperCamelCase`` for classes and ``lowercase_with_underscores`` for " @@ -2312,7 +2322,7 @@ msgstr "" "底線)。永遠用 ``self`` 作為 method 第一個引數的名稱(關於 class 和 method," "詳見 :ref:`tut-firstclasses`\\ )。" -#: ../../tutorial/controlflow.rst:1141 +#: ../../tutorial/controlflow.rst:1148 msgid "" "Don't use fancy encodings if your code is meant to be used in international " "environments. Python's default, UTF-8, or even plain ASCII work best in any " @@ -2321,7 +2331,7 @@ msgstr "" "若程式碼是為了用於國際環境時,不要用花俏的編碼。Python 預設的 UTF-8 或甚至普" "通的 ASCII,就可以勝任各種情況。" -#: ../../tutorial/controlflow.rst:1145 +#: ../../tutorial/controlflow.rst:1152 msgid "" "Likewise, don't use non-ASCII characters in identifiers if there is only the " "slightest chance people speaking a different language will read or maintain " @@ -2330,11 +2340,11 @@ msgstr "" "同樣地,若不同語言使用者閱讀或維護程式碼的可能性微乎其微,就不要在命名時使用" "非 ASCII 字元。" -#: ../../tutorial/controlflow.rst:1151 +#: ../../tutorial/controlflow.rst:1158 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/controlflow.rst:1152 +#: ../../tutorial/controlflow.rst:1159 msgid "" "Actually, *call by object reference* would be a better description, since if " "a mutable object is passed, the caller will see any changes the callee makes " @@ -2352,55 +2362,63 @@ msgstr "statement(陳述式)" msgid "for" msgstr "for" -#: ../../tutorial/controlflow.rst:478 ../../tutorial/controlflow.rst:1016 +#: ../../tutorial/controlflow.rst:254 +msgid "..." +msgstr "" + +#: ../../tutorial/controlflow.rst:254 +msgid "ellipsis literal" +msgstr "" + +#: ../../tutorial/controlflow.rst:485 ../../tutorial/controlflow.rst:1023 msgid "documentation strings" msgstr "ddocumentation strings(說明字串)" -#: ../../tutorial/controlflow.rst:478 ../../tutorial/controlflow.rst:1016 +#: ../../tutorial/controlflow.rst:485 ../../tutorial/controlflow.rst:1023 msgid "docstrings" msgstr "docstrings(說明字串)" -#: ../../tutorial/controlflow.rst:478 ../../tutorial/controlflow.rst:1016 +#: ../../tutorial/controlflow.rst:485 ../../tutorial/controlflow.rst:1023 msgid "strings, documentation" msgstr "strings(字串), documentation(說明文件)" -#: ../../tutorial/controlflow.rst:919 +#: ../../tutorial/controlflow.rst:926 msgid "* (asterisk)" msgstr "* (星號)" -#: ../../tutorial/controlflow.rst:919 ../../tutorial/controlflow.rst:963 +#: ../../tutorial/controlflow.rst:926 ../../tutorial/controlflow.rst:970 msgid "in function calls" msgstr "於函式呼叫中" -#: ../../tutorial/controlflow.rst:963 +#: ../../tutorial/controlflow.rst:970 msgid "**" msgstr "**" -#: ../../tutorial/controlflow.rst:1068 +#: ../../tutorial/controlflow.rst:1075 msgid "function" msgstr "function(函式)" -#: ../../tutorial/controlflow.rst:1068 +#: ../../tutorial/controlflow.rst:1075 msgid "annotations" msgstr "annotations(註釋)" -#: ../../tutorial/controlflow.rst:1068 +#: ../../tutorial/controlflow.rst:1075 msgid "->" msgstr "->" -#: ../../tutorial/controlflow.rst:1068 +#: ../../tutorial/controlflow.rst:1075 msgid "function annotations" msgstr "function annotations(函式註釋)" -#: ../../tutorial/controlflow.rst:1068 +#: ../../tutorial/controlflow.rst:1075 msgid ": (colon)" msgstr ": (冒號)" -#: ../../tutorial/controlflow.rst:1102 +#: ../../tutorial/controlflow.rst:1109 msgid "coding" msgstr "coding(程式編寫)" -#: ../../tutorial/controlflow.rst:1102 +#: ../../tutorial/controlflow.rst:1109 msgid "style" msgstr "style(風格)" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 94467dfda2..ef485f0251 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-18 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,8 +31,8 @@ msgstr "Adam Turner" #: ../../whatsnew/3.12.rst:48 msgid "" "This article explains the new features in Python 3.12, compared to 3.11. " -"Python 3.12 was released on October 2, 2023. For full details, see " -"the :ref:`changelog `." +"Python 3.12 was released on October 2, 2023. For full details, see the :ref:" +"`changelog `." msgstr "" "本文介紹了 Python 3.12 與 3.11 相比多了哪些新功能。 Python 3.12 於 2023 年 " "10 月 2 日發布。完整詳情請見 :ref:`changelog `。" @@ -55,18 +55,18 @@ msgid "" "improvements, and several modules have better performance." msgstr "" "Python 3.12 是 Python 程式語言的穩定版本,包含了語言和標準函式庫的綜合變更。" -"標準函式庫的變更主要集中在清理棄用的 API、可用性和正確性。值得注意的" -"是,:mod:`!distutils` 套件已從標準函式庫中移除。:mod:`os` 和 :mod:`pathlib` " -"中的檔案系統支援進行了許多改進,並且有數個模組得到更好的效能。" +"標準函式庫的變更主要集中在清理棄用的 API、可用性和正確性。值得注意的是,:mod:" +"`!distutils` 套件已從標準函式庫中移除。:mod:`os` 和 :mod:`pathlib` 中的檔案系" +"統支援進行了許多改進,並且有數個模組得到更好的效能。" #: ../../whatsnew/3.12.rst:69 msgid "" "The language changes focus on usability, as :term:`f-strings ` " "have had many limitations removed and 'Did you mean ...' suggestions " "continue to improve. The new :ref:`type parameter syntax ` and :keyword:`type` statement improve ergonomics for " -"using :term:`generic types ` and :term:`type aliases ` with static type checkers." +"pep695>` and :keyword:`type` statement improve ergonomics for using :term:" +"`generic types ` and :term:`type aliases ` with " +"static type checkers." msgstr "" "語言變更主要集中在可用性,因為 :term:`f-字串 `\\ 已經移除了許多限" "制,並且持續改進 'Did you mean ...' 建議。新的\\ :ref:`型別參數語法 " @@ -95,8 +95,8 @@ msgstr "新增語法特性:" #: ../../whatsnew/3.12.rst:92 msgid "" -":ref:`PEP 695 `, type parameter syntax and " -"the :keyword:`type` statement" +":ref:`PEP 695 `, type parameter syntax and the :keyword:" +"`type` statement" msgstr "" ":ref:`PEP 695 `,型別參數語法和 :keyword:`type` 陳述式" @@ -129,8 +129,8 @@ msgstr ":ref:`PEP 669 `,低影響監控" #: ../../whatsnew/3.12.rst:103 msgid "" -"`Improved 'Did you mean ...' suggestions `_ " -"for :exc:`NameError`, :exc:`ImportError`, and :exc:`SyntaxError` exceptions" +"`Improved 'Did you mean ...' suggestions `_ for :" +"exc:`NameError`, :exc:`ImportError`, and :exc:`SyntaxError` exceptions" msgstr "" #: ../../whatsnew/3.12.rst:106 @@ -157,15 +157,15 @@ msgstr ":mod:`os` 模組在 Windows 支援上有了數項改進" #: ../../whatsnew/3.12.rst:115 msgid "" -"A :ref:`command-line interface ` has been added to " -"the :mod:`sqlite3` module" +"A :ref:`command-line interface ` has been added to the :mod:" +"`sqlite3` module" msgstr "" "一個\\ :ref:`命令列介面 `\\ 已被加入 :mod:`sqlite3` 模組中" #: ../../whatsnew/3.12.rst:117 msgid "" -":func:`isinstance` checks against :func:`runtime-checkable protocols " -"` enjoy a speed up of between two and 20 times" +":func:`isinstance` checks against :func:`runtime-checkable protocols ` enjoy a speed up of between two and 20 times" msgstr "" #: ../../whatsnew/3.12.rst:119 @@ -236,8 +236,8 @@ msgid "" ":ref:`PEP 692 `, using :class:`~typing.TypedDict` to " "annotate :term:`**kwargs `" msgstr "" -":ref:`PEP 692 `、使用 :class:`~typing.TypedDict` 來標" -"註 :term:`**kwargs `" +":ref:`PEP 692 `、使用 :class:`~typing.TypedDict` 來標註 :" +"term:`**kwargs `" #: ../../whatsnew/3.12.rst:149 msgid ":ref:`PEP 698 `, :func:`typing.override` decorator" @@ -277,9 +277,9 @@ msgid "" "removed, along with several :class:`unittest.TestCase` `method aliases " "`_." msgstr "" -":mod:`!asynchat`、:mod:`!asyncore` 和 :mod:`!imp` 模組以及幾" -"個 :class:`unittest.TestCase` 的\\ `方法別名 `_\\ 已被刪除。" +":mod:`!asynchat`、:mod:`!asyncore` 和 :mod:`!imp` 模組以及幾個 :class:" +"`unittest.TestCase` 的\\ `方法別名 `_\\ " +"已被刪除。" #: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1842 msgid "New Features" @@ -298,8 +298,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:187 msgid "" -":pep:`695` introduces a new, more compact and explicit way to " -"create :ref:`generic classes ` and :ref:`functions ` and :ref:`functions `::" msgstr "" @@ -346,9 +346,9 @@ msgstr "type Point[T] = tuple[T, T]" #: ../../whatsnew/3.12.rst:210 msgid "" -"The new syntax allows declaring :class:`~typing.TypeVarTuple` " -"and :class:`~typing.ParamSpec` parameters, as well " -"as :class:`~typing.TypeVar` parameters with bounds or constraints::" +"The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" +"`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " +"parameters with bounds or constraints::" msgstr "" #: ../../whatsnew/3.12.rst:214 @@ -400,7 +400,8 @@ msgid "" "(PEP written by Eric Traut. Implementation by Jelle Zijlstra, Eric Traut, " "and others in :gh:`103764`.)" msgstr "" -"(PEP 由 Eric Traut 撰寫。由 Jelle Zijlstra、Eric Traut 和其他人在 :gh:`103764` 中實作。)" +"(PEP 由 Eric Traut 撰寫。由 Jelle Zijlstra、Eric Traut 和其他人在 :gh:" +"`103764` 中實作。)" #: ../../whatsnew/3.12.rst:245 msgid "PEP 701: Syntactic formalization of f-strings" @@ -449,11 +450,10 @@ msgstr "" #: ../../whatsnew/3.12.rst:290 msgid "" "Backslashes and unicode characters: before Python 3.12 f-string expressions " -"couldn't contain any ``\\`` character. This also affected " -"unicode :ref:`escape sequences ` (such as ``\\N{snowman}" -"``) as these contain the ``\\N`` part that previously could not be part of " -"expression components of f-strings. Now, you can define expressions like " -"this:" +"couldn't contain any ``\\`` character. This also affected unicode :ref:" +"`escape sequences ` (such as ``\\N{snowman}``) as these " +"contain the ``\\N`` part that previously could not be part of expression " +"components of f-strings. Now, you can define expressions like this:" msgstr "" #: ../../whatsnew/3.12.rst:303 @@ -593,17 +593,16 @@ msgstr "PEP 688:使緩衝區協定可在 Python 中存取" #: ../../whatsnew/3.12.rst:386 msgid "" ":pep:`688` introduces a way to use the :ref:`buffer protocol " -"` from Python code. Classes that implement " -"the :meth:`~object.__buffer__` method are now usable as buffer types." +"` from Python code. Classes that implement the :meth:`~object." +"__buffer__` method are now usable as buffer types." msgstr "" #: ../../whatsnew/3.12.rst:390 msgid "" "The new :class:`collections.abc.Buffer` ABC provides a standard way to " -"represent buffer objects, for example in type annotations. The " -"new :class:`inspect.BufferFlags` enum represents the flags that can be used " -"to customize buffer creation. (Contributed by Jelle Zijlstra " -"in :gh:`102500`.)" +"represent buffer objects, for example in type annotations. The new :class:" +"`inspect.BufferFlags` enum represents the flags that can be used to " +"customize buffer creation. (Contributed by Jelle Zijlstra in :gh:`102500`.)" msgstr "" #: ../../whatsnew/3.12.rst:399 @@ -682,8 +681,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:459 msgid "" "Improve the :exc:`SyntaxError` error message when the user types ``import x " -"from y`` instead of ``from y import x``. (Contributed by Pablo Galindo " -"in :gh:`98931`.)" +"from y`` instead of ``from y import x``. (Contributed by Pablo Galindo in :" +"gh:`98931`.)" msgstr "" #: ../../whatsnew/3.12.rst:469 @@ -700,8 +699,8 @@ msgstr "型別提示相關的新特性" #: ../../whatsnew/3.12.rst:482 msgid "" -"This section covers major changes affecting :pep:`type hints <484>` and " -"the :mod:`typing` module." +"This section covers major changes affecting :pep:`type hints <484>` and the :" +"mod:`typing` module." msgstr "" "本節涵蓋了影響\\ :pep:`型別提示 <484>`\\ 和 :mod:`typing` 模組的主要變更。" @@ -808,18 +807,17 @@ msgid "" "a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " "``re.compile(\"\\d+\\.\\d+\")`` now emits a :exc:`SyntaxWarning` " "(``\"\\d\"`` is an invalid escape sequence, use raw strings for regular " -"expression: ``re.compile(r\"\\d+\\.\\d+\")``). In a future Python " -"version, :exc:`SyntaxError` will eventually be raised, instead " -"of :exc:`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" +"expression: ``re.compile(r\"\\d+\\.\\d+\")``). In a future Python version, :" +"exc:`SyntaxError` will eventually be raised, instead of :exc:" +"`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" #: ../../whatsnew/3.12.rst:557 msgid "" "Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " -"deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead " -"of :exc:`DeprecationWarning`. In a future Python version they will be " -"eventually a :exc:`SyntaxError`. (Contributed by Victor Stinner " -"in :gh:`98401`.)" +"deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" +"exc:`DeprecationWarning`. In a future Python version they will be eventually " +"a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" #: ../../whatsnew/3.12.rst:563 @@ -842,9 +840,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:574 msgid "" "When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " -"and raises one other exception, that exception is no longer wrapped in " -"an :exc:`ExceptionGroup`. Also changed in version 3.11.4. (Contributed by " -"Irit Katriel in :gh:`103590`.)" +"and raises one other exception, that exception is no longer wrapped in an :" +"exc:`ExceptionGroup`. Also changed in version 3.11.4. (Contributed by Irit " +"Katriel in :gh:`103590`.)" msgstr "" #: ../../whatsnew/3.12.rst:579 @@ -853,8 +851,8 @@ msgid "" "Python bytecode evaluation loop instead of object allocations. The GC can " "also run when :c:func:`PyErr_CheckSignals` is called so C extensions that " "need to run for a long time without executing any Python code also have a " -"chance to execute the GC periodically. (Contributed by Pablo Galindo " -"in :gh:`97922`.)" +"chance to execute the GC periodically. (Contributed by Pablo Galindo in :gh:" +"`97922`.)" msgstr "" #: ../../whatsnew/3.12.rst:586 @@ -910,21 +908,19 @@ msgstr "" #: ../../whatsnew/3.12.rst:616 msgid "" "Add :ref:`support for the perf profiler ` through the new " -"environment variable :envvar:`PYTHONPERFSUPPORT` and command-line " -"option :option:`-X perf <-X>`, as well as the " -"new :func:`sys.activate_stack_trampoline`, :func:`sys.deactivate_stack_trampoline`, " -"and :func:`sys.is_stack_trampoline_active` functions. (Design by Pablo " -"Galindo. Contributed by Pablo Galindo and Christian Heimes with " -"contributions from Gregory P. Smith [Google] and Mark Shannon " -"in :gh:`96123`.)" +"environment variable :envvar:`PYTHONPERFSUPPORT` and command-line option :" +"option:`-X perf <-X>`, as well as the new :func:`sys." +"activate_stack_trampoline`, :func:`sys.deactivate_stack_trampoline`, and :" +"func:`sys.is_stack_trampoline_active` functions. (Design by Pablo Galindo. " +"Contributed by Pablo Galindo and Christian Heimes with contributions from " +"Gregory P. Smith [Google] and Mark Shannon in :gh:`96123`.)" msgstr "" "透過新的環境變數 :envvar:`PYTHONPERFSUPPORT` 和命令列選項 :option:`-X perf <-" -"X>` 以及新" -"的 :func:`sys.activate_stack_trampoline`、:func:`sys.deactivate_stack_trampoline` " -"和 :func:`sys.is_stack_trampoline_active` 函式,新增對\\ :ref:`效能分析器的支" -"援 `。(由 Pablo Galindo 設計。由 Pablo Galindo 和 Christian " -"Heimes 貢獻,Gregory P. Smith [Google] 和 Mark Shannon 在 :gh:`96123` 中也有" -"貢獻。)" +"X>` 以及新的 :func:`sys.activate_stack_trampoline`、:func:`sys." +"deactivate_stack_trampoline` 和 :func:`sys.is_stack_trampoline_active` 函式," +"新增對\\ :ref:`效能分析器的支援 `。(由 Pablo Galindo 設計。" +"由 Pablo Galindo 和 Christian Heimes 貢獻,Gregory P. Smith [Google] 和 Mark " +"Shannon 在 :gh:`96123` 中也有貢獻。)" #: ../../whatsnew/3.12.rst:628 msgid "New Modules" @@ -944,8 +940,8 @@ msgstr "array" #: ../../whatsnew/3.12.rst:639 msgid "" -"The :class:`array.array` class now supports subscripting, making it " -"a :term:`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" +"The :class:`array.array` class now supports subscripting, making it a :term:" +"`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" msgstr "" #: ../../whatsnew/3.12.rst:643 @@ -962,11 +958,10 @@ msgstr "" #: ../../whatsnew/3.12.rst:650 msgid "" -"Add :func:`asyncio.eager_task_factory` " -"and :func:`asyncio.create_eager_task_factory` functions to allow opting an " -"event loop in to eager task execution, making some use-cases 2x to 5x " -"faster. (Contributed by Jacob Bower & Itamar Oren " -"in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" +"Add :func:`asyncio.eager_task_factory` and :func:`asyncio." +"create_eager_task_factory` functions to allow opting an event loop in to " +"eager task execution, making some use-cases 2x to 5x faster. (Contributed by " +"Jacob Bower & Itamar Oren in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" msgstr "" #: ../../whatsnew/3.12.rst:655 @@ -978,10 +973,10 @@ msgstr "" #: ../../whatsnew/3.12.rst:660 msgid "" -"The event loop now uses the best available child watcher for each platform " -"(:class:`!asyncio.PidfdChildWatcher` if supported and :class:`!" -"asyncio.ThreadedChildWatcher` otherwise), so manually configuring a child " -"watcher is not recommended. (Contributed by Kumar Aditya in :gh:`94597`.)" +"The event loop now uses the best available child watcher for each platform (:" +"class:`!asyncio.PidfdChildWatcher` if supported and :class:`!asyncio." +"ThreadedChildWatcher` otherwise), so manually configuring a child watcher is " +"not recommended. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" #: ../../whatsnew/3.12.rst:666 @@ -998,9 +993,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:673 msgid "" -":func:`asyncio.iscoroutine` now returns ``False`` for generators " -"as :mod:`asyncio` does not support legacy generator-based coroutines. " -"(Contributed by Kumar Aditya in :gh:`102748`.)" +":func:`asyncio.iscoroutine` now returns ``False`` for generators as :mod:" +"`asyncio` does not support legacy generator-based coroutines. (Contributed " +"by Kumar Aditya in :gh:`102748`.)" msgstr "" #: ../../whatsnew/3.12.rst:677 @@ -1016,8 +1011,8 @@ msgstr "calendar" #: ../../whatsnew/3.12.rst:684 msgid "" "Add enums :data:`calendar.Month` and :data:`calendar.Day` defining months of " -"the year and days of the week. (Contributed by Prince Roshan " -"in :gh:`103636`.)" +"the year and days of the week. (Contributed by Prince Roshan in :gh:" +"`103636`.)" msgstr "" #: ../../whatsnew/3.12.rst:689 @@ -1027,8 +1022,8 @@ msgstr "csv" #: ../../whatsnew/3.12.rst:691 msgid "" "Add :const:`csv.QUOTE_NOTNULL` and :const:`csv.QUOTE_STRINGS` flags to " -"provide finer grained control of ``None`` and empty strings " -"by :class:`~csv.reader` and :class:`~csv.writer` objects." +"provide finer grained control of ``None`` and empty strings by :class:`~csv." +"reader` and :class:`~csv.writer` objects." msgstr "" #: ../../whatsnew/3.12.rst:696 @@ -1038,10 +1033,10 @@ msgstr "dis" #: ../../whatsnew/3.12.rst:698 msgid "" "Pseudo instruction opcodes (which are used by the compiler but do not appear " -"in executable bytecode) are now exposed in the :mod:`dis` " -"module. :opcode:`HAVE_ARGUMENT` is still relevant to real opcodes, but it is " -"not useful for pseudo instructions. Use the new :data:`dis.hasarg` " -"collection instead. (Contributed by Irit Katriel in :gh:`94216`.)" +"in executable bytecode) are now exposed in the :mod:`dis` module. :opcode:" +"`HAVE_ARGUMENT` is still relevant to real opcodes, but it is not useful for " +"pseudo instructions. Use the new :data:`dis.hasarg` collection instead. " +"(Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" #: ../../whatsnew/3.12.rst:706 @@ -1135,8 +1130,8 @@ msgid "" "Add :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" -"新增 :func:`math.sumprod` 以計算乘積總和。(由 Raymond Hettinger " -"於 :gh:`100485` 中貢獻。)" +"新增 :func:`math.sumprod` 以計算乘積總和。(由 Raymond Hettinger 於 :gh:" +"`100485` 中貢獻。)" #: ../../whatsnew/3.12.rst:752 msgid "" @@ -1151,16 +1146,16 @@ msgstr "os" #: ../../whatsnew/3.12.rst:759 msgid "" -"Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process " -"with :func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar " -"Aditya in :gh:`93312`.)" +"Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" +"func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" +"gh:`93312`.)" msgstr "" #: ../../whatsnew/3.12.rst:763 msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " -"to check if the entry is a junction. (Contributed by Charles Machalow " -"in :gh:`99547`.)" +"to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" +"`99547`.)" msgstr "" #: ../../whatsnew/3.12.rst:767 @@ -1179,8 +1174,8 @@ msgid "" "with other platforms). ``st_dev`` may be up to 64 bits and ``st_ino`` up to " "128 bits depending on your file system, and ``st_rdev`` is always set to " "zero rather than incorrect values. Both functions may be significantly " -"faster on newer releases of Windows. (Contributed by Steve Dower " -"in :gh:`99726`.)" +"faster on newer releases of Windows. (Contributed by Steve Dower in :gh:" +"`99726`.)" msgstr "" #: ../../whatsnew/3.12.rst:782 @@ -1209,10 +1204,10 @@ msgstr "pathlib" #: ../../whatsnew/3.12.rst:793 msgid "" -"Add support for subclassing :class:`pathlib.PurePath` " -"and :class:`pathlib.Path`, plus their Posix- and Windows-specific variants. " -"Subclasses may override the :meth:`pathlib.PurePath.with_segments` method to " -"pass information between path instances." +"Add support for subclassing :class:`pathlib.PurePath` and :class:`pathlib." +"Path`, plus their Posix- and Windows-specific variants. Subclasses may " +"override the :meth:`pathlib.PurePath.with_segments` method to pass " +"information between path instances." msgstr "" #: ../../whatsnew/3.12.rst:798 @@ -1226,23 +1221,22 @@ msgstr "" msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " -"consistent with :func:`os.path.relpath`. (Contributed by Domenico Ragusa " -"in :gh:`84538`.)" +"consistent with :func:`os.path.relpath`. (Contributed by Domenico Ragusa in :" +"gh:`84538`.)" msgstr "" #: ../../whatsnew/3.12.rst:807 msgid "" -"Add :meth:`pathlib.Path.is_junction` as a proxy " -"to :func:`os.path.isjunction`. (Contributed by Charles Machalow " -"in :gh:`99547`.)" +"Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." +"isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" #: ../../whatsnew/3.12.rst:810 msgid "" -"Add *case_sensitive* optional parameter " -"to :meth:`pathlib.Path.glob`, :meth:`pathlib.Path.rglob` " -"and :meth:`pathlib.PurePath.match` for matching the path's case sensitivity, " -"allowing for more precise control over the matching process." +"Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" +"`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " +"path's case sensitivity, allowing for more precise control over the matching " +"process." msgstr "" #: ../../whatsnew/3.12.rst:815 @@ -1274,8 +1268,8 @@ msgstr "random" #: ../../whatsnew/3.12.rst:833 msgid "" -"Add :func:`random.binomialvariate`. (Contributed by Raymond Hettinger " -"in :gh:`81620`.)" +"Add :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :gh:" +"`81620`.)" msgstr "" "新增 :func:`random.binomialvariate`。(由 Raymond Hettinger 於 :gh:`81620` 中" "貢獻。)" @@ -1339,31 +1333,29 @@ msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" -"新增\\ :ref:`命令列介面 `。(由 Erlend E. Aasland " -"於 :gh:`77617` 中貢獻。)" +"新增\\ :ref:`命令列介面 `。(由 Erlend E. Aasland 於 :gh:" +"`77617` 中貢獻。)" #: ../../whatsnew/3.12.rst:874 msgid "" -"Add the :attr:`sqlite3.Connection.autocommit` attribute " -"to :class:`sqlite3.Connection` and the *autocommit* parameter " -"to :func:`sqlite3.connect` to control :pep:`249`-compliant :ref:`transaction " -"handling `. (Contributed by Erlend " -"E. Aasland in :gh:`83638`.)" +"Add the :attr:`sqlite3.Connection.autocommit` attribute to :class:`sqlite3." +"Connection` and the *autocommit* parameter to :func:`sqlite3.connect` to " +"control :pep:`249`-compliant :ref:`transaction handling `. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" #: ../../whatsnew/3.12.rst:881 msgid "" -"Add *entrypoint* keyword-only parameter " -"to :meth:`sqlite3.Connection.load_extension`, for overriding the SQLite " -"extension entry point. (Contributed by Erlend E. Aasland in :gh:`103015`.)" +"Add *entrypoint* keyword-only parameter to :meth:`sqlite3.Connection." +"load_extension`, for overriding the SQLite extension entry point. " +"(Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" #: ../../whatsnew/3.12.rst:886 msgid "" -"Add :meth:`sqlite3.Connection.getconfig` " -"and :meth:`sqlite3.Connection.setconfig` to :class:`sqlite3.Connection` to " -"make configuration changes to a database connection. (Contributed by Erlend " -"E. Aasland in :gh:`103489`.)" +"Add :meth:`sqlite3.Connection.getconfig` and :meth:`sqlite3.Connection." +"setconfig` to :class:`sqlite3.Connection` to make configuration changes to a " +"database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" #: ../../whatsnew/3.12.rst:892 @@ -1384,28 +1376,27 @@ msgstr "sys" #: ../../whatsnew/3.12.rst:901 msgid "" "Add the :mod:`sys.monitoring` namespace to expose the new :ref:`PEP 669 " -"` monitoring API. (Contributed by Mark Shannon " -"in :gh:`103082`.)" +"` monitoring API. (Contributed by Mark Shannon in :gh:" +"`103082`.)" msgstr "" #: ../../whatsnew/3.12.rst:905 msgid "" -"Add :func:`sys.activate_stack_trampoline` " -"and :func:`sys.deactivate_stack_trampoline` for activating and deactivating " -"stack profiler trampolines, and :func:`sys.is_stack_trampoline_active` for " -"querying if stack profiler trampolines are active. (Contributed by Pablo " -"Galindo and Christian Heimes with contributions from Gregory P. Smith " -"[Google] and Mark Shannon in :gh:`96123`.)" +"Add :func:`sys.activate_stack_trampoline` and :func:`sys." +"deactivate_stack_trampoline` for activating and deactivating stack profiler " +"trampolines, and :func:`sys.is_stack_trampoline_active` for querying if " +"stack profiler trampolines are active. (Contributed by Pablo Galindo and " +"Christian Heimes with contributions from Gregory P. Smith [Google] and Mark " +"Shannon in :gh:`96123`.)" msgstr "" #: ../../whatsnew/3.12.rst:914 msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " -"that have the same information in its legacy " -"form: :data:`sys.last_type`, :data:`sys.last_value` " -"and :data:`sys.last_traceback`. (Contributed by Irit Katriel " -"in :gh:`102778`.)" +"that have the same information in its legacy form: :data:`sys.last_type`, :" +"data:`sys.last_value` and :data:`sys.last_traceback`. (Contributed by Irit " +"Katriel in :gh:`102778`.)" msgstr "" #: ../../whatsnew/3.12.rst:920 ../../whatsnew/3.12.rst:1741 @@ -1449,10 +1440,10 @@ msgstr "threading" #: ../../whatsnew/3.12.rst:940 msgid "" -"Add :func:`threading.settrace_all_threads` " -"and :func:`threading.setprofile_all_threads` that allow to set tracing and " -"profiling functions in all running threads in addition to the calling one. " -"(Contributed by Pablo Galindo in :gh:`93503`.)" +"Add :func:`threading.settrace_all_threads` and :func:`threading." +"setprofile_all_threads` that allow to set tracing and profiling functions in " +"all running threads in addition to the calling one. (Contributed by Pablo " +"Galindo in :gh:`93503`.)" msgstr "" #: ../../whatsnew/3.12.rst:946 @@ -1476,9 +1467,9 @@ msgstr "tokenize" #: ../../whatsnew/3.12.rst:959 msgid "" "The :mod:`tokenize` module includes the changes introduced in :pep:`701`. " -"(Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) " -"See :ref:`whatsnew312-porting-to-python312` for more information on the " -"changes to the :mod:`tokenize` module." +"(Contributed by Marta Gómez Macías and Pablo Galindo in :gh:`102856`.) See :" +"ref:`whatsnew312-porting-to-python312` for more information on the changes " +"to the :mod:`tokenize` module." msgstr "" #: ../../whatsnew/3.12.rst:965 @@ -1487,9 +1478,9 @@ msgstr "types" #: ../../whatsnew/3.12.rst:967 msgid "" -"Add :func:`types.get_original_bases` to allow for further introspection " -"of :ref:`user-defined-generics` when subclassed. (Contributed by James " -"Hilton-Balfe and Alex Waygood in :gh:`101827`.)" +"Add :func:`types.get_original_bases` to allow for further introspection of :" +"ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" +"Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" #: ../../whatsnew/3.12.rst:974 @@ -1498,16 +1489,15 @@ msgstr "typing" #: ../../whatsnew/3.12.rst:976 msgid "" -":func:`isinstance` checks against :func:`runtime-checkable protocols " -"` now use :func:`inspect.getattr_static` rather " -"than :func:`hasattr` to lookup whether attributes exist. This means that " -"descriptors and :meth:`~object.__getattr__` methods are no longer " -"unexpectedly evaluated during ``isinstance()`` checks against runtime-" -"checkable protocols. However, it may also mean that some objects which used " -"to be considered instances of a runtime-checkable protocol may no longer be " -"considered instances of that protocol on Python 3.12+, and vice versa. Most " -"users are unlikely to be affected by this change. (Contributed by Alex " -"Waygood in :gh:`102433`.)" +":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" +"`hasattr` to lookup whether attributes exist. This means that descriptors " +"and :meth:`~object.__getattr__` methods are no longer unexpectedly evaluated " +"during ``isinstance()`` checks against runtime-checkable protocols. However, " +"it may also mean that some objects which used to be considered instances of " +"a runtime-checkable protocol may no longer be considered instances of that " +"protocol on Python 3.12+, and vice versa. Most users are unlikely to be " +"affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" #: ../../whatsnew/3.12.rst:987 @@ -1568,8 +1558,8 @@ msgid "" "Most ``isinstance()`` checks against protocols with only a few members " "should be at least 2x faster than in 3.11, and some may be 20x faster or " "more. However, ``isinstance()`` checks against protocols with many members " -"may be slower than in Python 3.11. (Contributed by Alex Waygood " -"in :gh:`74690` and :gh:`103193`.)" +"may be slower than in Python 3.11. (Contributed by Alex Waygood in :gh:" +"`74690` and :gh:`103193`.)" msgstr "" #: ../../whatsnew/3.12.rst:1020 @@ -1672,8 +1662,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:1072 msgid "" -"Speed up the regular expression substitution (functions :func:`re.sub` " -"and :func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " +"Speed up the regular expression substitution (functions :func:`re.sub` and :" +"func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " "replacement strings containing group references by 2--3 times. (Contributed " "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" @@ -1689,16 +1679,16 @@ msgstr "" #: ../../whatsnew/3.12.rst:1080 msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " -"are up to 64% faster as a side effect of the changes required to " -"cover :pep:`701` in the :mod:`tokenize` module. (Contributed by Marta Gómez " -"Macías and Pablo Galindo in :gh:`102856`.)" +"are up to 64% faster as a side effect of the changes required to cover :pep:" +"`701` in the :mod:`tokenize` module. (Contributed by Marta Gómez Macías and " +"Pablo Galindo in :gh:`102856`.)" msgstr "" #: ../../whatsnew/3.12.rst:1085 msgid "" -"Speed up :func:`super` method calls and attribute loads via the " -"new :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and " -"Vladimir Matveev in :gh:`103497`.)" +"Speed up :func:`super` method calls and attribute loads via the new :opcode:" +"`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " +"Matveev in :gh:`103497`.)" msgstr "" #: ../../whatsnew/3.12.rst:1091 @@ -1707,29 +1697,28 @@ msgstr "CPython 位元組碼變更" #: ../../whatsnew/3.12.rst:1093 msgid "" -"Remove the :opcode:`!LOAD_METHOD` instruction. It has been merged " -"into :opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the " -"old :opcode:`!LOAD_METHOD` instruction if the low bit of its oparg is set. " -"(Contributed by Ken Jin in :gh:`93429`.)" +"Remove the :opcode:`!LOAD_METHOD` instruction. It has been merged into :" +"opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" +"`!LOAD_METHOD` instruction if the low bit of its oparg is set. (Contributed " +"by Ken Jin in :gh:`93429`.)" msgstr "" -"移除 :opcode:`!LOAD_METHOD` 指令。它已經合併" -"至 :opcode:`LOAD_ATTR`。:opcode:`LOAD_ATTR` 現在會像舊的 :opcode:`!" -"LOAD_METHOD` 指令一樣行為,如果其 oparg 的低位元 (low bit) 有被設定。(由 " -"Ken Jin 於 :gh:`93429` 中貢獻。)" +"移除 :opcode:`!LOAD_METHOD` 指令。它已經合併至 :opcode:`LOAD_ATTR`。:opcode:" +"`LOAD_ATTR` 現在會像舊的 :opcode:`!LOAD_METHOD` 指令一樣行為,如果其 oparg 的" +"低位元 (low bit) 有被設定。(由 Ken Jin 於 :gh:`93429` 中貢獻。)" #: ../../whatsnew/3.12.rst:1098 msgid "" "Remove the :opcode:`!JUMP_IF_FALSE_OR_POP` and :opcode:`!" -"JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel " -"in :gh:`102859`.)" +"JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" +"`102859`.)" msgstr "" "移除 :opcode:`!JUMP_IF_FALSE_OR_POP` 和 :opcode:`!JUMP_IF_TRUE_OR_POP` 指令。" "(由 Irit Katriel 於 :gh:`102859` 中貢獻。)" #: ../../whatsnew/3.12.rst:1101 msgid "" -"Remove the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon " -"in :gh:`92925`.)" +"Remove the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" +"gh:`92925`.)" msgstr "" "移除 :opcode:`!PRECALL` 指令。(由 Mark Shannon 於 :gh:`92925` 中貢獻。)" @@ -1767,8 +1756,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:1116 msgid "" -"Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon " -"in :gh:`103082`.)" +"Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon in :gh:" +"`103082`.)" msgstr "" "新增 :opcode:`!END_SEND` 指令。(由 Mark Shannon 於 :gh:`103082` 中貢獻。)" @@ -1790,34 +1779,32 @@ msgstr "" #: ../../whatsnew/3.12.rst:1125 msgid "" -"Add " -"the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:`LOAD_FROM_DICT_OR_GLOBALS`, " -"and :opcode:`LOAD_LOCALS` opcodes as part of the implementation " -"of :pep:`695`. Remove the :opcode:`!LOAD_CLASSDEREF` opcode, which can be " -"replaced with :opcode:`LOAD_LOCALS` plus :opcode:`LOAD_FROM_DICT_OR_DEREF`. " -"(Contributed by Jelle Zijlstra in :gh:`103764`.)" +"Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" +"`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " +"the implementation of :pep:`695`. Remove the :opcode:`!LOAD_CLASSDEREF` " +"opcode, which can be replaced with :opcode:`LOAD_LOCALS` plus :opcode:" +"`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" "新增 :opcode:`LOAD_FROM_DICT_OR_DEREF`、:opcode:`LOAD_FROM_DICT_OR_GLOBALS` " "和 :opcode:`LOAD_LOCALS` 操作碼作為 :pep:`695` 實作的一部分。移除 :opcode:`!" -"LOAD_CLASSDEREF` 操作碼,可以用 :opcode:`LOAD_LOCALS` 加" -"上 :opcode:`LOAD_FROM_DICT_OR_DEREF` 來取代。(由 Jelle Zijlstra " -"於 :gh:`103764` 中貢獻。)" +"LOAD_CLASSDEREF` 操作碼,可以用 :opcode:`LOAD_LOCALS` 加上 :opcode:" +"`LOAD_FROM_DICT_OR_DEREF` 來取代。(由 Jelle Zijlstra 於 :gh:`103764` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1131 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" -"新增 :opcode:`LOAD_SUPER_ATTR` 指令。(由 Carl Meyer 和 Vladimir Matveev " -"於 :gh:`103497` 中貢獻。)" +"新增 :opcode:`LOAD_SUPER_ATTR` 指令。(由 Carl Meyer 和 Vladimir Matveev 於 :" +"gh:`103497` 中貢獻。)" #: ../../whatsnew/3.12.rst:1134 msgid "" -"Add the ``RETURN_CONST`` instruction. (Contributed by Wenyang Wang " -"in :gh:`101632`.)" +"Add the ``RETURN_CONST`` instruction. (Contributed by Wenyang Wang in :gh:" +"`101632`.)" msgstr "" -"新增 ``RETURN_CONST`` 指令。(由 Wenyang Wang 於 :gh:`101632` 中貢" -"獻。)" +"新增 ``RETURN_CONST`` 指令。(由 Wenyang Wang 於 :gh:`101632` 中貢獻。)" #: ../../whatsnew/3.12.rst:1137 msgid "Demos and Tools" @@ -1891,8 +1878,8 @@ msgstr ":class:`!ast.Ellipsis`" #: ../../whatsnew/3.12.rst:1168 #: ../../deprecations/pending-removal-in-3.14.rst:19 msgid "" -"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka " -"in :gh:`90953`.)" +"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" +"`90953`.)" msgstr "" "請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)" @@ -1906,29 +1893,27 @@ msgstr ":mod:`asyncio`:" #: ../../deprecations/pending-removal-in-3.14.rst:24 msgid "" "The child watcher classes :class:`!asyncio.MultiLoopChildWatcher`, :class:`!" -"asyncio.FastChildWatcher`, :class:`!asyncio.AbstractChildWatcher` " -"and :class:`!asyncio.SafeChildWatcher` are deprecated and will be removed in " -"Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +"asyncio.FastChildWatcher`, :class:`!asyncio.AbstractChildWatcher` and :class:" +"`!asyncio.SafeChildWatcher` are deprecated and will be removed in Python " +"3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -"已棄用並將在 Python 3.14 中移除的 child watcher 類別::class:`!" -"asyncio.MultiLoopChildWatcher`、:class:`!asyncio.FastChildWatcher`、:class:`!" -"asyncio.AbstractChildWatcher` 和 :class:`!asyncio.SafeChildWatcher`。 (由 " -"Kumar Aditya 於 :gh:`94597` 貢獻。)" +"已棄用並將在 Python 3.14 中移除的 child watcher 類別::class:`!asyncio." +"MultiLoopChildWatcher`、:class:`!asyncio.FastChildWatcher`、:class:`!asyncio." +"AbstractChildWatcher` 和 :class:`!asyncio.SafeChildWatcher`。 (由 Kumar " +"Aditya 於 :gh:`94597` 貢獻。)" #: ../../whatsnew/3.12.rst:1179 #: ../../deprecations/pending-removal-in-3.14.rst:30 msgid "" -":func:`!asyncio.set_child_watcher`, :func:`!" -"asyncio.get_child_watcher`, :meth:`!" -"asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`!" +":func:`!asyncio.set_child_watcher`, :func:`!asyncio.get_child_watcher`, :" +"meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`!" "asyncio.AbstractEventLoopPolicy.get_child_watcher` are deprecated and will " "be removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -":func:`!asyncio.set_child_watcher`、:func:`!" -"asyncio.get_child_watcher`、:meth:`!" -"asyncio.AbstractEventLoopPolicy.set_child_watcher` 和 :meth:`!" -"asyncio.AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python " -"3.14 中移除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" +":func:`!asyncio.set_child_watcher`、:func:`!asyncio.get_child_watcher`、:" +"meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher` 和 :meth:`!asyncio." +"AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python 3.14 中移" +"除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" #: ../../whatsnew/3.12.rst:1185 #: ../../deprecations/pending-removal-in-3.14.rst:36 @@ -1946,9 +1931,8 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:45 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " -"are deprecated and replaced by :data:`calendar.JANUARY` " -"and :data:`calendar.FEBRUARY`. (Contributed by Prince Roshan " -"in :gh:`103636`.)" +"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." +"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" ":mod:`calendar`:``calendar.January`` 和 ``calendar.February`` 常數已被棄用並" "被 :data:`calendar.JANUARY` 和 :data:`calendar.FEBRUARY` 取代。 (由 Prince " @@ -1956,33 +1940,30 @@ msgstr "" #: ../../whatsnew/3.12.rst:1194 msgid "" -":mod:`collections.abc`: Deprecated :class:`!collections.abc.ByteString`. " -"Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " -"typing, prefer a union, like ``bytes | bytearray``, " -"or :class:`collections.abc.Buffer`. (Contributed by Shantanu Jain " -"in :gh:`91896`.)" +":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " +"Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in type " +"annotations, prefer a union, like ``bytes | bytearray``, or :class:" +"`collections.abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" -":mod:`collections.abc`:已棄用 :class:`!collections.abc.ByteString`。請改" -"用 :class:`Sequence` 或 :class:`collections.abc.Buffer`。在 typing 中使用時," -"請改用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。" -"(由 Shantanu Jain 於 :gh:`91896` 貢獻。)" +":mod:`collections.abc`:已棄用 :class:`collections.abc.ByteString`。請改用 :" +"class:`Sequence` 或 :class:`collections.abc.Buffer`。在 typing 中使用時,請改" +"用聯集,如 ``bytes | bytearray``,或 :class:`collections.abc.Buffer`。(由 " +"Shantanu Jain 於 :gh:`91896` 貢獻。)" #: ../../whatsnew/3.12.rst:1199 msgid "" -":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime.utcnow` " -"and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and will be " -"removed in a future version. Instead, use timezone-aware objects to " -"represent datetimes in UTC: respectively, " -"call :meth:`~datetime.datetime.now` " -"and :meth:`~datetime.datetime.fromtimestamp` with the *tz* parameter set " -"to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" +":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." +"utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " +"will be removed in a future version. Instead, use timezone-aware objects to " +"represent datetimes in UTC: respectively, call :meth:`~datetime.datetime." +"now` and :meth:`~datetime.datetime.fromtimestamp` with the *tz* parameter " +"set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" #: ../../whatsnew/3.12.rst:1207 msgid "" -":mod:`email`: Deprecate the *isdst* parameter " -"in :func:`email.utils.localtime`. (Contributed by Alan Williams " -"in :gh:`72346`.)" +":mod:`email`: Deprecate the *isdst* parameter in :func:`email.utils." +"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" ":mod:`email`:棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 中貢獻。)" @@ -1994,37 +1975,37 @@ msgid "" msgstr ":mod:`importlib.abc`:棄用下列類別,預定於 Python 3.14 中移除:" #: ../../whatsnew/3.12.rst:1213 -#: ../../deprecations/pending-removal-in-3.14.rst:52 +#: ../../deprecations/pending-removal-in-3.14.rst:46 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" #: ../../whatsnew/3.12.rst:1214 -#: ../../deprecations/pending-removal-in-3.14.rst:53 +#: ../../deprecations/pending-removal-in-3.14.rst:47 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" #: ../../whatsnew/3.12.rst:1215 -#: ../../deprecations/pending-removal-in-3.14.rst:54 +#: ../../deprecations/pending-removal-in-3.14.rst:48 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" #: ../../whatsnew/3.12.rst:1217 -#: ../../deprecations/pending-removal-in-3.14.rst:56 +#: ../../deprecations/pending-removal-in-3.14.rst:50 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" #: ../../whatsnew/3.12.rst:1219 -#: ../../deprecations/pending-removal-in-3.14.rst:58 +#: ../../deprecations/pending-removal-in-3.14.rst:52 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" #: ../../whatsnew/3.12.rst:1220 -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:53 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" #: ../../whatsnew/3.12.rst:1222 -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:55 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" @@ -2033,8 +2014,8 @@ msgid "" ":mod:`itertools`: Deprecate the support for copy, deepcopy, and pickle " "operations, which is undocumented, inefficient, historically buggy, and " "inconsistent. This will be removed in 3.14 for a significant reduction in " -"code volume and maintenance burden. (Contributed by Raymond Hettinger " -"in :gh:`101588`.)" +"code volume and maintenance burden. (Contributed by Raymond Hettinger in :gh:" +"`101588`.)" msgstr "" #: ../../whatsnew/3.12.rst:1230 @@ -2043,22 +2024,20 @@ msgid "" "start method will change to a safer one on Linux, BSDs, and other non-macOS " "POSIX platforms where ``'fork'`` is currently the default (:gh:`84559`). " "Adding a runtime warning about this was deemed too disruptive as the " -"majority of code is not expected to care. Use " -"the :func:`~multiprocessing.get_context` " -"or :func:`~multiprocessing.set_start_method` APIs to explicitly specify when " -"your code *requires* ``'fork'``. See :ref:`contexts and start methods " -"`." +"majority of code is not expected to care. Use the :func:`~multiprocessing." +"get_context` or :func:`~multiprocessing.set_start_method` APIs to explicitly " +"specify when your code *requires* ``'fork'``. See :ref:`contexts and start " +"methods `." msgstr "" #: ../../whatsnew/3.12.rst:1240 msgid "" ":mod:`pkgutil`: :func:`!pkgutil.find_loader` and :func:`!pkgutil.get_loader` " -"are deprecated and will be removed in Python 3.14; " -"use :func:`importlib.util.find_spec` instead. (Contributed by Nikita Sobolev " -"in :gh:`97850`.)" +"are deprecated and will be removed in Python 3.14; use :func:`importlib.util." +"find_spec` instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" -":mod:`pkgutil`::func:`!pkgutil.find_loader` 和 :func:`!pkgutil.get_loader` 已" -"被棄用並將在 Python 3.14 中移除;請改用 :func:`importlib.util.find_spec`。" +":mod:`pkgutil`::func:`!pkgutil.find_loader` 和 :func:`!pkgutil.get_loader` " +"已被棄用並將在 Python 3.14 中移除;請改用 :func:`importlib.util.find_spec`。" "(由 Nikita Sobolev 於 :gh:`97850` 中貢獻。)" #: ../../whatsnew/3.12.rst:1245 @@ -2084,37 +2063,36 @@ msgstr "" #: ../../whatsnew/3.12.rst:1258 msgid "" -"On POSIX platforms, :func:`os.fork` can now raise " -"a :exc:`DeprecationWarning` when it can detect being called from a " -"multithreaded process. There has always been a fundamental incompatibility " -"with the POSIX platform when doing so. Even if such code *appeared* to work. " -"We added the warning to raise awareness as issues encountered by code doing " -"this are becoming more frequent. See the :func:`os.fork` documentation for " -"more details along with `this discussion on fork being incompatible with " -"threads `_ for *why* we're now surfacing this longstanding " +"On POSIX platforms, :func:`os.fork` can now raise a :exc:" +"`DeprecationWarning` when it can detect being called from a multithreaded " +"process. There has always been a fundamental incompatibility with the POSIX " +"platform when doing so. Even if such code *appeared* to work. We added the " +"warning to raise awareness as issues encountered by code doing this are " +"becoming more frequent. See the :func:`os.fork` documentation for more " +"details along with `this discussion on fork being incompatible with threads " +"`_ for *why* we're now surfacing this longstanding " "platform compatibility problem to developers." msgstr "" #: ../../whatsnew/3.12.rst:1268 msgid "" -"When this warning appears due to usage of :mod:`multiprocessing` " -"or :mod:`concurrent.futures` the fix is to use a " -"different :mod:`multiprocessing` start method such as ``\"spawn\"`` or " -"``\"forkserver\"``." +"When this warning appears due to usage of :mod:`multiprocessing` or :mod:" +"`concurrent.futures` the fix is to use a different :mod:`multiprocessing` " +"start method such as ``\"spawn\"`` or ``\"forkserver\"``." msgstr "" #: ../../whatsnew/3.12.rst:1272 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is " -"deprecated; use *onexc* instead. (Contributed by Irit Katriel " -"in :gh:`102828`.)" +"deprecated; use *onexc* instead. (Contributed by Irit Katriel in :gh:" +"`102828`.)" msgstr "" ":mod:`shutil`::func:`shutil.rmtree` 的 *onerror* 引數已被棄用,請改用 " "*onexc*。(由 Irit Katriel 於 :gh:`102828` 中貢獻。)" #: ../../whatsnew/3.12.rst:1275 -#: ../../deprecations/pending-removal-in-3.14.rst:91 +#: ../../deprecations/pending-removal-in-3.14.rst:85 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" @@ -2137,14 +2115,13 @@ msgstr "" #: ../../whatsnew/3.12.rst:1290 msgid "" -":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` " -"and :data:`sys.last_traceback` fields are deprecated. " -"Use :data:`sys.last_exc` instead. (Contributed by Irit Katriel " -"in :gh:`102778`.)" +":mod:`sys`: The :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." +"last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " +"(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" -":mod:`sys`::data:`sys.last_type`、:data:`sys.last_value` " -"和 :data:`sys.last_traceback` 欄位已被棄用。請改用 :data:`sys.last_exc`。" -"(由 Irit Katriel 於 :gh:`102778` 中貢獻。)" +":mod:`sys`::data:`sys.last_type`、:data:`sys.last_value` 和 :data:`sys." +"last_traceback` 欄位已被棄用。請改用 :data:`sys.last_exc`。(由 Irit Katriel " +"於 :gh:`102778` 中貢獻。)" #: ../../whatsnew/3.12.rst:1294 msgid "" @@ -2161,20 +2138,19 @@ msgstr ":mod:`typing`:" #: ../../whatsnew/3.12.rst:1300 msgid "" -":class:`typing.Hashable` and :class:`typing.Sized`, aliases " -"for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized` " -"respectively, are deprecated. (:gh:`94309`.)" +":class:`typing.Hashable` and :class:`typing.Sized`, aliases for :class:" +"`collections.abc.Hashable` and :class:`collections.abc.Sized` respectively, " +"are deprecated. (:gh:`94309`.)" msgstr "" #: ../../whatsnew/3.12.rst:1304 msgid "" -":class:`!typing.ByteString`, deprecated since Python 3.9, now causes " -"a :exc:`DeprecationWarning` to be emitted when it is used. (Contributed by " -"Alex Waygood in :gh:`91896`.)" +":class:`typing.ByteString`, deprecated since Python 3.9, now causes a :exc:" +"`DeprecationWarning` to be emitted when it is used. (Contributed by Alex " +"Waygood in :gh:`91896`.)" msgstr "" -"自 Python 3.9 起已被棄用的 :class:`!typing.ByteString` 現在在" -"使用時會發出 :exc:`DeprecationWarning`。(由 Alex Waygood 於 :gh:`91896` " -"中貢獻。)" +"自 Python 3.9 起已被棄用的 :class:`typing.ByteString` 現在在使用時會發出 :" +"exc:`DeprecationWarning`。(由 Alex Waygood 於 :gh:`91896` 中貢獻。)" #: ../../whatsnew/3.12.rst:1308 msgid "" @@ -2187,26 +2163,26 @@ msgstr "" #: ../../whatsnew/3.12.rst:1314 msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`coroutine throw() " -"`, :meth:`generator throw() ` " -"and :meth:`async generator throw() ` are deprecated and may be " -"removed in a future version of Python. Use the single-arg versions of these " -"functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" +"`, :meth:`generator throw() ` and :meth:" +"`async generator throw() ` are deprecated and may be removed in " +"a future version of Python. Use the single-arg versions of these functions " +"instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" #: ../../whatsnew/3.12.rst:1320 msgid "" ":exc:`DeprecationWarning` is now raised when :attr:`~module.__package__` on " -"a module differs from :attr:`__spec__.parent " -"` (previously it " -"was :exc:`ImportWarning`). (Contributed by Brett Cannon in :gh:`65961`.)" +"a module differs from :attr:`__spec__.parent ` (previously it was :exc:`ImportWarning`). (Contributed by Brett " +"Cannon in :gh:`65961`.)" msgstr "" #: ../../whatsnew/3.12.rst:1326 msgid "" "Setting :attr:`~module.__package__` or :attr:`~module.__cached__` on a " "module is deprecated, and will cease to be set or taken into consideration " -"by the import system in Python 3.14. (Contributed by Brett Cannon " -"in :gh:`65961`.)" +"by the import system in Python 3.14. (Contributed by Brett Cannon in :gh:" +"`65961`.)" msgstr "" #: ../../whatsnew/3.12.rst:1330 @@ -2221,13 +2197,13 @@ msgstr "" #: ../../whatsnew/3.12.rst:1336 msgid "" "Accessing :attr:`~codeobject.co_lnotab` on code objects was deprecated in " -"Python 3.10 via :pep:`626`, but it only got a " -"proper :exc:`DeprecationWarning` in 3.12. May be removed in 3.15. " -"(Contributed by Nikita Sobolev in :gh:`101866`.)" +"Python 3.10 via :pep:`626`, but it only got a proper :exc:" +"`DeprecationWarning` in 3.12. May be removed in 3.15. (Contributed by Nikita " +"Sobolev in :gh:`101866`.)" msgstr "" -"自 3.10 起,於程式碼物件存取 :attr:`~codeobject.co_lnotab` 的功能已" -"在 :pep:`626` 中被棄用,但只在 3.12 中於適時發出 :exc:`DeprecationWarning`。" -"可能在 3.15 中移除。(由 Nikita Sobolev 於 :gh:`101866` 貢獻。)" +"自 3.10 起,於程式碼物件存取 :attr:`~codeobject.co_lnotab` 的功能已在 :pep:" +"`626` 中被棄用,但只在 3.12 中於適時發出 :exc:`DeprecationWarning`。可能在 " +"3.15 中移除。(由 Nikita Sobolev 於 :gh:`101866` 貢獻。)" #: ../../deprecations/pending-removal-in-3.13.rst:2 msgid "Pending removal in Python 3.13" @@ -2419,32 +2395,17 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.14.rst:41 msgid "" -":mod:`collections.abc`: Deprecated :class:`!collections.abc.ByteString`. " -"Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " -"typing, prefer a union, like ``bytes | bytearray``, " -"or :class:`collections.abc.Buffer`. (Contributed by Shantanu Jain " -"in :gh:`91896`.)" -msgstr "" -":mod:`collections.abc`:已棄用 :class:`!collections.abc.ByteString`。請改" -"用 :class:`!Sequence` 或 :class:`~collections.abc.Buffer`。在 typing 中使用" -"時,請改用聯集,如 ``bytes | bytearray``," -"或 :class:`collections.abc.Buffer`。(由 Shantanu Jain 於 :gh:`91896` 貢" -"獻。)" - -#: ../../deprecations/pending-removal-in-3.14.rst:47 -msgid "" -":mod:`email`: Deprecated the *isdst* parameter " -"in :func:`email.utils.localtime`. (Contributed by Alan Williams " -"in :gh:`72346`.)" +":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." +"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" ":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:50 +#: ../../deprecations/pending-removal-in-3.14.rst:44 msgid ":mod:`importlib.abc` deprecated classes:" msgstr ":mod:`importlib.abc` 的已棄用類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:63 +#: ../../deprecations/pending-removal-in-3.14.rst:57 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -2455,82 +2416,72 @@ msgstr "" "deepcopy 和 pickle 操作支援。將在 3.14 中移除以大幅減少程式碼量和維護負擔。 " "(由 Raymond Hettinger 於 :gh:`101588` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:69 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " "currently the default (:gh:`84559`). Adding a runtime warning about this was " "deemed too disruptive as the majority of code is not expected to care. Use " -"the :func:`~multiprocessing.get_context` " -"or :func:`~multiprocessing.set_start_method` APIs to explicitly specify when " -"your code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." +"the :func:`~multiprocessing.get_context` or :func:`~multiprocessing." +"set_start_method` APIs to explicitly specify when your code *requires* " +"``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" ":mod:`multiprocessing`:預設的啟動方法將在 Linux、BSD 和其他非 macOS POSIX 平" "台上更改為更安全的 方法,目前 ``'fork'`` 是預設值 (:gh:`84559`)。對此增加一" -"個 runtime 警告被認為太過擾人,因為 大多數程式碼不會在意。請使" -"用 :func:`~multiprocessing.get_context` " -"或 :func:`~multiprocessing.set_start_method` API 來明確指定你的程式碼何時\\ *" -"需要* ``'fork'``。請參閱 :ref:`multiprocessing-start-methods`。" +"個 runtime 警告被認為太過擾人,因為 大多數程式碼不會在意。請使用 :func:" +"`~multiprocessing.get_context` 或 :func:`~multiprocessing.set_start_method` " +"API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" +"`multiprocessing-start-methods`。" -#: ../../deprecations/pending-removal-in-3.14.rst:77 +#: ../../deprecations/pending-removal-in-3.14.rst:71 msgid "" -":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` " -"and :meth:`~pathlib.PurePath.relative_to`: passing additional arguments is " -"deprecated." +":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." +"PurePath.relative_to`: passing additional arguments is deprecated." msgstr "" -":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` " -"和 :meth:`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" +":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" +"`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" -#: ../../deprecations/pending-removal-in-3.14.rst:81 +#: ../../deprecations/pending-removal-in-3.14.rst:75 msgid "" ":mod:`pkgutil`: :func:`!pkgutil.find_loader` and :func:`!pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" ":mod:`pkgutil`::func:`!pkgutil.find_loader` 和 :func:`!pkgutil.get_loader` " -"現在會引發 :exc:`DeprecationWarning`;請改" -"用 :func:`importlib.util.find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢" -"獻。)" +"現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." +"find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:86 +#: ../../deprecations/pending-removal-in-3.14.rst:80 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.14.rst:88 +#: ../../deprecations/pending-removal-in-3.14.rst:82 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "``master_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:89 +#: ../../deprecations/pending-removal-in-3.14.rst:83 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "``slave_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:93 +#: ../../deprecations/pending-removal-in-3.14.rst:87 msgid ":data:`!version` and :data:`!version_info`." msgstr ":data:`!version` 和 :data:`!version_info`。" -#: ../../deprecations/pending-removal-in-3.14.rst:95 +#: ../../deprecations/pending-removal-in-3.14.rst:89 msgid "" -":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` " -"if :ref:`named placeholders ` are used and " -"*parameters* is a sequence instead of a :class:`dict`." +":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" +"ref:`named placeholders ` are used and *parameters* is " +"a sequence instead of a :class:`dict`." msgstr "" ":meth:`~sqlite3.Cursor.execute` 和 :meth:`~sqlite3.Cursor.executemany`,如果" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" "而不是 :class:`dict`。" -#: ../../deprecations/pending-removal-in-3.14.rst:99 -msgid "" -":mod:`typing`: :class:`!typing.ByteString`, deprecated since Python 3.9, now " -"causes a :exc:`DeprecationWarning` to be emitted when it is used." -msgstr "" -":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`!typing.ByteString` 現在在" -"使用時會發出 :exc:`DeprecationWarning`。" - -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " -"intended to be a public API. (Contributed by Gregory P. Smith " -"in :gh:`88168`.)" +"intended to be a public API. (Contributed by Gregory P. Smith in :gh:" +"`88168`.)" msgstr "" ":mod:`urllib`::class:`!urllib.parse.Quoter` 已被棄用:它並非預期的公開 API。" "(由 Gregory P. Smith 於 :gh:`88168` 貢獻。)" @@ -2547,10 +2498,10 @@ msgstr "引入系統 (import system):" #: ../../deprecations/pending-removal-in-3.15.rst:6 msgid "" -"Setting :attr:`~module.__cached__` on a module while failing to " -"set :attr:`__spec__.cached ` is " -"deprecated. In Python 3.15, :attr:`!__cached__` will cease to be set or take " -"into consideration by the import system or standard library. (:gh:`97879`)" +"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" +"`__spec__.cached ` is deprecated. In " +"Python 3.15, :attr:`!__cached__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" msgstr "" "在模組上設定 :attr:`~module.__cached__` 而沒有設定 :attr:`__spec__.cached " "` 的做法已被棄用。在 Python 3.15 中," @@ -2558,11 +2509,10 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:11 msgid "" -"Setting :attr:`~module.__package__` on a module while failing to " -"set :attr:`__spec__.parent ` is " -"deprecated. In Python 3.15, :attr:`!__package__` will cease to be set or " -"take into consideration by the import system or standard library. " -"(:gh:`97879`)" +"Setting :attr:`~module.__package__` on a module while failing to set :attr:" +"`__spec__.parent ` is deprecated. In " +"Python 3.15, :attr:`!__package__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" msgstr "" "在模組上設定 :attr:`~module.__package__` 而沒有設定 :attr:`__spec__.parent " "` 的做法已被棄用。在 Python 3.15 中," @@ -2617,17 +2567,15 @@ 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`.)" +"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` 貢" -"獻。)" +"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`:" @@ -2635,11 +2583,11 @@ msgstr ":mod:`pathlib`:" #: ../../deprecations/pending-removal-in-3.15.rst:48 msgid "" -":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. " -"Use :func:`os.path.isreserved` to detect reserved paths on Windows." +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" +"func:`os.path.isreserved` to detect reserved paths on Windows." msgstr "" -":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請" -"用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" +":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請用 :func:`os.path." +"isreserved` 來偵測 Windows 上的保留路徑。" #: ../../deprecations/pending-removal-in-3.15.rst:52 msgid ":mod:`platform`:" @@ -2694,16 +2642,16 @@ msgid "" "in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" ":class:`types.CodeType`:自 3.10 起,存取 :attr:`~codeobject.co_lnotab` 已" -"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發" -"出 :exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev " -"於 :gh:`101866` 貢獻。)" +"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發出 :" +"exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev 於 :gh:" +"`101866` 貢獻。)" #: ../../deprecations/pending-removal-in-3.15.rst:82 msgid "" -"The undocumented keyword argument syntax for " -"creating :class:`~typing.NamedTuple` classes (for example, ``Point = " -"NamedTuple(\"Point\", x=int, y=int)``) has been deprecated since Python " -"3.13. Use the class-based syntax or the functional syntax instead." +"The undocumented keyword argument syntax for creating :class:`~typing." +"NamedTuple` classes (for example, ``Point = NamedTuple(\"Point\", x=int, " +"y=int)``) has been deprecated since Python 3.13. Use the class-based syntax " +"or the functional syntax instead." msgstr "" "用於建立 :class:`~typing.NamedTuple` 類別的未以文件記錄之關鍵字引數語法 " "(``Point = NamedTuple(\"Point\", x=int, y=int)``) 已自 Python 3.13 棄用。請改" @@ -2738,14 +2686,13 @@ msgstr ":mod:`wave`:" #: ../../deprecations/pending-removal-in-3.15.rst:102 msgid "" -"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, " -"and :meth:`~wave.Wave_read.getmarkers` methods of " -"the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes have been " -"deprecated since Python 3.13." +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." +"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" +"`~wave.Wave_write` classes have been deprecated since Python 3.13." msgstr "" -"已棄用 :class:`~wave.Wave_read` 和 :class:`~wave.Wave_write` 類別" -"的 :meth:`~wave.Wave_read.getmark`、:meth:`!setmark` " -"和 :meth:`~wave.Wave_read.getmarkers` 方法自 Python 3.13 被棄用。" +"已棄用 :class:`~wave.Wave_read` 和 :class:`~wave.Wave_write` 類別的 :meth:" +"`~wave.Wave_read.getmark`、:meth:`!setmark` 和 :meth:`~wave.Wave_read." +"getmarkers` 方法自 Python 3.13 被棄用。" #: ../../deprecations/pending-removal-in-3.15.rst:107 msgid ":mod:`zipimport`:" @@ -2757,9 +2704,9 @@ msgid "" "3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead. (Contributed " "by Jiahao Li in :gh:`125746`.)" msgstr "" -":meth:`~zipimport.zipimporter.load_module` 自 Python 3.10 被棄用。請改" -"用 :meth:`~zipimport.zipimporter.exec_module`。(由 Jiahao Li " -"於 :gh:`125746` 貢獻。)" +":meth:`~zipimport.zipimporter.load_module` 自 Python 3.10 被棄用。請改用 :" +"meth:`~zipimport.zipimporter.exec_module`。(由 Jiahao Li 於 :gh:`125746` 貢" +"獻。)" #: ../../deprecations/c-api-pending-removal-in-3.16.rst:2 #: ../../deprecations/pending-removal-in-3.16.rst:2 @@ -2768,10 +2715,10 @@ msgstr "Python 3.16 中待移除的項目" #: ../../deprecations/pending-removal-in-3.16.rst:6 msgid "" -"Setting :attr:`~module.__loader__` on a module while failing to " -"set :attr:`__spec__.loader ` is " -"deprecated. In Python 3.16, :attr:`!__loader__` will cease to be set or " -"taken into consideration by the import system or the standard library." +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.16, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." msgstr "" "在模組上設定 :attr:`~module.__loader__` 而沒有設定 :attr:`__spec__.loader " "` 的做法將於 Python 3.16 被棄用。在 " @@ -2798,8 +2745,8 @@ msgid "" "by Jiahao Li and Kumar Aditya in :gh:`122875`.)" msgstr "" ":func:`!asyncio.iscoroutinefunction` 已被棄用並將在 Python 3.16 中移除;請改" -"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya " -"於 :gh:`122875` 貢獻。)" +"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya 於 :" +"gh:`122875` 貢獻。)" #: ../../deprecations/pending-removal-in-3.16.rst:26 msgid "" @@ -2893,8 +2840,8 @@ msgid "" "*function* or *sequence* as keyword arguments has been deprecated since " "Python 3.14." msgstr "" -"自 Python 3.14 起,使用 *function* 或 *sequence* 關鍵字引數呼" -"叫 :func:`functools.reduce` 的 Python 實作已被棄用。" +"自 Python 3.14 起,使用 *function* 或 *sequence* 關鍵字引數呼叫 :func:" +"`functools.reduce` 的 Python 實作已被棄用。" #: ../../deprecations/pending-removal-in-3.16.rst:64 msgid ":mod:`logging`:" @@ -2915,10 +2862,10 @@ msgstr ":mod:`mimetypes`:" #: ../../deprecations/pending-removal-in-3.16.rst:72 msgid "" -"Valid extensions start with a '.' or are empty " -"for :meth:`mimetypes.MimeTypes.add_type`. Undotted extensions are deprecated " -"and will raise a :exc:`ValueError` in Python 3.16. (Contributed by Hugo van " -"Kemenade in :gh:`75223`.)" +"Valid extensions start with a '.' or are empty for :meth:`mimetypes." +"MimeTypes.add_type`. Undotted extensions are deprecated and will raise a :" +"exc:`ValueError` in Python 3.16. (Contributed by Hugo van Kemenade in :gh:" +"`75223`.)" msgstr "" "有效的副檔名以 '.' 開頭或對 :meth:`mimetypes.MimeTypes.add_type` 為空字串。未" "加點的副檔名已被棄用,並將在 Python 3.16 中引發 :exc:`ValueError`。(由 Hugo " @@ -3001,6 +2948,36 @@ msgstr "" "除。使用者應該改用文件中記錄的內省輔助函式,例如 :func:`typing.get_origin` " "和 :func:`typing.get_args`,或者依賴私有實作細節。" +#: ../../deprecations/pending-removal-in-3.17.rst:11 +msgid "" +":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " +"removal in Python 3.17. Prefer :class:`~collections.abc.Sequence` or :class:" +"`~collections.abc.Buffer`. For use in type annotations, prefer a union, like " +"``bytes | bytearray``, or :class:`collections.abc.Buffer`. (Contributed by " +"Shantanu Jain in :gh:`91896`.)" +msgstr "" +"自 Python 3.9 起已被棄用的 :class:`typing.ByteString`,計劃在 Python " +"3.17 中移除。建議改用 :class:`~collections.abc.Sequence` 或 :class:`~" +"collections.abc.Buffer`。在型別註釋中建議改用聯集,例如 ``bytes | " +"bytearray`` 或 :class:`collections.abc.Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" + +#: ../../deprecations/pending-removal-in-3.17.rst:17 +msgid ":mod:`collections.abc`:" +msgstr ":mod:`collections.abc`:" + +#: ../../deprecations/pending-removal-in-3.17.rst:19 +msgid "" +":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17. " +"Prefer :class:`~collections.abc.Sequence` or :class:`~collections.abc." +"Buffer`. For use in type annotations, prefer a union, like ``bytes | " +"bytearray``, or :class:`collections.abc.Buffer`. (Contributed by Shantanu " +"Jain in :gh:`91896`.)" +msgstr "" +":class:`collections.abc.ByteString` 計劃在 Python 3.17 中移除。建議改用 " +":class:`~collections.abc.Sequence` 或 :class:`~collections.abc.Buffer`。在" +"型別註釋中建議改用聯集,例如 ``bytes | bytearray`` 或 :class:`collections.abc." +"Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" + #: ../../deprecations/c-api-pending-removal-in-future.rst:2 #: ../../deprecations/pending-removal-in-future.rst:2 msgid "Pending removal in future versions" @@ -3023,11 +3000,11 @@ msgstr "巢狀引數群組和巢狀互斥群組已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:11 msgid "" -"Passing the undocumented keyword argument *prefix_chars* " -"to :meth:`~argparse.ArgumentParser.add_argument_group` is now deprecated." +"Passing the undocumented keyword argument *prefix_chars* to :meth:`~argparse." +"ArgumentParser.add_argument_group` is now deprecated." msgstr "" -"將未以文件記錄的關鍵字引數 *prefix_chars* 傳遞" -"給 :meth:`~argparse.ArgumentParser.add_argument_group` 的做法現在已被棄用。" +"將未以文件記錄的關鍵字引數 *prefix_chars* 傳遞給 :meth:`~argparse." +"ArgumentParser.add_argument_group` 的做法現在已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:14 msgid "The :class:`argparse.FileType` type converter is deprecated." @@ -3052,17 +3029,17 @@ msgid "" "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " "ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " "``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised " -"if the numeric literal is immediately followed by one of " -"keywords :keyword:`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :keyword:`is` " -"and :keyword:`or`. In a future release it will be changed to a syntax " -"error. (:gh:`87999`)" +"if the numeric literal is immediately followed by one of keywords :keyword:" +"`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :" +"keyword:`is` and :keyword:`or`. In a future release it will be changed to a " +"syntax error. (:gh:`87999`)" msgstr "" "目前 Python 接受數值字面值後面立即接關鍵字,例如 ``0in x``、``1or x``、``0if " "1else 2``。它讓表達式模糊且容易混淆,如 ``[0x1for x in y]``\\ (可以解釋為 " -"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即" -"接 :keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:`in`、:keyword:`is` " -"和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版本中,它將被更改為語" -"法錯誤。(:gh:`87999`)" +"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即接 :" +"keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:" +"`in`、:keyword:`is` 和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版" +"本中,它將被更改為語法錯誤。(:gh:`87999`)" #: ../../deprecations/pending-removal-in-future.rst:30 msgid "" @@ -3075,18 +3052,18 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:33 msgid "" -"Support for ``__float__()`` method returning a strict subclass " -"of :class:`float`: these methods will be required to return an instance " -"of :class:`float`." +"Support for ``__float__()`` method returning a strict subclass of :class:" +"`float`: these methods will be required to return an instance of :class:" +"`float`." msgstr "" "回傳 :class:`float` 嚴格子類別 ``__float__()`` 方法的支援:這些方法將需要回" "傳 :class:`float` 的實例。" #: ../../deprecations/pending-removal-in-future.rst:36 msgid "" -"Support for ``__complex__()`` method returning a strict subclass " -"of :class:`complex`: these methods will be required to return an instance " -"of :class:`complex`." +"Support for ``__complex__()`` method returning a strict subclass of :class:" +"`complex`: these methods will be required to return an instance of :class:" +"`complex`." msgstr "" "回傳 :class:`complex` 嚴格子類別 ``__complex__()`` 方法的支援:這些方法將需要" "回傳 :class:`complex` 的實例。" @@ -3097,18 +3074,18 @@ msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。" #: ../../deprecations/pending-removal-in-future.rst:40 msgid "" -"Passing a complex number as the *real* or *imag* argument in " -"the :func:`complex` constructor is now deprecated; it should only be passed " -"as a single positional argument. (Contributed by Serhiy Storchaka " -"in :gh:`109218`.)" +"Passing a complex number as the *real* or *imag* argument in the :func:" +"`complex` constructor is now deprecated; it should only be passed as a " +"single positional argument. (Contributed by Serhiy Storchaka in :gh:" +"`109218`.)" msgstr "" "在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;" "它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)" #: ../../deprecations/pending-removal-in-future.rst:50 msgid "" -":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. " -"(:gh:`133038`)" +":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. (:gh:" +"`133038`)" msgstr "" ":mod:`codecs`:請改用 :func:`open` 而非 :func:`codecs.open`。(:gh:`133038`)" @@ -3125,19 +3102,19 @@ msgstr ":mod:`datetime`:" #: ../../deprecations/pending-removal-in-future.rst:57 msgid "" -":meth:`~datetime.datetime.utcnow`: use " -"``datetime.datetime.now(tz=datetime.UTC)``." +":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." +"UTC)``." msgstr "" -":meth:`~datetime.datetime.utcnow`:請改用 " -"``datetime.datetime.now(tz=datetime.UTC)``。" +":meth:`~datetime.datetime.utcnow`:請改用 ``datetime.datetime." +"now(tz=datetime.UTC)``。" #: ../../deprecations/pending-removal-in-future.rst:59 msgid "" -":meth:`~datetime.datetime.utcfromtimestamp`: use " -"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``." +":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." +"fromtimestamp(timestamp, tz=datetime.UTC)``." msgstr "" -":meth:`~datetime.datetime.utcfromtimestamp`:請改用 " -"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``。" +":meth:`~datetime.datetime.utcfromtimestamp`:請改用 ``datetime.datetime." +"fromtimestamp(timestamp, tz=datetime.UTC)``。" #: ../../deprecations/pending-removal-in-future.rst:62 msgid ":mod:`gettext`: Plural value must be an integer." @@ -3168,8 +3145,8 @@ msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." msgstr "" -":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改" -"用 :meth:`~logging.warning`。" +":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:" +"`~logging.warning`。" #: ../../deprecations/pending-removal-in-future.rst:77 msgid "" @@ -3226,11 +3203,11 @@ msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:100 msgid "" -":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` " -"and :meth:`!selected_npn_protocol` are deprecated: use ALPN instead." +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" +"`!selected_npn_protocol` are deprecated: use ALPN instead." msgstr "" -":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` " -"和 :meth:`!selected_npn_protocol` 已被棄用:請改用 ALPN。" +":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:" +"`!selected_npn_protocol` 已被棄用:請改用 ALPN。" #: ../../deprecations/pending-removal-in-future.rst:103 msgid "``ssl.OP_NO_SSL*`` options" @@ -3278,11 +3255,11 @@ msgstr ":mod:`threading` 方法:" #: ../../deprecations/pending-removal-in-future.rst:116 msgid "" -":meth:`!threading.Condition.notifyAll`: " -"use :meth:`~threading.Condition.notify_all`." +":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." +"notify_all`." msgstr "" -":meth:`!threading.Condition.notifyAll`:請" -"用 :meth:`~threading.Condition.notify_all`。" +":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." +"notify_all`。" #: ../../deprecations/pending-removal-in-future.rst:117 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." @@ -3290,19 +3267,19 @@ msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set` #: ../../deprecations/pending-removal-in-future.rst:118 msgid "" -":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: " -"use :attr:`threading.Thread.daemon` attribute." +":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" +"attr:`threading.Thread.daemon` attribute." msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" #: ../../deprecations/pending-removal-in-future.rst:120 msgid "" -":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: " -"use :attr:`threading.Thread.name` attribute." +":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" +"attr:`threading.Thread.name` attribute." msgstr "" -":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請" -"用 :attr:`threading.Thread.name` 屬性。" +":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" +"attr:`threading.Thread.name` 屬性。" #: ../../deprecations/pending-removal-in-future.rst:122 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." @@ -3395,22 +3372,22 @@ msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分 #: ../../deprecations/pending-removal-in-future.rst:152 msgid "" -":mod:`xml.etree.ElementTree`: Testing the truth value of " -"an :class:`~xml.etree.ElementTree.Element` is deprecated. In a future " -"release it will always return ``True``. Prefer explicit ``len(elem)`` or " -"``elem is not None`` tests instead." +":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." +"etree.ElementTree.Element` is deprecated. In a future release it will always " +"return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests " +"instead." msgstr "" -":mod:`xml.etree.ElementTree`:已棄用" -"對 :class:`~xml.etree.ElementTree.Element` 的真值測試。在未來版本中,它將始終" -"回傳 ``True``。請改用明確的 ``len(elem)`` 或 ``elem is not None`` 測試。" +":mod:`xml.etree.ElementTree`:已棄用對 :class:`~xml.etree.ElementTree." +"Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " +"``len(elem)`` 或 ``elem is not None`` 測試。" #: ../../deprecations/pending-removal-in-future.rst:157 msgid "" -":func:`sys._clear_type_cache` is deprecated: " -"use :func:`sys._clear_internal_caches` instead." +":func:`sys._clear_type_cache` is deprecated: use :func:`sys." +"_clear_internal_caches` instead." msgstr "" -":func:`sys._clear_type_cache` 已被棄用:請改" -"用 :func:`sys._clear_internal_caches`。" +":func:`sys._clear_type_cache` 已被棄用:請改用 :func:`sys." +"_clear_internal_caches`。" #: ../../whatsnew/3.12.rst:1357 ../../whatsnew/3.12.rst:2241 msgid "Removed" @@ -3451,16 +3428,16 @@ msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -":mod:`configparser` 不再具有 ``SafeConfigParser`` 類別。請改用較短" -"的 :class:`~configparser.ConfigParser` 名稱。" +":mod:`configparser` 不再具有 ``SafeConfigParser`` 類別。請改用較短的 :class:" +"`~configparser.ConfigParser` 名稱。" #: ../../whatsnew/3.12.rst:1378 msgid "" -":class:`configparser.ConfigParser` no longer has a ``readfp`` method. " -"Use :meth:`~configparser.ConfigParser.read_file` instead." +":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" +"meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -":class:`configparser.ConfigParser` 不再具有 ``readfp`` 方法。請改" -"用 :meth:`~configparser.ConfigParser.read_file`。" +":class:`configparser.ConfigParser` 不再具有 ``readfp`` 方法。請改用 :meth:" +"`~configparser.ConfigParser.read_file`。" #: ../../whatsnew/3.12.rst:1384 msgid "distutils" @@ -3540,8 +3517,8 @@ msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " "instead. In write mode, the ``filename`` attribute added ``'.gz'`` file " -"extension if it was not present. (Contributed by Victor Stinner " -"in :gh:`94196`.)" +"extension if it was not present. (Contributed by Victor Stinner in :gh:" +"`94196`.)" msgstr "" #: ../../whatsnew/3.12.rst:1437 @@ -3550,11 +3527,11 @@ msgstr "hashlib" #: ../../whatsnew/3.12.rst:1439 msgid "" -"Remove the pure Python implementation " -"of :mod:`hashlib`'s :func:`hashlib.pbkdf2_hmac`, deprecated in Python 3.10. " -"Python 3.10 and newer requires OpenSSL 1.1.1 (:pep:`644`): this OpenSSL " -"version provides a C implementation of :func:`~hashlib.pbkdf2_hmac` which is " -"faster. (Contributed by Victor Stinner in :gh:`94199`.)" +"Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." +"pbkdf2_hmac`, deprecated in Python 3.10. Python 3.10 and newer requires " +"OpenSSL 1.1.1 (:pep:`644`): this OpenSSL version provides a C implementation " +"of :func:`~hashlib.pbkdf2_hmac` which is faster. (Contributed by Victor " +"Stinner in :gh:`94199`.)" msgstr "" #: ../../whatsnew/3.12.rst:1446 ../../whatsnew/3.12.rst:1475 @@ -3581,9 +3558,9 @@ msgid "" "``importlib.util.module_for_loader`` have all been removed. (Contributed by " "Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -"``importlib.util.set_package``、``importlib.util.set_loader`` 和 " -"``importlib.util.module_for_loader`` 已全部刪除。(由 Brett Cannon 和 Nikita " -"Sobolev 在 :gh:`65961` 和 :gh:`97850` 貢獻。)" +"``importlib.util.set_package``、``importlib.util.set_loader`` 和 ``importlib." +"util.module_for_loader`` 已全部刪除。(由 Brett Cannon 和 Nikita Sobolev 在 :" +"gh:`65961` 和 :gh:`97850` 貢獻。)" #: ../../whatsnew/3.12.rst:1458 msgid "" @@ -3607,8 +3584,8 @@ msgstr "imp" #: ../../whatsnew/3.12.rst:1469 msgid "" -"The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw " -"in :gh:`98040`.)" +"The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" +"gh:`98040`.)" msgstr ":mod:`!imp` 模組已被移除。(由 Barry Warsaw 在 :gh:`98040` 中貢獻。)" #: ../../whatsnew/3.12.rst:1472 @@ -3653,11 +3630,11 @@ msgstr "``imp.get_suffixes()``" #: ../../whatsnew/3.12.rst:1481 msgid "" -":const:`importlib.machinery.SOURCE_SUFFIXES`, :const:`importlib.machinery.EXTENSION_SUFFIXES`, " -"and :const:`importlib.machinery.BYTECODE_SUFFIXES`" +":const:`importlib.machinery.SOURCE_SUFFIXES`, :const:`importlib.machinery." +"EXTENSION_SUFFIXES`, and :const:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -":const:`importlib.machinery.SOURCE_SUFFIXES`、:const:`importlib.machinery.EXTENSION_SUFFIXES` " -"和 :const:`importlib.machinery.BYTECODE_SUFFIXES`" +":const:`importlib.machinery.SOURCE_SUFFIXES`、:const:`importlib.machinery." +"EXTENSION_SUFFIXES` 和 :const:`importlib.machinery.BYTECODE_SUFFIXES`" #: ../../whatsnew/3.12.rst:1482 msgid "``imp.get_tag()``" @@ -3788,10 +3765,10 @@ msgstr "io" #: ../../whatsnew/3.12.rst:1523 msgid "" "Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " -"in Python 3.10: just use :func:`open` instead. The :func:`open` " -"(:func:`io.open`) function is a built-in function. Since Python " -"3.10, :func:`!_pyio.open` is also a static method. (Contributed by Victor " -"Stinner in :gh:`94169`.)" +"in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." +"open`) function is a built-in function. Since Python 3.10, :func:`!_pyio." +"open` is also a static method. (Contributed by Victor Stinner in :gh:" +"`94169`.)" msgstr "" #: ../../whatsnew/3.12.rst:1530 @@ -3811,10 +3788,10 @@ msgstr "smtpd" #: ../../whatsnew/3.12.rst:1539 msgid "" -"The ``smtpd`` module has been removed according to the schedule " -"in :pep:`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use " -"the :pypi:`aiosmtpd` PyPI module or any other :mod:`asyncio`-based server " -"instead. (Contributed by Oleg Iarygin in :gh:`93243`.)" +"The ``smtpd`` module has been removed according to the schedule in :pep:" +"`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use the :pypi:" +"`aiosmtpd` PyPI module or any other :mod:`asyncio`-based server instead. " +"(Contributed by Oleg Iarygin in :gh:`93243`.)" msgstr "" "根據 :pep:`594` 的時間表移除 ``smtpd`` 模組,它在 Python 3.4.7 和 3.5.4 中已" "被棄用。請改用 PyPI 上的 :pypi:`aiosmtpd` 模組或任何其他基於 :mod:`asyncio` " @@ -3844,9 +3821,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:1557 msgid "" -"The ``sqlite3.OptimizedUnicode`` text factory has been an alias " -"for :class:`str` since Python 3.3. Code that previously set the text factory " -"to ``OptimizedUnicode`` can either use ``str`` explicitly, or rely on the " +"The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" +"`str` since Python 3.3. Code that previously set the text factory to " +"``OptimizedUnicode`` can either use ``str`` explicitly, or rely on the " "default value which is also ``str``." msgstr "" @@ -3876,12 +3853,12 @@ msgstr "" #: ../../whatsnew/3.12.rst:1577 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " -"instead, create a :class:`ssl.SSLContext` object and call " -"its :class:`ssl.SSLContext.wrap_socket` method. Any package that still " -"uses :func:`!ssl.wrap_socket` is broken and insecure. The function neither " -"sends a SNI TLS extension nor validates the server hostname. Code is subject " -"to :cwe:`295` (Improper Certificate Validation). (Contributed by Victor " -"Stinner in :gh:`94199`.)" +"instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." +"SSLContext.wrap_socket` method. Any package that still uses :func:`!ssl." +"wrap_socket` is broken and insecure. The function neither sends a SNI TLS " +"extension nor validates the server hostname. Code is subject to :cwe:`295` " +"(Improper Certificate Validation). (Contributed by Victor Stinner in :gh:" +"`94199`.)" msgstr "" #: ../../whatsnew/3.12.rst:1588 @@ -4039,9 +4016,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:1620 msgid "" -"Undocumented :meth:`TestLoader.loadTestsFromModule " -"` parameter *use_load_tests* " -"(deprecated and ignored since Python 3.5)." +"Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " +"since Python 3.5)." msgstr "" #: ../../whatsnew/3.12.rst:1624 @@ -4087,9 +4064,8 @@ msgstr "zipimport" #: ../../whatsnew/3.12.rst:1648 msgid "" "Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, " -"deprecated in Python 3.10: use the ``find_spec()`` method instead. " -"See :pep:`451` for the rationale. (Contributed by Victor Stinner " -"in :gh:`94379`.)" +"deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" +"`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" #: ../../whatsnew/3.12.rst:1654 @@ -4098,20 +4074,20 @@ msgstr "其他" #: ../../whatsnew/3.12.rst:1656 msgid "" -"Remove the ``suspicious`` rule from the documentation :file:`Makefile` " -"and :file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `_. (Contributed by Julien Palard " -"in :gh:`98179`.)" +"Remove the ``suspicious`` rule from the documentation :file:`Makefile` and :" +"file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:" +"`98179`.)" msgstr "" #: ../../whatsnew/3.12.rst:1661 msgid "" -"Remove the *keyfile* and *certfile* parameters from " -"the :mod:`ftplib`, :mod:`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, " -"and the *key_file*, *cert_file* and *check_hostname* parameters from " -"the :mod:`http.client` module, all deprecated since Python 3.6. Use the " -"*context* parameter (*ssl_context* in :mod:`imaplib`) instead. (Contributed " -"by Victor Stinner in :gh:`94172`.)" +"Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" +"`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " +"*cert_file* and *check_hostname* parameters from the :mod:`http.client` " +"module, all deprecated since Python 3.6. Use the *context* parameter " +"(*ssl_context* in :mod:`imaplib`) instead. (Contributed by Victor Stinner " +"in :gh:`94172`.)" msgstr "" #: ../../whatsnew/3.12.rst:1669 @@ -4124,8 +4100,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:1672 msgid "" -"Remove ``_use_broken_old_ctypes_structure_semantics_`` flag " -"from :mod:`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" +"Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" +"`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" msgstr "" "移除 :mod:`ctypes` 模組中的 ``_use_broken_old_ctypes_structure_semantics_`` " "旗標。(由 Nikita Sobolev 於 :gh:`99285` 中貢獻。)" @@ -4161,8 +4137,8 @@ msgid "" "integer values such as ``randrange(10.5)`` or ``randrange('10')`` has been " "changed from :exc:`ValueError` to :exc:`TypeError`. This also prevents bugs " "where ``randrange(1e25)`` would silently select from a larger range than " -"``randrange(10**25)``. (Originally suggested by Serhiy " -"Storchaka :gh:`86388`.)" +"``randrange(10**25)``. (Originally suggested by Serhiy Storchaka :gh:" +"`86388`.)" msgstr "" #: ../../whatsnew/3.12.rst:1703 @@ -4178,8 +4154,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:1709 msgid "" "Remove the ``asyncore``-based ``smtpd`` module deprecated in Python 3.4.7 " -"and 3.5.4. A recommended replacement is the :mod:`asyncio`-" -"based :pypi:`aiosmtpd` PyPI module." +"and 3.5.4. A recommended replacement is the :mod:`asyncio`-based :pypi:" +"`aiosmtpd` PyPI module." msgstr "" #: ../../whatsnew/3.12.rst:1713 @@ -4191,10 +4167,10 @@ msgstr "" #: ../../whatsnew/3.12.rst:1718 msgid "" -"The :mod:`os` module no longer accepts bytes-like paths, " -"like :class:`bytearray` and :class:`memoryview` types: only the " -"exact :class:`bytes` type is accepted for bytes strings. (Contributed by " -"Victor Stinner in :gh:`98393`.)" +"The :mod:`os` module no longer accepts bytes-like paths, like :class:" +"`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " +"type is accepted for bytes strings. (Contributed by Victor Stinner in :gh:" +"`98393`.)" msgstr "" #: ../../whatsnew/3.12.rst:1723 @@ -4223,23 +4199,21 @@ msgstr "" #: ../../whatsnew/3.12.rst:1745 msgid "" -"When extracting tar files using :mod:`tarfile` " -"or :func:`shutil.unpack_archive`, pass the *filter* argument to limit " -"features that may be surprising or dangerous. See :ref:`tarfile-extraction-" -"filter` for details." +"When extracting tar files using :mod:`tarfile` or :func:`shutil." +"unpack_archive`, pass the *filter* argument to limit features that may be " +"surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" #: ../../whatsnew/3.12.rst:1750 msgid "" -"The output of the :func:`tokenize.tokenize` " -"and :func:`tokenize.generate_tokens` functions is now changed due to the " -"changes introduced in :pep:`701`. This means that ``STRING`` tokens are not " -"emitted any more for f-strings and the tokens described in :pep:`701` are " -"now produced instead: ``FSTRING_START``, ``FSTRING_MIDDLE`` and " -"``FSTRING_END`` are now emitted for f-string \"string\" parts in addition to " -"the appropriate tokens for the tokenization in the expression components. " -"For example for the f-string ``f\"start {1+1} end\"`` the old version of the " -"tokenizer emitted::" +"The output of the :func:`tokenize.tokenize` and :func:`tokenize." +"generate_tokens` functions is now changed due to the changes introduced in :" +"pep:`701`. This means that ``STRING`` tokens are not emitted any more for f-" +"strings and the tokens described in :pep:`701` are now produced instead: " +"``FSTRING_START``, ``FSTRING_MIDDLE`` and ``FSTRING_END`` are now emitted " +"for f-string \"string\" parts in addition to the appropriate tokens for the " +"tokenization in the expression components. For example for the f-string " +"``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" #: ../../whatsnew/3.12.rst:1759 @@ -4344,11 +4318,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:1815 msgid "" -"Add ``COMPILEALL_OPTS`` variable in :file:`Makefile` to " -"override :mod:`compileall` options (default: ``-j0``) in ``make install``. " -"Also merged the 3 ``compileall`` commands into a single command to " -"build .pyc files for all optimization levels (0, 1, 2) at once. (Contributed " -"by Victor Stinner in :gh:`99289`.)" +"Add ``COMPILEALL_OPTS`` variable in :file:`Makefile` to override :mod:" +"`compileall` options (default: ``-j0``) in ``make install``. Also merged the " +"3 ``compileall`` commands into a single command to build .pyc files for all " +"optimization levels (0, 1, 2) at once. (Contributed by Victor Stinner in :gh:" +"`99289`.)" msgstr "" #: ../../whatsnew/3.12.rst:1821 @@ -4377,9 +4351,8 @@ msgstr "``PYTHON_FOR_REGEN`` 現在需要 Python 3.10 或更新的版本。" #: ../../whatsnew/3.12.rst:1831 msgid "" -"Autoconf 2.71 and aclocal 1.16.4 is now required to " -"regenerate :file:`configure`. (Contributed by Christian Heimes " -"in :gh:`89886`.)" +"Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:" +"`configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" #: ../../whatsnew/3.12.rst:1835 @@ -4468,8 +4441,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:1875 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " -"to allow safely extending certain variable-sized types, " -"including :c:var:`PyType_Type`." +"to allow safely extending certain variable-sized types, including :c:var:" +"`PyType_Type`." msgstr "" #: ../../whatsnew/3.12.rst:1878 @@ -4484,10 +4457,10 @@ msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" #: ../../whatsnew/3.12.rst:1883 msgid "" -"Add the new :ref:`limited C API ` " -"function :c:func:`PyType_FromMetaclass`, which generalizes the " -"existing :c:func:`PyType_FromModuleAndSpec` using an additional metaclass " -"argument. (Contributed by Wenzel Jakob in :gh:`93012`.)" +"Add the new :ref:`limited C API ` function :c:func:" +"`PyType_FromMetaclass`, which generalizes the existing :c:func:" +"`PyType_FromModuleAndSpec` using an additional metaclass argument. " +"(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" #: ../../whatsnew/3.12.rst:1888 @@ -4519,16 +4492,16 @@ msgid "" "makes vectorcall safe to use with mutable types (i.e. heap types without the " "immutable flag, :c:macro:`Py_TPFLAGS_IMMUTABLETYPE`). Mutable types that do " "not override :c:member:`~PyTypeObject.tp_call` now inherit the " -"``Py_TPFLAGS_HAVE_VECTORCALL`` flag. (Contributed by Petr Viktorin " -"in :gh:`93274`.)" +"``Py_TPFLAGS_HAVE_VECTORCALL`` flag. (Contributed by Petr Viktorin in :gh:" +"`93274`.)" msgstr "" #: ../../whatsnew/3.12.rst:1905 msgid "" -"The :c:macro:`Py_TPFLAGS_MANAGED_DICT` " -"and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows " -"extensions classes to support object :attr:`~object.__dict__` and weakrefs " -"with less bookkeeping, using less memory and with faster access." +"The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" +"`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " +"classes to support object :attr:`~object.__dict__` and weakrefs with less " +"bookkeeping, using less memory and with faster access." msgstr "" #: ../../whatsnew/3.12.rst:1910 @@ -4558,9 +4531,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:1922 msgid "" -"Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` " -"and :c:func:`PyEval_SetTraceAllThreads`, that allow to set tracing and " -"profiling functions in all running threads in addition to the calling one. " +"Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" +"func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " +"functions in all running threads in addition to the calling one. " "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" @@ -4573,11 +4546,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:1932 msgid "" -"The C API now permits registering callbacks " -"via :c:func:`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to " -"be called whenever a dictionary is modified. This is intended for use by " -"optimizing interpreters, JIT compilers, or debuggers. (Contributed by Carl " -"Meyer in :gh:`91052`.)" +"The C API now permits registering callbacks via :c:func:" +"`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " +"whenever a dictionary is modified. This is intended for use by optimizing " +"interpreters, JIT compilers, or debuggers. (Contributed by Carl Meyer in :gh:" +"`91052`.)" msgstr "" #: ../../whatsnew/3.12.rst:1938 @@ -4597,18 +4570,18 @@ msgstr "" #: ../../whatsnew/3.12.rst:1947 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " -"get a frame variable by its name. (Contributed by Victor Stinner " -"in :gh:`91248`.)" +"get a frame variable by its name. (Contributed by Victor Stinner in :gh:" +"`91248`.)" msgstr "" #: ../../whatsnew/3.12.rst:1951 msgid "" -"Add :c:func:`PyErr_GetRaisedException` " -"and :c:func:`PyErr_SetRaisedException` for saving and restoring the current " -"exception. These functions return and accept a single exception object, " -"rather than the triple arguments of the now-deprecated :c:func:`PyErr_Fetch` " -"and :c:func:`PyErr_Restore`. This is less error prone and a bit more " -"efficient. (Contributed by Mark Shannon in :gh:`101578`.)" +"Add :c:func:`PyErr_GetRaisedException` and :c:func:" +"`PyErr_SetRaisedException` for saving and restoring the current exception. " +"These functions return and accept a single exception object, rather than the " +"triple arguments of the now-deprecated :c:func:`PyErr_Fetch` and :c:func:" +"`PyErr_Restore`. This is less error prone and a bit more efficient. " +"(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" #: ../../whatsnew/3.12.rst:1959 @@ -4621,9 +4594,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:1963 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " -"convenience functions for retrieving and modifying " -"the :attr:`~BaseException.args` passed to the exception's constructor. " -"(Contributed by Mark Shannon in :gh:`101578`.)" +"convenience functions for retrieving and modifying the :attr:`~BaseException." +"args` passed to the exception's constructor. (Contributed by Mark Shannon " +"in :gh:`101578`.)" msgstr "" #: ../../whatsnew/3.12.rst:1968 @@ -4692,22 +4665,21 @@ msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" #: ../../whatsnew/3.12.rst:1992 msgid "" -":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function " -"and :c:type:`PyInterpreterConfig`, which may be used to create sub-" -"interpreters with their own GILs. (See :ref:`whatsnew312-pep684` for more " -"info.) (Contributed by Eric Snow in :gh:`104110`.)" +":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" +"c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " +"with their own GILs. (See :ref:`whatsnew312-pep684` for more info.) " +"(Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -":pep:`684`:新增新的 :c:func:`Py_NewInterpreterFromConfig` 函式" -"和 :c:type:`PyInterpreterConfig`,它們可用於建立具有自己的 GIL 的子直譯器。" -"(有關更多資訊,請參閱 :ref:`whatsnew312-pep684`。)(由 Eric Snow " -"在 :gh:`104110` 中貢獻。)" +":pep:`684`:新增新的 :c:func:`Py_NewInterpreterFromConfig` 函式和 :c:type:" +"`PyInterpreterConfig`,它們可用於建立具有自己的 GIL 的子直譯器。(有關更多資" +"訊,請參閱 :ref:`whatsnew312-pep684`。)(由 Eric Snow 在 :gh:`104110` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1998 msgid "" -"In the limited C API version 3.12, :c:func:`Py_INCREF` " -"and :c:func:`Py_DECREF` functions are now implemented as opaque function " -"calls to hide implementation details. (Contributed by Victor Stinner " -"in :gh:`105387`.)" +"In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" +"`Py_DECREF` functions are now implemented as opaque function calls to hide " +"implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" #: ../../whatsnew/3.12.rst:2006 @@ -4742,9 +4714,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:2025 msgid "" -"To get a list of subclasses, call the Python " -"method :py:meth:`~type.__subclasses__` (using :c:func:`PyObject_CallMethod`, " -"for example)." +"To get a list of subclasses, call the Python method :py:meth:`~type." +"__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" #: ../../whatsnew/3.12.rst:2029 @@ -4752,38 +4723,37 @@ msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " "strings, variable width and precision) in :c:func:`PyUnicode_FromFormat` " -"and :c:func:`PyUnicode_FromFormatV`. (Contributed by Serhiy Storchaka " -"in :gh:`98836`.)" +"and :c:func:`PyUnicode_FromFormatV`. (Contributed by Serhiy Storchaka in :gh:" +"`98836`.)" msgstr "" #: ../../whatsnew/3.12.rst:2035 msgid "" -"An unrecognized format character in :c:func:`PyUnicode_FromFormat` " -"and :c:func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In " -"previous versions it caused all the rest of the format string to be copied " -"as-is to the result string, and any extra arguments discarded. (Contributed " -"by Serhiy Storchaka in :gh:`95781`.)" +"An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" +"func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " +"versions it caused all the rest of the format string to be copied as-is to " +"the result string, and any extra arguments discarded. (Contributed by Serhiy " +"Storchaka in :gh:`95781`.)" msgstr "" #: ../../whatsnew/3.12.rst:2041 msgid "" -"Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` " -"and :c:func:`PyUnicode_FromFormatV`. (Contributed by Philip Georgi " -"in :gh:`95504`.)" +"Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" +"`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" #: ../../whatsnew/3.12.rst:2045 msgid "" "Extension classes wanting to add a :attr:`~object.__dict__` or weak " -"reference slot should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` " -"and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead of ``tp_dictoffset`` and " +"reference slot should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" +"`Py_TPFLAGS_MANAGED_WEAKREF` instead of ``tp_dictoffset`` and " "``tp_weaklistoffset``, respectively. The use of ``tp_dictoffset`` and " "``tp_weaklistoffset`` is still supported, but does not fully support " "multiple inheritance (:gh:`95589`), and performance may be worse. Classes " "declaring :c:macro:`Py_TPFLAGS_MANAGED_DICT` must call :c:func:`!" "_PyObject_VisitManagedDict` and :c:func:`!_PyObject_ClearManagedDict` to " -"traverse and clear their instance's dictionaries. To clear weakrefs, " -"call :c:func:`PyObject_ClearWeakRefs`, as before." +"traverse and clear their instance's dictionaries. To clear weakrefs, call :c:" +"func:`PyObject_ClearWeakRefs`, as before." msgstr "" #: ../../whatsnew/3.12.rst:2057 @@ -4804,10 +4774,10 @@ msgstr "" #: ../../whatsnew/3.12.rst:2067 msgid "" -"The interpreter's error indicator is now always normalized. This means " -"that :c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other " -"functions that set the error indicator now normalize the exception before " -"storing it. (Contributed by Mark Shannon in :gh:`101578`.)" +"The interpreter's error indicator is now always normalized. This means that :" +"c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " +"that set the error indicator now normalize the exception before storing it. " +"(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" #: ../../whatsnew/3.12.rst:2072 @@ -4847,8 +4817,8 @@ msgstr "" #: ../../whatsnew/3.12.rst:2089 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " -"disallows creating classes whose metaclass overrides ``tp_new`` " -"(:meth:`~object.__new__` in Python)." +"disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" +"`~object.__new__` in Python)." msgstr "" #: ../../whatsnew/3.12.rst:2093 @@ -4866,16 +4836,16 @@ msgstr "" #: ../../whatsnew/3.12.rst:2102 msgid "" -"If initialization can be skipped, it can be done " -"in :c:member:`~PyTypeObject.tp_init` instead." +"If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." +"tp_init` instead." msgstr "" #: ../../whatsnew/3.12.rst:2104 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " -"``tp_new`` to ``NULL`` using " -"the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag. This makes it " -"acceptable for ``PyType_From*`` functions." +"``tp_new`` to ``NULL`` using the :c:macro:" +"`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag. This makes it acceptable for " +"``PyType_From*`` functions." msgstr "" #: ../../whatsnew/3.12.rst:2109 @@ -4911,10 +4881,10 @@ msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " "they are used by some extension modules. The internal fields should no " -"longer be accessed directly, instead the API functions beginning " -"``PyLong_...`` should be used instead. Two new *unstable* API functions are " -"provided for efficient access to the value of :c:struct:`PyLongObject`\\s " -"which fit into a single machine word:" +"longer be accessed directly, instead the API functions beginning ``PyLong_..." +"`` should be used instead. Two new *unstable* API functions are provided for " +"efficient access to the value of :c:struct:`PyLongObject`\\s which fit into " +"a single machine word:" msgstr "" #: ../../whatsnew/3.12.rst:2133 @@ -4936,11 +4906,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:2146 msgid "" -"In accordance with :pep:`699`, the ``ma_version_tag`` field " -"in :c:type:`PyDictObject` is deprecated for extension modules. Accessing " -"this field will generate a compiler warning at compile time. This field will " -"be removed in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya " -"in :gh:`101193`. PEP by Ken Jin.)" +"In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" +"`PyDictObject` is deprecated for extension modules. Accessing this field " +"will generate a compiler warning at compile time. This field will be removed " +"in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya in :gh:`101193`. " +"PEP by Ken Jin.)" msgstr "" #: ../../whatsnew/3.12.rst:2151 @@ -4990,8 +4960,8 @@ msgstr "" msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -":c:var:`Py_IgnoreEnvironmentFlag`:請改" -"用 :c:member:`PyConfig.use_environment`" +":c:var:`Py_IgnoreEnvironmentFlag`:請改用 :c:member:`PyConfig." +"use_environment`" #: ../../whatsnew/3.12.rst:2163 msgid "" @@ -5003,8 +4973,8 @@ msgstr "" msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -":c:var:`Py_NoUserSiteDirectory`:請改" -"用 :c:member:`PyConfig.user_site_directory`" +":c:var:`Py_NoUserSiteDirectory`:請改用 :c:member:`PyConfig." +"user_site_directory`" #: ../../whatsnew/3.12.rst:2165 msgid "" @@ -5026,57 +4996,56 @@ msgstr ":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated`" #: ../../whatsnew/3.12.rst:2169 msgid "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: " -"use :c:member:`PyPreConfig.legacy_windows_fs_encoding`" +":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." +"legacy_windows_fs_encoding`" msgstr "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改" -"用 :c:member:`PyPreConfig.legacy_windows_fs_encoding`" +":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改用 :c:member:`PyPreConfig." +"legacy_windows_fs_encoding`" #: ../../whatsnew/3.12.rst:2170 msgid "" -":c:var:`Py_LegacyWindowsStdioFlag`: " -"use :c:member:`PyConfig.legacy_windows_stdio`" +":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." +"legacy_windows_stdio`" msgstr "" -":c:var:`Py_LegacyWindowsStdioFlag`:請改" -"用 :c:member:`PyConfig.legacy_windows_stdio`" +":c:var:`Py_LegacyWindowsStdioFlag`:請改用 :c:member:`PyConfig." +"legacy_windows_stdio`" #: ../../whatsnew/3.12.rst:2171 msgid "" -":c:var:`!Py_FileSystemDefaultEncoding`: " -"use :c:member:`PyConfig.filesystem_encoding`" +":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." +"filesystem_encoding`" msgstr "" -":c:var:`!Py_FileSystemDefaultEncoding`:請改" -"用 :c:member:`PyConfig.filesystem_encoding`" +":c:var:`!Py_FileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." +"filesystem_encoding`" #: ../../whatsnew/3.12.rst:2172 msgid "" -":c:var:`!Py_HasFileSystemDefaultEncoding`: " -"use :c:member:`PyConfig.filesystem_encoding`" +":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." +"filesystem_encoding`" msgstr "" -":c:var:`!Py_HasFileSystemDefaultEncoding`:請改" -"用 :c:member:`PyConfig.filesystem_encoding`" +":c:var:`!Py_HasFileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." +"filesystem_encoding`" #: ../../whatsnew/3.12.rst:2173 msgid "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: " -"use :c:member:`PyConfig.filesystem_errors`" +":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." +"filesystem_errors`" msgstr "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改" -"用 :c:member:`PyConfig.filesystem_errors`" +":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改用 :c:member:`PyConfig." +"filesystem_errors`" #: ../../whatsnew/3.12.rst:2174 msgid "" -":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` " -"(see :c:func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" +"`Py_PreInitialize`)" msgstr "" -":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參" -"見 :c:func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參見 :c:" +"func:`Py_PreInitialize`)" #: ../../whatsnew/3.12.rst:2176 msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used " -"with :c:type:`PyConfig` instead. (Contributed by Victor Stinner " -"in :gh:`77782`.)" +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" ":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" "(由 Victor Stinner 於 :gh:`77782` 中貢獻。)" @@ -5102,11 +5071,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:2189 msgid "" -":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` " -"and :c:func:`PyMember_SetOne`" +":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" +"`PyMember_SetOne`" msgstr "" -":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` " -"和 :c:func:`PyMember_SetOne`" +":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" +"`PyMember_SetOne`" #: ../../whatsnew/3.12.rst:2191 msgid "" @@ -5118,11 +5087,11 @@ msgstr "" #: ../../whatsnew/3.12.rst:2193 msgid "" -"The flags :c:macro:`Py_READONLY` (previously ``READONLY``) " -"and :c:macro:`Py_AUDIT_READ` (previously all uppercase)" +"The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" +"`Py_AUDIT_READ` (previously all uppercase)" msgstr "" -":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)" -"和 :c:macro:`Py_AUDIT_READ`\\ (先前全大寫)旗標" +":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)和 :c:macro:" +"`Py_AUDIT_READ`\\ (先前全大寫)旗標" #: ../../whatsnew/3.12.rst:2196 msgid "Several items are not exposed from :file:`Python.h`:" @@ -5142,17 +5111,16 @@ msgstr "不做任何事的巨集 ``WRITE_RESTRICTED``。" #: ../../whatsnew/3.12.rst:2201 msgid "" -"The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents " -"of :c:macro:`Py_AUDIT_READ`." +"The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" +"`Py_AUDIT_READ`." msgstr "" -"``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當" -"於 :c:macro:`Py_AUDIT_READ`。" +"``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當於 :c:macro:" +"`Py_AUDIT_READ`。" #: ../../whatsnew/3.12.rst:2203 msgid "" -"In some configurations, ```` is not included " -"from :file:`Python.h`. It should be included manually when using " -"``offsetof()``." +"In some configurations, ```` is not included from :file:`Python." +"h`. It should be included manually when using ``offsetof()``." msgstr "" #: ../../whatsnew/3.12.rst:2206 @@ -5172,10 +5140,9 @@ msgstr "" #: ../../whatsnew/3.12.rst:2214 msgid "" -":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. " -"Use :c:func:`PyErr_GetRaisedException` " -"and :c:func:`PyErr_SetRaisedException` instead. (Contributed by Mark Shannon " -"in :gh:`101578`.)" +":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" +"func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " +"instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" #: ../../whatsnew/3.12.rst:2219 @@ -5196,58 +5163,57 @@ msgstr "" #: ../../whatsnew/3.12.rst:2225 msgid "" -"Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` " -"or :c:func:`PyType_FromModuleAndSpec` to create a class whose metaclass " -"overrides :c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass " -"instead." +"Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" +"func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" +"c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -"使用 :c:func:`PyType_FromSpec`、:c:func:`PyType_FromSpecWithBases` " -"或 :c:func:`PyType_FromModuleAndSpec` 建立一個其元類別覆" -"寫 :c:member:`~PyTypeObject.tp_new` 的類別已被棄用。請改為呼叫元類別。" +"使用 :c:func:`PyType_FromSpec`、:c:func:`PyType_FromSpecWithBases` 或 :c:" +"func:`PyType_FromModuleAndSpec` 建立一個其元類別覆寫 :c:member:" +"`~PyTypeObject.tp_new` 的類別已被棄用。請改為呼叫元類別。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:4 msgid "" "The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " "(:pep:`699`; :gh:`101193`)." msgstr "" -":c:type:`PyDictObject` 中的 ``ma_version_tag`` 欄位,用於擴充模組 " -"(:pep:`699`;:gh:`101193`)。" +":c:type:`PyDictObject` 中的 ``ma_version_tag`` 欄位,用於擴充模組 (:pep:" +"`699`;:gh:`101193`)。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:7 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases (:gh:`95388`)." msgstr "" -"使用可變基底建立\\ :c:data:`不可變型別 ` " -"(:gh:`95388`)。" +"使用可變基底建立\\ :c:data:`不可變型別 ` (:gh:" +"`95388`)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:4 msgid "" -"The :c:func:`PyImport_ImportModuleNoBlock`: " -"Use :c:func:`PyImport_ImportModule` instead." +"The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:" +"`PyImport_ImportModule` instead." msgstr "" -":c:func:`PyImport_ImportModuleNoBlock`:請改" -"用 :c:func:`PyImport_ImportModule`。" +":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:" +"`PyImport_ImportModule`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:6 msgid "" -":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: " -"Use :c:func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project " -"`__ can be used to " -"get :c:func:`PyWeakref_GetRef` on Python 3.12 and older." +":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" +"func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project `__ can be used to get :c:func:" +"`PyWeakref_GetRef` on Python 3.12 and older." msgstr "" -":c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT`:請改" -"用 :c:func:`PyWeakref_GetRef`。可以使用 `pythoncapi-compat 專案 `__\\ 來為 Python 3.12 和更早版本取" -"得 :c:func:`PyWeakref_GetRef`。" +":c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT`:請改用 :c:" +"func:`PyWeakref_GetRef`。可以使用 `pythoncapi-compat 專案 `__\\ 來為 Python 3.12 和更早版本取得 :c:func:" +"`PyWeakref_GetRef`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:10 msgid "" -":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: " -"Use :c:type:`wchar_t` instead." +":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:" +"type:`wchar_t` instead." msgstr "" -":c:type:`Py_UNICODE` 型別與 :c:macro:`!Py_UNICODE_WIDE` 巨集:請改" -"用 :c:type:`wchar_t`。" +":c:type:`Py_UNICODE` 型別與 :c:macro:`!Py_UNICODE_WIDE` 巨集:請改用 :c:type:" +"`wchar_t`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:12 msgid "" @@ -5262,8 +5228,8 @@ msgid "" "than :class:`str`, such as :class:`bytes`." msgstr "" ":c:func:`!PyUnicode_AsDecodedUnicode`:請改用 :c:func:`PyCodec_Decode`;請注" -"意某些編解碼器(例如 \"base64\")可能會回傳非 :class:`str` 的型別,例" -"如 :class:`bytes`。" +"意某些編解碼器(例如 \"base64\")可能會回傳非 :class:`str` 的型別,例如 :" +"class:`bytes`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 msgid "" @@ -5278,8 +5244,8 @@ msgid "" "than :class:`bytes`, such as :class:`str`." msgstr "" ":c:func:`!PyUnicode_AsEncodedUnicode`:請改用 :c:func:`PyCodec_Encode`;請注" -"意某些編解碼器(例如 \"base64\")可能會回傳非 :class:`bytes` 的型別,例" -"如 :class:`str`。" +"意某些編解碼器(例如 \"base64\")可能會回傳非 :class:`bytes` 的型別,例如 :" +"class:`str`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:22 msgid "Python initialization functions, deprecated in Python 3.13:" @@ -5296,37 +5262,35 @@ msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:27 msgid "" ":c:func:`Py_GetPrefix`: Use :c:func:`PyConfig_Get(\"base_prefix\") " -"` (:data:`sys.base_prefix`) instead. " -"Use :c:func:`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) " -"if :ref:`virtual environments ` need to be handled." +"` (:data:`sys.base_prefix`) instead. Use :c:func:" +"`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) if :ref:" +"`virtual environments ` need to be handled." msgstr "" ":c:func:`Py_GetPrefix`:請改用 :c:func:`PyConfig_Get(\"base_prefix\") " "` (:data:`sys.base_prefix`)。如果需要處理\\ :ref:`虛擬環境 " -"`,請改用 :c:func:`PyConfig_Get(\"prefix\") ` " -"(:data:`sys.prefix`)。" +"`,請改用 :c:func:`PyConfig_Get(\"prefix\") ` (:data:" +"`sys.prefix`)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:32 msgid "" ":c:func:`Py_GetExecPrefix`: Use :c:func:`PyConfig_Get(\"base_exec_prefix\") " -"` (:data:`sys.base_exec_prefix`) instead. " -"Use :c:func:`PyConfig_Get(\"exec_prefix\") ` " -"(:data:`sys.exec_prefix`) if :ref:`virtual environments ` need to " -"be handled." +"` (:data:`sys.base_exec_prefix`) instead. Use :c:func:" +"`PyConfig_Get(\"exec_prefix\") ` (:data:`sys.exec_prefix`) if :" +"ref:`virtual environments ` need to be handled." msgstr "" -":c:func:`Py_GetExecPrefix`:請改" -"用 :c:func:`PyConfig_Get(\"base_exec_prefix\") ` " -"(:data:`sys.base_exec_prefix`)。如果需要處理\\ :ref:`虛擬環境 `,請" -"改用 :c:func:`PyConfig_Get(\"exec_prefix\") ` " -"(:data:`sys.exec_prefix`)。" +":c:func:`Py_GetExecPrefix`:請改用 :c:func:" +"`PyConfig_Get(\"base_exec_prefix\") ` (:data:`sys." +"base_exec_prefix`)。如果需要處理\\ :ref:`虛擬環境 `,請改用 :c:" +"func:`PyConfig_Get(\"exec_prefix\") ` (:data:`sys." +"exec_prefix`)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:38 msgid "" ":c:func:`Py_GetProgramFullPath`: Use :c:func:`PyConfig_Get(\"executable\") " "` (:data:`sys.executable`) instead." msgstr "" -":c:func:`Py_GetProgramFullPath`:請改" -"用 :c:func:`PyConfig_Get(\"executable\") ` " -"(:data:`sys.executable`)。" +":c:func:`Py_GetProgramFullPath`:請改用 :c:func:" +"`PyConfig_Get(\"executable\") ` (:data:`sys.executable`)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:41 msgid "" @@ -5381,13 +5345,13 @@ msgid "" ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" "warnings.filters` instead." msgstr "" -":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` " -"和 :data:`!warnings.filters`。" +":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` 和 :" +"data:`!warnings.filters`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:65 msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used " -"with :c:type:`PyConfig` instead." +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` instead." msgstr "" "應改用帶有 :c:type:`PyConfig` 的 :c:func:`Py_InitializeFromConfig` API。" @@ -5397,108 +5361,108 @@ msgstr "全域配置變數:" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:70 msgid "" -":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` " -"or :c:func:`PyConfig_Get(\"parser_debug\") ` instead." +":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` or :c:func:" +"`PyConfig_Get(\"parser_debug\") ` instead." msgstr "" -":c:var:`Py_DebugFlag`:請改用 :c:member:`PyConfig.parser_debug` " -"或 :c:func:`PyConfig_Get(\"parser_debug\") `。" +":c:var:`Py_DebugFlag`:請改用 :c:member:`PyConfig.parser_debug` 或 :c:func:" +"`PyConfig_Get(\"parser_debug\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:73 msgid "" -":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` " -"or :c:func:`PyConfig_Get(\"verbose\") ` instead." +":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` or :c:func:" +"`PyConfig_Get(\"verbose\") ` instead." msgstr "" -":c:var:`Py_VerboseFlag`:請改用 :c:member:`PyConfig.verbose` " -"或 :c:func:`PyConfig_Get(\"verbose\") `。" +":c:var:`Py_VerboseFlag`:請改用 :c:member:`PyConfig.verbose` 或 :c:func:" +"`PyConfig_Get(\"verbose\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:76 msgid "" -":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` " -"or :c:func:`PyConfig_Get(\"quiet\") ` instead." +":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` or :c:func:" +"`PyConfig_Get(\"quiet\") ` instead." msgstr "" -":c:var:`Py_QuietFlag`:請改用 :c:member:`PyConfig.quiet` " -"或 :c:func:`PyConfig_Get(\"quiet\") `。" +":c:var:`Py_QuietFlag`:請改用 :c:member:`PyConfig.quiet` 或 :c:func:" +"`PyConfig_Get(\"quiet\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:79 msgid "" -":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` " -"or :c:func:`PyConfig_Get(\"interactive\") ` instead." +":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` or :c:func:" +"`PyConfig_Get(\"interactive\") ` instead." msgstr "" -":c:var:`Py_InteractiveFlag`:請改用 :c:member:`PyConfig.interactive` " -"或 :c:func:`PyConfig_Get(\"interactive\") `。" +":c:var:`Py_InteractiveFlag`:請改用 :c:member:`PyConfig.interactive` 或 :c:" +"func:`PyConfig_Get(\"interactive\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:82 msgid "" -":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` " -"or :c:func:`PyConfig_Get(\"inspect\") ` instead." +":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` or :c:func:" +"`PyConfig_Get(\"inspect\") ` instead." msgstr "" -":c:var:`Py_InspectFlag`:請改用 :c:member:`PyConfig.inspect` " -"或 :c:func:`PyConfig_Get(\"inspect\") `。" +":c:var:`Py_InspectFlag`:請改用 :c:member:`PyConfig.inspect` 或 :c:func:" +"`PyConfig_Get(\"inspect\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:85 msgid "" -":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` " -"or :c:func:`PyConfig_Get(\"optimization_level\") ` instead." +":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` or :c:" +"func:`PyConfig_Get(\"optimization_level\") ` instead." msgstr "" -":c:var:`Py_OptimizeFlag`:請改用 :c:member:`PyConfig.optimization_level` " -"或 :c:func:`PyConfig_Get(\"optimization_level\") `。" +":c:var:`Py_OptimizeFlag`:請改用 :c:member:`PyConfig.optimization_level` 或 :" +"c:func:`PyConfig_Get(\"optimization_level\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:88 msgid "" -":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` " -"or :c:func:`PyConfig_Get(\"site_import\") ` instead." +":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` or :c:func:" +"`PyConfig_Get(\"site_import\") ` instead." msgstr "" -":c:var:`Py_NoSiteFlag`:請改用 :c:member:`PyConfig.site_import` " -"或 :c:func:`PyConfig_Get(\"site_import\") `。" +":c:var:`Py_NoSiteFlag`:請改用 :c:member:`PyConfig.site_import` 或 :c:func:" +"`PyConfig_Get(\"site_import\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:91 msgid "" -":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` " -"or :c:func:`PyConfig_Get(\"bytes_warning\") ` instead." +":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` or :c:" +"func:`PyConfig_Get(\"bytes_warning\") ` instead." msgstr "" -":c:var:`Py_BytesWarningFlag`:請改用 :c:member:`PyConfig.bytes_warning` " -"或 :c:func:`PyConfig_Get(\"bytes_warning\") `。" +":c:var:`Py_BytesWarningFlag`:請改用 :c:member:`PyConfig.bytes_warning` 或 :" +"c:func:`PyConfig_Get(\"bytes_warning\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:94 msgid "" -":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` " -"or :c:func:`PyConfig_Get(\"pathconfig_warnings\") ` instead." +":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` or :c:" +"func:`PyConfig_Get(\"pathconfig_warnings\") ` instead." msgstr "" -":c:var:`Py_FrozenFlag`:請改用 :c:member:`PyConfig.pathconfig_warnings` " -"或 :c:func:`PyConfig_Get(\"pathconfig_warnings\") `。" +":c:var:`Py_FrozenFlag`:請改用 :c:member:`PyConfig.pathconfig_warnings` 或 :" +"c:func:`PyConfig_Get(\"pathconfig_warnings\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:97 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " "or :c:func:`PyConfig_Get(\"use_environment\") ` instead." msgstr "" -":c:var:`Py_IgnoreEnvironmentFlag`:請改" -"用 :c:member:`PyConfig.use_environment` " -"或 :c:func:`PyConfig_Get(\"use_environment\") `。" +":c:var:`Py_IgnoreEnvironmentFlag`:請改用 :c:member:`PyConfig." +"use_environment` 或 :c:func:`PyConfig_Get(\"use_environment\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:100 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " "or :c:func:`PyConfig_Get(\"write_bytecode\") ` instead." msgstr "" -":c:var:`Py_DontWriteBytecodeFlag`:請改" -"用 :c:member:`PyConfig.write_bytecode` " -"或 :c:func:`PyConfig_Get(\"write_bytecode\") `。" +":c:var:`Py_DontWriteBytecodeFlag`:請改用 :c:member:`PyConfig." +"write_bytecode` 或 :c:func:`PyConfig_Get(\"write_bytecode\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:103 msgid "" -":c:var:`Py_NoUserSiteDirectory`: " -"Use :c:member:`PyConfig.user_site_directory` " -"or :c:func:`PyConfig_Get(\"user_site_directory\") ` instead." +":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig." +"user_site_directory` or :c:func:`PyConfig_Get(\"user_site_directory\") " +"` instead." msgstr "" -":c:var:`Py_NoUserSiteDirectory`:請改" -"用 :c:member:`PyConfig.user_site_directory` " -"或 :c:func:`PyConfig_Get(\"user_site_directory\") `。" +":c:var:`Py_NoUserSiteDirectory`:請改用 :c:member:`PyConfig." +"user_site_directory` 或 :c:func:`PyConfig_Get(\"user_site_directory\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:106 msgid "" -":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` " -"or :c:func:`PyConfig_Get(\"buffered_stdio\") ` instead." +":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` or :" +"c:func:`PyConfig_Get(\"buffered_stdio\") ` instead." msgstr "" ":c:var:`Py_UnbufferedStdioFlag`:請改用 :c:member:`PyConfig.buffered_stdio` " "或 :c:func:`PyConfig_Get(\"buffered_stdio\") `。" @@ -5515,70 +5479,69 @@ msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:113 msgid "" -":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` " -"or :c:func:`PyConfig_Get(\"isolated\") ` instead." +":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` or :c:func:" +"`PyConfig_Get(\"isolated\") ` instead." msgstr "" -":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated` " -"或 :c:func:`PyConfig_Get(\"isolated\") `。" +":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated` 或 :c:func:" +"`PyConfig_Get(\"isolated\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:116 msgid "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: " -"Use :c:member:`PyPreConfig.legacy_windows_fs_encoding` " -"or :c:func:`PyConfig_Get(\"legacy_windows_fs_encoding\") ` " -"instead." +":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig." +"legacy_windows_fs_encoding` or :c:func:" +"`PyConfig_Get(\"legacy_windows_fs_encoding\") ` instead." msgstr "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改" -"用 :c:member:`PyPreConfig.legacy_windows_fs_encoding` " -"或 :c:func:`PyConfig_Get(\"legacy_windows_fs_encoding\") `。" +":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改用 :c:member:`PyPreConfig." +"legacy_windows_fs_encoding` 或 :c:func:" +"`PyConfig_Get(\"legacy_windows_fs_encoding\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:119 msgid "" -":c:var:`Py_LegacyWindowsStdioFlag`: " -"Use :c:member:`PyConfig.legacy_windows_stdio` " -"or :c:func:`PyConfig_Get(\"legacy_windows_stdio\") ` instead." +":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig." +"legacy_windows_stdio` or :c:func:`PyConfig_Get(\"legacy_windows_stdio\") " +"` instead." msgstr "" -":c:var:`Py_LegacyWindowsStdioFlag`:請改" -"用 :c:member:`PyConfig.legacy_windows_stdio` " -"或 :c:func:`PyConfig_Get(\"legacy_windows_stdio\") `。" +":c:var:`Py_LegacyWindowsStdioFlag`:請改用 :c:member:`PyConfig." +"legacy_windows_stdio` 或 :c:func:`PyConfig_Get(\"legacy_windows_stdio\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:122 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`, :c:var:`!" -"Py_HasFileSystemDefaultEncoding`: " -"Use :c:member:`PyConfig.filesystem_encoding` " -"or :c:func:`PyConfig_Get(\"filesystem_encoding\") ` instead." +"Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig." +"filesystem_encoding` or :c:func:`PyConfig_Get(\"filesystem_encoding\") " +"` instead." msgstr "" ":c:var:`!Py_FileSystemDefaultEncoding`、:c:var:`!" -"Py_HasFileSystemDefaultEncoding`:請改" -"用 :c:member:`PyConfig.filesystem_encoding` " -"或 :c:func:`PyConfig_Get(\"filesystem_encoding\") `。" +"Py_HasFileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." +"filesystem_encoding` 或 :c:func:`PyConfig_Get(\"filesystem_encoding\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:125 msgid "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: " -"Use :c:member:`PyConfig.filesystem_errors` " -"or :c:func:`PyConfig_Get(\"filesystem_errors\") ` instead." +":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig." +"filesystem_errors` or :c:func:`PyConfig_Get(\"filesystem_errors\") " +"` instead." msgstr "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改" -"用 :c:member:`PyConfig.filesystem_errors` " -"或 :c:func:`PyConfig_Get(\"filesystem_errors\") `。" +":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改用 :c:member:`PyConfig." +"filesystem_errors` 或 :c:func:`PyConfig_Get(\"filesystem_errors\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:128 msgid "" -":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` " -"or :c:func:`PyConfig_Get(\"utf8_mode\") ` instead. " -"(see :c:func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` or :c:func:" +"`PyConfig_Get(\"utf8_mode\") ` instead. (see :c:func:" +"`Py_PreInitialize`)" msgstr "" -":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode` " -"或 :c:func:`PyConfig_Get(\"utf8_mode\") `。(請參" -"閱 :c:func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode` 或 :c:func:" +"`PyConfig_Get(\"utf8_mode\") `。(請參閱 :c:func:" +"`Py_PreInitialize`)" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:133 msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used " -"with :c:type:`PyConfig` to set these options. Or :c:func:`PyConfig_Get` can " -"be used to get these options at runtime." +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` to set these options. Or :c:func:`PyConfig_Get` can be used to " +"get these options at runtime." msgstr "" "應改用帶有 :c:type:`PyConfig` 的 :c:func:`Py_InitializeFromConfig` API 來設定" "這些選項。或者也可以使用 :c:func:`PyConfig_Get` 在執行時取得這些選項。" @@ -5606,8 +5569,8 @@ msgid "" ":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " "instead." msgstr "" -":c:func:`PyErr_NormalizeException`:請改" -"用 :c:func:`PyErr_GetRaisedException`。" +":c:func:`PyErr_NormalizeException`:請改用 :c:func:" +"`PyErr_GetRaisedException`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:13 msgid "" @@ -5627,11 +5590,11 @@ msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:19 msgid "" -":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` " -"and :c:func:`PySlice_AdjustIndices` instead." +":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:" +"`PySlice_AdjustIndices` instead." msgstr "" -":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` " -"和 :c:func:`PySlice_AdjustIndices`。" +":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:" +"`PySlice_AdjustIndices`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:21 msgid ":c:func:`PyUnicode_READY`: Unneeded since Python 3.12" @@ -5653,8 +5616,8 @@ msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead." msgstr "" -":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼" -"叫 :c:func:`PyObject_Hash`。" +":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼叫 :c:func:" +"`PyObject_Hash`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:29 msgid "Thread Local Storage (TLS) API:" @@ -5696,9 +5659,9 @@ msgid "" "C API. The :file:`token.h` header file was only designed to be used by " "Python internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -"移除 :file:`token.h` 標頭檔案。從未有任何公開的 tokenizer C " -"API。:file:`token.h` 標頭檔案的設計是僅限用於 Python 內部。(由 Victor " -"Stinner 於 :gh:`92651` 中貢獻。)" +"移除 :file:`token.h` 標頭檔案。從未有任何公開的 tokenizer C API。:file:" +"`token.h` 標頭檔案的設計是僅限用於 Python 內部。(由 Victor Stinner 於 :gh:" +"`92651` 中貢獻。)" #: ../../whatsnew/3.12.rst:2248 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." @@ -5745,5 +5708,12 @@ msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" -"移除 ``PyUnicode_InternImmortal()`` 函式巨集。(由 Victor Stinner " -"於 :gh:`85858` 中貢獻。)" +"移除 ``PyUnicode_InternImmortal()`` 函式巨集。(由 Victor Stinner 於 :gh:" +"`85858` 中貢獻。)" + +#~ msgid "" +#~ ":mod:`typing`: :class:`!typing.ByteString`, deprecated since Python 3.9, " +#~ "now causes a :exc:`DeprecationWarning` to be emitted when it is used." +#~ msgstr "" +#~ ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`!typing.ByteString` 現在" +#~ "在使用時會發出 :exc:`DeprecationWarning`。" diff --git a/whatsnew/3.13.po b/whatsnew/3.13.po index a48e3cc151..82dd87b198 100644 --- a/whatsnew/3.13.po +++ b/whatsnew/3.13.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-18 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,8 +31,8 @@ msgstr "Adam Turner 和 Thomas Wouters" #: ../../whatsnew/3.13.rst:48 msgid "" "This article explains the new features in Python 3.13, compared to 3.12. " -"Python 3.13 was released on October 7, 2024. For full details, see " -"the :ref:`changelog `." +"Python 3.13 was released on October 7, 2024. For full details, see the :ref:" +"`changelog `." msgstr "" "本文介紹了 Python 3.13 與 3.12 相比多了哪些新功能。Python 3.13 已於 2024 年 " "10 月 7 日發布。完整詳情請見 :ref:`changelog `。" @@ -51,9 +51,9 @@ msgid "" "with a mix of changes to the language, the implementation and the standard " "library. The biggest changes include a new `interactive interpreter " "`_, experimental support for " -"running in a `free-threaded mode `_ " -"(:pep:`703`), and a `Just-In-Time compiler `_ " -"(:pep:`744`)." +"running in a `free-threaded mode `_ (:" +"pep:`703`), and a `Just-In-Time compiler `_ (:pep:" +"`744`)." msgstr "" #: ../../whatsnew/3.13.rst:72 @@ -76,8 +76,8 @@ msgstr "" msgid "" "This article doesn't attempt to provide a complete specification of all new " "features, but instead gives a convenient overview. For full details refer to " -"the documentation, such as the :ref:`Library Reference ` " -"and :ref:`Language Reference `. To understand the complete " +"the documentation, such as the :ref:`Library Reference ` and :" +"ref:`Language Reference `. To understand the complete " "implementation and design rationale for a change, refer to the PEP for a " "particular new feature; but note that PEPs usually are not kept up-to-date " "once a feature has been fully implemented. See `Porting to Python 3.13`_ for " @@ -105,9 +105,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:108 msgid "" -":pep:`703`: CPython 3.13 has experimental support for running with " -"the :term:`global interpreter lock` disabled. See :ref:`Free-threaded " -"CPython ` for more details." +":pep:`703`: CPython 3.13 has experimental support for running with the :term:" +"`global interpreter lock` disabled. See :ref:`Free-threaded CPython " +"` for more details." msgstr "" #: ../../whatsnew/3.13.rst:111 @@ -168,8 +168,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:137 msgid "" "The :mod:`copy` module now has a :func:`copy.replace` function, with support " -"for many builtin types and any class defining " -"the :func:`~object.__replace__` method." +"for many builtin types and any class defining the :func:`~object." +"__replace__` method." msgstr "" #: ../../whatsnew/3.13.rst:140 @@ -195,9 +195,9 @@ msgstr "安全性改進:" #: ../../whatsnew/3.13.rst:147 msgid "" -":func:`ssl.create_default_context` " -"sets :data:`ssl.VERIFY_X509_PARTIAL_CHAIN` " -"and :data:`ssl.VERIFY_X509_STRICT` as default flags." +":func:`ssl.create_default_context` sets :data:`ssl." +"VERIFY_X509_PARTIAL_CHAIN` and :data:`ssl.VERIFY_X509_STRICT` as default " +"flags." msgstr "" #: ../../whatsnew/3.13.rst:150 @@ -223,8 +223,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:157 msgid "" -"There is a new :ref:`suite of functions ` for " -"generating :pep:`669` monitoring events in the C API." +"There is a new :ref:`suite of functions ` for generating :" +"pep:`669` monitoring events in the C API." msgstr "" #: ../../whatsnew/3.13.rst:160 @@ -233,9 +233,8 @@ msgstr "新增型別特性:" #: ../../whatsnew/3.13.rst:162 msgid "" -":pep:`696`: Type parameters " -"(:data:`typing.TypeVar`, :data:`typing.ParamSpec`, " -"and :data:`typing.TypeVarTuple`) now support defaults." +":pep:`696`: Type parameters (:data:`typing.TypeVar`, :data:`typing." +"ParamSpec`, and :data:`typing.TypeVarTuple`) now support defaults." msgstr "" #: ../../whatsnew/3.13.rst:164 @@ -246,8 +245,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:166 msgid "" -":pep:`705`: :data:`typing.ReadOnly` can be used to mark an item of " -"a :class:`typing.TypedDict` as read-only for type checkers." +":pep:`705`: :data:`typing.ReadOnly` can be used to mark an item of a :class:" +"`typing.TypedDict` as read-only for type checkers." msgstr "" #: ../../whatsnew/3.13.rst:168 @@ -287,19 +286,20 @@ msgstr "重要的移除:" #: ../../whatsnew/3.13.rst:182 msgid "" -":ref:`PEP 594 `: The remaining 19 \"dead batteries\" " -"(legacy stdlib modules) have been removed from the standard library: :mod:`!" -"aifc`, :mod:`!audioop`, :mod:`!cgi`, :mod:`!cgitb`, :mod:`!chunk`, :mod:`!" -"crypt`, :mod:`!imghdr`, :mod:`!mailcap`, :mod:`!msilib`, :mod:`!nis`, :mod:`!" -"nntplib`, :mod:`!ossaudiodev`, :mod:`!pipes`, :mod:`!sndhdr`, :mod:`!" -"spwd`, :mod:`!sunau`, :mod:`!telnetlib`, :mod:`!uu` and :mod:`!xdrlib`." +":ref:`PEP 594 `: The remaining 19 \"dead " +"batteries\" (legacy stdlib modules) have been removed from the standard " +"library: :mod:`!aifc`, :mod:`!audioop`, :mod:`!cgi`, :mod:`!cgitb`, :mod:`!" +"chunk`, :mod:`!crypt`, :mod:`!imghdr`, :mod:`!mailcap`, :mod:`!msilib`, :mod:" +"`!nis`, :mod:`!nntplib`, :mod:`!ossaudiodev`, :mod:`!pipes`, :mod:`!" +"sndhdr`, :mod:`!spwd`, :mod:`!sunau`, :mod:`!telnetlib`, :mod:`!uu` and :mod:" +"`!xdrlib`." msgstr "" ":ref:`PEP 594 `: 剩下的 19 個 \"dead batteries\" (遺留標" "準函式庫模組)已自標準函式庫中移除::mod:`!aifc`、:mod:`!audioop`、:mod:`!" "cgi`、:mod:`!cgitb`、:mod:`!chunk`、:mod:`!crypt`、:mod:`!imghdr`、:mod:`!" "mailcap`、:mod:`!msilib`、:mod:`!nis`、:mod:`!nntplib`、:mod:`!" -"ossaudiodev`、:mod:`!pipes`、:mod:`!sndhdr`、:mod:`!spwd`、:mod:`!" -"sunau`、:mod:`!telnetlib`、:mod:`!uu` 和 :mod:`!xdrlib`." +"ossaudiodev`、:mod:`!pipes`、:mod:`!sndhdr`、:mod:`!spwd`、:mod:`!sunau`、:" +"mod:`!telnetlib`、:mod:`!uu` 和 :mod:`!xdrlib`." #: ../../whatsnew/3.13.rst:188 msgid "" @@ -384,8 +384,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:228 msgid "" -"History browsing using :kbd:`F2` that skips output as well as " -"the :term:`>>>` and :term:`...` prompts." +"History browsing using :kbd:`F2` that skips output as well as the :term:" +"`>>>` and :term:`...` prompts." msgstr "" #: ../../whatsnew/3.13.rst:230 @@ -701,35 +701,35 @@ msgstr "" #: ../../whatsnew/3.13.rst:423 msgid "" -"Historically, the expected result of mutating the return value " -"of :func:`locals` has been left to individual Python implementations to " -"define. Starting from Python 3.13, :pep:`667` standardises the historical " -"behavior of CPython for most code execution scopes, but " -"changes :term:`optimized scopes ` (functions, generators, " -"coroutines, comprehensions, and generator expressions) to explicitly return " -"independent snapshots of the currently assigned local variables, including " -"locally referenced nonlocal variables captured in closures." +"Historically, the expected result of mutating the return value of :func:" +"`locals` has been left to individual Python implementations to define. " +"Starting from Python 3.13, :pep:`667` standardises the historical behavior " +"of CPython for most code execution scopes, but changes :term:`optimized " +"scopes ` (functions, generators, coroutines, " +"comprehensions, and generator expressions) to explicitly return independent " +"snapshots of the currently assigned local variables, including locally " +"referenced nonlocal variables captured in closures." msgstr "" #: ../../whatsnew/3.13.rst:432 msgid "" "This change to the semantics of :func:`locals` in optimized scopes also " "affects the default behavior of code execution functions that implicitly " -"target :func:`!locals` if no explicit namespace is provided (such " -"as :func:`exec` and :func:`eval`). In previous versions, whether or not " -"changes could be accessed by calling :func:`!locals` after calling the code " -"execution function was implementation-dependent. In CPython specifically, " -"such code would typically appear to work as desired, but could sometimes " -"fail in optimized scopes based on other code (including debuggers and code " -"execution tracing tools) potentially resetting the shared snapshot in that " -"scope. Now, the code will always run against an independent snapshot of the " -"local variables in optimized scopes, and hence the changes will never be " -"visible in subsequent calls to :func:`!locals`. To access the changes made " -"in these cases, an explicit namespace reference must now be passed to the " -"relevant function. Alternatively, it may make sense to update affected code " -"to use a higher level code execution API that returns the resulting code " -"execution namespace (e.g. :func:`runpy.run_path` when executing Python files " -"from disk)." +"target :func:`!locals` if no explicit namespace is provided (such as :func:" +"`exec` and :func:`eval`). In previous versions, whether or not changes could " +"be accessed by calling :func:`!locals` after calling the code execution " +"function was implementation-dependent. In CPython specifically, such code " +"would typically appear to work as desired, but could sometimes fail in " +"optimized scopes based on other code (including debuggers and code execution " +"tracing tools) potentially resetting the shared snapshot in that scope. Now, " +"the code will always run against an independent snapshot of the local " +"variables in optimized scopes, and hence the changes will never be visible " +"in subsequent calls to :func:`!locals`. To access the changes made in these " +"cases, an explicit namespace reference must now be passed to the relevant " +"function. Alternatively, it may make sense to update affected code to use a " +"higher level code execution API that returns the resulting code execution " +"namespace (e.g. :func:`runpy.run_path` when executing Python files from " +"disk)." msgstr "" #: ../../whatsnew/3.13.rst:451 @@ -745,16 +745,16 @@ msgstr "" #: ../../whatsnew/3.13.rst:457 msgid "" "See :pep:`667` for more details, including related C API changes and " -"deprecations. Porting notes are also provided below for the " -"affected :ref:`Python APIs ` and :ref:`C APIs " -"`." +"deprecations. Porting notes are also provided below for the affected :ref:" +"`Python APIs ` and :ref:`C APIs `." msgstr "" #: ../../whatsnew/3.13.rst:462 msgid "" -"(PEP and implementation contributed by Mark Shannon and Tian Gao " -"in :gh:`74929`. Documentation updates provided by Guido van Rossum and " -"Alyssa Coghlan.)" +"(PEP and implementation contributed by Mark Shannon and Tian Gao in :gh:" +"`74929`. Documentation updates provided by Guido van Rossum and Alyssa " +"Coghlan.)" msgstr "" #: ../../whatsnew/3.13.rst:470 @@ -849,8 +849,8 @@ msgstr "" msgid "" ":keyword:`global` declarations are now permitted in :keyword:`except` blocks " "when that global is used in the :keyword:`else` block. Previously this " -"raised an erroneous :exc:`SyntaxError`. (Contributed by Irit Katriel " -"in :gh:`111123`.)" +"raised an erroneous :exc:`SyntaxError`. (Contributed by Irit Katriel in :gh:" +"`111123`.)" msgstr "" #: ../../whatsnew/3.13.rst:540 @@ -866,15 +866,15 @@ msgid "" "Add :ref:`support for the perf profiler ` working without " "`frame pointers `_ through the new " "environment variable :envvar:`PYTHON_PERF_JIT_SUPPORT` and command-line " -"option :option:`-X perf_jit <-X>`. (Contributed by Pablo Galindo " -"in :gh:`118518`.)" +"option :option:`-X perf_jit <-X>`. (Contributed by Pablo Galindo in :gh:" +"`118518`.)" msgstr "" #: ../../whatsnew/3.13.rst:551 msgid "" -"The location of a :file:`.python_history` file can be changed via the " -"new :envvar:`PYTHON_HISTORY` environment variable. (Contributed by Levi " -"Sabah, Zackery Spytz and Hugo van Kemenade in :gh:`73965`.)" +"The location of a :file:`.python_history` file can be changed via the new :" +"envvar:`PYTHON_HISTORY` environment variable. (Contributed by Levi Sabah, " +"Zackery Spytz and Hugo van Kemenade in :gh:`73965`.)" msgstr "" #: ../../whatsnew/3.13.rst:556 @@ -895,15 +895,15 @@ msgstr "" #: ../../whatsnew/3.13.rst:565 msgid "" "The :func:`exec` and :func:`eval` builtins now accept the *globals* and " -"*locals* arguments as keywords. (Contributed by Raphael Gaschignard " -"in :gh:`105879`)" +"*locals* arguments as keywords. (Contributed by Raphael Gaschignard in :gh:" +"`105879`)" msgstr "" #: ../../whatsnew/3.13.rst:569 msgid "" -"The :func:`compile` builtin now accepts a new flag, " -"``ast.PyCF_OPTIMIZED_AST``, which is similar to ``ast.PyCF_ONLY_AST`` except " -"that the returned AST is optimized according to the value of the *optimize* " +"The :func:`compile` builtin now accepts a new flag, ``ast." +"PyCF_OPTIMIZED_AST``, which is similar to ``ast.PyCF_ONLY_AST`` except that " +"the returned AST is optimized according to the value of the *optimize* " "argument. (Contributed by Irit Katriel in :gh:`108113`)." msgstr "" @@ -915,10 +915,10 @@ msgstr "" #: ../../whatsnew/3.13.rst:578 msgid "" -"Add :exc:`PythonFinalizationError`, a new exception derived " -"from :exc:`RuntimeError` and used to signal when operations are blocked " -"during :term:`finalization `. The following callables " -"now raise :exc:`!PythonFinalizationError`, instead of :exc:`RuntimeError`:" +"Add :exc:`PythonFinalizationError`, a new exception derived from :exc:" +"`RuntimeError` and used to signal when operations are blocked during :term:" +"`finalization `. The following callables now raise :" +"exc:`!PythonFinalizationError`, instead of :exc:`RuntimeError`:" msgstr "" #: ../../whatsnew/3.13.rst:584 @@ -946,8 +946,8 @@ msgid "" "Allow the *count* argument of :meth:`str.replace` to be a keyword. " "(Contributed by Hugo van Kemenade in :gh:`106487`.)" msgstr "" -"允許 :meth:`str.replace` 的 *count* 引數為關鍵字。(由 Hugo van Kemenade " -"在 :gh:`106487` 中貢獻。)" +"允許 :meth:`str.replace` 的 *count* 引數為關鍵字。(由 Hugo van Kemenade 在 :" +"gh:`106487` 中貢獻。)" #: ../../whatsnew/3.13.rst:594 msgid "" @@ -959,9 +959,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:599 msgid "" "Added :attr:`!name` and :attr:`!mode` attributes for compressed and archived " -"file-like objects in the :mod:`bz2`, :mod:`lzma`, :mod:`tarfile`, " -"and :mod:`zipfile` modules. (Contributed by Serhiy Storchaka " -"in :gh:`115961`.)" +"file-like objects in the :mod:`bz2`, :mod:`lzma`, :mod:`tarfile`, and :mod:" +"`zipfile` modules. (Contributed by Serhiy Storchaka in :gh:`115961`.)" msgstr "" #: ../../whatsnew/3.13.rst:606 @@ -984,10 +983,10 @@ msgstr "argparse" #: ../../whatsnew/3.13.rst:619 msgid "" -"Add the *deprecated* parameter to " -"the :meth:`~argparse.ArgumentParser.add_argument` and :meth:`!add_parser` " -"methods, to enable deprecating command-line options, positional arguments, " -"and subcommands. (Contributed by Serhiy Storchaka in :gh:`83648`.)" +"Add the *deprecated* parameter to the :meth:`~argparse.ArgumentParser." +"add_argument` and :meth:`!add_parser` methods, to enable deprecating command-" +"line options, positional arguments, and subcommands. (Contributed by Serhiy " +"Storchaka in :gh:`83648`.)" msgstr "" #: ../../whatsnew/3.13.rst:627 @@ -1041,14 +1040,14 @@ msgstr "" #: ../../whatsnew/3.13.rst:660 msgid "" "These changes do not apply to user-defined subclasses of :class:`ast.AST` " -"unless the class opts in to the new behavior by defining " -"the :attr:`.AST._field_types` mapping." +"unless the class opts in to the new behavior by defining the :attr:`.AST." +"_field_types` mapping." msgstr "" #: ../../whatsnew/3.13.rst:664 msgid "" -"(Contributed by Jelle Zijlstra in :gh:`105858`, :gh:`117486`, " -"and :gh:`118851`.)" +"(Contributed by Jelle Zijlstra in :gh:`105858`, :gh:`117486`, and :gh:" +"`118851`.)" msgstr "" #: ../../whatsnew/3.13.rst:666 @@ -1064,19 +1063,19 @@ msgstr "asyncio" #: ../../whatsnew/3.13.rst:675 msgid "" -":func:`asyncio.as_completed` now returns an object that is both " -"an :term:`asynchronous iterator` and a plain :term:`iterator` " -"of :term:`awaitables `. The awaitables yielded by asynchronous " -"iteration include original task or future objects that were passed in, " -"making it easier to associate results with the tasks being completed. " -"(Contributed by Justin Arthur in :gh:`77714`.)" +":func:`asyncio.as_completed` now returns an object that is both an :term:" +"`asynchronous iterator` and a plain :term:`iterator` of :term:`awaitables " +"`. The awaitables yielded by asynchronous iteration include " +"original task or future objects that were passed in, making it easier to " +"associate results with the tasks being completed. (Contributed by Justin " +"Arthur in :gh:`77714`.)" msgstr "" #: ../../whatsnew/3.13.rst:683 msgid "" ":meth:`asyncio.loop.create_unix_server` will now automatically remove the " -"Unix socket when the server is closed. (Contributed by Pierre Ossman " -"in :gh:`111246`.)" +"Unix socket when the server is closed. (Contributed by Pierre Ossman in :gh:" +"`111246`.)" msgstr "" #: ../../whatsnew/3.13.rst:687 @@ -1089,9 +1088,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:693 msgid "" -"Add :meth:`Queue.shutdown ` " -"and :exc:`~asyncio.QueueShutDown` to manage queue termination. (Contributed " -"by Laurie Opperman and Yves Duprat in :gh:`104228`.)" +"Add :meth:`Queue.shutdown ` and :exc:`~asyncio." +"QueueShutDown` to manage queue termination. (Contributed by Laurie Opperman " +"and Yves Duprat in :gh:`104228`.)" msgstr "" #: ../../whatsnew/3.13.rst:697 @@ -1104,8 +1103,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:701 msgid "" "Accept a tuple of separators in :meth:`.StreamReader.readuntil`, stopping " -"when any one of them is encountered. (Contributed by Bruce Merry " -"in :gh:`81322`.)" +"when any one of them is encountered. (Contributed by Bruce Merry in :gh:" +"`81322`.)" msgstr "" #: ../../whatsnew/3.13.rst:705 @@ -1120,10 +1119,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:712 msgid "" "In the case where a task group is cancelled externally and also must raise " -"an :exc:`ExceptionGroup`, it will now call the parent " -"task's :meth:`~asyncio.Task.cancel` method. This ensures that " -"a :exc:`~asyncio.CancelledError` will be raised at the " -"next :keyword:`await`, so the cancellation is not lost." +"an :exc:`ExceptionGroup`, it will now call the parent task's :meth:`~asyncio." +"Task.cancel` method. This ensures that a :exc:`~asyncio.CancelledError` will " +"be raised at the next :keyword:`await`, so the cancellation is not lost." msgstr "" #: ../../whatsnew/3.13.rst:718 @@ -1145,11 +1143,10 @@ msgstr "" #: ../../whatsnew/3.13.rst:727 msgid "" -"When :meth:`.TaskGroup.create_task` is called on an " -"inactive :class:`~asyncio.TaskGroup`, the given coroutine will be closed " -"(which prevents a :exc:`RuntimeWarning` about the given coroutine being " -"never awaited). (Contributed by Arthur Tacca and Jason Zhang " -"in :gh:`115957`.)" +"When :meth:`.TaskGroup.create_task` is called on an inactive :class:" +"`~asyncio.TaskGroup`, the given coroutine will be closed (which prevents a :" +"exc:`RuntimeWarning` about the given coroutine being never awaited). " +"(Contributed by Arthur Tacca and Jason Zhang in :gh:`115957`.)" msgstr "" #: ../../whatsnew/3.13.rst:733 @@ -1166,9 +1163,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:744 msgid "" -"This affects the following function and " -"methods: :meth:`asyncio.create_task`, :meth:`asyncio.loop.create_task`, :meth:`asyncio.TaskGroup.create_task`. " -"(Contributed by Thomas Grainger in :gh:`128307`.)" +"This affects the following function and methods: :meth:`asyncio." +"create_task`, :meth:`asyncio.loop.create_task`, :meth:`asyncio.TaskGroup." +"create_task`. (Contributed by Thomas Grainger in :gh:`128307`.)" msgstr "" #: ../../whatsnew/3.13.rst:751 @@ -1178,8 +1175,8 @@ msgstr "base64" #: ../../whatsnew/3.13.rst:753 msgid "" "Add :func:`~base64.z85encode` and :func:`~base64.z85decode` functions for " -"encoding :class:`bytes` as `Z85 data`_ and decoding Z85-encoded data " -"to :class:`!bytes`. (Contributed by Matan Perelman in :gh:`75299`.)" +"encoding :class:`bytes` as `Z85 data`_ and decoding Z85-encoded data to :" +"class:`!bytes`. (Contributed by Matan Perelman in :gh:`75299`.)" msgstr "" #: ../../whatsnew/3.13.rst:762 @@ -1189,9 +1186,9 @@ msgstr "compileall" #: ../../whatsnew/3.13.rst:764 ../../whatsnew/3.13.rst:772 #: ../../whatsnew/3.13.rst:1031 msgid "" -"The default number of worker threads and processes is now selected " -"using :func:`os.process_cpu_count` instead of :func:`os.cpu_count`. " -"(Contributed by Victor Stinner in :gh:`109649`.)" +"The default number of worker threads and processes is now selected using :" +"func:`os.process_cpu_count` instead of :func:`os.cpu_count`. (Contributed by " +"Victor Stinner in :gh:`109649`.)" msgstr "" #: ../../whatsnew/3.13.rst:770 @@ -1206,8 +1203,8 @@ msgstr "configparser" msgid "" ":class:`~configparser.ConfigParser` now has support for unnamed sections, " "which allows for top-level key-value pairs. This can be enabled with the new " -"*allow_unnamed_section* parameter. (Contributed by Pedro Sousa Lacerda " -"in :gh:`66449`.)" +"*allow_unnamed_section* parameter. (Contributed by Pedro Sousa Lacerda in :" +"gh:`66449`.)" msgstr "" #: ../../whatsnew/3.13.rst:787 @@ -1232,8 +1229,10 @@ msgid ":class:`dataclasses.dataclass`" msgstr ":class:`dataclasses.dataclass`" #: ../../whatsnew/3.13.rst:797 -msgid ":class:`datetime.datetime`, :class:`datetime.date`, :class:`datetime.time`" -msgstr ":class:`datetime.datetime`、:class:`datetime.date`、:class:`datetime.time`" +msgid "" +":class:`datetime.datetime`, :class:`datetime.date`, :class:`datetime.time`" +msgstr "" +":class:`datetime.datetime`、:class:`datetime.date`、:class:`datetime.time`" #: ../../whatsnew/3.13.rst:798 msgid ":class:`inspect.Signature`, :class:`inspect.Parameter`" @@ -1250,8 +1249,8 @@ msgstr ":ref:`程式碼物件 `" #: ../../whatsnew/3.13.rst:802 msgid "" "Any user-defined class can also support :func:`copy.replace` by defining " -"the :meth:`~object.__replace__` method. (Contributed by Serhiy Storchaka " -"in :gh:`108751`.)" +"the :meth:`~object.__replace__` method. (Contributed by Serhiy Storchaka in :" +"gh:`108751`.)" msgstr "" #: ../../whatsnew/3.13.rst:808 @@ -1286,10 +1285,10 @@ msgstr "" #: ../../whatsnew/3.13.rst:824 msgid "" -":class:`ctypes.Structure` objects have a " -"new :attr:`~ctypes.Structure._align_` attribute which allows the alignment " -"of the structure being packed to/from memory to be specified explicitly. " -"(Contributed by Matt Sanderson in :gh:`112433`)" +":class:`ctypes.Structure` objects have a new :attr:`~ctypes.Structure." +"_align_` attribute which allows the alignment of the structure being packed " +"to/from memory to be specified explicitly. (Contributed by Matt Sanderson " +"in :gh:`112433`)" msgstr "" #: ../../whatsnew/3.13.rst:830 @@ -1305,9 +1304,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:836 msgid "" -"Allow removing all items from the database through the " -"new :meth:`.gdbm.clear` and :meth:`.ndbm.clear` methods. (Contributed by " -"Donghee Na in :gh:`107122`.)" +"Allow removing all items from the database through the new :meth:`.gdbm." +"clear` and :meth:`.ndbm.clear` methods. (Contributed by Donghee Na in :gh:" +"`107122`.)" msgstr "" #: ../../whatsnew/3.13.rst:842 @@ -1325,10 +1324,10 @@ msgstr "" #: ../../whatsnew/3.13.rst:851 msgid "" ":meth:`~dis.get_instructions` no longer represents cache entries as separate " -"instructions. Instead, it returns them as part of " -"the :class:`~dis.Instruction`, in the new *cache_info* field. The " -"*show_caches* argument to :meth:`~dis.get_instructions` is deprecated and no " -"longer has any effect. (Contributed by Irit Katriel in :gh:`112962`.)" +"instructions. Instead, it returns them as part of the :class:`~dis." +"Instruction`, in the new *cache_info* field. The *show_caches* argument to :" +"meth:`~dis.get_instructions` is deprecated and no longer has any effect. " +"(Contributed by Irit Katriel in :gh:`112962`.)" msgstr "" #: ../../whatsnew/3.13.rst:863 @@ -1339,9 +1338,9 @@ msgstr "doctest" msgid "" ":mod:`doctest` output is now colored by default. This can be controlled via " "the new :envvar:`PYTHON_COLORS` environment variable as well as the " -"canonical |NO_COLOR|_ and |FORCE_COLOR|_ environment variables. See " -"also :ref:`using-on-controlling-color`. (Contributed by Hugo van Kemenade " -"in :gh:`117225`.)" +"canonical |NO_COLOR|_ and |FORCE_COLOR|_ environment variables. See also :" +"ref:`using-on-controlling-color`. (Contributed by Hugo van Kemenade in :gh:" +"`117225`.)" msgstr "" #: ../../whatsnew/3.13.rst:872 @@ -1357,13 +1356,12 @@ msgstr "email" #: ../../whatsnew/3.13.rst:880 msgid "" -"Headers with embedded newlines are now quoted on output. " -"The :mod:`~email.generator` will now refuse to serialize (write) headers " -"that are improperly folded or delimited, such that they would be parsed as " -"multiple headers or joined with adjacent data. If you need to turn this " -"safety feature off, " -"set :attr:`~email.policy.Policy.verify_generated_headers`. (Contributed by " -"Bas Bloemsaat and Petr Viktorin in :gh:`121650`.)" +"Headers with embedded newlines are now quoted on output. The :mod:`~email." +"generator` will now refuse to serialize (write) headers that are improperly " +"folded or delimited, such that they would be parsed as multiple headers or " +"joined with adjacent data. If you need to turn this safety feature off, set :" +"attr:`~email.policy.Policy.verify_generated_headers`. (Contributed by Bas " +"Bloemsaat and Petr Viktorin in :gh:`121650`.)" msgstr "" #: ../../whatsnew/3.13.rst:888 @@ -1372,10 +1370,10 @@ msgid "" "return ``('', '')`` pairs in more situations where invalid email addresses " "are encountered instead of potentially inaccurate values. The two functions " "have a new optional *strict* parameter (default ``True``). To get the old " -"behavior (accepting malformed input), use ``strict=False``. " -"``getattr(email.utils, 'supports_strict_parsing', False)`` can be used to " -"check if the *strict* parameter is available. (Contributed by Thomas Dwyer " -"and Victor Stinner for :gh:`102988` to improve the :cve:`2023-27043` fix.)" +"behavior (accepting malformed input), use ``strict=False``. ``getattr(email." +"utils, 'supports_strict_parsing', False)`` can be used to check if the " +"*strict* parameter is available. (Contributed by Thomas Dwyer and Victor " +"Stinner for :gh:`102988` to improve the :cve:`2023-27043` fix.)" msgstr "" #: ../../whatsnew/3.13.rst:900 @@ -1384,8 +1382,8 @@ msgstr "enum" #: ../../whatsnew/3.13.rst:902 msgid "" -":class:`~enum.EnumDict` has been made public to better support " -"subclassing :class:`~enum.EnumType`." +":class:`~enum.EnumDict` has been made public to better support subclassing :" +"class:`~enum.EnumType`." msgstr "" "公開 :class:`~enum.EnumDict` 以更好地支援 :class:`~enum.EnumType` 的子類別。" @@ -1397,8 +1395,8 @@ msgstr "fractions" msgid "" ":class:`~fractions.Fraction` objects now support the standard :ref:`format " "specification mini-language ` rules for fill, alignment, sign " -"handling, minimum width, and grouping. (Contributed by Mark Dickinson " -"in :gh:`111320`.)" +"handling, minimum width, and grouping. (Contributed by Mark Dickinson in :gh:" +"`111320`.)" msgstr "" #: ../../whatsnew/3.13.rst:916 @@ -1458,8 +1456,8 @@ msgstr "" msgid "" ":func:`~importlib.resources.contents` remains deprecated in favor of the " "fully-featured :class:`~importlib.resources.abc.Traversable` API. However, " -"there is now no plan to remove it. (Contributed by Petr Viktorin " -"in :gh:`116608`.)" +"there is now no plan to remove it. (Contributed by Petr Viktorin in :gh:" +"`116608`.)" msgstr "" #: ../../whatsnew/3.13.rst:948 @@ -1468,11 +1466,11 @@ msgstr "io" #: ../../whatsnew/3.13.rst:950 msgid "" -"The :class:`~io.IOBase` finalizer now logs any errors raised by " -"the :meth:`~io.IOBase.close` method with :data:`sys.unraisablehook`. " -"Previously, errors were ignored silently by default, and only logged " -"in :ref:`Python Development Mode ` or when using a :ref:`Python " -"debug build `. (Contributed by Victor Stinner in :gh:`62948`.)" +"The :class:`~io.IOBase` finalizer now logs any errors raised by the :meth:" +"`~io.IOBase.close` method with :data:`sys.unraisablehook`. Previously, " +"errors were ignored silently by default, and only logged in :ref:`Python " +"Development Mode ` or when using a :ref:`Python debug build `. (Contributed by Victor Stinner in :gh:`62948`.)" msgstr "" #: ../../whatsnew/3.13.rst:959 @@ -1487,10 +1485,10 @@ msgstr "" #: ../../whatsnew/3.13.rst:965 msgid "" -"Fix ``is_global`` and ``is_private`` behavior " -"in :class:`~ipaddress.IPv4Address`, :class:`~ipaddress.IPv6Address`, :class:`~ipaddress.IPv4Network`, " -"and :class:`~ipaddress.IPv6Network`. (Contributed by Jakub Stasiak " -"in :gh:`113171`.)" +"Fix ``is_global`` and ``is_private`` behavior in :class:`~ipaddress." +"IPv4Address`, :class:`~ipaddress.IPv6Address`, :class:`~ipaddress." +"IPv4Network`, and :class:`~ipaddress.IPv6Network`. (Contributed by Jakub " +"Stasiak in :gh:`113171`.)" msgstr "" #: ../../whatsnew/3.13.rst:972 @@ -1499,9 +1497,9 @@ msgstr "itertools" #: ../../whatsnew/3.13.rst:974 msgid "" -":func:`~itertools.batched` has a new *strict* parameter, which raises " -"a :exc:`ValueError` if the final batch is shorter than the specified batch " -"size. (Contributed by Raymond Hettinger in :gh:`113202`.)" +":func:`~itertools.batched` has a new *strict* parameter, which raises a :exc:" +"`ValueError` if the final batch is shorter than the specified batch size. " +"(Contributed by Raymond Hettinger in :gh:`113202`.)" msgstr "" #: ../../whatsnew/3.13.rst:981 @@ -1538,8 +1536,8 @@ msgstr "mimetypes" msgid "" "Add the :func:`~mimetypes.guess_file_type` function to guess a MIME type " "from a filesystem path. Using paths with :func:`~mimetypes.guess_type` is " -"now :term:`soft deprecated`. (Contributed by Serhiy Storchaka " -"in :gh:`66543`.)" +"now :term:`soft deprecated`. (Contributed by Serhiy Storchaka in :gh:" +"`66543`.)" msgstr "" #: ../../whatsnew/3.13.rst:1011 @@ -1556,17 +1554,17 @@ msgstr "" #: ../../whatsnew/3.13.rst:1017 msgid "" ":class:`~mmap.mmap` has a new :meth:`~mmap.mmap.seekable` method that can be " -"used when a seekable file-like object is required. " -"The :meth:`~mmap.mmap.seek` method now returns the new absolute position. " -"(Contributed by Donghee Na and Sylvie Liberman in :gh:`111835`.)" +"used when a seekable file-like object is required. The :meth:`~mmap.mmap." +"seek` method now returns the new absolute position. (Contributed by Donghee " +"Na and Sylvie Liberman in :gh:`111835`.)" msgstr "" #: ../../whatsnew/3.13.rst:1022 msgid "" "The new UNIX-only *trackfd* parameter for :class:`~mmap.mmap` controls file " "descriptor duplication; if false, the file descriptor specified by *fileno* " -"will not be duplicated. (Contributed by Zackery Spytz and Petr Viktorin " -"in :gh:`78502`.)" +"will not be duplicated. (Contributed by Zackery Spytz and Petr Viktorin in :" +"gh:`78502`.)" msgstr "" #: ../../whatsnew/3.13.rst:1029 @@ -1597,8 +1595,10 @@ msgstr "" #: ../../whatsnew/3.13.rst:1051 msgid "" "Add a :ref:`low level interface ` to Linux's :manpage:`timer " -"file descriptors ` " -"via :func:`~os.timerfd_create`, :func:`~os.timerfd_settime`, :func:`~os.timerfd_settime_ns`, :func:`~os.timerfd_gettime`, :func:`~os.timerfd_gettime_ns`, :const:`~os.TFD_NONBLOCK`, :const:`~os.TFD_CLOEXEC`, :const:`~os.TFD_TIMER_ABSTIME`, " +"file descriptors ` via :func:`~os.timerfd_create`, :func:" +"`~os.timerfd_settime`, :func:`~os.timerfd_settime_ns`, :func:`~os." +"timerfd_gettime`, :func:`~os.timerfd_gettime_ns`, :const:`~os." +"TFD_NONBLOCK`, :const:`~os.TFD_CLOEXEC`, :const:`~os.TFD_TIMER_ABSTIME`, " "and :const:`~os.TFD_TIMER_CANCEL_ON_SET` (Contributed by Masaru Tsuchiyama " "in :gh:`108277`.)" msgstr "" @@ -1614,17 +1614,17 @@ msgstr "" #: ../../whatsnew/3.13.rst:1066 msgid "" ":func:`~os.fchmod` and support for file descriptors in :func:`~os.chmod` are " -"both now available on Windows. (Contributed by Serhiy Storchaka " -"in :gh:`113191`.)" +"both now available on Windows. (Contributed by Serhiy Storchaka in :gh:" +"`113191`.)" msgstr "" #: ../../whatsnew/3.13.rst:1070 msgid "" "On Windows, :func:`~os.mkdir` and :func:`~os.makedirs` now support passing a " "*mode* value of ``0o700`` to apply access control to the new directory. This " -"implicitly affects :func:`tempfile.mkdtemp` and is a mitigation " -"for :cve:`2024-4030`. Other values for *mode* continue to be ignored. " -"(Contributed by Steve Dower in :gh:`118486`.)" +"implicitly affects :func:`tempfile.mkdtemp` and is a mitigation for :cve:" +"`2024-4030`. Other values for *mode* continue to be ignored. (Contributed by " +"Steve Dower in :gh:`118486`.)" msgstr "" #: ../../whatsnew/3.13.rst:1077 @@ -1637,9 +1637,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:1081 msgid "" ":func:`~os.posix_spawn` can now use the :const:`~os.POSIX_SPAWN_CLOSEFROM` " -"attribute in the *file_actions* parameter on platforms that " -"support :c:func:`!posix_spawn_file_actions_addclosefrom_np`. (Contributed by " -"Jakub Kulik in :gh:`113117`.)" +"attribute in the *file_actions* parameter on platforms that support :c:func:" +"`!posix_spawn_file_actions_addclosefrom_np`. (Contributed by Jakub Kulik in :" +"gh:`113117`.)" msgstr "" #: ../../whatsnew/3.13.rst:1088 @@ -1672,9 +1672,9 @@ msgstr "pathlib" #: ../../whatsnew/3.13.rst:1107 msgid "" -"Add :exc:`~pathlib.UnsupportedOperation`, which is raised instead " -"of :exc:`NotImplementedError` when a path operation isn't supported. " -"(Contributed by Barney Gale in :gh:`89812`.)" +"Add :exc:`~pathlib.UnsupportedOperation`, which is raised instead of :exc:" +"`NotImplementedError` when a path operation isn't supported. (Contributed by " +"Barney Gale in :gh:`89812`.)" msgstr "" #: ../../whatsnew/3.13.rst:1111 @@ -1700,8 +1700,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:1124 msgid "" -"Add *recurse_symlinks* keyword-only argument to :meth:`.Path.glob` " -"and :meth:`~pathlib.Path.rglob`. (Contributed by Barney Gale in :gh:`77609`.)" +"Add *recurse_symlinks* keyword-only argument to :meth:`.Path.glob` and :meth:" +"`~pathlib.Path.rglob`. (Contributed by Barney Gale in :gh:`77609`.)" msgstr "" #: ../../whatsnew/3.13.rst:1128 @@ -1714,9 +1714,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:1133 msgid "" "Add the *follow_symlinks* keyword-only argument to :meth:`Path.is_file " -"`, :meth:`Path.is_dir " -"`, :meth:`.Path.owner`, and :meth:`.Path.group`. " -"(Contributed by Barney Gale in :gh:`105793` and Kamil Turek in :gh:`107962`.)" +"`, :meth:`Path.is_dir `, :meth:`." +"Path.owner`, and :meth:`.Path.group`. (Contributed by Barney Gale in :gh:" +"`105793` and Kamil Turek in :gh:`107962`.)" msgstr "" #: ../../whatsnew/3.13.rst:1141 @@ -1749,8 +1749,8 @@ msgstr "" msgid "" "Add ability to move between chained exceptions during post-mortem debugging " "in :func:`~pdb.pm` using the new :pdbcmd:`exceptions [exc_number] " -"` command for Pdb. (Contributed by Matthias Bussonnier " -"in :gh:`106676`.)" +"` command for Pdb. (Contributed by Matthias Bussonnier in :gh:" +"`106676`.)" msgstr "" #: ../../whatsnew/3.13.rst:1161 @@ -1786,8 +1786,8 @@ msgstr "re" #: ../../whatsnew/3.13.rst:1184 msgid "" -"Rename :exc:`!re.error` to :exc:`~re.PatternError` for improved " -"clarity. :exc:`!re.error` is kept for backward compatibility." +"Rename :exc:`!re.error` to :exc:`~re.PatternError` for improved clarity. :" +"exc:`!re.error` is kept for backward compatibility." msgstr "" #: ../../whatsnew/3.13.rst:1189 @@ -1796,9 +1796,8 @@ msgstr "shutil" #: ../../whatsnew/3.13.rst:1191 msgid "" -"Support the *dir_fd* and *follow_symlinks* keyword arguments " -"in :func:`~shutil.chown`. (Contributed by Berker Peksag and Tahia K " -"in :gh:`62308`)" +"Support the *dir_fd* and *follow_symlinks* keyword arguments in :func:" +"`~shutil.chown`. (Contributed by Berker Peksag and Tahia K in :gh:`62308`)" msgstr "" #: ../../whatsnew/3.13.rst:1197 @@ -1807,9 +1806,9 @@ msgstr "site" #: ../../whatsnew/3.13.rst:1199 msgid "" -":file:`.pth` files are now decoded using UTF-8 first, and then with " -"the :term:`locale encoding` if UTF-8 decoding fails. (Contributed by Inada " -"Naoki in :gh:`117802`.)" +":file:`.pth` files are now decoded using UTF-8 first, and then with the :" +"term:`locale encoding` if UTF-8 decoding fails. (Contributed by Inada Naoki " +"in :gh:`117802`.)" msgstr "" #: ../../whatsnew/3.13.rst:1205 @@ -1826,8 +1825,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:1211 msgid "" "Add the *filter* keyword-only parameter to :meth:`.Connection.iterdump` for " -"filtering database objects to dump. (Contributed by Mariusz Felisiak " -"in :gh:`91602`.)" +"filtering database objects to dump. (Contributed by Mariusz Felisiak in :gh:" +"`91602`.)" msgstr "" #: ../../whatsnew/3.13.rst:1217 @@ -1836,9 +1835,9 @@ msgstr "ssl" #: ../../whatsnew/3.13.rst:1219 msgid "" -"The :func:`~ssl.create_default_context` API now " -"includes :data:`~ssl.VERIFY_X509_PARTIAL_CHAIN` " -"and :data:`~ssl.VERIFY_X509_STRICT` in its default flags." +"The :func:`~ssl.create_default_context` API now includes :data:`~ssl." +"VERIFY_X509_PARTIAL_CHAIN` and :data:`~ssl.VERIFY_X509_STRICT` in its " +"default flags." msgstr "" #: ../../whatsnew/3.13.rst:1225 @@ -1872,8 +1871,8 @@ msgstr "statistics" msgid "" "Add :func:`~statistics.kde` for kernel density estimation. This makes it " "possible to estimate a continuous probability density function from a fixed " -"number of discrete samples. (Contributed by Raymond Hettinger " -"in :gh:`115863`.)" +"number of discrete samples. (Contributed by Raymond Hettinger in :gh:" +"`115863`.)" msgstr "" #: ../../whatsnew/3.13.rst:1248 @@ -1905,11 +1904,11 @@ msgstr "" #: ../../whatsnew/3.13.rst:1268 msgid "" "A private control knob :attr:`!subprocess._USE_POSIX_SPAWN` can be set to " -"``False`` if you need to force :mod:`subprocess` to never " -"use :func:`~os.posix_spawn`. Please report your reason and platform details " -"in the :ref:`issue tracker ` if you set this so that we " -"can improve our API selection logic for everyone. (Contributed by Jakub " -"Kulik in :gh:`113117`.)" +"``False`` if you need to force :mod:`subprocess` to never use :func:`~os." +"posix_spawn`. Please report your reason and platform details in the :ref:" +"`issue tracker ` if you set this so that we can improve " +"our API selection logic for everyone. (Contributed by Jakub Kulik in :gh:" +"`113117`.)" msgstr "" #: ../../whatsnew/3.13.rst:1278 @@ -1931,8 +1930,8 @@ msgstr "tempfile" msgid "" "On Windows, the default mode ``0o700`` used by :func:`tempfile.mkdtemp` now " "limits access to the new directory due to changes to :func:`os.mkdir`. This " -"is a mitigation for :cve:`2024-4030`. (Contributed by Steve Dower " -"in :gh:`118486`.)" +"is a mitigation for :cve:`2024-4030`. (Contributed by Steve Dower in :gh:" +"`118486`.)" msgstr "" #: ../../whatsnew/3.13.rst:1295 @@ -1952,8 +1951,8 @@ msgid "" "On Windows, :func:`~time.time` now uses the " "``GetSystemTimePreciseAsFileTime()`` clock for a resolution of 1 " "microsecond, instead of the ``GetSystemTimeAsFileTime()`` clock which has a " -"resolution of 15.6 milliseconds. (Contributed by Victor Stinner " -"in :gh:`63207`.)" +"resolution of 15.6 milliseconds. (Contributed by Victor Stinner in :gh:" +"`63207`.)" msgstr "" #: ../../whatsnew/3.13.rst:1311 @@ -1973,9 +1972,8 @@ msgid "" "The :mod:`tkinter` widget method :meth:`!wm_attributes` now accepts the " "attribute name without the minus prefix to get window attributes, for " "example ``w.wm_attributes('alpha')`` and allows specifying attributes and " -"values to set as keyword arguments, for example " -"``w.wm_attributes(alpha=0.5)``. (Contributed by Serhiy Storchaka " -"in :gh:`43457`.)" +"values to set as keyword arguments, for example ``w." +"wm_attributes(alpha=0.5)``. (Contributed by Serhiy Storchaka in :gh:`43457`.)" msgstr "" #: ../../whatsnew/3.13.rst:1326 @@ -1995,10 +1993,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:1335 msgid "" -"Support the \"vsapi\" element type in " -"the :meth:`~tkinter.ttk.Style.element_create` method " -"of :class:`tkinter.ttk.Style`. (Contributed by Serhiy Storchaka " -"in :gh:`68166`.)" +"Support the \"vsapi\" element type in the :meth:`~tkinter.ttk.Style." +"element_create` method of :class:`tkinter.ttk.Style`. (Contributed by Serhiy " +"Storchaka in :gh:`68166`.)" msgstr "" #: ../../whatsnew/3.13.rst:1340 @@ -2036,9 +2033,9 @@ msgstr "traceback" #: ../../whatsnew/3.13.rst:1364 msgid "" -"Add the :attr:`~traceback.TracebackException.exc_type_str` attribute " -"to :class:`~traceback.TracebackException`, which holds a string display of " -"the *exc_type*. Deprecate the :attr:`~traceback.TracebackException.exc_type` " +"Add the :attr:`~traceback.TracebackException.exc_type_str` attribute to :" +"class:`~traceback.TracebackException`, which holds a string display of the " +"*exc_type*. Deprecate the :attr:`~traceback.TracebackException.exc_type` " "attribute, which holds the type object itself. Add parameter *save_exc_type* " "(default ``True``) to indicate whether ``exc_type`` should be saved. " "(Contributed by Irit Katriel in :gh:`112332`.)" @@ -2046,10 +2043,10 @@ msgstr "" #: ../../whatsnew/3.13.rst:1373 msgid "" -"Add a new *show_group* keyword-only parameter " -"to :meth:`.TracebackException.format_exception_only` to (recursively) format " -"the nested exceptions of a :exc:`BaseExceptionGroup` instance. (Contributed " -"by Irit Katriel in :gh:`105292`.)" +"Add a new *show_group* keyword-only parameter to :meth:`.TracebackException." +"format_exception_only` to (recursively) format the nested exceptions of a :" +"exc:`BaseExceptionGroup` instance. (Contributed by Irit Katriel in :gh:" +"`105292`.)" msgstr "" #: ../../whatsnew/3.13.rst:1380 @@ -2060,8 +2057,8 @@ msgstr "types" msgid "" ":class:`~types.SimpleNamespace` can now take a single positional argument to " "initialise the namespace's arguments. This argument must either be a mapping " -"or an iterable of key-value pairs. (Contributed by Serhiy Storchaka " -"in :gh:`108191`.)" +"or an iterable of key-value pairs. (Contributed by Serhiy Storchaka in :gh:" +"`108191`.)" msgstr "" #: ../../whatsnew/3.13.rst:1389 ../../whatsnew/3.13.rst:1769 @@ -2090,14 +2087,14 @@ msgstr "" #: ../../whatsnew/3.13.rst:1401 msgid "" "Add :func:`~typing.get_protocol_members` to return the set of members " -"defining a :class:`typing.Protocol`. (Contributed by Jelle Zijlstra " -"in :gh:`104873`.)" +"defining a :class:`typing.Protocol`. (Contributed by Jelle Zijlstra in :gh:" +"`104873`.)" msgstr "" #: ../../whatsnew/3.13.rst:1405 msgid "" -"Add :func:`~typing.is_protocol` to check whether a class is " -"a :class:`~typing.Protocol`. (Contributed by Jelle Zijlstra in :gh:`104873`.)" +"Add :func:`~typing.is_protocol` to check whether a class is a :class:" +"`~typing.Protocol`. (Contributed by Jelle Zijlstra in :gh:`104873`.)" msgstr "" #: ../../whatsnew/3.13.rst:1409 @@ -2179,9 +2176,9 @@ msgstr "(由 Sebastian Pipping 在 :gh:`115623` 中貢獻。)" #: ../../whatsnew/3.13.rst:1461 msgid "" -"Add the :meth:`!close` method for the iterator returned " -"by :func:`~xml.etree.ElementTree.iterparse` for explicit cleanup. " -"(Contributed by Serhiy Storchaka in :gh:`69893`.)" +"Add the :meth:`!close` method for the iterator returned by :func:`~xml.etree." +"ElementTree.iterparse` for explicit cleanup. (Contributed by Serhiy " +"Storchaka in :gh:`69893`.)" msgstr "" #: ../../whatsnew/3.13.rst:1467 @@ -2202,9 +2199,9 @@ msgstr "最佳化" msgid "" "Several standard library modules have had their import times significantly " "improved. For example, the import time of the :mod:`typing` module has been " -"reduced by around a third by removing dependencies on :mod:`re` " -"and :mod:`contextlib`. Other modules to enjoy import-time speedups " -"include :mod:`email.utils`, :mod:`enum`, :mod:`functools`, :mod:`importlib.metadata`, " +"reduced by around a third by removing dependencies on :mod:`re` and :mod:" +"`contextlib`. Other modules to enjoy import-time speedups include :mod:" +"`email.utils`, :mod:`enum`, :mod:`functools`, :mod:`importlib.metadata`, " "and :mod:`threading`. (Contributed by Alex Waygood, Shantanu Jain, Adam " "Turner, Daniel Hollas, and others in :gh:`109653`.)" msgstr "" @@ -2277,31 +2274,31 @@ msgstr ":mod:`!cgi` 和 :mod:`!cgitb`" #: ../../whatsnew/3.13.rst:1534 msgid "" -":class:`!cgi.FieldStorage` can typically be replaced " -"with :func:`urllib.parse.parse_qsl` for ``GET`` and ``HEAD`` requests, and " -"the :mod:`email.message` module or the :pypi:`multipart` library for " -"``POST`` and ``PUT`` requests." +":class:`!cgi.FieldStorage` can typically be replaced with :func:`urllib." +"parse.parse_qsl` for ``GET`` and ``HEAD`` requests, and the :mod:`email." +"message` module or the :pypi:`multipart` library for ``POST`` and ``PUT`` " +"requests." msgstr "" -":class:`!cgi.FieldStorage`,在於 ``GET`` 和 ``HEAD`` 請求中通常可以" -"被 :func:`urllib.parse.parse_qsl` 取代,而在於 ``POST`` 和 ``PUT`` 請求中可以" -"被 :mod:`email.message` 模組或 :pypi:`multipart` 函式庫取代。" +":class:`!cgi.FieldStorage`,在於 ``GET`` 和 ``HEAD`` 請求中通常可以被 :func:" +"`urllib.parse.parse_qsl` 取代,而在於 ``POST`` 和 ``PUT`` 請求中可以被 :mod:" +"`email.message` 模組或 :pypi:`multipart` 函式庫取代。" #: ../../whatsnew/3.13.rst:1539 msgid "" ":func:`!cgi.parse` can be replaced by calling :func:`urllib.parse.parse_qs` " "directly on the desired query string, unless the input is ``multipart/form-" -"data``, which should be replaced as described below for :func:`!" -"cgi.parse_multipart`." +"data``, which should be replaced as described below for :func:`!cgi." +"parse_multipart`." msgstr "" -":func:`!cgi.parse` 能夠以在所需的查詢字串上直接呼" -"叫 :func:`urllib.parse.parse_qs` 來取代,除非輸入為 ``multipart/form-data``," -"而這種情況則應該如下所述地將 :func:`!cgi.parse_multipart` 給替換掉。" +":func:`!cgi.parse` 能夠以在所需的查詢字串上直接呼叫 :func:`urllib.parse." +"parse_qs` 來取代,除非輸入為 ``multipart/form-data``,而這種情況則應該如下所" +"述地將 :func:`!cgi.parse_multipart` 給替換掉。" #: ../../whatsnew/3.13.rst:1544 msgid "" -":func:`!cgi.parse_header` can be replaced with the functionality in " -"the :mod:`email` package, which implements the same MIME RFCs. For example, " -"with :class:`email.message.EmailMessage`:" +":func:`!cgi.parse_header` can be replaced with the functionality in the :mod:" +"`email` package, which implements the same MIME RFCs. For example, with :" +"class:`email.message.EmailMessage`:" msgstr "" #: ../../whatsnew/3.13.rst:1548 @@ -2320,16 +2317,14 @@ msgstr "" #: ../../whatsnew/3.13.rst:1556 msgid "" -":func:`!cgi.parse_multipart` can be replaced with the functionality in " -"the :mod:`email` package, which implements the same MIME RFCs, or with " -"the :pypi:`multipart` library. For example, " -"the :class:`email.message.EmailMessage` and :class:`email.message.Message` " -"classes." +":func:`!cgi.parse_multipart` can be replaced with the functionality in the :" +"mod:`email` package, which implements the same MIME RFCs, or with the :pypi:" +"`multipart` library. For example, the :class:`email.message.EmailMessage` " +"and :class:`email.message.Message` classes." msgstr "" ":func:`!cgi.parse_multipart` 可以被 :mod:`email` 函式庫中實作相同 MIME RFCs " -"的功能取代,或者可以被 :pypi:`multipart` 函式庫取代,例" -"如 :class:`email.message.EmailMessage` 和 :class:`email.message.Message` 類" -"別。" +"的功能取代,或者可以被 :pypi:`multipart` 函式庫取代,例如 :class:`email." +"message.EmailMessage` 和 :class:`email.message.Message` 類別。" #: ../../whatsnew/3.13.rst:1562 msgid "" @@ -2371,11 +2366,11 @@ msgstr "" #: ../../whatsnew/3.13.rst:1579 msgid "" -":pypi:`crypt_r`: Fork of the :mod:`!crypt` module, wrapper to " -"the :manpage:`crypt_r(3)` library call and associated functionality." +":pypi:`crypt_r`: Fork of the :mod:`!crypt` module, wrapper to the :manpage:" +"`crypt_r(3)` library call and associated functionality." msgstr "" -":pypi:`crypt_r`:對 :mod:`!crypt` 模組的分支 (fork)," -"對 :manpage:`crypt_r(3)` 函式庫呼叫及相關功能的包裝。" +":pypi:`crypt_r`:對 :mod:`!crypt` 模組的分支 (fork),對 :manpage:" +"`crypt_r(3)` 函式庫呼叫及相關功能的包裝。" #: ../../whatsnew/3.13.rst:1583 msgid "" @@ -2440,8 +2435,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:1612 msgid "" -":mod:`!pipes`: Use the :mod:`subprocess` module instead. " -"Use :func:`shlex.quote` to replace the undocumented ``pipes.quote`` function." +":mod:`!pipes`: Use the :mod:`subprocess` module instead. Use :func:`shlex." +"quote` to replace the undocumented ``pipes.quote`` function." msgstr "" ":mod:`!pipes`:請改用 :mod:`subprocess` 模組。使用 :func:`shlex.quote` 來取代" "未以文件紀錄的 ``pipes.quote`` 函式。" @@ -2516,8 +2511,8 @@ msgstr ":pypi:`standard-xdrlib`:PyPI 上的 ``xdrlib`` 函式庫重新發布 #: ../../whatsnew/3.13.rst:1651 msgid "" -"(Contributed by Victor Stinner and Zachary Ware in :gh:`104773` " -"and :gh:`104780`.)" +"(Contributed by Victor Stinner and Zachary Ware in :gh:`104773` and :gh:" +"`104780`.)" msgstr "" "(由 Victor Stinner 和 Zachary Ware 在 :gh:`104773` 和 :gh:`104780` 中貢" "獻。)" @@ -2529,8 +2524,8 @@ msgstr "2to3" #: ../../whatsnew/3.13.rst:1657 msgid "" "Remove the :program:`2to3` program and the :mod:`!lib2to3` module, " -"previously deprecated in Python 3.11. (Contributed by Victor Stinner " -"in :gh:`104780`.)" +"previously deprecated in Python 3.11. (Contributed by Victor Stinner in :gh:" +"`104780`.)" msgstr "" #: ../../whatsnew/3.13.rst:1663 @@ -2539,9 +2534,9 @@ msgstr "builtins" #: ../../whatsnew/3.13.rst:1665 msgid "" -"Remove support for chained :class:`classmethod` descriptors (introduced " -"in :gh:`63272`). These can no longer be used to wrap other descriptors, such " -"as :class:`property`. The core design of this feature was flawed and led to " +"Remove support for chained :class:`classmethod` descriptors (introduced in :" +"gh:`63272`). These can no longer be used to wrap other descriptors, such as :" +"class:`property`. The core design of this feature was flawed and led to " "several problems. To \"pass-through\" a :class:`classmethod`, consider using " "the :attr:`!__wrapped__` attribute that was added in Python 3.10. " "(Contributed by Raymond Hettinger in :gh:`89519`.)" @@ -2567,9 +2562,9 @@ msgstr "importlib.metadata" #: ../../whatsnew/3.13.rst:1691 msgid "" -"Remove deprecated subscript (:meth:`~object.__getitem__`) access " -"for :ref:`EntryPoint ` objects. (Contributed by Jason R. " -"Coombs in :gh:`113175`.)" +"Remove deprecated subscript (:meth:`~object.__getitem__`) access for :ref:" +"`EntryPoint ` objects. (Contributed by Jason R. Coombs in :gh:" +"`113175`.)" msgstr "" #: ../../whatsnew/3.13.rst:1697 @@ -2589,19 +2584,18 @@ msgstr "opcode" #: ../../whatsnew/3.13.rst:1707 msgid "" -"Move :attr:`!opcode.ENABLE_SPECIALIZATION` to :attr:`!" -"_opcode.ENABLE_SPECIALIZATION`. This field was added in 3.12, it was never " +"Move :attr:`!opcode.ENABLE_SPECIALIZATION` to :attr:`!_opcode." +"ENABLE_SPECIALIZATION`. This field was added in 3.12, it was never " "documented, and is not intended for external use. (Contributed by Irit " "Katriel in :gh:`105481`.)" msgstr "" #: ../../whatsnew/3.13.rst:1712 msgid "" -"Remove :func:`!opcode.is_pseudo`, :attr:`!opcode.MIN_PSEUDO_OPCODE`, " -"and :attr:`!opcode.MAX_PSEUDO_OPCODE`, which were added in Python 3.12, but " -"were neither documented nor exposed through :mod:`dis`, and were not " -"intended to be used externally. (Contributed by Irit Katriel " -"in :gh:`105481`.)" +"Remove :func:`!opcode.is_pseudo`, :attr:`!opcode.MIN_PSEUDO_OPCODE`, and :" +"attr:`!opcode.MAX_PSEUDO_OPCODE`, which were added in Python 3.12, but were " +"neither documented nor exposed through :mod:`dis`, and were not intended to " +"be used externally. (Contributed by Irit Katriel in :gh:`105481`.)" msgstr "" #: ../../whatsnew/3.13.rst:1720 @@ -2610,12 +2604,12 @@ msgstr "optparse" #: ../../whatsnew/3.13.rst:1722 msgid "" -"This module is no longer considered :term:`soft deprecated`. " -"While :mod:`argparse` remains preferred for new projects that aren't using a " -"third party command line argument processing library, there are aspects of " -"the way ``argparse`` works that mean the lower level ``optparse`` module may " -"provide a better foundation for *writing* argument processing libraries, and " -"for implementing command line applications which adhere more strictly than " +"This module is no longer considered :term:`soft deprecated`. While :mod:" +"`argparse` remains preferred for new projects that aren't using a third " +"party command line argument processing library, there are aspects of the way " +"``argparse`` works that mean the lower level ``optparse`` module may provide " +"a better foundation for *writing* argument processing libraries, and for " +"implementing command line applications which adhere more strictly than " "``argparse`` does to various Unix command line processing conventions that " "originate in the behaviour of the C :c:func:`!getopt` function . " "(Contributed by Alyssa Coghlan and Serhiy Storchaka in :gh:`126180`.)" @@ -2661,15 +2655,15 @@ msgstr "" msgid "" "Remove the :mod:`!typing.io` and :mod:`!typing.re` namespaces, deprecated " "since Python 3.8. The items in those namespaces can be imported directly " -"from the :mod:`typing` module. (Contributed by Sebastian Rittau " -"in :gh:`92871`.)" +"from the :mod:`typing` module. (Contributed by Sebastian Rittau in :gh:" +"`92871`.)" msgstr "" #: ../../whatsnew/3.13.rst:1777 msgid "" "Remove the keyword-argument method of creating :class:`~typing.TypedDict` " -"types, deprecated in Python 3.11. (Contributed by Tomas Roun " -"in :gh:`104786`.)" +"types, deprecated in Python 3.11. (Contributed by Tomas Roun in :gh:" +"`104786`.)" msgstr "" #: ../../whatsnew/3.13.rst:1783 @@ -2716,8 +2710,8 @@ msgstr "(由 Hugo van Kemenade 在 :gh:`104835` 中貢獻。)" #: ../../whatsnew/3.13.rst:1799 msgid "" "Remove the untested and undocumented :meth:`!TestProgram.usageExit` method, " -"deprecated in Python 3.11. (Contributed by Hugo van Kemenade " -"in :gh:`104992`.)" +"deprecated in Python 3.11. (Contributed by Hugo van Kemenade in :gh:" +"`104992`.)" msgstr "" #: ../../whatsnew/3.13.rst:1805 @@ -2726,13 +2720,13 @@ msgstr "urllib" #: ../../whatsnew/3.13.rst:1807 msgid "" -"Remove the *cafile*, *capath*, and *cadefault* parameters of " -"the :func:`urllib.request.urlopen` function, deprecated in Python 3.6. Use " -"the *context* parameter instead with an :class:`~ssl.SSLContext` instance. " -"The :meth:`ssl.SSLContext.load_cert_chain` function can be used to load " -"specific certificates, or let :func:`ssl.create_default_context` select the " -"operating system's trusted certificate authority (CA) certificates. " -"(Contributed by Victor Stinner in :gh:`105382`.)" +"Remove the *cafile*, *capath*, and *cadefault* parameters of the :func:" +"`urllib.request.urlopen` function, deprecated in Python 3.6. Use the " +"*context* parameter instead with an :class:`~ssl.SSLContext` instance. The :" +"meth:`ssl.SSLContext.load_cert_chain` function can be used to load specific " +"certificates, or let :func:`ssl.create_default_context` select the operating " +"system's trusted certificate authority (CA) certificates. (Contributed by " +"Victor Stinner in :gh:`105382`.)" msgstr "" #: ../../whatsnew/3.13.rst:1818 @@ -2748,9 +2742,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:1825 msgid "" -"Remove the deprecated :attr:`!MacOSXOSAScript._name` attribute. Use " -"the :attr:`MacOSXOSAScript.name ` attribute " -"instead. (Contributed by Nikita Sobolev in :gh:`105546`.)" +"Remove the deprecated :attr:`!MacOSXOSAScript._name` attribute. Use the :" +"attr:`MacOSXOSAScript.name ` attribute instead. " +"(Contributed by Nikita Sobolev in :gh:`105546`.)" msgstr "" #: ../../whatsnew/3.13.rst:1832 @@ -2779,8 +2773,8 @@ msgid "" "Deprecate the ``'u'`` format code (:c:type:`wchar_t`) at runtime. This " "format code has been deprecated in documentation since Python 3.3, and will " "be removed in Python 3.16. Use the ``'w'`` format code (:c:type:`Py_UCS4`) " -"for Unicode characters instead. (Contributed by Hugo van Kemenade " -"in :gh:`80480`.)" +"for Unicode characters instead. (Contributed by Hugo van Kemenade in :gh:" +"`80480`.)" msgstr "" #: ../../whatsnew/3.13.rst:1851 @@ -2818,9 +2812,8 @@ msgstr ":mod:`dis`:" #: ../../whatsnew/3.13.rst:1870 msgid "" -"Deprecate the :attr:`!HAVE_ARGUMENT` separator. Check membership " -"in :data:`~dis.hasarg` instead. (Contributed by Irit Katriel " -"in :gh:`109319`.)" +"Deprecate the :attr:`!HAVE_ARGUMENT` separator. Check membership in :data:" +"`~dis.hasarg` instead. (Contributed by Irit Katriel in :gh:`109319`.)" msgstr "" #: ../../whatsnew/3.13.rst:1874 @@ -2840,10 +2833,10 @@ msgstr ":mod:`glob`:" #: ../../whatsnew/3.13.rst:1883 msgid "" -"Deprecate the undocumented :func:`!glob0` and :func:`!glob1` functions. " -"Use :func:`~glob.glob` and pass a :term:`path-like object` specifying the " -"root directory to the *root_dir* parameter instead. (Contributed by Barney " -"Gale in :gh:`117337`.)" +"Deprecate the undocumented :func:`!glob0` and :func:`!glob1` functions. Use :" +"func:`~glob.glob` and pass a :term:`path-like object` specifying the root " +"directory to the *root_dir* parameter instead. (Contributed by Barney Gale " +"in :gh:`117337`.)" msgstr "" #: ../../whatsnew/3.13.rst:1888 @@ -2874,9 +2867,9 @@ msgstr ":mod:`mimetypes`:" #: ../../whatsnew/3.13.rst:1904 msgid "" -":term:`Soft-deprecate ` file path arguments " -"to :func:`~mimetypes.guess_type`, use :func:`~mimetypes.guess_file_type` " -"instead. (Contributed by Serhiy Storchaka in :gh:`66543`.)" +":term:`Soft-deprecate ` file path arguments to :func:" +"`~mimetypes.guess_type`, use :func:`~mimetypes.guess_file_type` instead. " +"(Contributed by Serhiy Storchaka in :gh:`66543`.)" msgstr "" #: ../../whatsnew/3.13.rst:1909 @@ -2899,9 +2892,9 @@ msgstr ":mod:`pathlib`:" #: ../../whatsnew/3.13.rst:1920 msgid "" -"Deprecate :meth:`.PurePath.is_reserved`, to be removed in Python 3.15. " -"Use :func:`os.path.isreserved` to detect reserved paths on Windows. " -"(Contributed by Barney Gale in :gh:`88569`.)" +"Deprecate :meth:`.PurePath.is_reserved`, to be removed in Python 3.15. Use :" +"func:`os.path.isreserved` to detect reserved paths on Windows. (Contributed " +"by Barney Gale in :gh:`88569`.)" msgstr "" #: ../../whatsnew/3.13.rst:1925 @@ -2927,34 +2920,34 @@ msgid "" msgstr "" #: ../../whatsnew/3.13.rst:1938 -#: ../../deprecations/pending-removal-in-3.14.rst:91 +#: ../../deprecations/pending-removal-in-3.14.rst:85 msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" #: ../../whatsnew/3.13.rst:1940 msgid "" -"Deprecate passing more than one positional argument to " -"the :func:`~sqlite3.connect` function and the :class:`~sqlite3.Connection` " -"constructor. The remaining parameters will become keyword-only in Python " -"3.15. (Contributed by Erlend E. Aasland in :gh:`107948`.)" +"Deprecate passing more than one positional argument to the :func:`~sqlite3." +"connect` function and the :class:`~sqlite3.Connection` constructor. The " +"remaining parameters will become keyword-only in Python 3.15. (Contributed " +"by Erlend E. Aasland in :gh:`107948`.)" msgstr "" #: ../../whatsnew/3.13.rst:1946 msgid "" "Deprecate passing name, number of arguments, and the callable as keyword " -"arguments for :meth:`.Connection.create_function` " -"and :meth:`.Connection.create_aggregate` These parameters will become " -"positional-only in Python 3.15. (Contributed by Erlend E. Aasland " -"in :gh:`108278`.)" +"arguments for :meth:`.Connection.create_function` and :meth:`.Connection." +"create_aggregate` These parameters will become positional-only in Python " +"3.15. (Contributed by Erlend E. Aasland in :gh:`108278`.)" msgstr "" #: ../../whatsnew/3.13.rst:1952 msgid "" -"Deprecate passing the callback callable by keyword for " -"the :meth:`~sqlite3.Connection.set_authorizer`, :meth:`~sqlite3.Connection.set_progress_handler`, " -"and :meth:`~sqlite3.Connection.set_trace_callback` :class:`~sqlite3.Connection` " -"methods. The callback callables will become positional-only in Python 3.15. " -"(Contributed by Erlend E. Aasland in :gh:`108278`.)" +"Deprecate passing the callback callable by keyword for the :meth:`~sqlite3." +"Connection.set_authorizer`, :meth:`~sqlite3.Connection." +"set_progress_handler`, and :meth:`~sqlite3.Connection.set_trace_callback` :" +"class:`~sqlite3.Connection` methods. The callback callables will become " +"positional-only in Python 3.15. (Contributed by Erlend E. Aasland in :gh:" +"`108278`.)" msgstr "" #: ../../whatsnew/3.13.rst:1960 @@ -2986,9 +2979,9 @@ msgstr ":mod:`traceback`:" #: ../../whatsnew/3.13.rst:1975 msgid "" -"Deprecate the :attr:`.TracebackException.exc_type` attribute. " -"Use :attr:`.TracebackException.exc_type_str` instead. (Contributed by Irit " -"Katriel in :gh:`112332`.)" +"Deprecate the :attr:`.TracebackException.exc_type` attribute. Use :attr:`." +"TracebackException.exc_type_str` instead. (Contributed by Irit Katriel in :" +"gh:`112332`.)" msgstr "" #: ../../whatsnew/3.13.rst:1979 @@ -2999,23 +2992,22 @@ msgstr ":mod:`typing`:" #: ../../whatsnew/3.13.rst:1981 msgid "" -"Deprecate the undocumented keyword argument syntax for " -"creating :class:`~typing.NamedTuple` classes (e.g. ``Point = " -"NamedTuple(\"Point\", x=int, y=int)``), to be removed in Python 3.15. Use " -"the class-based syntax or the functional syntax instead. (Contributed by " -"Alex Waygood in :gh:`105566`.)" +"Deprecate the undocumented keyword argument syntax for creating :class:" +"`~typing.NamedTuple` classes (e.g. ``Point = NamedTuple(\"Point\", x=int, " +"y=int)``), to be removed in Python 3.15. Use the class-based syntax or the " +"functional syntax instead. (Contributed by Alex Waygood in :gh:`105566`.)" msgstr "" #: ../../whatsnew/3.13.rst:1988 msgid "" -"Deprecate omitting the *fields* parameter when creating " -"a :class:`~typing.NamedTuple` or :class:`typing.TypedDict` class, and " -"deprecate passing ``None`` to the *fields* parameter of both types. Python " -"3.15 will require a valid sequence for the *fields* parameter. To create a " -"NamedTuple class with zero fields, use ``class NT(NamedTuple): pass`` or " -"``NT = NamedTuple(\"NT\", ())``. To create a TypedDict class with zero " -"fields, use ``class TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})``. " -"(Contributed by Alex Waygood in :gh:`105566` and :gh:`105570`.)" +"Deprecate omitting the *fields* parameter when creating a :class:`~typing." +"NamedTuple` or :class:`typing.TypedDict` class, and deprecate passing " +"``None`` to the *fields* parameter of both types. Python 3.15 will require a " +"valid sequence for the *fields* parameter. To create a NamedTuple class with " +"zero fields, use ``class NT(NamedTuple): pass`` or ``NT = NamedTuple(\"NT\", " +"())``. To create a TypedDict class with zero fields, use ``class " +"TD(TypedDict): pass`` or ``TD = TypedDict(\"TD\", {})``. (Contributed by " +"Alex Waygood in :gh:`105566` and :gh:`105570`.)" msgstr "" #: ../../whatsnew/3.13.rst:1998 @@ -3045,10 +3037,10 @@ msgstr ":mod:`wave`:" #: ../../whatsnew/3.13.rst:2014 msgid "" -"Deprecate the :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, " -"and :meth:`~wave.Wave_read.getmarkers` methods of " -"the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes, to be " -"removed in Python 3.15. (Contributed by Victor Stinner in :gh:`105096`.)" +"Deprecate the :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:" +"`~wave.Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :" +"class:`~wave.Wave_write` classes, to be removed in Python 3.15. (Contributed " +"by Victor Stinner in :gh:`105096`.)" msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:2 @@ -3097,8 +3089,8 @@ msgstr ":class:`!ast.Ellipsis`" #: ../../deprecations/pending-removal-in-3.14.rst:19 msgid "" -"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka " -"in :gh:`90953`.)" +"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" +"`90953`.)" msgstr "" "請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 於 :gh:`90953` 貢獻。)" @@ -3110,28 +3102,26 @@ msgstr ":mod:`asyncio`:" #: ../../deprecations/pending-removal-in-3.14.rst:24 msgid "" "The child watcher classes :class:`!asyncio.MultiLoopChildWatcher`, :class:`!" -"asyncio.FastChildWatcher`, :class:`!asyncio.AbstractChildWatcher` " -"and :class:`!asyncio.SafeChildWatcher` are deprecated and will be removed in " -"Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" +"asyncio.FastChildWatcher`, :class:`!asyncio.AbstractChildWatcher` and :class:" +"`!asyncio.SafeChildWatcher` are deprecated and will be removed in Python " +"3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -"已棄用並將在 Python 3.14 中移除的 child watcher 類別::class:`!" -"asyncio.MultiLoopChildWatcher`、:class:`!asyncio.FastChildWatcher`、:class:`!" -"asyncio.AbstractChildWatcher` 和 :class:`!asyncio.SafeChildWatcher`。 (由 " -"Kumar Aditya 於 :gh:`94597` 貢獻。)" +"已棄用並將在 Python 3.14 中移除的 child watcher 類別::class:`!asyncio." +"MultiLoopChildWatcher`、:class:`!asyncio.FastChildWatcher`、:class:`!asyncio." +"AbstractChildWatcher` 和 :class:`!asyncio.SafeChildWatcher`。 (由 Kumar " +"Aditya 於 :gh:`94597` 貢獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:30 msgid "" -":func:`!asyncio.set_child_watcher`, :func:`!" -"asyncio.get_child_watcher`, :meth:`!" -"asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`!" +":func:`!asyncio.set_child_watcher`, :func:`!asyncio.get_child_watcher`, :" +"meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`!" "asyncio.AbstractEventLoopPolicy.get_child_watcher` are deprecated and will " "be removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" -":func:`!asyncio.set_child_watcher`、:func:`!" -"asyncio.get_child_watcher`、:meth:`!" -"asyncio.AbstractEventLoopPolicy.set_child_watcher` 和 :meth:`!" -"asyncio.AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python " -"3.14 中移除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" +":func:`!asyncio.set_child_watcher`、:func:`!asyncio.get_child_watcher`、:" +"meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher` 和 :meth:`!asyncio." +"AbstractEventLoopPolicy.get_child_watcher` 已被棄用並將在 Python 3.14 中移" +"除。(由 Kumar Aditya 於 :gh:`94597` 貢獻。)" #: ../../deprecations/pending-removal-in-3.14.rst:36 msgid "" @@ -3146,60 +3136,45 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.14.rst:41 msgid "" -":mod:`collections.abc`: Deprecated :class:`!collections.abc.ByteString`. " -"Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " -"typing, prefer a union, like ``bytes | bytearray``, " -"or :class:`collections.abc.Buffer`. (Contributed by Shantanu Jain " -"in :gh:`91896`.)" -msgstr "" -":mod:`collections.abc`:已棄用 :class:`!collections.abc.ByteString`。請改" -"用 :class:`!Sequence` 或 :class:`~collections.abc.Buffer`。在 typing 中使用" -"時,請改用聯集,如 ``bytes | bytearray``," -"或 :class:`collections.abc.Buffer`。(由 Shantanu Jain 於 :gh:`91896` 貢" -"獻。)" - -#: ../../deprecations/pending-removal-in-3.14.rst:47 -msgid "" -":mod:`email`: Deprecated the *isdst* parameter " -"in :func:`email.utils.localtime`. (Contributed by Alan Williams " -"in :gh:`72346`.)" +":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." +"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" ":mod:`email`:已棄用 :func:`email.utils.localtime` 中的 *isdst* 參數。(由 " "Alan Williams 於 :gh:`72346` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:50 +#: ../../deprecations/pending-removal-in-3.14.rst:44 msgid ":mod:`importlib.abc` deprecated classes:" msgstr ":mod:`importlib.abc` 的已棄用類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:52 +#: ../../deprecations/pending-removal-in-3.14.rst:46 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../deprecations/pending-removal-in-3.14.rst:53 +#: ../../deprecations/pending-removal-in-3.14.rst:47 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:54 +#: ../../deprecations/pending-removal-in-3.14.rst:48 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:56 +#: ../../deprecations/pending-removal-in-3.14.rst:50 msgid "Use :mod:`importlib.resources.abc` classes instead:" msgstr "請改用 :mod:`importlib.resources.abc` 類別:" -#: ../../deprecations/pending-removal-in-3.14.rst:58 +#: ../../deprecations/pending-removal-in-3.14.rst:52 msgid ":class:`importlib.resources.abc.Traversable`" msgstr ":class:`importlib.resources.abc.Traversable`" -#: ../../deprecations/pending-removal-in-3.14.rst:59 +#: ../../deprecations/pending-removal-in-3.14.rst:53 msgid ":class:`importlib.resources.abc.TraversableResources`" msgstr ":class:`importlib.resources.abc.TraversableResources`" -#: ../../deprecations/pending-removal-in-3.14.rst:61 +#: ../../deprecations/pending-removal-in-3.14.rst:55 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" -#: ../../deprecations/pending-removal-in-3.14.rst:63 +#: ../../deprecations/pending-removal-in-3.14.rst:57 msgid "" ":mod:`itertools` had undocumented, inefficient, historically buggy, and " "inconsistent support for copy, deepcopy, and pickle operations. This will be " @@ -3210,82 +3185,72 @@ msgstr "" "deepcopy 和 pickle 操作支援。將在 3.14 中移除以大幅減少程式碼量和維護負擔。 " "(由 Raymond Hettinger 於 :gh:`101588` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:69 +#: ../../deprecations/pending-removal-in-3.14.rst:63 msgid "" ":mod:`multiprocessing`: The default start method will change to a safer one " "on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " "currently the default (:gh:`84559`). Adding a runtime warning about this was " "deemed too disruptive as the majority of code is not expected to care. Use " -"the :func:`~multiprocessing.get_context` " -"or :func:`~multiprocessing.set_start_method` APIs to explicitly specify when " -"your code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." +"the :func:`~multiprocessing.get_context` or :func:`~multiprocessing." +"set_start_method` APIs to explicitly specify when your code *requires* " +"``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" ":mod:`multiprocessing`:預設的啟動方法將在 Linux、BSD 和其他非 macOS POSIX 平" "台上更改為更安全的 方法,目前 ``'fork'`` 是預設值 (:gh:`84559`)。對此增加一" -"個 runtime 警告被認為太過擾人,因為 大多數程式碼不會在意。請使" -"用 :func:`~multiprocessing.get_context` " -"或 :func:`~multiprocessing.set_start_method` API 來明確指定你的程式碼何時\\ *" -"需要* ``'fork'``。請參閱 :ref:`multiprocessing-start-methods`。" +"個 runtime 警告被認為太過擾人,因為 大多數程式碼不會在意。請使用 :func:" +"`~multiprocessing.get_context` 或 :func:`~multiprocessing.set_start_method` " +"API 來明確指定你的程式碼何時\\ *需要* ``'fork'``。請參閱 :ref:" +"`multiprocessing-start-methods`。" -#: ../../deprecations/pending-removal-in-3.14.rst:77 +#: ../../deprecations/pending-removal-in-3.14.rst:71 msgid "" -":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` " -"and :meth:`~pathlib.PurePath.relative_to`: passing additional arguments is " -"deprecated." +":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." +"PurePath.relative_to`: passing additional arguments is deprecated." msgstr "" -":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` " -"和 :meth:`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" +":mod:`pathlib`:已棄用 :meth:`~pathlib.PurePath.is_relative_to` 和 :meth:" +"`~pathlib.PurePath.relative_to`:額外引數的傳遞已被棄用。" -#: ../../deprecations/pending-removal-in-3.14.rst:81 +#: ../../deprecations/pending-removal-in-3.14.rst:75 msgid "" ":mod:`pkgutil`: :func:`!pkgutil.find_loader` and :func:`!pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" ":mod:`pkgutil`::func:`!pkgutil.find_loader` 和 :func:`!pkgutil.get_loader` " -"現在會引發 :exc:`DeprecationWarning`;請改" -"用 :func:`importlib.util.find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢" -"獻。)" +"現在會引發 :exc:`DeprecationWarning`;請改用 :func:`importlib.util." +"find_spec`。 (由 Nikita Sobolev 於 :gh:`97850` 貢獻。)" -#: ../../deprecations/pending-removal-in-3.14.rst:86 +#: ../../deprecations/pending-removal-in-3.14.rst:80 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../deprecations/pending-removal-in-3.14.rst:88 +#: ../../deprecations/pending-removal-in-3.14.rst:82 msgid "``master_open()``: use :func:`pty.openpty`." msgstr "``master_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:89 +#: ../../deprecations/pending-removal-in-3.14.rst:83 msgid "``slave_open()``: use :func:`pty.openpty`." msgstr "``slave_open()``:請用 :func:`pty.openpty`。" -#: ../../deprecations/pending-removal-in-3.14.rst:93 +#: ../../deprecations/pending-removal-in-3.14.rst:87 msgid ":data:`!version` and :data:`!version_info`." msgstr ":data:`!version` 和 :data:`!version_info`。" -#: ../../deprecations/pending-removal-in-3.14.rst:95 +#: ../../deprecations/pending-removal-in-3.14.rst:89 msgid "" -":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` " -"if :ref:`named placeholders ` are used and " -"*parameters* is a sequence instead of a :class:`dict`." +":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" +"ref:`named placeholders ` are used and *parameters* is " +"a sequence instead of a :class:`dict`." msgstr "" ":meth:`~sqlite3.Cursor.execute` 和 :meth:`~sqlite3.Cursor.executemany`,如果" "使用 :ref:`named placeholders ` 且 *parameters* 是序列" "而不是 :class:`dict`。" -#: ../../deprecations/pending-removal-in-3.14.rst:99 -msgid "" -":mod:`typing`: :class:`!typing.ByteString`, deprecated since Python 3.9, now " -"causes a :exc:`DeprecationWarning` to be emitted when it is used." -msgstr "" -":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`!typing.ByteString` 現在在" -"使用時會發出 :exc:`DeprecationWarning`。" - -#: ../../deprecations/pending-removal-in-3.14.rst:102 +#: ../../deprecations/pending-removal-in-3.14.rst:93 msgid "" ":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " -"intended to be a public API. (Contributed by Gregory P. Smith " -"in :gh:`88168`.)" +"intended to be a public API. (Contributed by Gregory P. Smith in :gh:" +"`88168`.)" msgstr "" ":mod:`urllib`::class:`!urllib.parse.Quoter` 已被棄用:它並非預期的公開 API。" "(由 Gregory P. Smith 於 :gh:`88168` 貢獻。)" @@ -3302,10 +3267,10 @@ msgstr "引入系統 (import system):" #: ../../deprecations/pending-removal-in-3.15.rst:6 msgid "" -"Setting :attr:`~module.__cached__` on a module while failing to " -"set :attr:`__spec__.cached ` is " -"deprecated. In Python 3.15, :attr:`!__cached__` will cease to be set or take " -"into consideration by the import system or standard library. (:gh:`97879`)" +"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" +"`__spec__.cached ` is deprecated. In " +"Python 3.15, :attr:`!__cached__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" msgstr "" "在模組上設定 :attr:`~module.__cached__` 而沒有設定 :attr:`__spec__.cached " "` 的做法已被棄用。在 Python 3.15 中," @@ -3313,11 +3278,10 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:11 msgid "" -"Setting :attr:`~module.__package__` on a module while failing to " -"set :attr:`__spec__.parent ` is " -"deprecated. In Python 3.15, :attr:`!__package__` will cease to be set or " -"take into consideration by the import system or standard library. " -"(:gh:`97879`)" +"Setting :attr:`~module.__package__` on a module while failing to set :attr:" +"`__spec__.parent ` is deprecated. In " +"Python 3.15, :attr:`!__package__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" msgstr "" "在模組上設定 :attr:`~module.__package__` 而沒有設定 :attr:`__spec__.parent " "` 的做法已被棄用。在 Python 3.15 中," @@ -3364,25 +3328,23 @@ 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`.)" +"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` 貢" -"獻。)" +"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:48 msgid "" -":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. " -"Use :func:`os.path.isreserved` to detect reserved paths on Windows." +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" +"func:`os.path.isreserved` to detect reserved paths on Windows." msgstr "" -":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請" -"用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" +":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請用 :func:`os.path." +"isreserved` 來偵測 Windows 上的保留路徑。" #: ../../deprecations/pending-removal-in-3.15.rst:54 msgid "" @@ -3433,16 +3395,16 @@ msgid "" "in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" ":class:`types.CodeType`:自 3.10 起,存取 :attr:`~codeobject.co_lnotab` 已" -"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發" -"出 :exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev " -"於 :gh:`101866` 貢獻。)" +"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發出 :" +"exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev 於 :gh:" +"`101866` 貢獻。)" #: ../../deprecations/pending-removal-in-3.15.rst:82 msgid "" -"The undocumented keyword argument syntax for " -"creating :class:`~typing.NamedTuple` classes (for example, ``Point = " -"NamedTuple(\"Point\", x=int, y=int)``) has been deprecated since Python " -"3.13. Use the class-based syntax or the functional syntax instead." +"The undocumented keyword argument syntax for creating :class:`~typing." +"NamedTuple` classes (for example, ``Point = NamedTuple(\"Point\", x=int, " +"y=int)``) has been deprecated since Python 3.13. Use the class-based syntax " +"or the functional syntax instead." msgstr "" "用於建立 :class:`~typing.NamedTuple` 類別的未以文件記錄之關鍵字引數語法 " "(``Point = NamedTuple(\"Point\", x=int, y=int)``) 已自 Python 3.13 棄用。請改" @@ -3473,14 +3435,13 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:102 msgid "" -"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, " -"and :meth:`~wave.Wave_read.getmarkers` methods of " -"the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes have been " -"deprecated since Python 3.13." +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." +"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" +"`~wave.Wave_write` classes have been deprecated since Python 3.13." msgstr "" -"已棄用 :class:`~wave.Wave_read` 和 :class:`~wave.Wave_write` 類別" -"的 :meth:`~wave.Wave_read.getmark`、:meth:`!setmark` " -"和 :meth:`~wave.Wave_read.getmarkers` 方法自 Python 3.13 被棄用。" +"已棄用 :class:`~wave.Wave_read` 和 :class:`~wave.Wave_write` 類別的 :meth:" +"`~wave.Wave_read.getmark`、:meth:`!setmark` 和 :meth:`~wave.Wave_read." +"getmarkers` 方法自 Python 3.13 被棄用。" #: ../../deprecations/pending-removal-in-3.15.rst:107 msgid ":mod:`zipimport`:" @@ -3492,9 +3453,9 @@ msgid "" "3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead. (Contributed " "by Jiahao Li in :gh:`125746`.)" msgstr "" -":meth:`~zipimport.zipimporter.load_module` 自 Python 3.10 被棄用。請改" -"用 :meth:`~zipimport.zipimporter.exec_module`。(由 Jiahao Li " -"於 :gh:`125746` 貢獻。)" +":meth:`~zipimport.zipimporter.load_module` 自 Python 3.10 被棄用。請改用 :" +"meth:`~zipimport.zipimporter.exec_module`。(由 Jiahao Li 於 :gh:`125746` 貢" +"獻。)" #: ../../deprecations/c-api-pending-removal-in-3.16.rst:2 #: ../../deprecations/pending-removal-in-3.16.rst:2 @@ -3503,10 +3464,10 @@ msgstr "Python 3.16 中待移除的項目" #: ../../deprecations/pending-removal-in-3.16.rst:6 msgid "" -"Setting :attr:`~module.__loader__` on a module while failing to " -"set :attr:`__spec__.loader ` is " -"deprecated. In Python 3.16, :attr:`!__loader__` will cease to be set or " -"taken into consideration by the import system or the standard library." +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.16, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." msgstr "" "在模組上設定 :attr:`~module.__loader__` 而沒有設定 :attr:`__spec__.loader " "` 的做法將於 Python 3.16 被棄用。在 " @@ -3529,8 +3490,8 @@ msgid "" "by Jiahao Li and Kumar Aditya in :gh:`122875`.)" msgstr "" ":func:`!asyncio.iscoroutinefunction` 已被棄用並將在 Python 3.16 中移除;請改" -"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya " -"於 :gh:`122875` 貢獻。)" +"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya 於 :" +"gh:`122875` 貢獻。)" #: ../../deprecations/pending-removal-in-3.16.rst:26 msgid "" @@ -3624,8 +3585,8 @@ msgid "" "*function* or *sequence* as keyword arguments has been deprecated since " "Python 3.14." msgstr "" -"自 Python 3.14 起,使用 *function* 或 *sequence* 關鍵字引數呼" -"叫 :func:`functools.reduce` 的 Python 實作已被棄用。" +"自 Python 3.14 起,使用 *function* 或 *sequence* 關鍵字引數呼叫 :func:" +"`functools.reduce` 的 Python 實作已被棄用。" #: ../../deprecations/pending-removal-in-3.16.rst:64 msgid ":mod:`logging`:" @@ -3642,10 +3603,10 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.16.rst:72 msgid "" -"Valid extensions start with a '.' or are empty " -"for :meth:`mimetypes.MimeTypes.add_type`. Undotted extensions are deprecated " -"and will raise a :exc:`ValueError` in Python 3.16. (Contributed by Hugo van " -"Kemenade in :gh:`75223`.)" +"Valid extensions start with a '.' or are empty for :meth:`mimetypes." +"MimeTypes.add_type`. Undotted extensions are deprecated and will raise a :" +"exc:`ValueError` in Python 3.16. (Contributed by Hugo van Kemenade in :gh:" +"`75223`.)" msgstr "" "有效的副檔名以 '.' 開頭或對 :meth:`mimetypes.MimeTypes.add_type` 為空字串。未" "加點的副檔名已被棄用,並將在 Python 3.16 中引發 :exc:`ValueError`。(由 Hugo " @@ -3720,6 +3681,36 @@ msgstr "" "除。使用者應該改用文件中記錄的內省輔助函式,例如 :func:`typing.get_origin` " "和 :func:`typing.get_args`,或者依賴私有實作細節。" +#: ../../deprecations/pending-removal-in-3.17.rst:11 +msgid "" +":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " +"removal in Python 3.17. Prefer :class:`~collections.abc.Sequence` or :class:" +"`~collections.abc.Buffer`. For use in type annotations, prefer a union, like " +"``bytes | bytearray``, or :class:`collections.abc.Buffer`. (Contributed by " +"Shantanu Jain in :gh:`91896`.)" +msgstr "" +"自 Python 3.9 起已被棄用的 :class:`typing.ByteString`,計劃在 Python " +"3.17 中移除。建議改用 :class:`~collections.abc.Sequence` 或 :class:`~" +"collections.abc.Buffer`。在型別註釋中建議改用聯集,例如 ``bytes | " +"bytearray`` 或 :class:`collections.abc.Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" + +#: ../../deprecations/pending-removal-in-3.17.rst:17 +msgid ":mod:`collections.abc`:" +msgstr ":mod:`collections.abc`:" + +#: ../../deprecations/pending-removal-in-3.17.rst:19 +msgid "" +":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17. " +"Prefer :class:`~collections.abc.Sequence` or :class:`~collections.abc." +"Buffer`. For use in type annotations, prefer a union, like ``bytes | " +"bytearray``, or :class:`collections.abc.Buffer`. (Contributed by Shantanu " +"Jain in :gh:`91896`.)" +msgstr "" +":class:`collections.abc.ByteString` 計劃在 Python 3.17 中移除。建議改用 " +":class:`~collections.abc.Sequence` 或 :class:`~collections.abc.Buffer`。在" +"型別註釋中建議改用聯集,例如 ``bytes | bytearray`` 或 :class:`collections.abc." +"Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" + #: ../../deprecations/c-api-pending-removal-in-future.rst:2 #: ../../deprecations/pending-removal-in-future.rst:2 msgid "Pending removal in future versions" @@ -3742,11 +3733,11 @@ msgstr "巢狀引數群組和巢狀互斥群組已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:11 msgid "" -"Passing the undocumented keyword argument *prefix_chars* " -"to :meth:`~argparse.ArgumentParser.add_argument_group` is now deprecated." +"Passing the undocumented keyword argument *prefix_chars* to :meth:`~argparse." +"ArgumentParser.add_argument_group` is now deprecated." msgstr "" -"將未以文件記錄的關鍵字引數 *prefix_chars* 傳遞" -"給 :meth:`~argparse.ArgumentParser.add_argument_group` 的做法現在已被棄用。" +"將未以文件記錄的關鍵字引數 *prefix_chars* 傳遞給 :meth:`~argparse." +"ArgumentParser.add_argument_group` 的做法現在已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:14 msgid "The :class:`argparse.FileType` type converter is deprecated." @@ -3771,17 +3762,17 @@ msgid "" "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " "ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " "``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised " -"if the numeric literal is immediately followed by one of " -"keywords :keyword:`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :keyword:`is` " -"and :keyword:`or`. In a future release it will be changed to a syntax " -"error. (:gh:`87999`)" +"if the numeric literal is immediately followed by one of keywords :keyword:" +"`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :" +"keyword:`is` and :keyword:`or`. In a future release it will be changed to a " +"syntax error. (:gh:`87999`)" msgstr "" "目前 Python 接受數值字面值後面立即接關鍵字,例如 ``0in x``、``1or x``、``0if " "1else 2``。它讓表達式模糊且容易混淆,如 ``[0x1for x in y]``\\ (可以解釋為 " -"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即" -"接 :keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:`in`、:keyword:`is` " -"和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版本中,它將被更改為語" -"法錯誤。(:gh:`87999`)" +"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即接 :" +"keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:" +"`in`、:keyword:`is` 和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版" +"本中,它將被更改為語法錯誤。(:gh:`87999`)" #: ../../deprecations/pending-removal-in-future.rst:30 msgid "" @@ -3794,18 +3785,18 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:33 msgid "" -"Support for ``__float__()`` method returning a strict subclass " -"of :class:`float`: these methods will be required to return an instance " -"of :class:`float`." +"Support for ``__float__()`` method returning a strict subclass of :class:" +"`float`: these methods will be required to return an instance of :class:" +"`float`." msgstr "" "回傳 :class:`float` 嚴格子類別 ``__float__()`` 方法的支援:這些方法將需要回" "傳 :class:`float` 的實例。" #: ../../deprecations/pending-removal-in-future.rst:36 msgid "" -"Support for ``__complex__()`` method returning a strict subclass " -"of :class:`complex`: these methods will be required to return an instance " -"of :class:`complex`." +"Support for ``__complex__()`` method returning a strict subclass of :class:" +"`complex`: these methods will be required to return an instance of :class:" +"`complex`." msgstr "" "回傳 :class:`complex` 嚴格子類別 ``__complex__()`` 方法的支援:這些方法將需要" "回傳 :class:`complex` 的實例。" @@ -3816,10 +3807,10 @@ msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。" #: ../../deprecations/pending-removal-in-future.rst:40 msgid "" -"Passing a complex number as the *real* or *imag* argument in " -"the :func:`complex` constructor is now deprecated; it should only be passed " -"as a single positional argument. (Contributed by Serhiy Storchaka " -"in :gh:`109218`.)" +"Passing a complex number as the *real* or *imag* argument in the :func:" +"`complex` constructor is now deprecated; it should only be passed as a " +"single positional argument. (Contributed by Serhiy Storchaka in :gh:" +"`109218`.)" msgstr "" "在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;" "它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)" @@ -3827,9 +3818,8 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:45 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " -"are deprecated and replaced by :data:`calendar.JANUARY` " -"and :data:`calendar.FEBRUARY`. (Contributed by Prince Roshan " -"in :gh:`103636`.)" +"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." +"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" ":mod:`calendar`:``calendar.January`` 和 ``calendar.February`` 常數已被棄用並" "被 :data:`calendar.JANUARY` 和 :data:`calendar.FEBRUARY` 取代。 (由 Prince " @@ -3837,8 +3827,8 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:50 msgid "" -":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. " -"(:gh:`133038`)" +":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. (:gh:" +"`133038`)" msgstr "" ":mod:`codecs`:請改用 :func:`open` 而非 :func:`codecs.open`。(:gh:`133038`)" @@ -3855,19 +3845,19 @@ msgstr ":mod:`datetime`:" #: ../../deprecations/pending-removal-in-future.rst:57 msgid "" -":meth:`~datetime.datetime.utcnow`: use " -"``datetime.datetime.now(tz=datetime.UTC)``." +":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." +"UTC)``." msgstr "" -":meth:`~datetime.datetime.utcnow`:請改用 " -"``datetime.datetime.now(tz=datetime.UTC)``。" +":meth:`~datetime.datetime.utcnow`:請改用 ``datetime.datetime." +"now(tz=datetime.UTC)``。" #: ../../deprecations/pending-removal-in-future.rst:59 msgid "" -":meth:`~datetime.datetime.utcfromtimestamp`: use " -"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``." +":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." +"fromtimestamp(timestamp, tz=datetime.UTC)``." msgstr "" -":meth:`~datetime.datetime.utcfromtimestamp`:請改用 " -"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``。" +":meth:`~datetime.datetime.utcfromtimestamp`:請改用 ``datetime.datetime." +"fromtimestamp(timestamp, tz=datetime.UTC)``。" #: ../../deprecations/pending-removal-in-future.rst:62 msgid ":mod:`gettext`: Plural value must be an integer." @@ -3898,8 +3888,8 @@ msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." msgstr "" -":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改" -"用 :meth:`~logging.warning`。" +":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:" +"`~logging.warning`。" #: ../../deprecations/pending-removal-in-future.rst:77 msgid "" @@ -3956,11 +3946,11 @@ msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:100 msgid "" -":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` " -"and :meth:`!selected_npn_protocol` are deprecated: use ALPN instead." +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" +"`!selected_npn_protocol` are deprecated: use ALPN instead." msgstr "" -":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` " -"和 :meth:`!selected_npn_protocol` 已被棄用:請改用 ALPN。" +":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:" +"`!selected_npn_protocol` 已被棄用:請改用 ALPN。" #: ../../deprecations/pending-removal-in-future.rst:103 msgid "``ssl.OP_NO_SSL*`` options" @@ -4008,11 +3998,11 @@ msgstr ":mod:`threading` 方法:" #: ../../deprecations/pending-removal-in-future.rst:116 msgid "" -":meth:`!threading.Condition.notifyAll`: " -"use :meth:`~threading.Condition.notify_all`." +":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." +"notify_all`." msgstr "" -":meth:`!threading.Condition.notifyAll`:請" -"用 :meth:`~threading.Condition.notify_all`。" +":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." +"notify_all`。" #: ../../deprecations/pending-removal-in-future.rst:117 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." @@ -4020,19 +4010,19 @@ msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set` #: ../../deprecations/pending-removal-in-future.rst:118 msgid "" -":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: " -"use :attr:`threading.Thread.daemon` attribute." +":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" +"attr:`threading.Thread.daemon` attribute." msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" #: ../../deprecations/pending-removal-in-future.rst:120 msgid "" -":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: " -"use :attr:`threading.Thread.name` attribute." +":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" +"attr:`threading.Thread.name` attribute." msgstr "" -":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請" -"用 :attr:`threading.Thread.name` 屬性。" +":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" +"attr:`threading.Thread.name` 屬性。" #: ../../deprecations/pending-removal-in-future.rst:122 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." @@ -4125,22 +4115,22 @@ msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分 #: ../../deprecations/pending-removal-in-future.rst:152 msgid "" -":mod:`xml.etree.ElementTree`: Testing the truth value of " -"an :class:`~xml.etree.ElementTree.Element` is deprecated. In a future " -"release it will always return ``True``. Prefer explicit ``len(elem)`` or " -"``elem is not None`` tests instead." +":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." +"etree.ElementTree.Element` is deprecated. In a future release it will always " +"return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests " +"instead." msgstr "" -":mod:`xml.etree.ElementTree`:已棄用" -"對 :class:`~xml.etree.ElementTree.Element` 的真值測試。在未來版本中,它將始終" -"回傳 ``True``。請改用明確的 ``len(elem)`` 或 ``elem is not None`` 測試。" +":mod:`xml.etree.ElementTree`:已棄用對 :class:`~xml.etree.ElementTree." +"Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " +"``len(elem)`` 或 ``elem is not None`` 測試。" #: ../../deprecations/pending-removal-in-future.rst:157 msgid "" -":func:`sys._clear_type_cache` is deprecated: " -"use :func:`sys._clear_internal_caches` instead." +":func:`sys._clear_type_cache` is deprecated: use :func:`sys." +"_clear_internal_caches` instead." msgstr "" -":func:`sys._clear_type_cache` 已被棄用:請改" -"用 :func:`sys._clear_internal_caches`。" +":func:`sys._clear_type_cache` 已被棄用:請改用 :func:`sys." +"_clear_internal_caches`。" #: ../../whatsnew/3.13.rst:2033 msgid "CPython Bytecode Changes" @@ -4151,8 +4141,8 @@ msgid "" "The oparg of :opcode:`YIELD_VALUE` is now ``1`` if the yield is part of a " "yield-from or await, and ``0`` otherwise. The oparg of :opcode:`RESUME` was " "changed to add a bit indicating if the except-depth is 1, which is needed to " -"optimize closing of generators. (Contributed by Irit Katriel " -"in :gh:`111354`.)" +"optimize closing of generators. (Contributed by Irit Katriel in :gh:" +"`111354`.)" msgstr "" #: ../../whatsnew/3.13.rst:2043 @@ -4161,8 +4151,8 @@ msgstr "C API 變更" #: ../../whatsnew/3.13.rst:2048 msgid "" -"Add the :ref:`PyMonitoring C API ` for " -"generating :pep:`669` monitoring events:" +"Add the :ref:`PyMonitoring C API ` for generating :pep:" +"`669` monitoring events:" msgstr "" #: ../../whatsnew/3.13.rst:2051 @@ -4248,10 +4238,9 @@ msgstr "(由 Irit Katriel 在 :gh:`111997` 中貢獻。)" #: ../../whatsnew/3.13.rst:2073 msgid "" "Add :c:type:`PyMutex`, a lightweight mutex that occupies a single byte, and " -"the new :c:func:`PyMutex_Lock` and :c:func:`PyMutex_Unlock` " -"functions. :c:func:`!PyMutex_Lock` will release the :term:`GIL` (if " -"currently held) if the operation needs to block. (Contributed by Sam Gross " -"in :gh:`108724`.)" +"the new :c:func:`PyMutex_Lock` and :c:func:`PyMutex_Unlock` functions. :c:" +"func:`!PyMutex_Lock` will release the :term:`GIL` (if currently held) if the " +"operation needs to block. (Contributed by Sam Gross in :gh:`108724`.)" msgstr "" #: ../../whatsnew/3.13.rst:2079 @@ -4301,10 +4290,10 @@ msgstr "(由 Victor Stinner 和 Petr Viktorin 在 :gh:`110850` 中貢獻。) #: ../../whatsnew/3.13.rst:2093 msgid "" -"Add the :c:func:`PyDict_ContainsString` function with the same behavior " -"as :c:func:`PyDict_Contains`, but *key* is specified as a :c:expr:`const " -"char*` UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`. " -"(Contributed by Victor Stinner in :gh:`108314`.)" +"Add the :c:func:`PyDict_ContainsString` function with the same behavior as :" +"c:func:`PyDict_Contains`, but *key* is specified as a :c:expr:`const char*` " +"UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`. (Contributed " +"by Victor Stinner in :gh:`108314`.)" msgstr "" #: ../../whatsnew/3.13.rst:2099 @@ -4313,16 +4302,16 @@ msgid "" "functions, which behave similarly to :c:func:`PyDict_GetItemWithError`, but " "return a :term:`strong reference` instead of a :term:`borrowed reference`. " "Moreover, these functions return ``-1`` on error, removing the need to " -"check :c:func:`!PyErr_Occurred`. (Contributed by Victor Stinner " -"in :gh:`106004`.)" +"check :c:func:`!PyErr_Occurred`. (Contributed by Victor Stinner in :gh:" +"`106004`.)" msgstr "" #: ../../whatsnew/3.13.rst:2107 msgid "" -"Add the :c:func:`PyDict_SetDefaultRef` function, which behaves similarly " -"to :c:func:`PyDict_SetDefault`, but returns a :term:`strong reference` " -"instead of a :term:`borrowed reference`. This function returns ``-1`` on " -"error, ``0`` on insertion, and ``1`` if the key was already present in the " +"Add the :c:func:`PyDict_SetDefaultRef` function, which behaves similarly to :" +"c:func:`PyDict_SetDefault`, but returns a :term:`strong reference` instead " +"of a :term:`borrowed reference`. This function returns ``-1`` on error, " +"``0`` on insertion, and ``1`` if the key was already present in the " "dictionary. (Contributed by Sam Gross in :gh:`112066`.)" msgstr "" @@ -4330,45 +4319,45 @@ msgstr "" msgid "" "Add the :c:func:`PyDict_Pop` and :c:func:`PyDict_PopString` functions to " "remove a key from a dictionary and optionally return the removed value. This " -"is similar to :meth:`dict.pop`, though there is no default value, " -"and :exc:`KeyError` is not raised for missing keys. (Contributed by Stefan " -"Behnel and Victor Stinner in :gh:`111262`.)" +"is similar to :meth:`dict.pop`, though there is no default value, and :exc:" +"`KeyError` is not raised for missing keys. (Contributed by Stefan Behnel and " +"Victor Stinner in :gh:`111262`.)" msgstr "" #: ../../whatsnew/3.13.rst:2122 msgid "" -"Add the :c:func:`PyMapping_GetOptionalItem` " -"and :c:func:`PyMapping_GetOptionalItemString` functions as alternatives " -"to :c:func:`PyObject_GetItem` and :c:func:`PyMapping_GetItemString` " -"respectively. The new functions do not raise :exc:`KeyError` if the " -"requested key is missing from the mapping. These variants are more " -"convenient and faster if a missing key should not be treated as a failure. " -"(Contributed by Serhiy Storchaka in :gh:`106307`.)" +"Add the :c:func:`PyMapping_GetOptionalItem` and :c:func:" +"`PyMapping_GetOptionalItemString` functions as alternatives to :c:func:" +"`PyObject_GetItem` and :c:func:`PyMapping_GetItemString` respectively. The " +"new functions do not raise :exc:`KeyError` if the requested key is missing " +"from the mapping. These variants are more convenient and faster if a missing " +"key should not be treated as a failure. (Contributed by Serhiy Storchaka in :" +"gh:`106307`.)" msgstr "" #: ../../whatsnew/3.13.rst:2132 msgid "" -"Add the :c:func:`PyObject_GetOptionalAttr` " -"and :c:func:`PyObject_GetOptionalAttrString` functions as alternatives " -"to :c:func:`PyObject_GetAttr` and :c:func:`PyObject_GetAttrString` " -"respectively. The new functions do not raise :exc:`AttributeError` if the " -"requested attribute is not found on the object. These variants are more " -"convenient and faster if the missing attribute should not be treated as a " -"failure. (Contributed by Serhiy Storchaka in :gh:`106521`.)" +"Add the :c:func:`PyObject_GetOptionalAttr` and :c:func:" +"`PyObject_GetOptionalAttrString` functions as alternatives to :c:func:" +"`PyObject_GetAttr` and :c:func:`PyObject_GetAttrString` respectively. The " +"new functions do not raise :exc:`AttributeError` if the requested attribute " +"is not found on the object. These variants are more convenient and faster if " +"the missing attribute should not be treated as a failure. (Contributed by " +"Serhiy Storchaka in :gh:`106521`.)" msgstr "" #: ../../whatsnew/3.13.rst:2142 msgid "" -"Add the :c:func:`PyErr_FormatUnraisable` function as an extension " -"to :c:func:`PyErr_WriteUnraisable` that allows customizing the warning " -"message. (Contributed by Serhiy Storchaka in :gh:`108082`.)" +"Add the :c:func:`PyErr_FormatUnraisable` function as an extension to :c:func:" +"`PyErr_WriteUnraisable` that allows customizing the warning message. " +"(Contributed by Serhiy Storchaka in :gh:`108082`.)" msgstr "" #: ../../whatsnew/3.13.rst:2147 msgid "" -"Add new functions that return a :term:`strong reference` instead of " -"a :term:`borrowed reference` for frame locals, globals, and builtins, as " -"part of :ref:`PEP 667 `:" +"Add new functions that return a :term:`strong reference` instead of a :term:" +"`borrowed reference` for frame locals, globals, and builtins, as part of :" +"ref:`PEP 667 `:" msgstr "" #: ../../whatsnew/3.13.rst:2151 @@ -4398,10 +4387,10 @@ msgstr "" #: ../../whatsnew/3.13.rst:2164 msgid "" -"Add the :c:func:`PyImport_AddModuleRef` function as a replacement " -"for :c:func:`PyImport_AddModule` that returns a :term:`strong reference` " -"instead of a :term:`borrowed reference`. (Contributed by Victor Stinner " -"in :gh:`105922`.)" +"Add the :c:func:`PyImport_AddModuleRef` function as a replacement for :c:" +"func:`PyImport_AddModule` that returns a :term:`strong reference` instead of " +"a :term:`borrowed reference`. (Contributed by Victor Stinner in :gh:" +"`105922`.)" msgstr "" #: ../../whatsnew/3.13.rst:2169 @@ -4413,9 +4402,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:2174 msgid "" -"Add the :c:func:`PyList_GetItemRef` function as a replacement " -"for :c:func:`PyList_GetItem` that returns a :term:`strong reference` instead " -"of a :term:`borrowed reference`. (Contributed by Sam Gross in :gh:`114329`.)" +"Add the :c:func:`PyList_GetItemRef` function as a replacement for :c:func:" +"`PyList_GetItem` that returns a :term:`strong reference` instead of a :term:" +"`borrowed reference`. (Contributed by Sam Gross in :gh:`114329`.)" msgstr "" #: ../../whatsnew/3.13.rst:2179 @@ -4427,10 +4416,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:2183 msgid "" -"Add the :c:func:`PyLong_AsInt` function. It behaves similarly " -"to :c:func:`PyLong_AsLong`, but stores the result in a C :c:expr:`int` " -"instead of a C :c:expr:`long`. (Contributed by Victor Stinner " -"in :gh:`108014`.)" +"Add the :c:func:`PyLong_AsInt` function. It behaves similarly to :c:func:" +"`PyLong_AsLong`, but stores the result in a C :c:expr:`int` instead of a C :" +"c:expr:`long`. (Contributed by Victor Stinner in :gh:`108014`.)" msgstr "" #: ../../whatsnew/3.13.rst:2188 @@ -4443,17 +4431,16 @@ msgstr "" #: ../../whatsnew/3.13.rst:2194 msgid "" -"Add :c:func:`PyModule_Add` function, which is similar " -"to :c:func:`PyModule_AddObjectRef` and :c:func:`PyModule_AddObject`, but " -"always steals a reference to the value. (Contributed by Serhiy Storchaka " -"in :gh:`86493`.)" +"Add :c:func:`PyModule_Add` function, which is similar to :c:func:" +"`PyModule_AddObjectRef` and :c:func:`PyModule_AddObject`, but always steals " +"a reference to the value. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" #: ../../whatsnew/3.13.rst:2199 msgid "" "Add the :c:func:`PyObject_GenericHash` function that implements the default " -"hashing function of a Python object. (Contributed by Serhiy Storchaka " -"in :gh:`113024`.)" +"hashing function of a Python object. (Contributed by Serhiy Storchaka in :gh:" +"`113024`.)" msgstr "" #: ../../whatsnew/3.13.rst:2203 @@ -4464,12 +4451,11 @@ msgstr "" #: ../../whatsnew/3.13.rst:2206 msgid "" -"Add the :c:func:`PyObject_VisitManagedDict` " -"and :c:func:`PyObject_ClearManagedDict` functions. which must be called by " -"the traverse and clear functions of a type using " -"the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag. The `pythoncapi-compat " -"project`_ can be used to use these functions with Python 3.11 and 3.12. " -"(Contributed by Victor Stinner in :gh:`107073`.)" +"Add the :c:func:`PyObject_VisitManagedDict` and :c:func:" +"`PyObject_ClearManagedDict` functions. which must be called by the traverse " +"and clear functions of a type using the :c:macro:`Py_TPFLAGS_MANAGED_DICT` " +"flag. The `pythoncapi-compat project`_ can be used to use these functions " +"with Python 3.11 and 3.12. (Contributed by Victor Stinner in :gh:`107073`.)" msgstr "" #: ../../whatsnew/3.13.rst:2214 @@ -4482,9 +4468,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:2220 msgid "" -"Add the :c:func:`PySys_AuditTuple` function as an alternative " -"to :c:func:`PySys_Audit` that takes event arguments as a " -"Python :class:`tuple` object. (Contributed by Victor Stinner in :gh:`85283`.)" +"Add the :c:func:`PySys_AuditTuple` function as an alternative to :c:func:" +"`PySys_Audit` that takes event arguments as a Python :class:`tuple` object. " +"(Contributed by Victor Stinner in :gh:`85283`.)" msgstr "" #: ../../whatsnew/3.13.rst:2225 @@ -4498,10 +4484,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:2231 msgid "" "Add the :c:func:`PyType_GetFullyQualifiedName` function to get the type's " -"fully qualified name. The module name is prepended " -"if :attr:`type.__module__` is a string and is not equal to either " -"``'builtins'`` or ``'__main__'``. (Contributed by Victor Stinner " -"in :gh:`111696`.)" +"fully qualified name. The module name is prepended if :attr:`type." +"__module__` is a string and is not equal to either ``'builtins'`` or " +"``'__main__'``. (Contributed by Victor Stinner in :gh:`111696`.)" msgstr "" #: ../../whatsnew/3.13.rst:2237 @@ -4513,19 +4498,19 @@ msgstr "" #: ../../whatsnew/3.13.rst:2242 msgid "" -"Add the :c:func:`PyUnicode_EqualToUTF8AndSize` " -"and :c:func:`PyUnicode_EqualToUTF8` functions to compare a Unicode object " -"with a :c:expr:`const char*` UTF-8 encoded string and ``1`` if they are " -"equal or ``0`` otherwise. These functions do not raise exceptions. " -"(Contributed by Serhiy Storchaka in :gh:`110289`.)" +"Add the :c:func:`PyUnicode_EqualToUTF8AndSize` and :c:func:" +"`PyUnicode_EqualToUTF8` functions to compare a Unicode object with a :c:expr:" +"`const char*` UTF-8 encoded string and ``1`` if they are equal or ``0`` " +"otherwise. These functions do not raise exceptions. (Contributed by Serhiy " +"Storchaka in :gh:`110289`.)" msgstr "" #: ../../whatsnew/3.13.rst:2249 msgid "" -"Add the :c:func:`PyWeakref_GetRef` function as an alternative " -"to :c:func:`PyWeakref_GetObject` that returns a :term:`strong reference` or " -"``NULL`` if the referent is no longer live. (Contributed by Victor Stinner " -"in :gh:`105927`.)" +"Add the :c:func:`PyWeakref_GetRef` function as an alternative to :c:func:" +"`PyWeakref_GetObject` that returns a :term:`strong reference` or ``NULL`` if " +"the referent is no longer live. (Contributed by Victor Stinner in :gh:" +"`105927`.)" msgstr "" #: ../../whatsnew/3.13.rst:2255 @@ -4539,11 +4524,11 @@ msgstr ":c:func:`PyObject_HasAttrWithError` 取代 :c:func:`PyObject_HasAttr`。 #: ../../whatsnew/3.13.rst:2258 msgid "" -":c:func:`PyObject_HasAttrStringWithError` " -"replaces :c:func:`PyObject_HasAttrString`." +":c:func:`PyObject_HasAttrStringWithError` replaces :c:func:" +"`PyObject_HasAttrString`." msgstr "" -":c:func:`PyObject_HasAttrStringWithError` 取" -"代 :c:func:`PyObject_HasAttrString`。" +":c:func:`PyObject_HasAttrStringWithError` 取代 :c:func:" +"`PyObject_HasAttrString`。" #: ../../whatsnew/3.13.rst:2260 msgid "" @@ -4552,11 +4537,11 @@ msgstr ":c:func:`PyMapping_HasKeyWithError` 取代 :c:func:`PyMapping_HasKey`。 #: ../../whatsnew/3.13.rst:2261 msgid "" -":c:func:`PyMapping_HasKeyStringWithError` " -"replaces :c:func:`PyMapping_HasKeyString`." +":c:func:`PyMapping_HasKeyStringWithError` replaces :c:func:" +"`PyMapping_HasKeyString`." msgstr "" -":c:func:`PyMapping_HasKeyStringWithError` 取" -"代 :c:func:`PyMapping_HasKeyString`。" +":c:func:`PyMapping_HasKeyStringWithError` 取代 :c:func:" +"`PyMapping_HasKeyString`。" #: ../../whatsnew/3.13.rst:2264 msgid "" @@ -4574,15 +4559,15 @@ msgstr "" #: ../../whatsnew/3.13.rst:2273 msgid "" -"The *keywords* parameter of :c:func:`PyArg_ParseTupleAndKeywords` " -"and :c:func:`PyArg_VaParseTupleAndKeywords` now has type :c:expr:`char * " -"const *` in C and :c:expr:`const char * const *` in C++, instead " -"of :c:expr:`char **`. In C++, this makes these functions compatible with " -"arguments of type :c:expr:`const char * const *`, :c:expr:`const char **`, " -"or :c:expr:`char * const *` without an explicit type cast. In C, the " -"functions only support arguments of type :c:expr:`char * const *`. This can " -"be overridden with the :c:macro:`PY_CXX_CONST` macro. (Contributed by Serhiy " -"Storchaka in :gh:`65210`.)" +"The *keywords* parameter of :c:func:`PyArg_ParseTupleAndKeywords` and :c:" +"func:`PyArg_VaParseTupleAndKeywords` now has type :c:expr:`char * const *` " +"in C and :c:expr:`const char * const *` in C++, instead of :c:expr:`char " +"**`. In C++, this makes these functions compatible with arguments of type :c:" +"expr:`const char * const *`, :c:expr:`const char **`, or :c:expr:`char * " +"const *` without an explicit type cast. In C, the functions only support " +"arguments of type :c:expr:`char * const *`. This can be overridden with the :" +"c:macro:`PY_CXX_CONST` macro. (Contributed by Serhiy Storchaka in :gh:" +"`65210`.)" msgstr "" #: ../../whatsnew/3.13.rst:2285 @@ -4600,18 +4585,19 @@ msgstr "" #: ../../whatsnew/3.13.rst:2293 msgid "" -"The :c:func:`PyDict_GetItem`, :c:func:`PyDict_GetItemString`, :c:func:`PyMapping_HasKey`, :c:func:`PyMapping_HasKeyString`, :c:func:`PyObject_HasAttr`, :c:func:`PyObject_HasAttrString`, " -"and :c:func:`PySys_GetObject` functions, each of which clears all errors " -"which occurred when calling them now reports these errors " -"using :func:`sys.unraisablehook`. You may replace them with other functions " -"as recommended in the documentation. (Contributed by Serhiy Storchaka " -"in :gh:`106672`.)" +"The :c:func:`PyDict_GetItem`, :c:func:`PyDict_GetItemString`, :c:func:" +"`PyMapping_HasKey`, :c:func:`PyMapping_HasKeyString`, :c:func:" +"`PyObject_HasAttr`, :c:func:`PyObject_HasAttrString`, and :c:func:" +"`PySys_GetObject` functions, each of which clears all errors which occurred " +"when calling them now reports these errors using :func:`sys.unraisablehook`. " +"You may replace them with other functions as recommended in the " +"documentation. (Contributed by Serhiy Storchaka in :gh:`106672`.)" msgstr "" #: ../../whatsnew/3.13.rst:2302 msgid "" -"Add support for the ``%T``, ``%#T``, ``%N`` and ``%#N`` formats " -"to :c:func:`PyUnicode_FromFormat`:" +"Add support for the ``%T``, ``%#T``, ``%N`` and ``%#N`` formats to :c:func:" +"`PyUnicode_FromFormat`:" msgstr "" #: ../../whatsnew/3.13.rst:2305 @@ -4632,8 +4618,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:2310 msgid "" -"See :pep:`737` for more information. (Contributed by Victor Stinner " -"in :gh:`111696`.)" +"See :pep:`737` for more information. (Contributed by Victor Stinner in :gh:" +"`111696`.)" msgstr "" #: ../../whatsnew/3.13.rst:2313 @@ -4641,16 +4627,16 @@ msgid "" "You no longer have to define the ``PY_SSIZE_T_CLEAN`` macro before " "including :file:`Python.h` when using ``#`` formats in :ref:`format codes " "`. APIs accepting the format codes always " -"use ``Py_ssize_t`` for ``#`` formats. (Contributed by Inada Naoki " -"in :gh:`104922`.)" +"use ``Py_ssize_t`` for ``#`` formats. (Contributed by Inada Naoki in :gh:" +"`104922`.)" msgstr "" #: ../../whatsnew/3.13.rst:2319 msgid "" "If Python is built in :ref:`debug mode ` or :option:`with " -"assertions <--with-assertions>`, :c:func:`PyTuple_SET_ITEM` " -"and :c:func:`PyList_SET_ITEM` now check the index argument with an " -"assertion. (Contributed by Victor Stinner in :gh:`106168`.)" +"assertions <--with-assertions>`, :c:func:`PyTuple_SET_ITEM` and :c:func:" +"`PyList_SET_ITEM` now check the index argument with an assertion. " +"(Contributed by Victor Stinner in :gh:`106168`.)" msgstr "" #: ../../whatsnew/3.13.rst:2327 @@ -4691,8 +4677,8 @@ msgstr ":c:func:`PyType_GetModuleByDef`" #: ../../whatsnew/3.13.rst:2339 msgid "" -"(Contributed by Victor Stinner in :gh:`85283`, :gh:`85283`, " -"and :gh:`116936`.)" +"(Contributed by Victor Stinner in :gh:`85283`, :gh:`85283`, and :gh:" +"`116936`.)" msgstr "" "(由 Victor Stinner 貢獻於 :gh:`85283`、:gh:`85283` 和 :gh:`116936`。)" @@ -4719,26 +4705,26 @@ msgstr "" #: ../../whatsnew/3.13.rst:2357 msgid "" -"Remove old buffer protocols deprecated in Python 3.0. " -"Use :ref:`bufferobjects` instead." +"Remove old buffer protocols deprecated in Python 3.0. Use :ref:" +"`bufferobjects` instead." msgstr "" #: ../../whatsnew/3.13.rst:2360 msgid "" ":c:func:`!PyObject_CheckReadBuffer`: Use :c:func:`PyObject_CheckBuffer` to " -"test whether the object supports the buffer protocol. Note " -"that :c:func:`PyObject_CheckBuffer` doesn't guarantee " -"that :c:func:`PyObject_GetBuffer` will succeed. To test if the object is " -"actually readable, see the next example of :c:func:`PyObject_GetBuffer`." +"test whether the object supports the buffer protocol. Note that :c:func:" +"`PyObject_CheckBuffer` doesn't guarantee that :c:func:`PyObject_GetBuffer` " +"will succeed. To test if the object is actually readable, see the next " +"example of :c:func:`PyObject_GetBuffer`." msgstr "" #: ../../whatsnew/3.13.rst:2368 msgid "" -":c:func:`!PyObject_AsCharBuffer`, :c:func:`!PyObject_AsReadBuffer`: " -"Use :c:func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release` instead:" +":c:func:`!PyObject_AsCharBuffer`, :c:func:`!PyObject_AsReadBuffer`: Use :c:" +"func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release` instead:" msgstr "" -":c:func:`!PyObject_AsCharBuffer`、:c:func:`!PyObject_AsReadBuffer`:請改" -"用 :c:func:`PyObject_GetBuffer` 和 :c:func:`PyBuffer_Release`。" +":c:func:`!PyObject_AsCharBuffer`、:c:func:`!PyObject_AsReadBuffer`:請改用 :" +"c:func:`PyObject_GetBuffer` 和 :c:func:`PyBuffer_Release`。" #: ../../whatsnew/3.13.rst:2371 msgid "" @@ -4753,11 +4739,11 @@ msgstr "" #: ../../whatsnew/3.13.rst:2381 msgid "" -":c:func:`!PyObject_AsWriteBuffer`: Use :c:func:`PyObject_GetBuffer` " -"and :c:func:`PyBuffer_Release` instead:" +":c:func:`!PyObject_AsWriteBuffer`: Use :c:func:`PyObject_GetBuffer` and :c:" +"func:`PyBuffer_Release` instead:" msgstr "" -":c:func:`!PyObject_AsWriteBuffer`:請改用 :c:func:`PyObject_GetBuffer` " -"和 :c:func:`PyBuffer_Release`。" +":c:func:`!PyObject_AsWriteBuffer`:請改用 :c:func:`PyObject_GetBuffer` 和 :c:" +"func:`PyBuffer_Release`。" #: ../../whatsnew/3.13.rst:2384 msgid "" @@ -4779,8 +4765,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:2397 msgid "" -":c:func:`!PyEval_CallObject`, :c:func:`!PyEval_CallObjectWithKeywords`: " -"Use :c:func:`PyObject_CallNoArgs` or :c:func:`PyObject_Call` instead." +":c:func:`!PyEval_CallObject`, :c:func:`!PyEval_CallObjectWithKeywords`: Use :" +"c:func:`PyObject_CallNoArgs` or :c:func:`PyObject_Call` instead." msgstr "" ":c:func:`!PyEval_CallObject`、:c:func:`!PyEval_CallObjectWithKeywords`:請改" "用 :c:func:`PyObject_CallNoArgs` 或 :c:func:`PyObject_Call`。" @@ -4791,9 +4777,9 @@ msgid "" "and must not be ``NULL``, and keyword arguments must be a :class:`dict` or " "``NULL``, whereas the removed functions checked argument types and accepted " "``NULL`` positional and keyword arguments. To replace " -"``PyEval_CallObjectWithKeywords(func, NULL, kwargs)`` " -"with :c:func:`PyObject_Call`, pass an empty tuple as positional arguments " -"using :c:func:`PyTuple_New(0) `." +"``PyEval_CallObjectWithKeywords(func, NULL, kwargs)`` with :c:func:" +"`PyObject_Call`, pass an empty tuple as positional arguments using :c:func:" +"`PyTuple_New(0) `." msgstr "" #: ../../whatsnew/3.13.rst:2412 @@ -4827,8 +4813,8 @@ msgid "" ":c:func:`!PySys_AddWarnOptionUnicode`: Use :c:member:`PyConfig.warnoptions` " "instead." msgstr "" -":c:func:`!PySys_AddWarnOptionUnicode`:請改" -"用 :c:member:`PyConfig.warnoptions`。" +":c:func:`!PySys_AddWarnOptionUnicode`:請改用 :c:member:`PyConfig." +"warnoptions`。" #: ../../whatsnew/3.13.rst:2426 msgid "" @@ -4861,13 +4847,13 @@ msgstr "" #: ../../whatsnew/3.13.rst:2436 msgid "" -":c:func:`!Py_SetStandardStreamEncoding`: " -"Set :c:member:`PyConfig.stdio_encoding` instead, and set also " -"maybe :c:member:`PyConfig.legacy_windows_stdio` (on Windows)." +":c:func:`!Py_SetStandardStreamEncoding`: Set :c:member:`PyConfig." +"stdio_encoding` instead, and set also maybe :c:member:`PyConfig." +"legacy_windows_stdio` (on Windows)." msgstr "" -":c:func:`!Py_SetStandardStreamEncoding`:請改" -"用 :c:member:`PyConfig.stdio_encoding` 並設定可能" -"的 :c:member:`PyConfig.legacy_windows_stdio`\\ (在 Windows 上)。" +":c:func:`!Py_SetStandardStreamEncoding`:請改用 :c:member:`PyConfig." +"stdio_encoding` 並設定可能的 :c:member:`PyConfig.legacy_windows_stdio`\\ " +"(在 Windows 上)。" #: ../../whatsnew/3.13.rst:2439 msgid "" @@ -4883,8 +4869,8 @@ msgid "" "(Contributed by Victor Stinner in :gh:`105145`.)" msgstr "" "請改用 :ref:`Python 初始化設定 `\\ 的新 :c:type:`PyConfig` API " -"(:pep:`587`),這是在 Python 3.8 中新增的。(由 Victor Stinner " -"於 :gh:`105145` 貢獻。)" +"(:pep:`587`),這是在 Python 3.8 中新增的。(由 Victor Stinner 於 :gh:" +"`105145` 貢獻。)" #: ../../whatsnew/3.13.rst:2446 msgid "" @@ -4929,17 +4915,17 @@ msgstr "" #: ../../whatsnew/3.13.rst:2464 msgid "" -"Remove the :c:func:`!_PyInterpreterState_Get` alias " -"to :c:func:`PyInterpreterState_Get()` which was kept for backward " -"compatibility with Python 3.8. The `pythoncapi-compat project`_ can be used " -"to get :c:func:`PyInterpreterState_Get()` on Python 3.8 and older. " -"(Contributed by Victor Stinner in :gh:`106320`.)" +"Remove the :c:func:`!_PyInterpreterState_Get` alias to :c:func:" +"`PyInterpreterState_Get()` which was kept for backward compatibility with " +"Python 3.8. The `pythoncapi-compat project`_ can be used to get :c:func:" +"`PyInterpreterState_Get()` on Python 3.8 and older. (Contributed by Victor " +"Stinner in :gh:`106320`.)" msgstr "" -"移除 :c:func:`!_PyInterpreterState_Get` 這個" -"對 :c:func:`PyInterpreterState_Get()` 的別名,這個別名是為了與 Python 3.8 的" -"向後相容性而保留的。`pythoncapi-compat 專案`_\\ 可以用於在 Python 3.8 和更舊" -"的版本中取得 :c:func:`PyInterpreterState_Get()`。(由 Victor Stinner " -"於 :gh:`106320` 貢獻。)" +"移除 :c:func:`!_PyInterpreterState_Get` 這個對 :c:func:" +"`PyInterpreterState_Get()` 的別名,這個別名是為了與 Python 3.8 的向後相容性而" +"保留的。`pythoncapi-compat 專案`_\\ 可以用於在 Python 3.8 和更舊的版本中取" +"得 :c:func:`PyInterpreterState_Get()`。(由 Victor Stinner 於 :gh:`106320` 貢" +"獻。)" #: ../../whatsnew/3.13.rst:2471 msgid "" @@ -4947,17 +4933,17 @@ msgid "" "PyObject_Vectorcall` which is available since Python 3.8 (:pep:`590`). " "(Contributed by Victor Stinner in :gh:`106023`.)" msgstr "" -"移除私有的 :c:func:`!_PyObject_FastCall` 函式:請改用自 Python 3.8 起可用" -"的 :c:func:`!PyObject_Vectorcall` 函式(:pep:`590`)。(由 Victor Stinner " -"於 :gh:`106023` 貢獻。)" +"移除私有的 :c:func:`!_PyObject_FastCall` 函式:請改用自 Python 3.8 起可用的 :" +"c:func:`!PyObject_Vectorcall` 函式(:pep:`590`)。(由 Victor Stinner 於 :gh:" +"`106023` 貢獻。)" #: ../../whatsnew/3.13.rst:2476 msgid "" "Remove the ``cpython/pytime.h`` header file, which only contained private " "functions. (Contributed by Victor Stinner in :gh:`106316`.)" msgstr "" -"移除只包含私有函式的 ``cpython/pytime.h`` 標頭檔。(由 Victor Stinner " -"於 :gh:`106316` 貢獻。)" +"移除只包含私有函式的 ``cpython/pytime.h`` 標頭檔。(由 Victor Stinner 於 :gh:" +"`106316` 貢獻。)" #: ../../whatsnew/3.13.rst:2480 msgid "" @@ -4990,8 +4976,8 @@ msgid "" ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" "warnings.filters` instead." msgstr "" -":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` " -"和 :data:`!warnings.filters`。" +":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` 和 :" +"data:`!warnings.filters`。" #: ../../whatsnew/3.13.rst:2496 msgid ":c:func:`Py_GetExecPrefix`: Get :data:`sys.exec_prefix` instead." @@ -5015,11 +5001,11 @@ msgstr ":c:func:`Py_GetProgramName`:請改用 :data:`sys.executable`。" #: ../../whatsnew/3.13.rst:2506 msgid "" -":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or " -"the :envvar:`PYTHONHOME` environment variable instead." +":c:func:`Py_GetPythonHome`: Get :c:member:`PyConfig.home` or the :envvar:" +"`PYTHONHOME` environment variable instead." msgstr "" -":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` " -"或 :envvar:`PYTHONHOME` 環境變數。" +":c:func:`Py_GetPythonHome`:請改用 :c:member:`PyConfig.home` 或 :envvar:" +"`PYTHONHOME` 環境變數。" #: ../../whatsnew/3.13.rst:2510 msgid "(Contributed by Victor Stinner in :gh:`105145`.)" @@ -5027,15 +5013,14 @@ msgstr "(由 Victor Stinner 在 :gh:`105145` 中貢獻。)" #: ../../whatsnew/3.13.rst:2512 msgid "" -":term:`Soft deprecate ` " -"the :c:func:`PyEval_GetBuiltins`, :c:func:`PyEval_GetGlobals`, " -"and :c:func:`PyEval_GetLocals` functions, which return a :term:`borrowed " -"reference`. (Soft deprecated as part of :pep:`667`.)" +":term:`Soft deprecate ` the :c:func:`PyEval_GetBuiltins`, :" +"c:func:`PyEval_GetGlobals`, and :c:func:`PyEval_GetLocals` functions, which " +"return a :term:`borrowed reference`. (Soft deprecated as part of :pep:`667`.)" msgstr "" -":term:`軟性棄用 ` :c:func:`PyEval_GetBuiltins`、:c:func:`PyEval_GetGlobals` " -"和 :c:func:`PyEval_GetLocals` 函式,這些函式會回傳一個\\ :term:`借用參照 " -"`。(作為 :pep:`667` 一部分的軟性棄用。)" +":term:`軟性棄用 ` :c:func:`PyEval_GetBuiltins`、:c:func:" +"`PyEval_GetGlobals` 和 :c:func:`PyEval_GetLocals` 函式,這些函式會回傳一個" +"\\ :term:`借用參照 `。(作為 :pep:`667` 一部分的軟性棄" +"用。)" #: ../../whatsnew/3.13.rst:2518 msgid "" @@ -5043,16 +5028,15 @@ msgid "" "an alias to :c:func:`PyImport_ImportModule` since Python 3.3. (Contributed " "by Victor Stinner in :gh:`105396`.)" msgstr "" -"棄用 :c:func:`PyImport_ImportModuleNoBlock` 函式,這只是自 Python 3.3 起" -"的 :c:func:`PyImport_ImportModule` 的別名。(由 Victor Stinner " -"在 :gh:`105396` 中貢獻。)" +"棄用 :c:func:`PyImport_ImportModuleNoBlock` 函式,這只是自 Python 3.3 起的 :" +"c:func:`PyImport_ImportModule` 的別名。(由 Victor Stinner 在 :gh:`105396` 中" +"貢獻。)" #: ../../whatsnew/3.13.rst:2522 msgid "" ":term:`Soft deprecate ` the :c:func:`PyModule_AddObject` " -"function. It should be replaced with :c:func:`PyModule_Add` " -"or :c:func:`PyModule_AddObjectRef`. (Contributed by Serhiy Storchaka " -"in :gh:`86493`.)" +"function. It should be replaced with :c:func:`PyModule_Add` or :c:func:" +"`PyModule_AddObjectRef`. (Contributed by Serhiy Storchaka in :gh:`86493`.)" msgstr "" ":term:`軟性棄用 ` :c:func:`PyModule_AddObject` 函式。應該改" "用 :c:func:`PyModule_Add` 或 :c:func:`PyModule_AddObjectRef`。(由 Serhiy " @@ -5060,11 +5044,11 @@ msgstr "" #: ../../whatsnew/3.13.rst:2528 msgid "" -"Deprecate the old ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` types and " -"the :c:macro:`!Py_UNICODE_WIDE` define. Use the :c:type:`wchar_t` type " -"directly instead. Since Python 3.3, ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` " -"are just aliases to :c:type:`!wchar_t`. (Contributed by Victor Stinner " -"in :gh:`105156`.)" +"Deprecate the old ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` types and the :c:" +"macro:`!Py_UNICODE_WIDE` define. Use the :c:type:`wchar_t` type directly " +"instead. Since Python 3.3, ``Py_UNICODE`` and ``PY_UNICODE_TYPE`` are just " +"aliases to :c:type:`!wchar_t`. (Contributed by Victor Stinner in :gh:" +"`105156`.)" msgstr "" "棄用舊的 ``Py_UNICODE`` 和 ``PY_UNICODE_TYPE`` 型別以及 :c:macro:`!" "Py_UNICODE_WIDE` 定義。請直接使用 :c:type:`wchar_t` 型別。自 Python 3.3 起," @@ -5073,63 +5057,63 @@ msgstr "" #: ../../whatsnew/3.13.rst:2535 msgid "" -"Deprecate the :c:func:`PyWeakref_GetObject` " -"and :c:func:`PyWeakref_GET_OBJECT` functions, which return a :term:`borrowed " -"reference`. Replace them with the new :c:func:`PyWeakref_GetRef` function, " -"which returns a :term:`strong reference`. The `pythoncapi-compat project`_ " -"can be used to get :c:func:`PyWeakref_GetRef` on Python 3.12 and older. " -"(Contributed by Victor Stinner in :gh:`105927`.)" +"Deprecate the :c:func:`PyWeakref_GetObject` and :c:func:" +"`PyWeakref_GET_OBJECT` functions, which return a :term:`borrowed reference`. " +"Replace them with the new :c:func:`PyWeakref_GetRef` function, which returns " +"a :term:`strong reference`. The `pythoncapi-compat project`_ can be used to " +"get :c:func:`PyWeakref_GetRef` on Python 3.12 and older. (Contributed by " +"Victor Stinner in :gh:`105927`.)" msgstr "" "棄用 :c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT` 函式,這" -"些函式會回傳一個\\ :term:`借用參照 `。請改用新" -"的 :c:func:`PyWeakref_GetRef` 函式,這個函式會回傳一個\\ :term:`強參照 " -"`。`pythoncapi-compat 專案`_\\ 可以用於在 Python 3.12 和更" -"舊的版本中取得 :c:func:`PyWeakref_GetRef`。(由 Victor Stinner " -"在 :gh:`105927` 中貢獻。)" +"些函式會回傳一個\\ :term:`借用參照 `。請改用新的 :c:func:" +"`PyWeakref_GetRef` 函式,這個函式會回傳一個\\ :term:`強參照 `。`pythoncapi-compat 專案`_\\ 可以用於在 Python 3.12 和更舊的版本" +"中取得 :c:func:`PyWeakref_GetRef`。(由 Victor Stinner 在 :gh:`105927` 中貢" +"獻。)" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:4 msgid "" "The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " "(:pep:`699`; :gh:`101193`)." msgstr "" -":c:type:`PyDictObject` 中的 ``ma_version_tag`` 欄位,用於擴充模組 " -"(:pep:`699`;:gh:`101193`)。" +":c:type:`PyDictObject` 中的 ``ma_version_tag`` 欄位,用於擴充模組 (:pep:" +"`699`;:gh:`101193`)。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:7 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases (:gh:`95388`)." msgstr "" -"使用可變基底建立\\ :c:data:`不可變型別 ` " -"(:gh:`95388`)。" +"使用可變基底建立\\ :c:data:`不可變型別 ` (:gh:" +"`95388`)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:4 msgid "" -"The :c:func:`PyImport_ImportModuleNoBlock`: " -"Use :c:func:`PyImport_ImportModule` instead." +"The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:" +"`PyImport_ImportModule` instead." msgstr "" -":c:func:`PyImport_ImportModuleNoBlock`:請改" -"用 :c:func:`PyImport_ImportModule`。" +":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:" +"`PyImport_ImportModule`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:6 msgid "" -":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: " -"Use :c:func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project " -"`__ can be used to " -"get :c:func:`PyWeakref_GetRef` on Python 3.12 and older." +":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" +"func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project `__ can be used to get :c:func:" +"`PyWeakref_GetRef` on Python 3.12 and older." msgstr "" -":c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT`:請改" -"用 :c:func:`PyWeakref_GetRef`。可以使用 `pythoncapi-compat 專案 `__\\ 來為 Python 3.12 和更早版本取" -"得 :c:func:`PyWeakref_GetRef`。" +":c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT`:請改用 :c:" +"func:`PyWeakref_GetRef`。可以使用 `pythoncapi-compat 專案 `__\\ 來為 Python 3.12 和更早版本取得 :c:func:" +"`PyWeakref_GetRef`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:10 msgid "" -":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: " -"Use :c:type:`wchar_t` instead." +":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:" +"type:`wchar_t` instead." msgstr "" -":c:type:`Py_UNICODE` 型別與 :c:macro:`!Py_UNICODE_WIDE` 巨集:請改" -"用 :c:type:`wchar_t`。" +":c:type:`Py_UNICODE` 型別與 :c:macro:`!Py_UNICODE_WIDE` 巨集:請改用 :c:type:" +"`wchar_t`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:12 msgid "" @@ -5144,8 +5128,8 @@ msgid "" "than :class:`str`, such as :class:`bytes`." msgstr "" ":c:func:`!PyUnicode_AsDecodedUnicode`:請改用 :c:func:`PyCodec_Decode`;請注" -"意某些編解碼器(例如 \"base64\")可能會回傳非 :class:`str` 的型別,例" -"如 :class:`bytes`。" +"意某些編解碼器(例如 \"base64\")可能會回傳非 :class:`str` 的型別,例如 :" +"class:`bytes`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 msgid "" @@ -5160,8 +5144,8 @@ msgid "" "than :class:`bytes`, such as :class:`str`." msgstr "" ":c:func:`!PyUnicode_AsEncodedUnicode`:請改用 :c:func:`PyCodec_Encode`;請注" -"意某些編解碼器(例如 \"base64\")可能會回傳非 :class:`bytes` 的型別,例" -"如 :class:`str`。" +"意某些編解碼器(例如 \"base64\")可能會回傳非 :class:`bytes` 的型別,例如 :" +"class:`str`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:22 msgid "Python initialization functions, deprecated in Python 3.13:" @@ -5178,37 +5162,35 @@ msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:27 msgid "" ":c:func:`Py_GetPrefix`: Use :c:func:`PyConfig_Get(\"base_prefix\") " -"` (:data:`sys.base_prefix`) instead. " -"Use :c:func:`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) " -"if :ref:`virtual environments ` need to be handled." +"` (:data:`sys.base_prefix`) instead. Use :c:func:" +"`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) if :ref:" +"`virtual environments ` need to be handled." msgstr "" ":c:func:`Py_GetPrefix`:請改用 :c:func:`PyConfig_Get(\"base_prefix\") " "` (:data:`sys.base_prefix`)。如果需要處理\\ :ref:`虛擬環境 " -"`,請改用 :c:func:`PyConfig_Get(\"prefix\") ` " -"(:data:`sys.prefix`)。" +"`,請改用 :c:func:`PyConfig_Get(\"prefix\") ` (:data:" +"`sys.prefix`)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:32 msgid "" ":c:func:`Py_GetExecPrefix`: Use :c:func:`PyConfig_Get(\"base_exec_prefix\") " -"` (:data:`sys.base_exec_prefix`) instead. " -"Use :c:func:`PyConfig_Get(\"exec_prefix\") ` " -"(:data:`sys.exec_prefix`) if :ref:`virtual environments ` need to " -"be handled." +"` (:data:`sys.base_exec_prefix`) instead. Use :c:func:" +"`PyConfig_Get(\"exec_prefix\") ` (:data:`sys.exec_prefix`) if :" +"ref:`virtual environments ` need to be handled." msgstr "" -":c:func:`Py_GetExecPrefix`:請改" -"用 :c:func:`PyConfig_Get(\"base_exec_prefix\") ` " -"(:data:`sys.base_exec_prefix`)。如果需要處理\\ :ref:`虛擬環境 `,請" -"改用 :c:func:`PyConfig_Get(\"exec_prefix\") ` " -"(:data:`sys.exec_prefix`)。" +":c:func:`Py_GetExecPrefix`:請改用 :c:func:" +"`PyConfig_Get(\"base_exec_prefix\") ` (:data:`sys." +"base_exec_prefix`)。如果需要處理\\ :ref:`虛擬環境 `,請改用 :c:" +"func:`PyConfig_Get(\"exec_prefix\") ` (:data:`sys." +"exec_prefix`)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:38 msgid "" ":c:func:`Py_GetProgramFullPath`: Use :c:func:`PyConfig_Get(\"executable\") " "` (:data:`sys.executable`) instead." msgstr "" -":c:func:`Py_GetProgramFullPath`:請改" -"用 :c:func:`PyConfig_Get(\"executable\") ` " -"(:data:`sys.executable`)。" +":c:func:`Py_GetProgramFullPath`:請改用 :c:func:" +"`PyConfig_Get(\"executable\") ` (:data:`sys.executable`)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:41 msgid "" @@ -5260,8 +5242,8 @@ msgstr ":c:func:`!Py_SetPythonHome()`:請改用 :c:member:`PyConfig.home`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:65 msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used " -"with :c:type:`PyConfig` instead." +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` instead." msgstr "" "應改用帶有 :c:type:`PyConfig` 的 :c:func:`Py_InitializeFromConfig` API。" @@ -5271,108 +5253,108 @@ msgstr "全域配置變數:" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:70 msgid "" -":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` " -"or :c:func:`PyConfig_Get(\"parser_debug\") ` instead." +":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` or :c:func:" +"`PyConfig_Get(\"parser_debug\") ` instead." msgstr "" -":c:var:`Py_DebugFlag`:請改用 :c:member:`PyConfig.parser_debug` " -"或 :c:func:`PyConfig_Get(\"parser_debug\") `。" +":c:var:`Py_DebugFlag`:請改用 :c:member:`PyConfig.parser_debug` 或 :c:func:" +"`PyConfig_Get(\"parser_debug\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:73 msgid "" -":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` " -"or :c:func:`PyConfig_Get(\"verbose\") ` instead." +":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` or :c:func:" +"`PyConfig_Get(\"verbose\") ` instead." msgstr "" -":c:var:`Py_VerboseFlag`:請改用 :c:member:`PyConfig.verbose` " -"或 :c:func:`PyConfig_Get(\"verbose\") `。" +":c:var:`Py_VerboseFlag`:請改用 :c:member:`PyConfig.verbose` 或 :c:func:" +"`PyConfig_Get(\"verbose\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:76 msgid "" -":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` " -"or :c:func:`PyConfig_Get(\"quiet\") ` instead." +":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` or :c:func:" +"`PyConfig_Get(\"quiet\") ` instead." msgstr "" -":c:var:`Py_QuietFlag`:請改用 :c:member:`PyConfig.quiet` " -"或 :c:func:`PyConfig_Get(\"quiet\") `。" +":c:var:`Py_QuietFlag`:請改用 :c:member:`PyConfig.quiet` 或 :c:func:" +"`PyConfig_Get(\"quiet\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:79 msgid "" -":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` " -"or :c:func:`PyConfig_Get(\"interactive\") ` instead." +":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` or :c:func:" +"`PyConfig_Get(\"interactive\") ` instead." msgstr "" -":c:var:`Py_InteractiveFlag`:請改用 :c:member:`PyConfig.interactive` " -"或 :c:func:`PyConfig_Get(\"interactive\") `。" +":c:var:`Py_InteractiveFlag`:請改用 :c:member:`PyConfig.interactive` 或 :c:" +"func:`PyConfig_Get(\"interactive\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:82 msgid "" -":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` " -"or :c:func:`PyConfig_Get(\"inspect\") ` instead." +":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` or :c:func:" +"`PyConfig_Get(\"inspect\") ` instead." msgstr "" -":c:var:`Py_InspectFlag`:請改用 :c:member:`PyConfig.inspect` " -"或 :c:func:`PyConfig_Get(\"inspect\") `。" +":c:var:`Py_InspectFlag`:請改用 :c:member:`PyConfig.inspect` 或 :c:func:" +"`PyConfig_Get(\"inspect\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:85 msgid "" -":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` " -"or :c:func:`PyConfig_Get(\"optimization_level\") ` instead." +":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` or :c:" +"func:`PyConfig_Get(\"optimization_level\") ` instead." msgstr "" -":c:var:`Py_OptimizeFlag`:請改用 :c:member:`PyConfig.optimization_level` " -"或 :c:func:`PyConfig_Get(\"optimization_level\") `。" +":c:var:`Py_OptimizeFlag`:請改用 :c:member:`PyConfig.optimization_level` 或 :" +"c:func:`PyConfig_Get(\"optimization_level\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:88 msgid "" -":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` " -"or :c:func:`PyConfig_Get(\"site_import\") ` instead." +":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` or :c:func:" +"`PyConfig_Get(\"site_import\") ` instead." msgstr "" -":c:var:`Py_NoSiteFlag`:請改用 :c:member:`PyConfig.site_import` " -"或 :c:func:`PyConfig_Get(\"site_import\") `。" +":c:var:`Py_NoSiteFlag`:請改用 :c:member:`PyConfig.site_import` 或 :c:func:" +"`PyConfig_Get(\"site_import\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:91 msgid "" -":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` " -"or :c:func:`PyConfig_Get(\"bytes_warning\") ` instead." +":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` or :c:" +"func:`PyConfig_Get(\"bytes_warning\") ` instead." msgstr "" -":c:var:`Py_BytesWarningFlag`:請改用 :c:member:`PyConfig.bytes_warning` " -"或 :c:func:`PyConfig_Get(\"bytes_warning\") `。" +":c:var:`Py_BytesWarningFlag`:請改用 :c:member:`PyConfig.bytes_warning` 或 :" +"c:func:`PyConfig_Get(\"bytes_warning\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:94 msgid "" -":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` " -"or :c:func:`PyConfig_Get(\"pathconfig_warnings\") ` instead." +":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` or :c:" +"func:`PyConfig_Get(\"pathconfig_warnings\") ` instead." msgstr "" -":c:var:`Py_FrozenFlag`:請改用 :c:member:`PyConfig.pathconfig_warnings` " -"或 :c:func:`PyConfig_Get(\"pathconfig_warnings\") `。" +":c:var:`Py_FrozenFlag`:請改用 :c:member:`PyConfig.pathconfig_warnings` 或 :" +"c:func:`PyConfig_Get(\"pathconfig_warnings\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:97 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " "or :c:func:`PyConfig_Get(\"use_environment\") ` instead." msgstr "" -":c:var:`Py_IgnoreEnvironmentFlag`:請改" -"用 :c:member:`PyConfig.use_environment` " -"或 :c:func:`PyConfig_Get(\"use_environment\") `。" +":c:var:`Py_IgnoreEnvironmentFlag`:請改用 :c:member:`PyConfig." +"use_environment` 或 :c:func:`PyConfig_Get(\"use_environment\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:100 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " "or :c:func:`PyConfig_Get(\"write_bytecode\") ` instead." msgstr "" -":c:var:`Py_DontWriteBytecodeFlag`:請改" -"用 :c:member:`PyConfig.write_bytecode` " -"或 :c:func:`PyConfig_Get(\"write_bytecode\") `。" +":c:var:`Py_DontWriteBytecodeFlag`:請改用 :c:member:`PyConfig." +"write_bytecode` 或 :c:func:`PyConfig_Get(\"write_bytecode\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:103 msgid "" -":c:var:`Py_NoUserSiteDirectory`: " -"Use :c:member:`PyConfig.user_site_directory` " -"or :c:func:`PyConfig_Get(\"user_site_directory\") ` instead." +":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig." +"user_site_directory` or :c:func:`PyConfig_Get(\"user_site_directory\") " +"` instead." msgstr "" -":c:var:`Py_NoUserSiteDirectory`:請改" -"用 :c:member:`PyConfig.user_site_directory` " -"或 :c:func:`PyConfig_Get(\"user_site_directory\") `。" +":c:var:`Py_NoUserSiteDirectory`:請改用 :c:member:`PyConfig." +"user_site_directory` 或 :c:func:`PyConfig_Get(\"user_site_directory\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:106 msgid "" -":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` " -"or :c:func:`PyConfig_Get(\"buffered_stdio\") ` instead." +":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` or :" +"c:func:`PyConfig_Get(\"buffered_stdio\") ` instead." msgstr "" ":c:var:`Py_UnbufferedStdioFlag`:請改用 :c:member:`PyConfig.buffered_stdio` " "或 :c:func:`PyConfig_Get(\"buffered_stdio\") `。" @@ -5389,70 +5371,69 @@ msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:113 msgid "" -":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` " -"or :c:func:`PyConfig_Get(\"isolated\") ` instead." +":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` or :c:func:" +"`PyConfig_Get(\"isolated\") ` instead." msgstr "" -":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated` " -"或 :c:func:`PyConfig_Get(\"isolated\") `。" +":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated` 或 :c:func:" +"`PyConfig_Get(\"isolated\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:116 msgid "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: " -"Use :c:member:`PyPreConfig.legacy_windows_fs_encoding` " -"or :c:func:`PyConfig_Get(\"legacy_windows_fs_encoding\") ` " -"instead." +":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig." +"legacy_windows_fs_encoding` or :c:func:" +"`PyConfig_Get(\"legacy_windows_fs_encoding\") ` instead." msgstr "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改" -"用 :c:member:`PyPreConfig.legacy_windows_fs_encoding` " -"或 :c:func:`PyConfig_Get(\"legacy_windows_fs_encoding\") `。" +":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改用 :c:member:`PyPreConfig." +"legacy_windows_fs_encoding` 或 :c:func:" +"`PyConfig_Get(\"legacy_windows_fs_encoding\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:119 msgid "" -":c:var:`Py_LegacyWindowsStdioFlag`: " -"Use :c:member:`PyConfig.legacy_windows_stdio` " -"or :c:func:`PyConfig_Get(\"legacy_windows_stdio\") ` instead." +":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig." +"legacy_windows_stdio` or :c:func:`PyConfig_Get(\"legacy_windows_stdio\") " +"` instead." msgstr "" -":c:var:`Py_LegacyWindowsStdioFlag`:請改" -"用 :c:member:`PyConfig.legacy_windows_stdio` " -"或 :c:func:`PyConfig_Get(\"legacy_windows_stdio\") `。" +":c:var:`Py_LegacyWindowsStdioFlag`:請改用 :c:member:`PyConfig." +"legacy_windows_stdio` 或 :c:func:`PyConfig_Get(\"legacy_windows_stdio\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:122 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`, :c:var:`!" -"Py_HasFileSystemDefaultEncoding`: " -"Use :c:member:`PyConfig.filesystem_encoding` " -"or :c:func:`PyConfig_Get(\"filesystem_encoding\") ` instead." +"Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig." +"filesystem_encoding` or :c:func:`PyConfig_Get(\"filesystem_encoding\") " +"` instead." msgstr "" ":c:var:`!Py_FileSystemDefaultEncoding`、:c:var:`!" -"Py_HasFileSystemDefaultEncoding`:請改" -"用 :c:member:`PyConfig.filesystem_encoding` " -"或 :c:func:`PyConfig_Get(\"filesystem_encoding\") `。" +"Py_HasFileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." +"filesystem_encoding` 或 :c:func:`PyConfig_Get(\"filesystem_encoding\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:125 msgid "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: " -"Use :c:member:`PyConfig.filesystem_errors` " -"or :c:func:`PyConfig_Get(\"filesystem_errors\") ` instead." +":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig." +"filesystem_errors` or :c:func:`PyConfig_Get(\"filesystem_errors\") " +"` instead." msgstr "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改" -"用 :c:member:`PyConfig.filesystem_errors` " -"或 :c:func:`PyConfig_Get(\"filesystem_errors\") `。" +":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改用 :c:member:`PyConfig." +"filesystem_errors` 或 :c:func:`PyConfig_Get(\"filesystem_errors\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:128 msgid "" -":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` " -"or :c:func:`PyConfig_Get(\"utf8_mode\") ` instead. " -"(see :c:func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` or :c:func:" +"`PyConfig_Get(\"utf8_mode\") ` instead. (see :c:func:" +"`Py_PreInitialize`)" msgstr "" -":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode` " -"或 :c:func:`PyConfig_Get(\"utf8_mode\") `。(請參" -"閱 :c:func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode` 或 :c:func:" +"`PyConfig_Get(\"utf8_mode\") `。(請參閱 :c:func:" +"`Py_PreInitialize`)" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:133 msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used " -"with :c:type:`PyConfig` to set these options. Or :c:func:`PyConfig_Get` can " -"be used to get these options at runtime." +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` to set these options. Or :c:func:`PyConfig_Get` can be used to " +"get these options at runtime." msgstr "" "應改用帶有 :c:type:`PyConfig` 的 :c:func:`Py_InitializeFromConfig` API 來設定" "這些選項。或者也可以使用 :c:func:`PyConfig_Get` 在執行時取得這些選項。" @@ -5466,50 +5447,52 @@ msgid "Pending removal in Python 3.18" msgstr "Python 3.18 中待移除的項目" #: ../../deprecations/c-api-pending-removal-in-3.18.rst:4 -msgid "Deprecated private functions (:gh:`128863`):" -msgstr "被棄用的私有函式 (:gh:`128863`):" +msgid "" +"The following private functions are deprecated and planned for removal in " +"Python 3.18:" +msgstr "以下私有函式已被棄用,並計劃在 Python 3.18 中移除:" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:6 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:7 msgid ":c:func:`!_PyBytes_Join`: use :c:func:`PyBytes_Join`." msgstr ":c:func:`!_PyBytes_Join`:請改用 :c:func:`PyBytes_Join`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:7 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:8 msgid "" -":c:func:`!_PyDict_GetItemStringWithError`: " -"use :c:func:`PyDict_GetItemStringRef`." +":c:func:`!_PyDict_GetItemStringWithError`: use :c:func:" +"`PyDict_GetItemStringRef`." msgstr "" -":c:func:`!_PyDict_GetItemStringWithError`:請改" -"用 :c:func:`PyDict_GetItemStringRef`。" +":c:func:`!_PyDict_GetItemStringWithError`:請改用 :c:func:" +"`PyDict_GetItemStringRef`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:8 -msgid ":c:func:`!_PyDict_Pop()`: :c:func:`PyDict_Pop`." +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:9 +msgid ":c:func:`!_PyDict_Pop()`: use :c:func:`PyDict_Pop`." msgstr ":c:func:`!_PyDict_Pop()`:請改用 :c:func:`PyDict_Pop`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:9 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:10 msgid ":c:func:`!_PyLong_Sign()`: use :c:func:`PyLong_GetSign`." msgstr ":c:func:`!_PyLong_Sign()`:請改用 :c:func:`PyLong_GetSign`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:10 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:11 msgid "" -":c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`: " -"use :c:func:`PyLongWriter_Create`." +":c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`: use :c:func:" +"`PyLongWriter_Create`." msgstr "" -":c:func:`!_PyLong_FromDigits` 和 :c:func:`!_PyLong_New`:請改" -"用 :c:func:`PyLongWriter_Create`。" +":c:func:`!_PyLong_FromDigits` 和 :c:func:`!_PyLong_New`:請改用 :c:func:" +"`PyLongWriter_Create`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:12 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:13 msgid "" -":c:func:`!_PyThreadState_UncheckedGet`: " -"use :c:func:`PyThreadState_GetUnchecked`." +":c:func:`!_PyThreadState_UncheckedGet`: use :c:func:" +"`PyThreadState_GetUnchecked`." msgstr "" -":c:func:`!_PyThreadState_UncheckedGet`:請改" -"用 :c:func:`PyThreadState_GetUnchecked`。" +":c:func:`!_PyThreadState_UncheckedGet`:請改用 :c:func:" +"`PyThreadState_GetUnchecked`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:13 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:14 msgid ":c:func:`!_PyUnicode_AsString`: use :c:func:`PyUnicode_AsUTF8`." msgstr ":c:func:`!_PyUnicode_AsString`:請改用 :c:func:`PyUnicode_AsUTF8`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:14 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:15 msgid "" ":c:func:`!_PyUnicodeWriter_Init`: replace ``_PyUnicodeWriter_Init(&writer)`` " "with :c:func:`writer = PyUnicodeWriter_Create(0) `." @@ -5517,108 +5500,102 @@ msgstr "" ":c:func:`!_PyUnicodeWriter_Init`:將 ``_PyUnicodeWriter_Init(&writer)`` 替換" "為 :c:func:`writer = PyUnicodeWriter_Create(0) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:17 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:18 msgid "" ":c:func:`!_PyUnicodeWriter_Finish`: replace " -"``_PyUnicodeWriter_Finish(&writer)`` " -"with :c:func:`PyUnicodeWriter_Finish(writer) `." +"``_PyUnicodeWriter_Finish(&writer)`` with :c:func:" +"`PyUnicodeWriter_Finish(writer) `." msgstr "" ":c:func:`!_PyUnicodeWriter_Finish`:將 ``_PyUnicodeWriter_Finish(&writer)`` " "替換為 :c:func:`PyUnicodeWriter_Finish(writer) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:20 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:21 msgid "" ":c:func:`!_PyUnicodeWriter_Dealloc`: replace " -"``_PyUnicodeWriter_Dealloc(&writer)`` " -"with :c:func:`PyUnicodeWriter_Discard(writer) `." +"``_PyUnicodeWriter_Dealloc(&writer)`` with :c:func:" +"`PyUnicodeWriter_Discard(writer) `." msgstr "" ":c:func:`!_PyUnicodeWriter_Dealloc`:將 " -"``_PyUnicodeWriter_Dealloc(&writer)`` 替換" -"為 :c:func:`PyUnicodeWriter_Discard(writer) `。" +"``_PyUnicodeWriter_Dealloc(&writer)`` 替換為 :c:func:" +"`PyUnicodeWriter_Discard(writer) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:23 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:24 msgid "" ":c:func:`!_PyUnicodeWriter_WriteChar`: replace " -"``_PyUnicodeWriter_WriteChar(&writer, ch)`` " -"with :c:func:`PyUnicodeWriter_WriteChar(writer, ch) " -"`." +"``_PyUnicodeWriter_WriteChar(&writer, ch)`` with :c:func:" +"`PyUnicodeWriter_WriteChar(writer, ch) `." msgstr "" ":c:func:`!_PyUnicodeWriter_WriteChar`:將 " -"``_PyUnicodeWriter_WriteChar(&writer, ch)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteChar(writer, ch) " -"`。" +"``_PyUnicodeWriter_WriteChar(&writer, ch)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteChar(writer, ch) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:26 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:27 msgid "" ":c:func:`!_PyUnicodeWriter_WriteStr`: replace " -"``_PyUnicodeWriter_WriteStr(&writer, str)`` " -"with :c:func:`PyUnicodeWriter_WriteStr(writer, str) " -"`." +"``_PyUnicodeWriter_WriteStr(&writer, str)`` with :c:func:" +"`PyUnicodeWriter_WriteStr(writer, str) `." msgstr "" ":c:func:`!_PyUnicodeWriter_WriteStr`:將 " -"``_PyUnicodeWriter_WriteStr(&writer, str)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteStr(writer, str) " -"`。" +"``_PyUnicodeWriter_WriteStr(&writer, str)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteStr(writer, str) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:29 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:30 msgid "" ":c:func:`!_PyUnicodeWriter_WriteSubstring`: replace " -"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` " -"with :c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " +"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` with :c:func:" +"`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " "`." msgstr "" ":c:func:`!_PyUnicodeWriter_WriteSubstring`:將 " -"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " +"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " "`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:32 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:33 msgid "" ":c:func:`!_PyUnicodeWriter_WriteASCIIString`: replace " -"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` " -"with :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " -"`." +"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` with :c:func:" +"`PyUnicodeWriter_WriteASCII(writer, str) `." msgstr "" ":c:func:`!_PyUnicodeWriter_WriteASCIIString`:將 " -"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " -"`。" +"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteASCII(writer, str) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:35 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:36 msgid "" ":c:func:`!_PyUnicodeWriter_WriteLatin1String`: replace " -"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` " -"with :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " -"`." +"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` with :c:func:" +"`PyUnicodeWriter_WriteUTF8(writer, str) `." msgstr "" ":c:func:`!_PyUnicodeWriter_WriteLatin1String`:將 " -"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " -"`。" +"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteUTF8(writer, str) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:38 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:39 msgid ":c:func:`!_PyUnicodeWriter_Prepare`: (no replacement)." msgstr ":c:func:`!_PyUnicodeWriter_Prepare`:(無替代方案)。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:39 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:40 msgid ":c:func:`!_PyUnicodeWriter_PrepareKind`: (no replacement)." msgstr ":c:func:`!_PyUnicodeWriter_PrepareKind`:(無替代方案)。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:40 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:41 msgid ":c:func:`!_Py_HashPointer`: use :c:func:`Py_HashPointer`." msgstr ":c:func:`!_Py_HashPointer`:請改用 :c:func:`Py_HashPointer`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:41 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:42 msgid ":c:func:`!_Py_fopen_obj`: use :c:func:`Py_fopen`." msgstr ":c:func:`!_Py_fopen_obj`:請改用 :c:func:`Py_fopen`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:43 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:44 msgid "" "The `pythoncapi-compat project `__ can be used to get these new public functions on Python 3.13 and older." +">`__ can be used to get these new public functions on Python 3.13 and older. " +"(Contributed by Victor Stinner in :gh:`128863`.)" msgstr "" "可以使用 `pythoncapi-compat project `__ 來取得這些於 Python 3.13 及更早版本的新公開函式。" +"compat/>`__ 來取得這些於 Python 3.13 及更早版本的新公開函式。(由 " +"Victor Stinner 在 :gh:`128863` 貢獻)" #: ../../deprecations/c-api-pending-removal-in-future.rst:4 msgid "" @@ -5639,8 +5616,8 @@ msgid "" ":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " "instead." msgstr "" -":c:func:`PyErr_NormalizeException`:請改" -"用 :c:func:`PyErr_GetRaisedException`。" +":c:func:`PyErr_NormalizeException`:請改用 :c:func:" +"`PyErr_GetRaisedException`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:13 msgid "" @@ -5660,11 +5637,11 @@ msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:19 msgid "" -":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` " -"and :c:func:`PySlice_AdjustIndices` instead." +":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:" +"`PySlice_AdjustIndices` instead." msgstr "" -":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` " -"和 :c:func:`PySlice_AdjustIndices`。" +":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:" +"`PySlice_AdjustIndices`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:21 msgid ":c:func:`PyUnicode_READY`: Unneeded since Python 3.12" @@ -5686,8 +5663,8 @@ msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead." msgstr "" -":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼" -"叫 :c:func:`PyObject_Hash`。" +":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼叫 :c:func:" +"`PyObject_Hash`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:29 msgid "Thread Local Storage (TLS) API:" @@ -5736,10 +5713,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:2566 msgid "" -"``aarch64-linux-android`` and ``x86_64-linux-android`` are both " -"now :pep:`11` tier 3 platforms. (:ref:`PEP 738 ` written and implementation contributed by Malcolm Smith " -"in :gh:`116622`.)" +"``aarch64-linux-android`` and ``x86_64-linux-android`` are both now :pep:" +"`11` tier 3 platforms. (:ref:`PEP 738 ` " +"written and implementation contributed by Malcolm Smith in :gh:`116622`.)" msgstr "" #: ../../whatsnew/3.13.rst:2571 @@ -5753,8 +5729,8 @@ msgid "" "``wasm32-emscripten`` is no longer a :pep:`11` supported platform. " "(Contributed by Brett Cannon in :gh:`115192`.)" msgstr "" -"``wasm32-emscripten`` 不再是 :pep:`11` 支援的平台。(由 Brett Cannon " -"在 :gh:`115192` 貢獻。)" +"``wasm32-emscripten`` 不再是 :pep:`11` 支援的平台。(由 Brett Cannon 在 :gh:" +"`115192` 貢獻。)" #: ../../whatsnew/3.13.rst:2577 msgid "" @@ -5764,9 +5740,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:2580 msgid "" -"Autoconf 2.71 and aclocal 1.16.5 are now required to regenerate " -"the :file:`configure` script. (Contributed by Christian Heimes " -"in :gh:`89886` and by Victor Stinner in :gh:`112090`.)" +"Autoconf 2.71 and aclocal 1.16.5 are now required to regenerate the :file:" +"`configure` script. (Contributed by Christian Heimes in :gh:`89886` and by " +"Victor Stinner in :gh:`112090`.)" msgstr "" #: ../../whatsnew/3.13.rst:2584 @@ -5792,9 +5768,8 @@ msgstr "" #: ../../whatsnew/3.13.rst:2600 msgid "" "Python built with :file:`configure` :option:`--with-trace-refs` (tracing " -"references) is now ABI compatible with the Python release build " -"and :ref:`debug build `. (Contributed by Victor Stinner " -"in :gh:`108634`.)" +"references) is now ABI compatible with the Python release build and :ref:" +"`debug build `. (Contributed by Victor Stinner in :gh:`108634`.)" msgstr "" #: ../../whatsnew/3.13.rst:2605 @@ -5807,11 +5782,11 @@ msgstr "" #: ../../whatsnew/3.13.rst:2609 msgid "" "The ``errno``, ``fcntl``, ``grp``, ``md5``, ``pwd``, ``resource``, " -"``termios``, ``winsound``, ``_ctypes_test``, " -"``_multiprocessing.posixshmem``, ``_scproxy``, ``_stat``, ``_statistics``, " -"``_testconsole``, ``_testimportmultiple`` and ``_uuid`` C extensions are now " -"built with the :ref:`limited C API `. (Contributed by Victor " -"Stinner in :gh:`85283`.)" +"``termios``, ``winsound``, ``_ctypes_test``, ``_multiprocessing." +"posixshmem``, ``_scproxy``, ``_stat``, ``_statistics``, ``_testconsole``, " +"``_testimportmultiple`` and ``_uuid`` C extensions are now built with the :" +"ref:`limited C API `. (Contributed by Victor Stinner in :gh:" +"`85283`.)" msgstr "" #: ../../whatsnew/3.13.rst:2618 @@ -5868,9 +5843,9 @@ msgstr "" #: ../../whatsnew/3.13.rst:2653 msgid "" ":class:`functools.partial` now emits a :exc:`FutureWarning` when used as a " -"method. The behavior will change in future Python versions. Wrap it " -"in :func:`staticmethod` if you want to preserve the old behavior. " -"(Contributed by Serhiy Storchaka in :gh:`121027`.)" +"method. The behavior will change in future Python versions. Wrap it in :func:" +"`staticmethod` if you want to preserve the old behavior. (Contributed by " +"Serhiy Storchaka in :gh:`121027`.)" msgstr "" #: ../../whatsnew/3.13.rst:2659 @@ -5928,8 +5903,8 @@ msgid "" "``Python.h`` no longer includes the ```` standard header. It was " "included for the :c:func:`!finite` function which is now provided by the " "```` header. It should now be included explicitly if needed. Remove " -"also the ``HAVE_IEEEFP_H`` macro. (Contributed by Victor Stinner " -"in :gh:`108765`.)" +"also the ``HAVE_IEEEFP_H`` macro. (Contributed by Victor Stinner in :gh:" +"`108765`.)" msgstr "" #: ../../whatsnew/3.13.rst:2698 @@ -5938,9 +5913,9 @@ msgid "" "```` and ````. If needed, they should now be " "included explicitly. For example, ```` provides the :c:func:`!clock` " "and :c:func:`!gmtime` functions, ```` provides the :c:func:`!" -"select` function, and ```` provides the :c:func:`!" -"futimes`, :c:func:`!gettimeofday` and :c:func:`!setitimer` functions. " -"(Contributed by Victor Stinner in :gh:`108765`.)" +"select` function, and ```` provides the :c:func:`!futimes`, :c:" +"func:`!gettimeofday` and :c:func:`!setitimer` functions. (Contributed by " +"Victor Stinner in :gh:`108765`.)" msgstr "" #: ../../whatsnew/3.13.rst:2706 @@ -6032,17 +6007,16 @@ msgstr "" #: ../../whatsnew/3.13.rst:2754 msgid "" -"The effects of mutating the dictionary returned " -"from :c:func:`PyEval_GetLocals` in an :term:`optimized scope` have changed. " -"New dict entries added this way will now *only* be visible to " -"subsequent :c:func:`PyEval_GetLocals` calls in that frame, " -"as :c:func:`PyFrame_GetLocals`, :func:`locals`, " -"and :attr:`FrameType.f_locals ` no longer access the same " -"underlying cached dictionary. Changes made to entries for actual variable " -"names and names added via the write-through proxy interfaces will be " -"overwritten on subsequent calls to :c:func:`PyEval_GetLocals` in that frame. " -"The recommended code update depends on how the function was being used, so " -"refer to the deprecation notice on the function for details." +"The effects of mutating the dictionary returned from :c:func:" +"`PyEval_GetLocals` in an :term:`optimized scope` have changed. New dict " +"entries added this way will now *only* be visible to subsequent :c:func:" +"`PyEval_GetLocals` calls in that frame, as :c:func:`PyFrame_GetLocals`, :" +"func:`locals`, and :attr:`FrameType.f_locals ` no longer " +"access the same underlying cached dictionary. Changes made to entries for " +"actual variable names and names added via the write-through proxy interfaces " +"will be overwritten on subsequent calls to :c:func:`PyEval_GetLocals` in " +"that frame. The recommended code update depends on how the function was " +"being used, so refer to the deprecation notice on the function for details." msgstr "" #: ../../whatsnew/3.13.rst:2767 @@ -6050,8 +6024,8 @@ msgid "" "Calling :c:func:`PyFrame_GetLocals` in an :term:`optimized scope` now " "returns a write-through proxy rather than a snapshot that gets updated at " "ill-specified times. If a snapshot is desired, it must be created explicitly " -"(e.g. with :c:func:`PyDict_Copy`), or by calling the " -"new :c:func:`PyEval_GetFrameLocals` API." +"(e.g. with :c:func:`PyDict_Copy`), or by calling the new :c:func:" +"`PyEval_GetFrameLocals` API." msgstr "" #: ../../whatsnew/3.13.rst:2774 @@ -6089,11 +6063,11 @@ msgstr "``_PyErr_WriteUnraisableMsg()``::c:func:`PyErr_FormatUnraisable`;" #: ../../whatsnew/3.13.rst:2789 msgid "" -"``_PyEval_SetTrace()``: :c:func:`PyEval_SetTrace` " -"or :c:func:`PyEval_SetTraceAllThreads`;" +"``_PyEval_SetTrace()``: :c:func:`PyEval_SetTrace` or :c:func:" +"`PyEval_SetTraceAllThreads`;" msgstr "" -"``_PyEval_SetTrace()``::c:func:`PyEval_SetTrace` " -"或 :c:func:`PyEval_SetTraceAllThreads`;" +"``_PyEval_SetTrace()``::c:func:`PyEval_SetTrace` 或 :c:func:" +"`PyEval_SetTraceAllThreads`;" #: ../../whatsnew/3.13.rst:2790 msgid "``_PyList_Extend()``: :c:func:`PyList_Extend`;" @@ -6113,15 +6087,19 @@ msgstr "``_PyMem_Strdup()``:``strdup()``;" #: ../../whatsnew/3.13.rst:2794 msgid "``_PyObject_ClearManagedDict()``: :c:func:`PyObject_ClearManagedDict`;" -msgstr "``_PyObject_ClearManagedDict()``::c:func:`PyObject_ClearManagedDict`;" +msgstr "" +"``_PyObject_ClearManagedDict()``::c:func:`PyObject_ClearManagedDict`;" #: ../../whatsnew/3.13.rst:2795 msgid "``_PyObject_VisitManagedDict()``: :c:func:`PyObject_VisitManagedDict`;" -msgstr "``_PyObject_VisitManagedDict()``::c:func:`PyObject_VisitManagedDict`;" +msgstr "" +"``_PyObject_VisitManagedDict()``::c:func:`PyObject_VisitManagedDict`;" #: ../../whatsnew/3.13.rst:2796 -msgid "``_PyThreadState_UncheckedGet()``: :c:func:`PyThreadState_GetUnchecked()`;" -msgstr "``_PyThreadState_UncheckedGet()``::c:func:`PyThreadState_GetUnchecked()`;" +msgid "" +"``_PyThreadState_UncheckedGet()``: :c:func:`PyThreadState_GetUnchecked()`;" +msgstr "" +"``_PyThreadState_UncheckedGet()``::c:func:`PyThreadState_GetUnchecked()`;" #: ../../whatsnew/3.13.rst:2797 msgid "``_PyTime_AsSecondsDouble()``: :c:func:`PyTime_AsSecondsDouble`;" @@ -6129,27 +6107,27 @@ msgstr "``_PyTime_AsSecondsDouble()``::c:func:`PyTime_AsSecondsDouble`;" #: ../../whatsnew/3.13.rst:2798 msgid "" -"``_PyTime_GetMonotonicClock()``: :c:func:`PyTime_Monotonic` " -"or :c:func:`PyTime_MonotonicRaw`;" +"``_PyTime_GetMonotonicClock()``: :c:func:`PyTime_Monotonic` or :c:func:" +"`PyTime_MonotonicRaw`;" msgstr "" -"``_PyTime_GetMonotonicClock()``::c:func:`PyTime_Monotonic` " -"或 :c:func:`PyTime_MonotonicRaw`;" +"``_PyTime_GetMonotonicClock()``::c:func:`PyTime_Monotonic` 或 :c:func:" +"`PyTime_MonotonicRaw`;" #: ../../whatsnew/3.13.rst:2799 msgid "" -"``_PyTime_GetPerfCounter()``: :c:func:`PyTime_PerfCounter` " -"or :c:func:`PyTime_PerfCounterRaw`;" +"``_PyTime_GetPerfCounter()``: :c:func:`PyTime_PerfCounter` or :c:func:" +"`PyTime_PerfCounterRaw`;" msgstr "" -"``_PyTime_GetPerfCounter()``::c:func:`PyTime_PerfCounter` " -"或 :c:func:`PyTime_PerfCounterRaw`;" +"``_PyTime_GetPerfCounter()``::c:func:`PyTime_PerfCounter` 或 :c:func:" +"`PyTime_PerfCounterRaw`;" #: ../../whatsnew/3.13.rst:2800 msgid "" -"``_PyTime_GetSystemClock()``: :c:func:`PyTime_Time` " -"or :c:func:`PyTime_TimeRaw`;" +"``_PyTime_GetSystemClock()``: :c:func:`PyTime_Time` or :c:func:" +"`PyTime_TimeRaw`;" msgstr "" -"``_PyTime_GetSystemClock()``::c:func:`PyTime_Time` " -"或 :c:func:`PyTime_TimeRaw`;" +"``_PyTime_GetSystemClock()``::c:func:`PyTime_Time` 或 :c:func:" +"`PyTime_TimeRaw`;" #: ../../whatsnew/3.13.rst:2801 msgid "``_PyTime_MAX``: :c:var:`PyTime_MAX`;" @@ -6185,13 +6163,20 @@ msgstr "迴歸測試的變更" #: ../../whatsnew/3.13.rst:2813 msgid "" -"Python built with :file:`configure` :option:`--with-pydebug` now supports " -"a :option:`-X presite=package.module <-X>` command-line option. If used, it " +"Python built with :file:`configure` :option:`--with-pydebug` now supports a :" +"option:`-X presite=package.module <-X>` command-line option. If used, it " "specifies a module that should be imported early in the lifecycle of the " "interpreter, before ``site.py`` is executed. (Contributed by Łukasz Langa " "in :gh:`110769`.)" msgstr "" -"使用 :file:`configure` :option:`--with-pydebug` 建置的 Python 現在支" -"援 :option:`-X presite=package.module <-X>` 命令列選項。如果使用它就會指定一" -"個應該在直譯器生命週期的早期階段、在執行 ``site.py`` 之前被引入的模組。(由 " +"使用 :file:`configure` :option:`--with-pydebug` 建置的 Python 現在支援 :" +"option:`-X presite=package.module <-X>` 命令列選項。如果使用它就會指定一個應" +"該在直譯器生命週期的早期階段、在執行 ``site.py`` 之前被引入的模組。(由 " "Łukasz Langa 在 :gh:`110769` 中貢獻。)" + +#~ msgid "" +#~ ":mod:`typing`: :class:`!typing.ByteString`, deprecated since Python 3.9, " +#~ "now causes a :exc:`DeprecationWarning` to be emitted when it is used." +#~ msgstr "" +#~ ":mod:`typing`:自 Python 3.9 起已被棄用的 :class:`!typing.ByteString` 現在" +#~ "在使用時會發出 :exc:`DeprecationWarning`。" diff --git a/whatsnew/3.14.po b/whatsnew/3.14.po index 259c8bc51c..147dddd4b7 100644 --- a/whatsnew/3.14.po +++ b/whatsnew/3.14.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-08 15:25+0800\n" +"POT-Creation-Date: 2025-09-18 00:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -61,9 +61,9 @@ msgstr "" #: ../../whatsnew/3.14.rst:72 msgid "" -"The biggest changes to the implementation include template strings " -"(:pep:`750`), deferred evaluation of annotations (:pep:`649`), and a new " -"type of interpreter that uses tail calls." +"The biggest changes to the implementation include template strings (:pep:" +"`750`), deferred evaluation of annotations (:pep:`649`), and a new type of " +"interpreter that uses tail calls." msgstr "" #: ../../whatsnew/3.14.rst:76 @@ -141,8 +141,8 @@ msgstr "" msgid "" ":ref:`Syntax highlighting in PyREPL `, and " "color output in :ref:`unittest `, :ref:`argparse " -"`, :ref:`json ` " -"and :ref:`calendar ` CLIs" +"`, :ref:`json ` and :ref:" +"`calendar ` CLIs" msgstr "" #: ../../whatsnew/3.14.rst:102 @@ -158,8 +158,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:108 msgid "" "On platforms other than macOS and Windows, the default :ref:`start method " -"` for :mod:`multiprocessing` " -"and :class:`~concurrent.futures.ProcessPoolExecutor` switches from *fork* to " +"` for :mod:`multiprocessing` and :class:" +"`~concurrent.futures.ProcessPoolExecutor` switches from *fork* to " "*forkserver*." msgstr "" @@ -171,20 +171,20 @@ msgstr "" #: ../../whatsnew/3.14.rst:116 msgid "" -"If you encounter :exc:`NameError`\\s or pickling errors coming out " -"of :mod:`multiprocessing` or :mod:`concurrent.futures`, see " -"the :ref:`forkserver restrictions `." +"If you encounter :exc:`NameError`\\s or pickling errors coming out of :mod:" +"`multiprocessing` or :mod:`concurrent.futures`, see the :ref:`forkserver " +"restrictions `." msgstr "" #: ../../whatsnew/3.14.rst:120 msgid "" "The interpreter avoids some reference count modifications internally when " -"it's safe to do so. This can lead to different values returned " -"from :func:`sys.getrefcount` and :c:func:`Py_REFCNT` compared to previous " -"versions of Python. See :ref:`below ` for details." +"it's safe to do so. This can lead to different values returned from :func:" +"`sys.getrefcount` and :c:func:`Py_REFCNT` compared to previous versions of " +"Python. See :ref:`below ` for details." msgstr "" -#: ../../whatsnew/3.14.rst:126 ../../whatsnew/3.14.rst:2827 +#: ../../whatsnew/3.14.rst:126 msgid "New features" msgstr "" @@ -242,8 +242,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:164 msgid "" -"That limitation is removed in the 3.14 release, with the " -"new :mod:`concurrent.interpreters` module." +"That limitation is removed in the 3.14 release, with the new :mod:" +"`concurrent.interpreters` module." msgstr "" #: ../../whatsnew/3.14.rst:167 @@ -265,8 +265,8 @@ msgid "" "For some use cases, concurrency in software enables efficiency and can " "simplify software, at a high level. At the same time, implementing and " "maintaining all but the simplest concurrency is often a struggle for the " -"human brain. That especially applies to plain threads (for " -"example, :mod:`threading`), where all memory is shared between all threads." +"human brain. That especially applies to plain threads (for example, :mod:" +"`threading`), where all memory is shared between all threads." msgstr "" #: ../../whatsnew/3.14.rst:179 @@ -280,20 +280,20 @@ msgstr "" #: ../../whatsnew/3.14.rst:185 msgid "" "Regarding multi-core parallelism: as of the 3.12 release, interpreters are " -"now sufficiently isolated from one another to be used in parallel. " -"(See :pep:`684`.) This unlocks a variety of CPU-intensive use cases for " -"Python that were limited by the :term:`GIL`." +"now sufficiently isolated from one another to be used in parallel. (See :pep:" +"`684`.) This unlocks a variety of CPU-intensive use cases for Python that " +"were limited by the :term:`GIL`." msgstr "" #: ../../whatsnew/3.14.rst:190 msgid "" -"Using multiple interpreters is similar in many ways " -"to :mod:`multiprocessing`, in that they both provide isolated logical " -"\"processes\" that can run in parallel, with no sharing by default. However, " -"when using multiple interpreters, an application will use fewer system " -"resources and will operate more efficiently (since it stays within the same " -"process). Think of multiple interpreters as having the isolation of " -"processes with the efficiency of threads." +"Using multiple interpreters is similar in many ways to :mod:" +"`multiprocessing`, in that they both provide isolated logical \"processes\" " +"that can run in parallel, with no sharing by default. However, when using " +"multiple interpreters, an application will use fewer system resources and " +"will operate more efficiently (since it stays within the same process). " +"Think of multiple interpreters as having the isolation of processes with the " +"efficiency of threads." msgstr "" #: ../../whatsnew/3.14.rst:201 @@ -350,9 +350,9 @@ msgid "" "provide utilities that are less appropriate on PyPI. In the meantime, most " "of the limitations can also be addressed through extension modules, meaning " "PyPI packages can fill any gap for 3.14, and even back to 3.12 where " -"interpreters were finally properly isolated and stopped sharing " -"the :term:`GIL`. Likewise, we expect to slowly see libraries on PyPI for " -"high-level abstractions on top of interpreters." +"interpreters were finally properly isolated and stopped sharing the :term:" +"`GIL`. Likewise, we expect to slowly see libraries on PyPI for high-level " +"abstractions on top of interpreters." msgstr "" #: ../../whatsnew/3.14.rst:233 @@ -383,9 +383,9 @@ msgstr "" #: ../../whatsnew/3.14.rst:254 msgid "" "Template string literals (t-strings) are a generalization of f-strings, " -"using a ``t`` in place of the ``f`` prefix. Instead of evaluating " -"to :class:`str`, t-strings evaluate to a new :class:`!" -"string.templatelib.Template` type:" +"using a ``t`` in place of the ``f`` prefix. Instead of evaluating to :class:" +"`str`, t-strings evaluate to a new :class:`!string.templatelib.Template` " +"type:" msgstr "" #: ../../whatsnew/3.14.rst:258 @@ -584,15 +584,14 @@ msgstr "" #: ../../whatsnew/3.14.rst:387 msgid "" -"The new ``compression`` package contains modules :mod:`!" -"compression.lzma`, :mod:`!compression.bz2`, :mod:`!compression.gzip` " -"and :mod:`!compression.zlib` which re-export " -"the :mod:`lzma`, :mod:`bz2`, :mod:`gzip` and :mod:`zlib` modules " -"respectively. The new import names under ``compression`` are the canonical " -"names for importing these compression modules going forward. However, the " -"existing modules names have not been deprecated. Any deprecation or removal " -"of the existing compression modules will occur no sooner than five years " -"after the release of 3.14." +"The new ``compression`` package contains modules :mod:`!compression.lzma`, :" +"mod:`!compression.bz2`, :mod:`!compression.gzip` and :mod:`!compression." +"zlib` which re-export the :mod:`lzma`, :mod:`bz2`, :mod:`gzip` and :mod:" +"`zlib` modules respectively. The new import names under ``compression`` are " +"the canonical names for importing these compression modules going forward. " +"However, the existing modules names have not been deprecated. Any " +"deprecation or removal of the existing compression modules will occur no " +"sooner than five years after the release of 3.14." msgstr "" #: ../../whatsnew/3.14.rst:396 @@ -602,8 +601,8 @@ msgid "" "library `__. Zstandard is a widely " "adopted, highly efficient, and fast compression format. In addition to the " "APIs introduced in :mod:`!compression.zstd`, support for reading and writing " -"Zstandard compressed archives has been added to " -"the :mod:`tarfile`, :mod:`zipfile`, and :mod:`shutil` modules." +"Zstandard compressed archives has been added to the :mod:`tarfile`, :mod:" +"`zipfile`, and :mod:`shutil` modules." msgstr "" #: ../../whatsnew/3.14.rst:404 @@ -625,8 +624,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:418 msgid "" -"As can be seen, the API is similar to the APIs of the :mod:`!lzma` " -"and :mod:`!bz2` modules." +"As can be seen, the API is similar to the APIs of the :mod:`!lzma` and :mod:" +"`!bz2` modules." msgstr "" #: ../../whatsnew/3.14.rst:421 @@ -736,13 +735,12 @@ msgstr "" #: ../../whatsnew/3.14.rst:504 msgid "" "The new :mod:`annotationlib` module provides tools for inspecting deferred " -"annotations. Annotations may be evaluated in " -"the :attr:`~annotationlib.Format.VALUE` format (which evaluates annotations " -"to runtime values, similar to the behavior in earlier Python versions), " -"the :attr:`~annotationlib.Format.FORWARDREF` format (which replaces " -"undefined names with special markers), and " -"the :attr:`~annotationlib.Format.STRING` format (which returns annotations " -"as strings)." +"annotations. Annotations may be evaluated in the :attr:`~annotationlib." +"Format.VALUE` format (which evaluates annotations to runtime values, similar " +"to the behavior in earlier Python versions), the :attr:`~annotationlib." +"Format.FORWARDREF` format (which replaces undefined names with special " +"markers), and the :attr:`~annotationlib.Format.STRING` format (which returns " +"annotations as strings)." msgstr "" #: ../../whatsnew/3.14.rst:511 @@ -794,20 +792,18 @@ msgstr "" msgid "" "If your code reads the ``__annotations__`` attribute on objects, you may " "want to make changes in order to support code that relies on deferred " -"evaluation of annotations. For example, you may want to " -"use :func:`annotationlib.get_annotations` with " -"the :attr:`~annotationlib.Format.FORWARDREF` format, as " -"the :mod:`dataclasses` module now does." +"evaluation of annotations. For example, you may want to use :func:" +"`annotationlib.get_annotations` with the :attr:`~annotationlib.Format." +"FORWARDREF` format, as the :mod:`dataclasses` module now does." msgstr "" #: ../../whatsnew/3.14.rst:551 msgid "" "The external :pypi:`typing_extensions` package provides partial backports of " -"some of the functionality of the :mod:`annotationlib` module, such as " -"the :class:`~annotationlib.Format` enum and " -"the :func:`~annotationlib.get_annotations` function. These can be used to " -"write cross-version code that takes advantage of the new behavior in Python " -"3.14." +"some of the functionality of the :mod:`annotationlib` module, such as the :" +"class:`~annotationlib.Format` enum and the :func:`~annotationlib." +"get_annotations` function. These can be used to write cross-version code " +"that takes advantage of the new behavior in Python 3.14." msgstr "" #: ../../whatsnew/3.14.rst:557 @@ -828,9 +824,9 @@ msgstr "" #: ../../whatsnew/3.14.rst:567 msgid "" "In particular, do not read annotations directly from the namespace " -"dictionary attribute of type objects. " -"Use :func:`annotationlib.get_annotate_from_class_namespace` during class " -"construction and :func:`annotationlib.get_annotations` afterwards." +"dictionary attribute of type objects. Use :func:`annotationlib." +"get_annotate_from_class_namespace` during class construction and :func:" +"`annotationlib.get_annotations` afterwards." msgstr "" #: ../../whatsnew/3.14.rst:571 @@ -958,13 +954,13 @@ msgstr "" #: ../../whatsnew/3.14.rst:667 msgid "" -"If a statement " -"(:keyword:`pass`, :keyword:`del`, :keyword:`return`, :keyword:`yield`, :keyword:`raise`, :keyword:`break`, :keyword:`continue`, :keyword:`assert`, :keyword:`import`, :keyword:`from`) " -"is passed to the :ref:`if_expr` after :keyword:`else`, or one " -"of :keyword:`pass`, :keyword:`break`, or :keyword:`continue` is passed " -"before :keyword:`if`, then the error message highlights where " -"the :token:`~python-grammar:expression` is required. (Contributed by Sergey " -"Miryanov in :gh:`129515`.)" +"If a statement (:keyword:`pass`, :keyword:`del`, :keyword:`return`, :keyword:" +"`yield`, :keyword:`raise`, :keyword:`break`, :keyword:`continue`, :keyword:" +"`assert`, :keyword:`import`, :keyword:`from`) is passed to the :ref:" +"`if_expr` after :keyword:`else`, or one of :keyword:`pass`, :keyword:" +"`break`, or :keyword:`continue` is passed before :keyword:`if`, then the " +"error message highlights where the :token:`~python-grammar:expression` is " +"required. (Contributed by Sergey Miryanov in :gh:`129515`.)" msgstr "" #: ../../whatsnew/3.14.rst:675 @@ -1035,8 +1031,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:721 msgid "" -"(Contributed by Nikita Sobolev in :gh:`123539`, :gh:`123562`, " -"and :gh:`123440`.)" +"(Contributed by Nikita Sobolev in :gh:`123539`, :gh:`123562`, and :gh:" +"`123440`.)" msgstr "" #: ../../whatsnew/3.14.rst:724 @@ -1087,9 +1083,9 @@ msgstr "" #: ../../whatsnew/3.14.rst:764 msgid "" -"Complete the :pep:`587` :ref:`PyConfig C API ` by " -"adding :c:func:`PyInitConfig_AddModule` which can be used to add a built-in " -"extension module; a feature previously referred to as the “inittab”." +"Complete the :pep:`587` :ref:`PyConfig C API ` by adding :c:" +"func:`PyInitConfig_AddModule` which can be used to add a built-in extension " +"module; a feature previously referred to as the “inittab”." msgstr "" #: ../../whatsnew/3.14.rst:768 @@ -1116,8 +1112,8 @@ msgid "" "configuration mechanisms)." msgstr "" -#: ../../whatsnew/3.14.rst:783 ../../whatsnew/3.14.rst:2889 -#: ../../whatsnew/3.14.rst:2908 +#: ../../whatsnew/3.14.rst:783 ../../whatsnew/3.14.rst:2832 +#: ../../whatsnew/3.14.rst:2852 msgid "(Contributed by Victor Stinner in :gh:`107954`.)" msgstr "(由 Victor Stinner 於 :gh:`107954` 貢獻。)" @@ -1214,17 +1210,17 @@ msgid "" "TaskGroup.__aexit__ -> album TaskGroup._aexit -> TaskGroup.__aexit__ -> " "main Task-1 0x7fc930c18050\n" "1935500 0x7fc93173fdf0 TNDNBTG sleep -> " -"play TaskGroup._aexit -> " -"TaskGroup.__aexit__ -> album Sundowning 0x7fc930c18230\n" +"play TaskGroup._aexit -> TaskGroup." +"__aexit__ -> album Sundowning 0x7fc930c18230\n" "1935500 0x7fc930d32510 Levitate sleep -> " -"play TaskGroup._aexit -> " -"TaskGroup.__aexit__ -> album Sundowning 0x7fc930c18230\n" +"play TaskGroup._aexit -> TaskGroup." +"__aexit__ -> album Sundowning 0x7fc930c18230\n" "1935500 0x7fc930d32890 DYWTYLM sleep -> " -"play TaskGroup._aexit -> " -"TaskGroup.__aexit__ -> album TMBTE 0x7fc93173fa50\n" +"play TaskGroup._aexit -> TaskGroup." +"__aexit__ -> album TMBTE 0x7fc93173fa50\n" "1935500 0x7fc93161ec30 Aqua Regia sleep -> " -"play TaskGroup._aexit -> " -"TaskGroup.__aexit__ -> album TMBTE 0x7fc93173fa50" +"play TaskGroup._aexit -> TaskGroup." +"__aexit__ -> album TMBTE 0x7fc93173fa50" msgstr "" #: ../../whatsnew/3.14.rst:856 @@ -1241,10 +1237,10 @@ msgid "" " └── TaskGroup._aexit Lib/asyncio/taskgroups.py:121\n" " ├── (T) Sundowning\n" " │ └── album example.py:8\n" -" │ └── TaskGroup.__aexit__ Lib/asyncio/" -"taskgroups.py:72\n" -" │ └── TaskGroup._aexit Lib/asyncio/" -"taskgroups.py:121\n" +" │ └── TaskGroup.__aexit__ Lib/asyncio/taskgroups." +"py:72\n" +" │ └── TaskGroup._aexit Lib/asyncio/taskgroups." +"py:121\n" " │ ├── (T) TNDNBTG\n" " │ │ └── play example.py:4\n" " │ │ └── sleep Lib/asyncio/tasks.py:702\n" @@ -1253,10 +1249,10 @@ msgid "" " │ └── sleep Lib/asyncio/tasks.py:702\n" " └── (T) TMBTE\n" " └── album example.py:8\n" -" └── TaskGroup.__aexit__ Lib/asyncio/" -"taskgroups.py:72\n" -" └── TaskGroup._aexit Lib/asyncio/" -"taskgroups.py:121\n" +" └── TaskGroup.__aexit__ Lib/asyncio/taskgroups." +"py:72\n" +" └── TaskGroup._aexit Lib/asyncio/taskgroups." +"py:121\n" " ├── (T) DYWTYLM\n" " │ └── play example.py:4\n" " │ └── sleep Lib/asyncio/tasks.py:702\n" @@ -1407,14 +1403,13 @@ msgstr "" msgid "" "A new flag has been added, :data:`~sys.flags.thread_inherit_context`. This " "flag defaults to true for the free-threaded build and false for the GIL-" -"enabled build. If the flag is true then threads created " -"with :class:`threading.Thread` start with a copy of " -"the :class:`~contextvars.Context()` of the caller " -"of :meth:`~threading.Thread.start`. Most significantly, this makes the " -"warning filtering context established by :class:`~warnings.catch_warnings` " -"be \"inherited\" by threads (or asyncio tasks) started within that context. " -"It also affects other modules that use context variables, such as " -"the :mod:`decimal` context manager." +"enabled build. If the flag is true then threads created with :class:" +"`threading.Thread` start with a copy of the :class:`~contextvars.Context()` " +"of the caller of :meth:`~threading.Thread.start`. Most significantly, this " +"makes the warning filtering context established by :class:`~warnings." +"catch_warnings` be \"inherited\" by threads (or asyncio tasks) started " +"within that context. It also affects other modules that use context " +"variables, such as the :mod:`decimal` context manager." msgstr "" #: ../../whatsnew/3.14.rst:1002 @@ -1424,10 +1419,9 @@ msgstr "" #: ../../whatsnew/3.14.rst:1004 msgid "" "The default :term:`interactive` shell now highlights Python syntax as you " -"type. The feature is enabled by default unless " -"the :envvar:`PYTHON_BASIC_REPL` environment is set or any color-disabling " -"environment variables are used. See :ref:`using-on-controlling-color` for " -"details." +"type. The feature is enabled by default unless the :envvar:" +"`PYTHON_BASIC_REPL` environment is set or any color-disabling environment " +"variables are used. See :ref:`using-on-controlling-color` for details." msgstr "" #: ../../whatsnew/3.14.rst:1010 @@ -1451,10 +1445,10 @@ msgstr "" msgid "" "The official macOS and Windows release binaries now include an " "*experimental* just-in-time (JIT) compiler. Although it is **not** " -"recommended for production use, it can be tested by " -"setting :envvar:`PYTHON_JIT=1 ` as an environment variable. " -"Downstream source builds and redistributors can use the :option:`--enable-" -"experimental-jit=yes-off` configuration option for similar behavior." +"recommended for production use, it can be tested by setting :envvar:" +"`PYTHON_JIT=1 ` as an environment variable. Downstream source " +"builds and redistributors can use the :option:`--enable-experimental-jit=yes-" +"off` configuration option for similar behavior." msgstr "" #: ../../whatsnew/3.14.rst:1031 @@ -1464,18 +1458,18 @@ msgid "" "faster, depending on workload. To aid in testing and evaluation, a set of " "introspection functions has been provided in the :data:`sys._jit` " "namespace. :func:`sys._jit.is_available` can be used to determine if the " -"current executable supports JIT compilation, " -"while :func:`sys._jit.is_enabled` can be used to tell if JIT compilation has " -"been enabled for the current process." +"current executable supports JIT compilation, while :func:`sys._jit." +"is_enabled` can be used to tell if JIT compilation has been enabled for the " +"current process." msgstr "" #: ../../whatsnew/3.14.rst:1039 msgid "" "Currently, the most significant missing functionality is that native " "debuggers and profilers like ``gdb`` and ``perf`` are unable to unwind " -"through JIT frames (Python debuggers and profilers, like :mod:`pdb` " -"or :mod:`profile`, continue to work without modification). Free-threaded " -"builds do not support JIT compilation." +"through JIT frames (Python debuggers and profilers, like :mod:`pdb` or :mod:" +"`profile`, continue to work without modification). Free-threaded builds do " +"not support JIT compilation." msgstr "" #: ../../whatsnew/3.14.rst:1044 @@ -1494,8 +1488,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:1051 msgid "" "The :class:`warnings.catch_warnings` context manager will now optionally use " -"a context variable for warning filters. This is enabled by setting " -"the :data:`~sys.flags.context_aware_warnings` flag, either with the ``-X`` " +"a context variable for warning filters. This is enabled by setting the :" +"data:`~sys.flags.context_aware_warnings` flag, either with the ``-X`` " "command-line option or an environment variable. This gives predictable " "warnings control when using :class:`~warnings.catch_warnings` combined with " "multiple threads or asynchronous tasks. The flag defaults to true for the " @@ -1528,13 +1522,13 @@ msgstr "" msgid "The behavior of :func:`!gc.collect` changes slightly:" msgstr "" -#: ../../whatsnew/3.14.rst:1078 ../../whatsnew/3.14.rst:3183 +#: ../../whatsnew/3.14.rst:1078 ../../whatsnew/3.14.rst:3145 msgid "" "``gc.collect(1)``: Performs an increment of garbage collection, rather than " "collecting generation 1." msgstr "" -#: ../../whatsnew/3.14.rst:1080 ../../whatsnew/3.14.rst:3185 +#: ../../whatsnew/3.14.rst:1080 ../../whatsnew/3.14.rst:3147 msgid "Other calls to :func:`!gc.collect` are unchanged." msgstr "" @@ -1550,15 +1544,15 @@ msgstr "" msgid "" ":pep:`776`: Emscripten is now an officially supported platform at :pep:`tier " "3 <11#tier-3>`. As a part of this effort, more than 25 bugs in `Emscripten " -"libc`__ were fixed. Emscripten now includes support " -"for :mod:`ctypes`, :mod:`termios`, and :mod:`fcntl`, as well as experimental " -"support for :ref:`PyREPL `." +"libc`__ were fixed. Emscripten now includes support for :mod:`ctypes`, :mod:" +"`termios`, and :mod:`fcntl`, as well as experimental support for :ref:" +"`PyREPL `." msgstr "" #: ../../whatsnew/3.14.rst:1093 msgid "" -"(Contributed by R. Hood Chatham in :gh:`127146`, :gh:`127683`, " -"and :gh:`136931`.)" +"(Contributed by R. Hood Chatham in :gh:`127146`, :gh:`127683`, and :gh:" +"`136931`.)" msgstr "" #: ../../whatsnew/3.14.rst:1098 @@ -1586,8 +1580,8 @@ msgstr "" msgid "" "Incorrect usage of :keyword:`await` and asynchronous comprehensions is now " "detected even if the code is optimized away by the :option:`-O` command-line " -"option. For example, ``python -O -c 'assert await 1'`` now produces " -"a :exc:`SyntaxError`. (Contributed by Jelle Zijlstra in :gh:`121637`.)" +"option. For example, ``python -O -c 'assert await 1'`` now produces a :exc:" +"`SyntaxError`. (Contributed by Jelle Zijlstra in :gh:`121637`.)" msgstr "" #: ../../whatsnew/3.14.rst:1116 @@ -1609,8 +1603,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:1126 msgid "" "Implement mixed-mode arithmetic rules combining real and complex numbers as " -"specified by C standards since C99. (Contributed by Sergey B Kirpichev " -"in :gh:`69639`.)" +"specified by C standards since C99. (Contributed by Sergey B Kirpichev in :" +"gh:`69639`.)" msgstr "" #: ../../whatsnew/3.14.rst:1130 @@ -1627,8 +1621,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:1137 msgid "" -"The :class:`memoryview` type now supports subscription, making it " -"a :term:`generic type`. (Contributed by Brian Schubert in :gh:`126012`.)" +"The :class:`memoryview` type now supports subscription, making it a :term:" +"`generic type`. (Contributed by Brian Schubert in :gh:`126012`.)" msgstr "" #: ../../whatsnew/3.14.rst:1141 @@ -1703,24 +1697,23 @@ msgstr "" msgid "" "When subclassing from a pure C type, the C slots for the new type are no " "longer replaced with a wrapped version on class creation if they are not " -"explicitly overridden in the subclass. (Contributed by Tomasz Pytel " -"in :gh:`132329`.)" +"explicitly overridden in the subclass. (Contributed by Tomasz Pytel in :gh:" +"`132329`.)" msgstr "" #: ../../whatsnew/3.14.rst:1190 msgid "" "The command-line option :option:`-c` now automatically dedents its code " -"argument before execution. The auto-dedentation behavior " -"mirrors :func:`textwrap.dedent`. (Contributed by Jon Crall and Steven Sun " -"in :gh:`103998`.)" +"argument before execution. The auto-dedentation behavior mirrors :func:" +"`textwrap.dedent`. (Contributed by Jon Crall and Steven Sun in :gh:`103998`.)" msgstr "" #: ../../whatsnew/3.14.rst:1195 msgid "" "Improve error message when an object supporting the synchronous context " -"manager protocol is entered using :keyword:`async with` instead " -"of :keyword:`with`. And vice versa with the asynchronous context manager " -"protocol. (Contributed by Bénédikt Tran in :gh:`128398`.)" +"manager protocol is entered using :keyword:`async with` instead of :keyword:" +"`with`. And vice versa with the asynchronous context manager protocol. " +"(Contributed by Bénédikt Tran in :gh:`128398`.)" msgstr "" #: ../../whatsnew/3.14.rst:1201 @@ -1739,9 +1732,9 @@ msgstr "" #: ../../whatsnew/3.14.rst:1212 msgid "" -"Using :data:`NotImplemented` in a boolean context will now raise " -"a :exc:`TypeError`. This has raised a :exc:`DeprecationWarning` since Python " -"3.9. (Contributed by Jelle Zijlstra in :gh:`118767`.)" +"Using :data:`NotImplemented` in a boolean context will now raise a :exc:" +"`TypeError`. This has raised a :exc:`DeprecationWarning` since Python 3.9. " +"(Contributed by Jelle Zijlstra in :gh:`118767`.)" msgstr "" #: ../../whatsnew/3.14.rst:1221 @@ -1752,10 +1745,9 @@ msgstr "" #: ../../whatsnew/3.14.rst:1223 msgid "" -"The compiler emits a :exc:`SyntaxWarning` when " -"a :keyword:`return`, :keyword:`break` or :keyword:`continue` statement " -"appears where it exits a :keyword:`finally` block. This change is specified " -"in :pep:`765`." +"The compiler emits a :exc:`SyntaxWarning` when a :keyword:`return`, :keyword:" +"`break` or :keyword:`continue` statement appears where it exits a :keyword:" +"`finally` block. This change is specified in :pep:`765`." msgstr "" #: ../../whatsnew/3.14.rst:1229 @@ -1765,8 +1757,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:1231 msgid "" ":mod:`annotationlib`: For introspecting :term:`annotations `. " -"See :pep:`749` for more details. (Contributed by Jelle Zijlstra " -"in :gh:`119180`.)" +"See :pep:`749` for more details. (Contributed by Jelle Zijlstra in :gh:" +"`119180`.)" msgstr "" #: ../../whatsnew/3.14.rst:1237 @@ -1779,18 +1771,18 @@ msgstr "argparse" #: ../../whatsnew/3.14.rst:1242 msgid "" -"The default value of the :ref:`program name ` " -"for :class:`argparse.ArgumentParser` now reflects the way the Python " -"interpreter was instructed to find the ``__main__`` module code. " -"(Contributed by Serhiy Storchaka and Alyssa Coghlan in :gh:`66436`.)" +"The default value of the :ref:`program name ` for :class:`argparse." +"ArgumentParser` now reflects the way the Python interpreter was instructed " +"to find the ``__main__`` module code. (Contributed by Serhiy Storchaka and " +"Alyssa Coghlan in :gh:`66436`.)" msgstr "" #: ../../whatsnew/3.14.rst:1247 msgid "" -"Introduced the optional *suggest_on_error* parameter " -"to :class:`argparse.ArgumentParser`, enabling suggestions for argument " -"choices and subparser names if mistyped by the user. (Contributed by " -"Savannah Ostrowski in :gh:`124456`.)" +"Introduced the optional *suggest_on_error* parameter to :class:`argparse." +"ArgumentParser`, enabling suggestions for argument choices and subparser " +"names if mistyped by the user. (Contributed by Savannah Ostrowski in :gh:" +"`124456`.)" msgstr "" #: ../../whatsnew/3.14.rst:1254 @@ -1832,8 +1824,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:1276 msgid "" ":func:`ast.parse`, when called with an AST as input, now always verifies " -"that the root node type is appropriate. (Contributed by Irit Katriel " -"in :gh:`130139`.)" +"that the root node type is appropriate. (Contributed by Irit Katriel in :gh:" +"`130139`.)" msgstr "" #: ../../whatsnew/3.14.rst:1280 @@ -1850,27 +1842,26 @@ msgstr "asyncio" #: ../../whatsnew/3.14.rst:1288 msgid "" "The function and methods named :func:`!create_task` now take an arbitrary " -"list of keyword arguments. All keyword arguments are passed to " -"the :class:`~asyncio.Task` constructor or the custom task factory. " -"(See :meth:`~asyncio.loop.set_task_factory` for details.) The ``name`` and " -"``context`` keyword arguments are no longer special; the name should now be " -"set using the ``name`` keyword argument of the factory, and ``context`` may " -"be ``None``." +"list of keyword arguments. All keyword arguments are passed to the :class:" +"`~asyncio.Task` constructor or the custom task factory. (See :meth:`~asyncio." +"loop.set_task_factory` for details.) The ``name`` and ``context`` keyword " +"arguments are no longer special; the name should now be set using the " +"``name`` keyword argument of the factory, and ``context`` may be ``None``." msgstr "" #: ../../whatsnew/3.14.rst:1296 msgid "" -"This affects the following function and " -"methods: :meth:`asyncio.create_task`, :meth:`asyncio.loop.create_task`, :meth:`asyncio.TaskGroup.create_task`. " -"(Contributed by Thomas Grainger in :gh:`128307`.)" +"This affects the following function and methods: :meth:`asyncio." +"create_task`, :meth:`asyncio.loop.create_task`, :meth:`asyncio.TaskGroup." +"create_task`. (Contributed by Thomas Grainger in :gh:`128307`.)" msgstr "" #: ../../whatsnew/3.14.rst:1302 msgid "" "There are two new utility functions for introspecting and printing a " -"program's call graph: :func:`~asyncio.capture_call_graph` " -"and :func:`~asyncio.print_call_graph`. (Contributed by Yury Selivanov, Pablo " -"Galindo Salgado, and Łukasz Langa in :gh:`91048`.)" +"program's call graph: :func:`~asyncio.capture_call_graph` and :func:" +"`~asyncio.print_call_graph`. (Contributed by Yury Selivanov, Pablo Galindo " +"Salgado, and Łukasz Langa in :gh:`91048`.)" msgstr "" #: ../../whatsnew/3.14.rst:1312 @@ -1879,10 +1870,10 @@ msgstr "calendar" #: ../../whatsnew/3.14.rst:1314 msgid "" -"By default, today's date is highlighted in color " -"in :mod:`calendar`'s :ref:`command-line ` text output. This " -"can be controlled by :ref:`environment variables `. (Contributed by Hugo van Kemenade in :gh:`128317`.)" +"By default, today's date is highlighted in color in :mod:`calendar`'s :ref:" +"`command-line ` text output. This can be controlled by :ref:" +"`environment variables `. (Contributed by Hugo " +"van Kemenade in :gh:`128317`.)" msgstr "" #: ../../whatsnew/3.14.rst:1322 @@ -1909,8 +1900,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:1340 msgid "" "If the threading incompatible *fork* method is required, you must explicitly " -"request it by supplying a multiprocessing context *mp_context* " -"to :class:`~concurrent.futures.ProcessPoolExecutor`." +"request it by supplying a multiprocessing context *mp_context* to :class:" +"`~concurrent.futures.ProcessPoolExecutor`." msgstr "" #: ../../whatsnew/3.14.rst:1344 ../../whatsnew/3.14.rst:1774 @@ -1927,19 +1918,19 @@ msgstr "(由 Gregory P. Smith 於 :gh:`84559` 貢獻。)" #: ../../whatsnew/3.14.rst:1351 msgid "" -"Add :meth:`concurrent.futures.ProcessPoolExecutor.terminate_workers` " -"and :meth:`concurrent.futures.ProcessPoolExecutor.kill_workers` as ways to " +"Add :meth:`concurrent.futures.ProcessPoolExecutor.terminate_workers` and :" +"meth:`concurrent.futures.ProcessPoolExecutor.kill_workers` as ways to " "terminate or kill all living worker processes in the given pool. " "(Contributed by Charles Machalow in :gh:`130849`.)" msgstr "" #: ../../whatsnew/3.14.rst:1356 msgid "" -"Add the optional ``buffersize`` parameter " -"to :meth:`concurrent.futures.Executor.map` to limit the number of submitted " -"tasks whose results have not yet been yielded. If the buffer is full, " -"iteration over the *iterables* pauses until a result is yielded from the " -"buffer. (Contributed by Enzo Bonnal and Josh Rosenberg in :gh:`74028`.)" +"Add the optional ``buffersize`` parameter to :meth:`concurrent.futures." +"Executor.map` to limit the number of submitted tasks whose results have not " +"yet been yielded. If the buffer is full, iteration over the *iterables* " +"pauses until a result is yielded from the buffer. (Contributed by Enzo " +"Bonnal and Josh Rosenberg in :gh:`74028`.)" msgstr "" #: ../../whatsnew/3.14.rst:1364 @@ -1950,9 +1941,8 @@ msgstr "configparser" msgid "" "Security fix: will no longer write config files it cannot read. Attempting " "to :meth:`configparser.ConfigParser.write` keys containing delimiters or " -"beginning with the section header pattern will raise " -"a :class:`configparser.InvalidWriteError`. (Contributed by Jacob Lincoln " -"in :gh:`129270`.)" +"beginning with the section header pattern will raise a :class:`configparser." +"InvalidWriteError`. (Contributed by Jacob Lincoln in :gh:`129270`.)" msgstr "" #: ../../whatsnew/3.14.rst:1373 @@ -1971,10 +1961,10 @@ msgstr "ctypes" #: ../../whatsnew/3.14.rst:1382 msgid "" -"The layout of :ref:`bit fields ` " -"in :class:`~ctypes.Structure` and :class:`~ctypes.Union` now matches " -"platform defaults (GCC/Clang or MSVC) more closely. In particular, fields no " -"longer overlap. (Contributed by Matthias Görgens in :gh:`97702`.)" +"The layout of :ref:`bit fields ` in :" +"class:`~ctypes.Structure` and :class:`~ctypes.Union` now matches platform " +"defaults (GCC/Clang or MSVC) more closely. In particular, fields no longer " +"overlap. (Contributed by Matthias Görgens in :gh:`97702`.)" msgstr "" #: ../../whatsnew/3.14.rst:1388 @@ -2006,20 +1996,18 @@ msgstr "" #: ../../whatsnew/3.14.rst:1403 msgid "" ":func:`ctypes.memoryview_at` now exists to create a :class:`memoryview` " -"object that refers to the supplied pointer and length. This works " -"like :func:`ctypes.string_at` except it avoids a buffer copy, and is " -"typically useful when implementing pure Python callback functions that are " -"passed dynamically-sized buffers. (Contributed by Rian Hunter " -"in :gh:`112018`.)" +"object that refers to the supplied pointer and length. This works like :func:" +"`ctypes.string_at` except it avoids a buffer copy, and is typically useful " +"when implementing pure Python callback functions that are passed dynamically-" +"sized buffers. (Contributed by Rian Hunter in :gh:`112018`.)" msgstr "" #: ../../whatsnew/3.14.rst:1410 msgid "" -"Complex " -"types, :class:`~ctypes.c_float_complex`, :class:`~ctypes.c_double_complex` " -"and :class:`~ctypes.c_longdouble_complex`, are now available if both the " -"compiler and the ``libffi`` library support complex C types. (Contributed by " -"Sergey B Kirpichev in :gh:`61103`.)" +"Complex types, :class:`~ctypes.c_float_complex`, :class:`~ctypes." +"c_double_complex` and :class:`~ctypes.c_longdouble_complex`, are now " +"available if both the compiler and the ``libffi`` library support complex C " +"types. (Contributed by Sergey B Kirpichev in :gh:`61103`.)" msgstr "" #: ../../whatsnew/3.14.rst:1416 @@ -2039,8 +2027,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:1426 msgid "" -"The :class:`ctypes.py_object` type now supports subscription, making it " -"a :term:`generic type`. (Contributed by Brian Schubert in :gh:`132168`.)" +"The :class:`ctypes.py_object` type now supports subscription, making it a :" +"term:`generic type`. (Contributed by Brian Schubert in :gh:`132168`.)" msgstr "" #: ../../whatsnew/3.14.rst:1430 @@ -2055,9 +2043,9 @@ msgstr "curses" #: ../../whatsnew/3.14.rst:1436 msgid "" -"Add the :func:`~curses.assume_default_colors` function, a refinement of " -"the :func:`~curses.use_default_colors` function which allows to change the " -"color pair ``0``. (Contributed by Serhiy Storchaka in :gh:`133139`.)" +"Add the :func:`~curses.assume_default_colors` function, a refinement of the :" +"func:`~curses.use_default_colors` function which allows to change the color " +"pair ``0``. (Contributed by Serhiy Storchaka in :gh:`133139`.)" msgstr "" #: ../../whatsnew/3.14.rst:1442 @@ -2076,9 +2064,9 @@ msgstr "decimal" #: ../../whatsnew/3.14.rst:1450 msgid "" -"Add alternative :class:`~decimal.Decimal` " -"constructor :meth:`Decimal.from_number() `. " -"(Contributed by Serhiy Storchaka in :gh:`121798`.)" +"Add alternative :class:`~decimal.Decimal` constructor :meth:`Decimal." +"from_number() `. (Contributed by Serhiy " +"Storchaka in :gh:`121798`.)" msgstr "" #: ../../whatsnew/3.14.rst:1454 @@ -2094,9 +2082,9 @@ msgstr "difflib" #: ../../whatsnew/3.14.rst:1461 msgid "" -"Comparison pages with highlighted changes generated by " -"the :class:`difflib.HtmlDiff` class now support dark mode. (Contributed by " -"Jiahao Li in :gh:`129939`.)" +"Comparison pages with highlighted changes generated by the :class:`difflib." +"HtmlDiff` class now support dark mode. (Contributed by Jiahao Li in :gh:" +"`129939`.)" msgstr "" #: ../../whatsnew/3.14.rst:1466 @@ -2105,10 +2093,10 @@ msgstr "dis" #: ../../whatsnew/3.14.rst:1468 msgid "" -"Add support for rendering full source location information " -"of :class:`instructions `, rather than only the line " -"number. This feature is added to the following interfaces via the " -"*show_positions* keyword argument:" +"Add support for rendering full source location information of :class:" +"`instructions `, rather than only the line number. This " +"feature is added to the following interfaces via the *show_positions* " +"keyword argument:" msgstr "" #: ../../whatsnew/3.14.rst:1473 @@ -2145,8 +2133,8 @@ msgstr "errno" #: ../../whatsnew/3.14.rst:1489 msgid "" -"Add :data:`errno.EHWPOISON` error code. (Contributed by James Roy " -"in :gh:`126585`.)" +"Add :data:`errno.EHWPOISON` error code. (Contributed by James Roy in :gh:" +"`126585`.)" msgstr "" #: ../../whatsnew/3.14.rst:1494 @@ -2184,9 +2172,9 @@ msgstr "" #: ../../whatsnew/3.14.rst:1516 msgid "" -"Add alternative :class:`~fractions.Fraction` " -"constructor :meth:`Fraction.from_number() `. " -"(Contributed by Serhiy Storchaka in :gh:`121797`.)" +"Add alternative :class:`~fractions.Fraction` constructor :meth:`Fraction." +"from_number() `. (Contributed by Serhiy " +"Storchaka in :gh:`121797`.)" msgstr "" #: ../../whatsnew/3.14.rst:1522 @@ -2241,8 +2229,8 @@ msgstr "graphlib" #: ../../whatsnew/3.14.rst:1556 msgid "" "Allow :meth:`graphlib.TopologicalSorter.prepare` to be called more than once " -"as long as sorting has not started. (Contributed by Daniel Pope " -"in :gh:`130914`.)" +"as long as sorting has not started. (Contributed by Daniel Pope in :gh:" +"`130914`.)" msgstr "" #: ../../whatsnew/3.14.rst:1562 @@ -2297,9 +2285,9 @@ msgstr "" #: ../../whatsnew/3.14.rst:1588 msgid "" -"The :mod:`http.server` module now supports serving over HTTPS using " -"the :class:`http.server.HTTPSServer` class. This functionality is exposed by " -"the command-line interface (``python -m http.server``) through the following " +"The :mod:`http.server` module now supports serving over HTTPS using the :" +"class:`http.server.HTTPSServer` class. This functionality is exposed by the " +"command-line interface (``python -m http.server``) through the following " "options:" msgstr "" @@ -2328,8 +2316,8 @@ msgstr "imaplib" #: ../../whatsnew/3.14.rst:1603 msgid "" "Add :meth:`IMAP4.idle() `, implementing the IMAP4 " -"``IDLE`` command as defined in :rfc:`2177`. (Contributed by Forest " -"in :gh:`55454`.)" +"``IDLE`` command as defined in :rfc:`2177`. (Contributed by Forest in :gh:" +"`55454`.)" msgstr "" #: ../../whatsnew/3.14.rst:1609 @@ -2352,8 +2340,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:1619 msgid "" -"Add function :func:`inspect.ispackage` to determine whether an object is " -"a :term:`package` or not. (Contributed by Zhikang Yan in :gh:`125634`.)" +"Add function :func:`inspect.ispackage` to determine whether an object is a :" +"term:`package` or not. (Contributed by Zhikang Yan in :gh:`125634`.)" msgstr "" #: ../../whatsnew/3.14.rst:1625 ../../whatsnew/3.14.rst:2336 @@ -2362,18 +2350,17 @@ msgstr "io" #: ../../whatsnew/3.14.rst:1627 msgid "" -"Reading text from a non-blocking stream with ``read`` may now raise " -"a :exc:`BlockingIOError` if the operation cannot immediately return bytes. " +"Reading text from a non-blocking stream with ``read`` may now raise a :exc:" +"`BlockingIOError` if the operation cannot immediately return bytes. " "(Contributed by Giovanni Siragusa in :gh:`109523`.)" msgstr "" #: ../../whatsnew/3.14.rst:1631 msgid "" "Add protocols :class:`io.Reader` and :class:`io.Writer` as simpler " -"alternatives to the pseudo-" -"protocols :class:`typing.IO`, :class:`typing.TextIO`, " -"and :class:`typing.BinaryIO`. (Contributed by Sebastian Rittau " -"in :gh:`127648`.)" +"alternatives to the pseudo-protocols :class:`typing.IO`, :class:`typing." +"TextIO`, and :class:`typing.BinaryIO`. (Contributed by Sebastian Rittau in :" +"gh:`127648`.)" msgstr "" #: ../../whatsnew/3.14.rst:1638 @@ -2390,16 +2377,16 @@ msgstr "" msgid "" "Enable the :mod:`json` module to work as a script using the :option:`-m` " "switch: :program:`python -m json`. See the :ref:`JSON command-line interface " -"` documentation. (Contributed by Trey Hunner " -"in :gh:`122873`.)" +"` documentation. (Contributed by Trey Hunner in :gh:" +"`122873`.)" msgstr "" #: ../../whatsnew/3.14.rst:1651 msgid "" "By default, the output of the :ref:`JSON command-line interface ` is highlighted in color. This can be controlled " -"by :ref:`environment variables `. (Contributed " -"by Tomas Roun in :gh:`131952`.)" +"commandline>` is highlighted in color. This can be controlled by :ref:" +"`environment variables `. (Contributed by Tomas " +"Roun in :gh:`131952`.)" msgstr "" #: ../../whatsnew/3.14.rst:1658 @@ -2517,8 +2504,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:1716 msgid "" -":rfc:`3745`: JPEG 2000 (``.jp2``), extension (``.jpx``) and compound " -"(``.jpm``)" +":rfc:`3745`: JPEG 2000 (``.jp2``), extension (``.jpx``) and compound (``." +"jpm``)" msgstr "" #: ../../whatsnew/3.14.rst:1717 @@ -2661,8 +2648,8 @@ msgstr "" msgid "" "If the threading incompatible *fork* method is required, you must explicitly " "request it via a context from :func:`multiprocessing.get_context` " -"(preferred) or change the default " -"via :func:`multiprocessing.set_start_method`." +"(preferred) or change the default via :func:`multiprocessing." +"set_start_method`." msgstr "" #: ../../whatsnew/3.14.rst:1781 @@ -2696,17 +2683,17 @@ msgstr "(由 Roy Hyunjin Han 於 :gh:`103134` 貢獻。)" #: ../../whatsnew/3.14.rst:1796 msgid "" "Add support for shared :class:`set` objects via :meth:`SyncManager.set() " -"`. The :func:`set` " -"in :func:`multiprocessing.Manager` method is now available. (Contributed by " -"Mingyu Park in :gh:`129949`.)" +"`. The :func:`set` in :func:" +"`multiprocessing.Manager` method is now available. (Contributed by Mingyu " +"Park in :gh:`129949`.)" msgstr "" #: ../../whatsnew/3.14.rst:1801 msgid "" "Add :func:`multiprocessing.Process.interrupt` which terminates the child " -"process by sending :py:const:`~signal.SIGINT`. This " -"enables :keyword:`finally` clauses to print a stack trace for the terminated " -"process. (Contributed by Artem Pulkin in :gh:`131913`.)" +"process by sending :py:const:`~signal.SIGINT`. This enables :keyword:" +"`finally` clauses to print a stack trace for the terminated process. " +"(Contributed by Artem Pulkin in :gh:`131913`.)" msgstr "" #: ../../whatsnew/3.14.rst:1807 @@ -2727,10 +2714,10 @@ msgstr "os" #: ../../whatsnew/3.14.rst:1819 msgid "" -"Add the :func:`os.reload_environ` function to update :data:`os.environ` " -"and :data:`os.environb` with changes to the environment made " -"by :func:`os.putenv`, by :func:`os.unsetenv`, or made outside Python in the " -"same process. (Contributed by Victor Stinner in :gh:`120057`.)" +"Add the :func:`os.reload_environ` function to update :data:`os.environ` and :" +"data:`os.environb` with changes to the environment made by :func:`os." +"putenv`, by :func:`os.unsetenv`, or made outside Python in the same process. " +"(Contributed by Victor Stinner in :gh:`120057`.)" msgstr "" #: ../../whatsnew/3.14.rst:1825 @@ -2742,8 +2729,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:1829 msgid "" "Add the :func:`os.readinto` function to read into a :ref:`buffer object " -"` from a file descriptor. (Contributed by Cody Maloney " -"in :gh:`129205`.)" +"` from a file descriptor. (Contributed by Cody Maloney in :gh:" +"`129205`.)" msgstr "" #: ../../whatsnew/3.14.rst:1835 @@ -2752,15 +2739,15 @@ msgstr "os.path" #: ../../whatsnew/3.14.rst:1837 msgid "" -"The *strict* parameter to :func:`os.path.realpath` accepts a new " -"value, :data:`os.path.ALLOW_MISSING`. If used, errors other " -"than :exc:`FileNotFoundError` will be re-raised; the resulting path can be " -"missing but it will be free of symlinks. (Contributed by Petr Viktorin " -"for :cve:`2025-4517`.)" +"The *strict* parameter to :func:`os.path.realpath` accepts a new value, :" +"data:`os.path.ALLOW_MISSING`. If used, errors other than :exc:" +"`FileNotFoundError` will be re-raised; the resulting path can be missing but " +"it will be free of symlinks. (Contributed by Petr Viktorin for :cve:" +"`2025-4517`.)" msgstr "" #: ../../whatsnew/3.14.rst:1845 ../../whatsnew/3.14.rst:2345 -#: ../../whatsnew/3.14.rst:2605 +#: ../../whatsnew/3.14.rst:2596 msgid "pathlib" msgstr "pathlib" @@ -2809,18 +2796,18 @@ msgstr "pdb" #: ../../whatsnew/3.14.rst:1869 msgid "" "Hardcoded breakpoints (:func:`breakpoint` and :func:`pdb.set_trace`) now " -"reuse the most recent :class:`~pdb.Pdb` instance that " -"calls :meth:`~pdb.Pdb.set_trace`, instead of creating a new one each time. " -"As a result, all the instance specific data like :pdbcmd:`display` " -"and :pdbcmd:`commands` are preserved across hardcoded breakpoints. " -"(Contributed by Tian Gao in :gh:`121450`.)" +"reuse the most recent :class:`~pdb.Pdb` instance that calls :meth:`~pdb.Pdb." +"set_trace`, instead of creating a new one each time. As a result, all the " +"instance specific data like :pdbcmd:`display` and :pdbcmd:`commands` are " +"preserved across hardcoded breakpoints. (Contributed by Tian Gao in :gh:" +"`121450`.)" msgstr "" #: ../../whatsnew/3.14.rst:1876 msgid "" "Add a new argument *mode* to :class:`pdb.Pdb`. Disable the ``restart`` " -"command when :mod:`pdb` is in ``inline`` mode. (Contributed by Tian Gao " -"in :gh:`123757`.)" +"command when :mod:`pdb` is in ``inline`` mode. (Contributed by Tian Gao in :" +"gh:`123757`.)" msgstr "" #: ../../whatsnew/3.14.rst:1880 @@ -2938,9 +2925,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:1950 msgid "" -"Add support for *cid* and *bdaddr_type* in the address " -"for :const:`~socket.BTPROTO_L2CAP` on FreeBSD. (Contributed by Serhiy " -"Storchaka in :gh:`132429`.)" +"Add support for *cid* and *bdaddr_type* in the address for :const:`~socket." +"BTPROTO_L2CAP` on FreeBSD. (Contributed by Serhiy Storchaka in :gh:`132429`.)" msgstr "" #: ../../whatsnew/3.14.rst:1953 @@ -2957,9 +2943,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:1959 msgid "" -"Return *cid* in :meth:`~socket.socket.getsockname` " -"for :const:`~socket.BTPROTO_L2CAP`. (Contributed by Serhiy Storchaka " -"in :gh:`132429`.)" +"Return *cid* in :meth:`~socket.socket.getsockname` for :const:`~socket." +"BTPROTO_L2CAP`. (Contributed by Serhiy Storchaka in :gh:`132429`.)" msgstr "" #: ../../whatsnew/3.14.rst:1962 @@ -3026,8 +3011,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:2001 msgid "" -"Add :func:`sys._is_immortal` for determining if an object " -"is :term:`immortal`. (Contributed by Peter Bierma in :gh:`128509`.)" +"Add :func:`sys._is_immortal` for determining if an object is :term:" +"`immortal`. (Contributed by Peter Bierma in :gh:`128509`.)" msgstr "" #: ../../whatsnew/3.14.rst:2004 @@ -3069,8 +3054,8 @@ msgstr "tarfile" #: ../../whatsnew/3.14.rst:2028 msgid "" ":func:`~tarfile.data_filter` now normalizes symbolic link targets in order " -"to avoid path traversal attacks. (Contributed by Petr Viktorin " -"in :gh:`127987` and :cve:`2025-4138`.)" +"to avoid path traversal attacks. (Contributed by Petr Viktorin in :gh:" +"`127987` and :cve:`2025-4138`.)" msgstr "" #: ../../whatsnew/3.14.rst:2031 @@ -3085,17 +3070,17 @@ msgid "" ":func:`~tarfile.TarFile.extract` and :func:`~tarfile.TarFile.extractall` now " "(re-)apply the extraction filter when substituting a link (hard or symbolic) " "with a copy of another archive member, and when fixing up directory " -"attributes. The former raises a new " -"exception, :exc:`~tarfile.LinkFallbackError`. (Contributed by Petr Viktorin " -"for :cve:`2025-4330` and :cve:`2024-12718`.)" +"attributes. The former raises a new exception, :exc:`~tarfile." +"LinkFallbackError`. (Contributed by Petr Viktorin for :cve:`2025-4330` and :" +"cve:`2024-12718`.)" msgstr "" #: ../../whatsnew/3.14.rst:2040 msgid "" ":func:`~tarfile.TarFile.extract` and :func:`~tarfile.TarFile.extractall` no " "longer extract rejected members when :func:`~tarfile.TarFile.errorlevel` is " -"zero. (Contributed by Matt Prodani and Petr Viktorin in :gh:`112887` " -"and :cve:`2025-4435`.)" +"zero. (Contributed by Matt Prodani and Petr Viktorin in :gh:`112887` and :" +"cve:`2025-4435`.)" msgstr "" #: ../../whatsnew/3.14.rst:2048 @@ -3104,9 +3089,8 @@ msgstr "threading" #: ../../whatsnew/3.14.rst:2050 msgid "" -":meth:`threading.Thread.start` now sets the operating system thread name " -"to :attr:`threading.Thread.name`. (Contributed by Victor Stinner " -"in :gh:`59705`.)" +":meth:`threading.Thread.start` now sets the operating system thread name to :" +"attr:`threading.Thread.name`. (Contributed by Victor Stinner in :gh:`59705`.)" msgstr "" #: ../../whatsnew/3.14.rst:2056 @@ -3116,8 +3100,8 @@ msgstr "tkinter" #: ../../whatsnew/3.14.rst:2058 msgid "" "Make :mod:`tkinter` widget methods :meth:`!after` and :meth:`!after_idle` " -"accept arguments passed by keyword. (Contributed by Zhikang Yan " -"in :gh:`126899`.)" +"accept arguments passed by keyword. (Contributed by Zhikang Yan in :gh:" +"`126899`.)" msgstr "" #: ../../whatsnew/3.14.rst:2062 @@ -3132,9 +3116,9 @@ msgstr "turtle" #: ../../whatsnew/3.14.rst:2069 msgid "" -"Add context managers for :func:`turtle.fill`, :func:`turtle.poly` " -"and :func:`turtle.no_animation`. (Contributed by Marie Roald and Yngve " -"Mardal Moe in :gh:`126350`.)" +"Add context managers for :func:`turtle.fill`, :func:`turtle.poly` and :func:" +"`turtle.no_animation`. (Contributed by Marie Roald and Yngve Mardal Moe in :" +"gh:`126350`.)" msgstr "" #: ../../whatsnew/3.14.rst:2075 @@ -3143,12 +3127,12 @@ msgstr "types" #: ../../whatsnew/3.14.rst:2077 msgid "" -":class:`types.UnionType` is now an alias for :class:`typing.Union`. " -"See :ref:`below ` for more details. (Contributed " -"by Jelle Zijlstra in :gh:`105499`.)" +":class:`types.UnionType` is now an alias for :class:`typing.Union`. See :ref:" +"`below ` for more details. (Contributed by Jelle " +"Zijlstra in :gh:`105499`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2083 ../../whatsnew/3.14.rst:2651 +#: ../../whatsnew/3.14.rst:2083 msgid "typing" msgstr "typing" @@ -3179,11 +3163,11 @@ msgid "" "change could increase memory usage for some programs that use a large number " "of unions created by subscripting ``typing.Union``. However, several factors " "offset this cost: unions used in annotations are no longer evaluated by " -"default in Python 3.14 because of :pep:`649`; an instance " -"of :class:`types.UnionType` is itself much smaller than the object returned " -"by ``Union[]`` was on prior Python versions; and removing the cache also " -"saves some space. It is therefore unlikely that this change will cause a " -"significant increase in memory usage for most users." +"default in Python 3.14 because of :pep:`649`; an instance of :class:`types." +"UnionType` is itself much smaller than the object returned by ``Union[]`` " +"was on prior Python versions; and removing the cache also saves some space. " +"It is therefore unlikely that this change will cause a significant increase " +"in memory usage for most users." msgstr "" #: ../../whatsnew/3.14.rst:2109 @@ -3238,16 +3222,16 @@ msgstr "unittest" #: ../../whatsnew/3.14.rst:2138 msgid "" -":mod:`unittest` output is now colored by default. This can be controlled " -"by :ref:`environment variables `. (Contributed " -"by Hugo van Kemenade in :gh:`127221`.)" +":mod:`unittest` output is now colored by default. This can be controlled by :" +"ref:`environment variables `. (Contributed by " +"Hugo van Kemenade in :gh:`127221`.)" msgstr "" #: ../../whatsnew/3.14.rst:2143 msgid "" "unittest discovery supports :term:`namespace package` as start directory " -"again. It was removed in Python 3.11. (Contributed by Jacob Walls " -"in :gh:`80958`.)" +"again. It was removed in Python 3.11. (Contributed by Jacob Walls in :gh:" +"`80958`.)" msgstr "" #: ../../whatsnew/3.14.rst:2147 @@ -3258,30 +3242,30 @@ msgstr "" #: ../../whatsnew/3.14.rst:2150 msgid "" -":meth:`~unittest.TestCase.assertHasAttr` " -"and :meth:`~unittest.TestCase.assertNotHasAttr` check whether the object has " -"a particular attribute." +":meth:`~unittest.TestCase.assertHasAttr` and :meth:`~unittest.TestCase." +"assertNotHasAttr` check whether the object has a particular attribute." msgstr "" #: ../../whatsnew/3.14.rst:2153 msgid "" -":meth:`~unittest.TestCase.assertIsSubclass` " -"and :meth:`~unittest.TestCase.assertNotIsSubclass` check whether the object " -"is a subclass of a particular class, or of one of a tuple of classes." +":meth:`~unittest.TestCase.assertIsSubclass` and :meth:`~unittest.TestCase." +"assertNotIsSubclass` check whether the object is a subclass of a particular " +"class, or of one of a tuple of classes." msgstr "" #: ../../whatsnew/3.14.rst:2156 msgid "" -":meth:`~unittest.TestCase.assertStartsWith`, :meth:`~unittest.TestCase.assertNotStartsWith`, :meth:`~unittest.TestCase.assertEndsWith` " -"and :meth:`~unittest.TestCase.assertNotEndsWith` check whether the Unicode " -"or byte string starts or ends with particular strings." +":meth:`~unittest.TestCase.assertStartsWith`, :meth:`~unittest.TestCase." +"assertNotStartsWith`, :meth:`~unittest.TestCase.assertEndsWith` and :meth:" +"`~unittest.TestCase.assertNotEndsWith` check whether the Unicode or byte " +"string starts or ends with particular strings." msgstr "" #: ../../whatsnew/3.14.rst:2162 msgid "(Contributed by Serhiy Storchaka in :gh:`71339`.)" msgstr "(由 Serhiy Storchaka 於 :gh:`71339` 貢獻。)" -#: ../../whatsnew/3.14.rst:2166 ../../whatsnew/3.14.rst:2658 +#: ../../whatsnew/3.14.rst:2166 ../../whatsnew/3.14.rst:2642 msgid "urllib" msgstr "urllib" @@ -3294,8 +3278,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:2172 msgid "" -"Improve ergonomics and standards compliance when parsing and emitting " -"``file:`` URLs." +"Improve ergonomics and standards compliance when parsing and emitting ``file:" +"`` URLs." msgstr "" #: ../../whatsnew/3.14.rst:2175 @@ -3359,10 +3343,9 @@ msgstr "uuid" #: ../../whatsnew/3.14.rst:2202 msgid "" -"Add support for UUID versions 6, 7, and 8 " -"via :func:`uuid.uuid6`, :func:`uuid.uuid7`, and :func:`uuid.uuid8` " -"respectively, as specified in :rfc:`9562`. (Contributed by Bénédikt Tran " -"in :gh:`89083`.)" +"Add support for UUID versions 6, 7, and 8 via :func:`uuid.uuid6`, :func:" +"`uuid.uuid7`, and :func:`uuid.uuid8` respectively, as specified in :rfc:" +"`9562`. (Contributed by Bénédikt Tran in :gh:`89083`.)" msgstr "" #: ../../whatsnew/3.14.rst:2207 @@ -3402,9 +3385,9 @@ msgstr "zipfile" #: ../../whatsnew/3.14.rst:2229 msgid "" "Added :func:`ZipInfo._for_archive ` to resolve " -"suitable defaults for a :class:`~zipfile.ZipInfo` object as used " -"by :func:`ZipFile.writestr `. (Contributed by " -"Bénédikt Tran in :gh:`123424`.)" +"suitable defaults for a :class:`~zipfile.ZipInfo` object as used by :func:" +"`ZipFile.writestr `. (Contributed by Bénédikt Tran " +"in :gh:`123424`.)" msgstr "" #: ../../whatsnew/3.14.rst:2234 @@ -3421,8 +3404,12 @@ msgstr "最佳化" #: ../../whatsnew/3.14.rst:2246 msgid "" "The import time for several standard library modules has been improved, " -"including :mod:`annotationlib`, :mod:`ast`, :mod:`asyncio`, :mod:`base64`, :mod:`cmd`, :mod:`csv`, :mod:`gettext`, :mod:`importlib.util`, :mod:`locale`, :mod:`mimetypes`, :mod:`optparse`, :mod:`pickle`, :mod:`pprint`, :mod:`pstats`, :mod:`shlex`, :mod:`socket`, :mod:`string`, :mod:`subprocess`, :mod:`threading`, :mod:`tomllib`, :mod:`types`, " -"and :mod:`zipfile`." +"including :mod:`annotationlib`, :mod:`ast`, :mod:`asyncio`, :mod:`base64`, :" +"mod:`cmd`, :mod:`csv`, :mod:`gettext`, :mod:`importlib.util`, :mod:" +"`locale`, :mod:`mimetypes`, :mod:`optparse`, :mod:`pickle`, :mod:`pprint`, :" +"mod:`pstats`, :mod:`shlex`, :mod:`socket`, :mod:`string`, :mod:" +"`subprocess`, :mod:`threading`, :mod:`tomllib`, :mod:`types`, and :mod:" +"`zipfile`." msgstr "" #: ../../whatsnew/3.14.rst:2253 @@ -3489,9 +3476,9 @@ msgstr "" #: ../../whatsnew/3.14.rst:2307 msgid "" -"Because of this optimization, the meaning of the results " -"of :meth:`~gc.get_threshold` and :meth:`~gc.set_threshold` have changed, " -"along with :meth:`~gc.get_count` and :meth:`~gc.get_stats`." +"Because of this optimization, the meaning of the results of :meth:`~gc." +"get_threshold` and :meth:`~gc.set_threshold` have changed, along with :meth:" +"`~gc.get_count` and :meth:`~gc.get_stats`." msgstr "" #: ../../whatsnew/3.14.rst:2311 @@ -3540,11 +3527,11 @@ msgstr "" #: ../../whatsnew/3.14.rst:2355 msgid "" ":mod:`pdb` now supports two backends, based on either :func:`sys.settrace` " -"or :mod:`sys.monitoring`. Using the :ref:`pdb CLI ` " -"or :func:`breakpoint` will always use the :mod:`sys.monitoring` backend. " -"Explicitly instantiating :class:`pdb.Pdb` and its derived classes will use " -"the :func:`sys.settrace` backend by default, which is configurable. " -"(Contributed by Tian Gao in :gh:`124533`.)" +"or :mod:`sys.monitoring`. Using the :ref:`pdb CLI ` or :func:" +"`breakpoint` will always use the :mod:`sys.monitoring` backend. Explicitly " +"instantiating :class:`pdb.Pdb` and its derived classes will use the :func:" +"`sys.settrace` backend by default, which is configurable. (Contributed by " +"Tian Gao in :gh:`124533`.)" msgstr "" #: ../../whatsnew/3.14.rst:2367 @@ -3556,8 +3543,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:2372 msgid "" -":func:`~uuid.uuid4` is now c. 30% faster. (Contributed by Bénédikt Tran " -"in :gh:`128150`.)" +":func:`~uuid.uuid4` is now c. 30% faster. (Contributed by Bénédikt Tran in :" +"gh:`128150`.)" msgstr "" #: ../../whatsnew/3.14.rst:2377 @@ -3584,7 +3571,7 @@ msgstr "" msgid "(Contributed by Steve Dower in :gh:`91349`.)" msgstr "(由 Steve Dower 於 :gh:`91349` 貢獻。)" -#: ../../whatsnew/3.14.rst:2394 ../../whatsnew/3.14.rst:3079 +#: ../../whatsnew/3.14.rst:2394 msgid "Removed" msgstr "已移除" @@ -3598,21 +3585,20 @@ msgstr "" #: ../../whatsnew/3.14.rst:2404 msgid "" "Calling :meth:`~argparse.ArgumentParser.add_argument_group` on an argument " -"group now raises a :exc:`ValueError`. " -"Similarly, :meth:`~argparse.ArgumentParser.add_argument_group` " -"or :meth:`~argparse.ArgumentParser.add_mutually_exclusive_group` on a " -"mutually exclusive group now both raise :exc:`ValueError`\\ s. This " -"'nesting' was never supported, often failed to work correctly, and was " -"unintentionally exposed through inheritance. This functionality has been " -"deprecated since Python 3.11. (Contributed by Savannah Ostrowski " -"in :gh:`127186`.)" +"group now raises a :exc:`ValueError`. Similarly, :meth:`~argparse." +"ArgumentParser.add_argument_group` or :meth:`~argparse.ArgumentParser." +"add_mutually_exclusive_group` on a mutually exclusive group now both raise :" +"exc:`ValueError`\\ s. This 'nesting' was never supported, often failed to " +"work correctly, and was unintentionally exposed through inheritance. This " +"functionality has been deprecated since Python 3.11. (Contributed by " +"Savannah Ostrowski in :gh:`127186`.)" msgstr "" #: ../../whatsnew/3.14.rst:2418 msgid "" -"Remove the following classes, which have been deprecated aliases " -"of :class:`~ast.Constant` since Python 3.8 and have emitted deprecation " -"warnings since Python 3.12:" +"Remove the following classes, which have been deprecated aliases of :class:" +"`~ast.Constant` since Python 3.8 and have emitted deprecation warnings since " +"Python 3.12:" msgstr "" #: ../../whatsnew/3.14.rst:2422 @@ -3664,8 +3650,8 @@ msgstr "" #: ../../whatsnew/3.14.rst:2442 msgid "" -"Use :attr:`!Constant.value` instead. (Contributed by Alex Waygood " -"in :gh:`119562`.)" +"Use :attr:`!Constant.value` instead. (Contributed by Alex Waygood in :gh:" +"`119562`.)" msgstr "" #: ../../whatsnew/3.14.rst:2449 @@ -3831,178 +3817,164 @@ msgid "" " runner.run(operation_two())" msgstr "" -#: ../../whatsnew/3.14.rst:2565 -msgid "collections.abc" -msgstr "collections.abc" - -#: ../../whatsnew/3.14.rst:2567 ../../whatsnew/3.14.rst:2653 -msgid "" -"Remove :class:`!ByteString`, which has been deprecated since Python 3.12. " -"(Contributed by Nikita Sobolev in :gh:`118803`.)" -msgstr "" - -#: ../../whatsnew/3.14.rst:2573 +#: ../../whatsnew/3.14.rst:2564 msgid "email" msgstr "email" -#: ../../whatsnew/3.14.rst:2575 +#: ../../whatsnew/3.14.rst:2566 msgid "" "Remove :func:`email.utils.localtime`'s *isdst* parameter, which was " "deprecated in and has been ignored since Python 3.12. (Contributed by Hugo " "van Kemenade in :gh:`118798`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2581 +#: ../../whatsnew/3.14.rst:2572 msgid "importlib.abc" msgstr "" -#: ../../whatsnew/3.14.rst:2583 +#: ../../whatsnew/3.14.rst:2574 msgid "Remove deprecated :mod:`importlib.abc` classes:" msgstr "" -#: ../../whatsnew/3.14.rst:2585 +#: ../../whatsnew/3.14.rst:2576 msgid "" -":class:`!ResourceReader` " -"(use :class:`~importlib.resources.abc.TraversableResources`)" +":class:`!ResourceReader` (use :class:`~importlib.resources.abc." +"TraversableResources`)" msgstr "" -#: ../../whatsnew/3.14.rst:2587 +#: ../../whatsnew/3.14.rst:2578 msgid "" ":class:`!Traversable` (use :class:`~importlib.resources.abc.Traversable`)" msgstr "" -#: ../../whatsnew/3.14.rst:2589 +#: ../../whatsnew/3.14.rst:2580 msgid "" -":class:`!TraversableResources` " -"(use :class:`~importlib.resources.abc.TraversableResources`)" +":class:`!TraversableResources` (use :class:`~importlib.resources.abc." +"TraversableResources`)" msgstr "" -#: ../../whatsnew/3.14.rst:2592 +#: ../../whatsnew/3.14.rst:2583 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 貢獻於 :gh:`93963`。)" -#: ../../whatsnew/3.14.rst:2596 +#: ../../whatsnew/3.14.rst:2587 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.14.rst:2598 +#: ../../whatsnew/3.14.rst:2589 msgid "" -"Remove support for copy, deepcopy, and pickle operations " -"from :mod:`itertools` iterators. These have emitted " -"a :exc:`DeprecationWarning` since Python 3.12. (Contributed by Raymond " -"Hettinger in :gh:`101588`.)" +"Remove support for copy, deepcopy, and pickle operations from :mod:" +"`itertools` iterators. These have emitted a :exc:`DeprecationWarning` since " +"Python 3.12. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2607 +#: ../../whatsnew/3.14.rst:2598 msgid "" -"Remove support for passing additional keyword arguments " -"to :class:`~pathlib.Path`. In previous versions, any such arguments are " -"ignored. (Contributed by Barney Gale in :gh:`74033`.)" +"Remove support for passing additional keyword arguments to :class:`~pathlib." +"Path`. In previous versions, any such arguments are ignored. (Contributed by " +"Barney Gale in :gh:`74033`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2612 +#: ../../whatsnew/3.14.rst:2603 msgid "" -"Remove support for passing additional positional arguments " -"to :meth:`.PurePath.relative_to` " -"and :meth:`~pathlib.PurePath.is_relative_to`. In previous versions, any such " -"arguments are joined onto *other*. (Contributed by Barney Gale " -"in :gh:`78707`.)" +"Remove support for passing additional positional arguments to :meth:`." +"PurePath.relative_to` and :meth:`~pathlib.PurePath.is_relative_to`. In " +"previous versions, any such arguments are joined onto *other*. (Contributed " +"by Barney Gale in :gh:`78707`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2619 +#: ../../whatsnew/3.14.rst:2610 msgid "pkgutil" msgstr "" -#: ../../whatsnew/3.14.rst:2621 +#: ../../whatsnew/3.14.rst:2612 msgid "" "Remove the :func:`!get_loader` and :func:`!find_loader` functions, which " -"have been deprecated since Python 3.12. (Contributed by Bénédikt Tran " -"in :gh:`97850`.)" +"have been deprecated since Python 3.12. (Contributed by Bénédikt Tran in :gh:" +"`97850`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2627 +#: ../../whatsnew/3.14.rst:2618 msgid "pty" msgstr "" -#: ../../whatsnew/3.14.rst:2629 +#: ../../whatsnew/3.14.rst:2620 msgid "" "Remove the :func:`!master_open` and :func:`!slave_open` functions, which " "have been deprecated since Python 3.12. Use :func:`pty.openpty` instead. " "(Contributed by Nikita Sobolev in :gh:`118824`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2636 +#: ../../whatsnew/3.14.rst:2627 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.14.rst:2638 +#: ../../whatsnew/3.14.rst:2629 msgid "" "Remove :data:`!version` and :data:`!version_info` from the :mod:`sqlite3` " -"module; use :data:`~sqlite3.sqlite_version` " -"and :data:`~sqlite3.sqlite_version_info` for the actual version number of " -"the runtime SQLite library. (Contributed by Hugo van Kemenade " -"in :gh:`118924`.)" +"module; use :data:`~sqlite3.sqlite_version` and :data:`~sqlite3." +"sqlite_version_info` for the actual version number of the runtime SQLite " +"library. (Contributed by Hugo van Kemenade in :gh:`118924`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2644 +#: ../../whatsnew/3.14.rst:2635 msgid "" -"Using a sequence of parameters with named placeholders now raises " -"a :exc:`~sqlite3.ProgrammingError`, having been deprecated since Python " -"3.12. (Contributed by Erlend E. Aasland in :gh:`118928` and :gh:`101693`.)" +"Using a sequence of parameters with named placeholders now raises a :exc:" +"`~sqlite3.ProgrammingError`, having been deprecated since Python 3.12. " +"(Contributed by Erlend E. Aasland in :gh:`118928` and :gh:`101693`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2660 +#: ../../whatsnew/3.14.rst:2644 msgid "" "Remove the :class:`!Quoter` class from :mod:`urllib.parse`, which has been " -"deprecated since Python 3.11. (Contributed by Nikita Sobolev " -"in :gh:`118827`.)" +"deprecated since Python 3.11. (Contributed by Nikita Sobolev in :gh:" +"`118827`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2664 +#: ../../whatsnew/3.14.rst:2648 msgid "" -"Remove the :class:`!URLopener` and :class:`!FancyURLopener` classes " -"from :mod:`urllib.request`, which have been deprecated since Python 3.3." +"Remove the :class:`!URLopener` and :class:`!FancyURLopener` classes from :" +"mod:`urllib.request`, which have been deprecated since Python 3.3." msgstr "" -#: ../../whatsnew/3.14.rst:2668 +#: ../../whatsnew/3.14.rst:2652 msgid "" "``myopener.open()`` can be replaced with :func:`~urllib.request.urlopen`. " -"``myopener.retrieve()`` can be replaced " -"with :func:`~urllib.request.urlretrieve`. Customisations to the opener " -"classes can be replaced by passing customized handlers " -"to :func:`~urllib.request.build_opener`. (Contributed by Barney Gale " -"in :gh:`84850`.)" +"``myopener.retrieve()`` can be replaced with :func:`~urllib.request." +"urlretrieve`. Customisations to the opener classes can be replaced by " +"passing customized handlers to :func:`~urllib.request.build_opener`. " +"(Contributed by Barney Gale in :gh:`84850`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2677 ../../whatsnew/3.14.rst:2996 +#: ../../whatsnew/3.14.rst:2661 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.14.rst:2679 +#: ../../whatsnew/3.14.rst:2663 #: ../../deprecations/pending-removal-in-future.rst:7 msgid ":mod:`argparse`:" msgstr ":mod:`argparse`:" -#: ../../whatsnew/3.14.rst:2681 +#: ../../whatsnew/3.14.rst:2665 msgid "" -"Passing the undocumented keyword argument *prefix_chars* " -"to :meth:`~argparse.ArgumentParser.add_argument_group` is now deprecated. " -"(Contributed by Savannah Ostrowski in :gh:`125563`.)" +"Passing the undocumented keyword argument *prefix_chars* to :meth:`~argparse." +"ArgumentParser.add_argument_group` is now deprecated. (Contributed by " +"Savannah Ostrowski in :gh:`125563`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2685 +#: ../../whatsnew/3.14.rst:2669 msgid "" "Deprecated the :class:`argparse.FileType` type converter. Anything with " "resource management should be done downstream after the arguments are " "parsed. (Contributed by Serhiy Storchaka in :gh:`58032`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2690 +#: ../../whatsnew/3.14.rst:2674 #: ../../deprecations/pending-removal-in-3.16.rst:19 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" -#: ../../whatsnew/3.14.rst:2692 +#: ../../whatsnew/3.14.rst:2676 #: ../../deprecations/pending-removal-in-3.16.rst:21 msgid "" ":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in " @@ -4010,10 +3982,10 @@ msgid "" "by Jiahao Li and Kumar Aditya in :gh:`122875`.)" msgstr "" ":func:`!asyncio.iscoroutinefunction` 已被棄用並將在 Python 3.16 中移除;請改" -"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya " -"於 :gh:`122875` 貢獻。)" +"用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya 於 :" +"gh:`122875` 貢獻。)" -#: ../../whatsnew/3.14.rst:2697 +#: ../../whatsnew/3.14.rst:2681 #: ../../deprecations/pending-removal-in-3.16.rst:26 msgid "" ":mod:`asyncio` policy system is deprecated and will be removed in Python " @@ -4022,37 +3994,37 @@ msgstr "" ":mod:`asyncio` 策略系統已被棄用並將在 Python 3.16 中移除。特別是以下類別和函" "式已被棄用:" -#: ../../whatsnew/3.14.rst:2700 +#: ../../whatsnew/3.14.rst:2684 #: ../../deprecations/pending-removal-in-3.16.rst:29 msgid ":class:`asyncio.AbstractEventLoopPolicy`" msgstr ":class:`asyncio.AbstractEventLoopPolicy`" -#: ../../whatsnew/3.14.rst:2701 +#: ../../whatsnew/3.14.rst:2685 #: ../../deprecations/pending-removal-in-3.16.rst:30 msgid ":class:`asyncio.DefaultEventLoopPolicy`" msgstr ":class:`asyncio.DefaultEventLoopPolicy`" -#: ../../whatsnew/3.14.rst:2702 +#: ../../whatsnew/3.14.rst:2686 #: ../../deprecations/pending-removal-in-3.16.rst:31 msgid ":class:`asyncio.WindowsSelectorEventLoopPolicy`" msgstr ":class:`asyncio.WindowsSelectorEventLoopPolicy`" -#: ../../whatsnew/3.14.rst:2703 +#: ../../whatsnew/3.14.rst:2687 #: ../../deprecations/pending-removal-in-3.16.rst:32 msgid ":class:`asyncio.WindowsProactorEventLoopPolicy`" msgstr ":class:`asyncio.WindowsProactorEventLoopPolicy`" -#: ../../whatsnew/3.14.rst:2704 +#: ../../whatsnew/3.14.rst:2688 #: ../../deprecations/pending-removal-in-3.16.rst:33 msgid ":func:`asyncio.get_event_loop_policy`" msgstr ":func:`asyncio.get_event_loop_policy`" -#: ../../whatsnew/3.14.rst:2705 +#: ../../whatsnew/3.14.rst:2689 #: ../../deprecations/pending-removal-in-3.16.rst:34 msgid ":func:`asyncio.set_event_loop_policy`" msgstr ":func:`asyncio.set_event_loop_policy`" -#: ../../whatsnew/3.14.rst:2707 +#: ../../whatsnew/3.14.rst:2691 #: ../../deprecations/pending-removal-in-3.16.rst:36 msgid "" "Users should use :func:`asyncio.run` or :class:`asyncio.Runner` with " @@ -4061,12 +4033,12 @@ msgstr "" "使用者應該使用 :func:`asyncio.run` 或 :class:`asyncio.Runner` 搭配 " "*loop_factory* 來使用所需的事件迴圈實作。" -#: ../../whatsnew/3.14.rst:2710 +#: ../../whatsnew/3.14.rst:2694 #: ../../deprecations/pending-removal-in-3.16.rst:39 msgid "For example, to use :class:`asyncio.SelectorEventLoop` on Windows::" msgstr "例如在 Windows 上使用 :class:`asyncio.SelectorEventLoop`: ::" -#: ../../whatsnew/3.14.rst:2712 +#: ../../whatsnew/3.14.rst:2696 #: ../../deprecations/pending-removal-in-3.16.rst:41 msgid "" "import asyncio\n" @@ -4083,96 +4055,94 @@ msgstr "" "\n" "asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)" -#: ../../whatsnew/3.14.rst:2719 +#: ../../whatsnew/3.14.rst:2703 #: ../../deprecations/pending-removal-in-3.16.rst:48 msgid "(Contributed by Kumar Aditya in :gh:`127949`.)" msgstr "(由 Kumar Aditya 於 :gh:`127949` 貢獻。)" -#: ../../whatsnew/3.14.rst:2721 +#: ../../whatsnew/3.14.rst:2705 msgid "" ":mod:`builtins`: Passing a complex number as the *real* or *imag* argument " "in the :func:`complex` constructor is now deprecated; it should only be " -"passed as a single positional argument. (Contributed by Serhiy Storchaka " -"in :gh:`109218`.)" +"passed as a single positional argument. (Contributed by Serhiy Storchaka in :" +"gh:`109218`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2727 +#: ../../whatsnew/3.14.rst:2711 msgid "" ":mod:`codecs`: :func:`codecs.open` is now deprecated. Use :func:`open` " "instead. (Contributed by Inada Naoki in :gh:`133036`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2731 +#: ../../whatsnew/3.14.rst:2715 #: ../../deprecations/pending-removal-in-3.15.rst:16 #: ../../deprecations/pending-removal-in-3.19.rst:4 msgid ":mod:`ctypes`:" msgstr ":mod:`ctypes`:" -#: ../../whatsnew/3.14.rst:2733 +#: ../../whatsnew/3.14.rst:2717 msgid "" "On non-Windows platforms, setting :attr:`.Structure._pack_` to use a MSVC-" -"compatible default memory layout is deprecated in favor of " -"setting :attr:`.Structure._layout_` to ``'ms'``. (Contributed by Petr " -"Viktorin in :gh:`131747`.)" +"compatible default memory layout is deprecated in favor of setting :attr:`." +"Structure._layout_` to ``'ms'``. (Contributed by Petr Viktorin in :gh:" +"`131747`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2738 +#: ../../whatsnew/3.14.rst:2722 msgid "" "Calling :func:`ctypes.POINTER` on a string is deprecated. Use :ref:`ctypes-" "incomplete-types` for self-referential structures. Also, the internal " "``ctypes._pointer_type_cache`` is deprecated. See :func:`ctypes.POINTER` for " -"updated implementation details. (Contributed by Sergey Myrianov " -"in :gh:`100926`.)" +"updated implementation details. (Contributed by Sergey Myrianov in :gh:" +"`100926`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2744 +#: ../../whatsnew/3.14.rst:2728 msgid "" -":mod:`functools`: Calling the Python implementation " -"of :func:`functools.reduce` with *function* or *sequence* as keyword " -"arguments is now deprecated. (Contributed by Kirill Podoprigora " -"in :gh:`121676`.)" +":mod:`functools`: Calling the Python implementation of :func:`functools." +"reduce` with *function* or *sequence* as keyword arguments is now " +"deprecated. (Contributed by Kirill Podoprigora in :gh:`121676`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2749 +#: ../../whatsnew/3.14.rst:2733 msgid "" ":mod:`logging`: Support for custom logging handlers with the *strm* argument " "is deprecated and scheduled for removal in Python 3.16. Define handlers with " -"the *stream* argument instead. (Contributed by Mariusz Felisiak " -"in :gh:`115032`.)" +"the *stream* argument instead. (Contributed by Mariusz Felisiak in :gh:" +"`115032`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2754 +#: ../../whatsnew/3.14.rst:2738 msgid "" -":mod:`mimetypes`: Valid extensions start with a '.' or are empty " -"for :meth:`mimetypes.MimeTypes.add_type`. Undotted extensions are deprecated " -"and will raise a :exc:`ValueError` in Python 3.16. (Contributed by Hugo van " -"Kemenade in :gh:`75223`.)" +":mod:`mimetypes`: Valid extensions start with a '.' or are empty for :meth:" +"`mimetypes.MimeTypes.add_type`. Undotted extensions are deprecated and will " +"raise a :exc:`ValueError` in Python 3.16. (Contributed by Hugo van Kemenade " +"in :gh:`75223`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2761 +#: ../../whatsnew/3.14.rst:2745 msgid "" -":mod:`!nturl2path`: This module is now deprecated. " -"Call :func:`urllib.request.url2pathname` " -"and :func:`~urllib.request.pathname2url` instead. (Contributed by Barney " -"Gale in :gh:`125866`.)" +":mod:`!nturl2path`: This module is now deprecated. Call :func:`urllib." +"request.url2pathname` and :func:`~urllib.request.pathname2url` instead. " +"(Contributed by Barney Gale in :gh:`125866`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2766 +#: ../../whatsnew/3.14.rst:2750 msgid "" -":mod:`os`: :term:`Soft deprecate ` :func:`os.popen` " -"and :func:`os.spawn* ` functions. They should no longer be used " -"to write new code. The :mod:`subprocess` module is recommended instead. " +":mod:`os`: :term:`Soft deprecate ` :func:`os.popen` and :" +"func:`os.spawn* ` functions. They should no longer be used to " +"write new code. The :mod:`subprocess` module is recommended instead. " "(Contributed by Victor Stinner in :gh:`120743`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2772 +#: ../../whatsnew/3.14.rst:2756 msgid "" ":mod:`pathlib`: :meth:`!pathlib.PurePath.as_uri` is deprecated and will be " "removed in Python 3.19. Use :meth:`pathlib.Path.as_uri` instead. " "(Contributed by Barney Gale in :gh:`123599`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2777 +#: ../../whatsnew/3.14.rst:2761 msgid "" ":mod:`pdb`: The undocumented ``pdb.Pdb.curframe_locals`` attribute is now a " "deprecated read-only property. The low overhead dynamic frame locals access " @@ -4182,13 +4152,13 @@ msgid "" "later versions. (Contributed by Tian Gao in :gh:`124369` and :gh:`125951`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2785 +#: ../../whatsnew/3.14.rst:2769 msgid "" ":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the " "lack of interest. (Contributed by Bénédikt Tran in :gh:`119698`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2789 +#: ../../whatsnew/3.14.rst:2773 msgid "" ":mod:`tkinter`: The :class:`!tkinter.Variable` methods :meth:`!" "trace_variable`, :meth:`!trace_vdelete` and :meth:`!trace_vinfo` are now " @@ -4196,13 +4166,13 @@ msgid "" "trace_info` instead. (Contributed by Serhiy Storchaka in :gh:`120220`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2796 +#: ../../whatsnew/3.14.rst:2780 msgid "" ":mod:`urllib.parse`: Accepting objects with false values (like ``0`` and " -"``[]``) except empty strings, byte-like objects and ``None`` " -"in :mod:`urllib.parse` functions :func:`~urllib.parse.parse_qsl` " -"and :func:`~urllib.parse.parse_qs` is now deprecated. (Contributed by Serhiy " -"Storchaka in :gh:`116897`.)" +"``[]``) except empty strings, byte-like objects and ``None`` in :mod:`urllib." +"parse` functions :func:`~urllib.parse.parse_qsl` and :func:`~urllib.parse." +"parse_qs` is now deprecated. (Contributed by Serhiy Storchaka in :gh:" +"`116897`.)" msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:2 @@ -4217,10 +4187,10 @@ msgstr "引入系統 (import system):" #: ../../deprecations/pending-removal-in-3.15.rst:6 msgid "" -"Setting :attr:`~module.__cached__` on a module while failing to " -"set :attr:`__spec__.cached ` is " -"deprecated. In Python 3.15, :attr:`!__cached__` will cease to be set or take " -"into consideration by the import system or standard library. (:gh:`97879`)" +"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" +"`__spec__.cached ` is deprecated. In " +"Python 3.15, :attr:`!__cached__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" msgstr "" "在模組上設定 :attr:`~module.__cached__` 而沒有設定 :attr:`__spec__.cached " "` 的做法已被棄用。在 Python 3.15 中," @@ -4228,11 +4198,10 @@ msgstr "" #: ../../deprecations/pending-removal-in-3.15.rst:11 msgid "" -"Setting :attr:`~module.__package__` on a module while failing to " -"set :attr:`__spec__.parent ` is " -"deprecated. In Python 3.15, :attr:`!__package__` will cease to be set or " -"take into consideration by the import system or standard library. " -"(:gh:`97879`)" +"Setting :attr:`~module.__package__` on a module while failing to set :attr:" +"`__spec__.parent ` is deprecated. In " +"Python 3.15, :attr:`!__package__` will cease to be set or take into " +"consideration by the import system or standard library. (:gh:`97879`)" msgstr "" "在模組上設定 :attr:`~module.__package__` 而沒有設定 :attr:`__spec__.parent " "` 的做法已被棄用。在 Python 3.15 中," @@ -4283,17 +4252,15 @@ 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`.)" +"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` 貢" -"獻。)" +"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`:" @@ -4301,11 +4268,11 @@ msgstr ":mod:`pathlib`:" #: ../../deprecations/pending-removal-in-3.15.rst:48 msgid "" -":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. " -"Use :func:`os.path.isreserved` to detect reserved paths on Windows." +":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" +"func:`os.path.isreserved` to detect reserved paths on Windows." msgstr "" -":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請" -"用 :func:`os.path.isreserved` 來偵測 Windows 上的保留路徑。" +":meth:`.PurePath.is_reserved` 已自 Python 3.13 被棄用。請用 :func:`os.path." +"isreserved` 來偵測 Windows 上的保留路徑。" #: ../../deprecations/pending-removal-in-3.15.rst:52 msgid ":mod:`platform`:" @@ -4360,9 +4327,9 @@ msgid "" "in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" ":class:`types.CodeType`:自 3.10 起,存取 :attr:`~codeobject.co_lnotab` 已" -"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發" -"出 :exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev " -"於 :gh:`101866` 貢獻。)" +"在 :pep:`626` 中被棄用,並計劃在 3.12 中移除,但只在 3.12 中於適當時發出 :" +"exc:`DeprecationWarning`。可能在 3.15 中移除。(由 Nikita Sobolev 於 :gh:" +"`101866` 貢獻。)" #: ../../deprecations/pending-removal-in-3.15.rst:80 #: ../../deprecations/pending-removal-in-3.17.rst:4 @@ -4371,10 +4338,10 @@ msgstr ":mod:`typing`:" #: ../../deprecations/pending-removal-in-3.15.rst:82 msgid "" -"The undocumented keyword argument syntax for " -"creating :class:`~typing.NamedTuple` classes (for example, ``Point = " -"NamedTuple(\"Point\", x=int, y=int)``) has been deprecated since Python " -"3.13. Use the class-based syntax or the functional syntax instead." +"The undocumented keyword argument syntax for creating :class:`~typing." +"NamedTuple` classes (for example, ``Point = NamedTuple(\"Point\", x=int, " +"y=int)``) has been deprecated since Python 3.13. Use the class-based syntax " +"or the functional syntax instead." msgstr "" "用於建立 :class:`~typing.NamedTuple` 類別的未以文件記錄之關鍵字引數語法 " "(``Point = NamedTuple(\"Point\", x=int, y=int)``) 已自 Python 3.13 棄用。請改" @@ -4409,14 +4376,13 @@ msgstr ":mod:`wave`:" #: ../../deprecations/pending-removal-in-3.15.rst:102 msgid "" -"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, " -"and :meth:`~wave.Wave_read.getmarkers` methods of " -"the :class:`~wave.Wave_read` and :class:`~wave.Wave_write` classes have been " -"deprecated since Python 3.13." +"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." +"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" +"`~wave.Wave_write` classes have been deprecated since Python 3.13." msgstr "" -"已棄用 :class:`~wave.Wave_read` 和 :class:`~wave.Wave_write` 類別" -"的 :meth:`~wave.Wave_read.getmark`、:meth:`!setmark` " -"和 :meth:`~wave.Wave_read.getmarkers` 方法自 Python 3.13 被棄用。" +"已棄用 :class:`~wave.Wave_read` 和 :class:`~wave.Wave_write` 類別的 :meth:" +"`~wave.Wave_read.getmark`、:meth:`!setmark` 和 :meth:`~wave.Wave_read." +"getmarkers` 方法自 Python 3.13 被棄用。" #: ../../deprecations/pending-removal-in-3.15.rst:107 msgid ":mod:`zipimport`:" @@ -4428,9 +4394,9 @@ msgid "" "3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead. (Contributed " "by Jiahao Li in :gh:`125746`.)" msgstr "" -":meth:`~zipimport.zipimporter.load_module` 自 Python 3.10 被棄用。請改" -"用 :meth:`~zipimport.zipimporter.exec_module`。(由 Jiahao Li " -"於 :gh:`125746` 貢獻。)" +":meth:`~zipimport.zipimporter.load_module` 自 Python 3.10 被棄用。請改用 :" +"meth:`~zipimport.zipimporter.exec_module`。(由 Jiahao Li 於 :gh:`125746` 貢" +"獻。)" #: ../../deprecations/c-api-pending-removal-in-3.16.rst:2 #: ../../deprecations/pending-removal-in-3.16.rst:2 @@ -4439,10 +4405,10 @@ msgstr "Python 3.16 中待移除的項目" #: ../../deprecations/pending-removal-in-3.16.rst:6 msgid "" -"Setting :attr:`~module.__loader__` on a module while failing to " -"set :attr:`__spec__.loader ` is " -"deprecated. In Python 3.16, :attr:`!__loader__` will cease to be set or " -"taken into consideration by the import system or the standard library." +"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" +"`__spec__.loader ` is deprecated. In " +"Python 3.16, :attr:`!__loader__` will cease to be set or taken into " +"consideration by the import system or the standard library." msgstr "" "在模組上設定 :attr:`~module.__loader__` 而沒有設定 :attr:`__spec__.loader " "` 的做法將於 Python 3.16 被棄用。在 " @@ -4490,8 +4456,8 @@ msgid "" "*function* or *sequence* as keyword arguments has been deprecated since " "Python 3.14." msgstr "" -"自 Python 3.14 起,使用 *function* 或 *sequence* 關鍵字引數呼" -"叫 :func:`functools.reduce` 的 Python 實作已被棄用。" +"自 Python 3.14 起,使用 *function* 或 *sequence* 關鍵字引數呼叫 :func:" +"`functools.reduce` 的 Python 實作已被棄用。" #: ../../deprecations/pending-removal-in-3.16.rst:64 msgid ":mod:`logging`:" @@ -4512,10 +4478,10 @@ msgstr ":mod:`mimetypes`:" #: ../../deprecations/pending-removal-in-3.16.rst:72 msgid "" -"Valid extensions start with a '.' or are empty " -"for :meth:`mimetypes.MimeTypes.add_type`. Undotted extensions are deprecated " -"and will raise a :exc:`ValueError` in Python 3.16. (Contributed by Hugo van " -"Kemenade in :gh:`75223`.)" +"Valid extensions start with a '.' or are empty for :meth:`mimetypes." +"MimeTypes.add_type`. Undotted extensions are deprecated and will raise a :" +"exc:`ValueError` in Python 3.16. (Contributed by Hugo van Kemenade in :gh:" +"`75223`.)" msgstr "" "有效的副檔名以 '.' 開頭或對 :meth:`mimetypes.MimeTypes.add_type` 為空字串。未" "加點的副檔名已被棄用,並將在 Python 3.16 中引發 :exc:`ValueError`。(由 Hugo " @@ -4598,18 +4564,48 @@ msgstr "" "除。使用者應該改用文件中記錄的內省輔助函式,例如 :func:`typing.get_origin` " "和 :func:`typing.get_args`,或者依賴私有實作細節。" +#: ../../deprecations/pending-removal-in-3.17.rst:11 +msgid "" +":class:`typing.ByteString`, deprecated since Python 3.9, is scheduled for " +"removal in Python 3.17. Prefer :class:`~collections.abc.Sequence` or :class:" +"`~collections.abc.Buffer`. For use in type annotations, prefer a union, like " +"``bytes | bytearray``, or :class:`collections.abc.Buffer`. (Contributed by " +"Shantanu Jain in :gh:`91896`.)" +msgstr "" +"自 Python 3.9 起已被棄用的 :class:`typing.ByteString`,計劃在 Python " +"3.17 中移除。建議改用 :class:`~collections.abc.Sequence` 或 :class:`~" +"collections.abc.Buffer`。在型別註釋中建議改用聯集,例如 ``bytes | " +"bytearray`` 或 :class:`collections.abc.Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" + +#: ../../deprecations/pending-removal-in-3.17.rst:17 +msgid ":mod:`collections.abc`:" +msgstr ":mod:`collections.abc`:" + +#: ../../deprecations/pending-removal-in-3.17.rst:19 +msgid "" +":class:`collections.abc.ByteString` is scheduled for removal in Python 3.17. " +"Prefer :class:`~collections.abc.Sequence` or :class:`~collections.abc." +"Buffer`. For use in type annotations, prefer a union, like ``bytes | " +"bytearray``, or :class:`collections.abc.Buffer`. (Contributed by Shantanu " +"Jain in :gh:`91896`.)" +msgstr "" +":class:`collections.abc.ByteString` 計劃在 Python 3.17 中移除。建議改用 " +":class:`~collections.abc.Sequence` 或 :class:`~collections.abc.Buffer`。在" +"型別註釋中建議改用聯集,例如 ``bytes | bytearray`` 或 :class:`collections.abc." +"Buffer`。(Shantanu Jain 於 :gh:`91896` 貢獻。)" + #: ../../deprecations/pending-removal-in-3.19.rst:2 msgid "Pending removal in Python 3.19" msgstr "Python 3.19 中待移除的項目" #: ../../deprecations/pending-removal-in-3.19.rst:6 msgid "" -"Implicitly switching to the MSVC-compatible struct layout by " -"setting :attr:`~ctypes.Structure._pack_` but " -"not :attr:`~ctypes.Structure._layout_` on non-Windows platforms." +"Implicitly switching to the MSVC-compatible struct layout by setting :attr:" +"`~ctypes.Structure._pack_` but not :attr:`~ctypes.Structure._layout_` on non-" +"Windows platforms." msgstr "" -"在非 Windows 平台上,透過設定 :attr:`~ctypes.Structure._pack_` 而沒有設" -"定 :attr:`~ctypes.Structure._layout_` 來隱式地切換到與 MSVC 相容的結構佈局。" +"在非 Windows 平台上,透過設定 :attr:`~ctypes.Structure._pack_` 而沒有設定 :" +"attr:`~ctypes.Structure._layout_` 來隱式地切換到與 MSVC 相容的結構佈局。" #: ../../deprecations/c-api-pending-removal-in-future.rst:2 #: ../../deprecations/pending-removal-in-future.rst:2 @@ -4629,11 +4625,11 @@ msgstr "巢狀引數群組和巢狀互斥群組已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:11 msgid "" -"Passing the undocumented keyword argument *prefix_chars* " -"to :meth:`~argparse.ArgumentParser.add_argument_group` is now deprecated." +"Passing the undocumented keyword argument *prefix_chars* to :meth:`~argparse." +"ArgumentParser.add_argument_group` is now deprecated." msgstr "" -"將未以文件記錄的關鍵字引數 *prefix_chars* 傳遞" -"給 :meth:`~argparse.ArgumentParser.add_argument_group` 的做法現在已被棄用。" +"將未以文件記錄的關鍵字引數 *prefix_chars* 傳遞給 :meth:`~argparse." +"ArgumentParser.add_argument_group` 的做法現在已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:14 msgid "The :class:`argparse.FileType` type converter is deprecated." @@ -4658,17 +4654,17 @@ msgid "" "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " "ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " "``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised " -"if the numeric literal is immediately followed by one of " -"keywords :keyword:`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :keyword:`is` " -"and :keyword:`or`. In a future release it will be changed to a syntax " -"error. (:gh:`87999`)" +"if the numeric literal is immediately followed by one of keywords :keyword:" +"`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :" +"keyword:`is` and :keyword:`or`. In a future release it will be changed to a " +"syntax error. (:gh:`87999`)" msgstr "" "目前 Python 接受數值字面值後面立即接關鍵字,例如 ``0in x``、``1or x``、``0if " "1else 2``。它讓表達式模糊且容易混淆,如 ``[0x1for x in y]``\\ (可以解釋為 " -"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即" -"接 :keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:`in`、:keyword:`is` " -"和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版本中,它將被更改為語" -"法錯誤。(:gh:`87999`)" +"``[0x1 for x in y]`` 或 ``[0x1f or x in y]``)。如果數值字面值後立即接 :" +"keyword:`and`、:keyword:`else`、:keyword:`for`、:keyword:`if`、:keyword:" +"`in`、:keyword:`is` 和 :keyword:`or` 之一的關鍵字,則會引發語法警告。在未來版" +"本中,它將被更改為語法錯誤。(:gh:`87999`)" #: ../../deprecations/pending-removal-in-future.rst:30 msgid "" @@ -4681,18 +4677,18 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:33 msgid "" -"Support for ``__float__()`` method returning a strict subclass " -"of :class:`float`: these methods will be required to return an instance " -"of :class:`float`." +"Support for ``__float__()`` method returning a strict subclass of :class:" +"`float`: these methods will be required to return an instance of :class:" +"`float`." msgstr "" "回傳 :class:`float` 嚴格子類別 ``__float__()`` 方法的支援:這些方法將需要回" "傳 :class:`float` 的實例。" #: ../../deprecations/pending-removal-in-future.rst:36 msgid "" -"Support for ``__complex__()`` method returning a strict subclass " -"of :class:`complex`: these methods will be required to return an instance " -"of :class:`complex`." +"Support for ``__complex__()`` method returning a strict subclass of :class:" +"`complex`: these methods will be required to return an instance of :class:" +"`complex`." msgstr "" "回傳 :class:`complex` 嚴格子類別 ``__complex__()`` 方法的支援:這些方法將需要" "回傳 :class:`complex` 的實例。" @@ -4703,10 +4699,10 @@ msgstr "將 ``int()`` 委派給 ``__trunc__()`` 方法。" #: ../../deprecations/pending-removal-in-future.rst:40 msgid "" -"Passing a complex number as the *real* or *imag* argument in " -"the :func:`complex` constructor is now deprecated; it should only be passed " -"as a single positional argument. (Contributed by Serhiy Storchaka " -"in :gh:`109218`.)" +"Passing a complex number as the *real* or *imag* argument in the :func:" +"`complex` constructor is now deprecated; it should only be passed as a " +"single positional argument. (Contributed by Serhiy Storchaka in :gh:" +"`109218`.)" msgstr "" "在 :func:`complex` 建構子中將複數作為 *real* 或 *imag* 引數傳遞現在已被棄用;" "它應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢獻。)" @@ -4714,9 +4710,8 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:45 msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " -"are deprecated and replaced by :data:`calendar.JANUARY` " -"and :data:`calendar.FEBRUARY`. (Contributed by Prince Roshan " -"in :gh:`103636`.)" +"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." +"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" ":mod:`calendar`:``calendar.January`` 和 ``calendar.February`` 常數已被棄用並" "被 :data:`calendar.JANUARY` 和 :data:`calendar.FEBRUARY` 取代。 (由 Prince " @@ -4724,8 +4719,8 @@ msgstr "" #: ../../deprecations/pending-removal-in-future.rst:50 msgid "" -":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. " -"(:gh:`133038`)" +":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. (:gh:" +"`133038`)" msgstr "" ":mod:`codecs`:請改用 :func:`open` 而非 :func:`codecs.open`。(:gh:`133038`)" @@ -4742,19 +4737,19 @@ msgstr ":mod:`datetime`:" #: ../../deprecations/pending-removal-in-future.rst:57 msgid "" -":meth:`~datetime.datetime.utcnow`: use " -"``datetime.datetime.now(tz=datetime.UTC)``." +":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." +"UTC)``." msgstr "" -":meth:`~datetime.datetime.utcnow`:請改用 " -"``datetime.datetime.now(tz=datetime.UTC)``。" +":meth:`~datetime.datetime.utcnow`:請改用 ``datetime.datetime." +"now(tz=datetime.UTC)``。" #: ../../deprecations/pending-removal-in-future.rst:59 msgid "" -":meth:`~datetime.datetime.utcfromtimestamp`: use " -"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``." +":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." +"fromtimestamp(timestamp, tz=datetime.UTC)``." msgstr "" -":meth:`~datetime.datetime.utcfromtimestamp`:請改用 " -"``datetime.datetime.fromtimestamp(timestamp, tz=datetime.UTC)``。" +":meth:`~datetime.datetime.utcfromtimestamp`:請改用 ``datetime.datetime." +"fromtimestamp(timestamp, tz=datetime.UTC)``。" #: ../../deprecations/pending-removal-in-future.rst:62 msgid ":mod:`gettext`: Plural value must be an integer." @@ -4785,8 +4780,8 @@ msgid "" ":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " "use :meth:`~logging.warning` instead." msgstr "" -":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改" -"用 :meth:`~logging.warning`。" +":mod:`logging`:自 Python 3.3 起,``warn()`` 方法已被棄用,請改用 :meth:" +"`~logging.warning`。" #: ../../deprecations/pending-removal-in-future.rst:77 msgid "" @@ -4843,11 +4838,11 @@ msgstr "不帶協定引數的 :class:`ssl.SSLContext` 已被棄用。" #: ../../deprecations/pending-removal-in-future.rst:100 msgid "" -":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` " -"and :meth:`!selected_npn_protocol` are deprecated: use ALPN instead." +":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" +"`!selected_npn_protocol` are deprecated: use ALPN instead." msgstr "" -":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` " -"和 :meth:`!selected_npn_protocol` 已被棄用:請改用 ALPN。" +":class:`ssl.SSLContext`::meth:`~ssl.SSLContext.set_npn_protocols` 和 :meth:" +"`!selected_npn_protocol` 已被棄用:請改用 ALPN。" #: ../../deprecations/pending-removal-in-future.rst:103 msgid "``ssl.OP_NO_SSL*`` options" @@ -4895,11 +4890,11 @@ msgstr ":mod:`threading` 方法:" #: ../../deprecations/pending-removal-in-future.rst:116 msgid "" -":meth:`!threading.Condition.notifyAll`: " -"use :meth:`~threading.Condition.notify_all`." +":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." +"notify_all`." msgstr "" -":meth:`!threading.Condition.notifyAll`:請" -"用 :meth:`~threading.Condition.notify_all`。" +":meth:`!threading.Condition.notifyAll`:請用 :meth:`~threading.Condition." +"notify_all`。" #: ../../deprecations/pending-removal-in-future.rst:117 msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." @@ -4907,19 +4902,19 @@ msgstr ":meth:`!threading.Event.isSet`:請用 :meth:`~threading.Event.is_set` #: ../../deprecations/pending-removal-in-future.rst:118 msgid "" -":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: " -"use :attr:`threading.Thread.daemon` attribute." +":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" +"attr:`threading.Thread.daemon` attribute." msgstr "" ":meth:`!threading.Thread.isDaemon`、:meth:`threading.Thread.setDaemon`:請" "用 :attr:`threading.Thread.daemon` 屬性。" #: ../../deprecations/pending-removal-in-future.rst:120 msgid "" -":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: " -"use :attr:`threading.Thread.name` attribute." +":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" +"attr:`threading.Thread.name` attribute." msgstr "" -":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請" -"用 :attr:`threading.Thread.name` 屬性。" +":meth:`!threading.Thread.getName`、:meth:`threading.Thread.setName`:請用 :" +"attr:`threading.Thread.name` 屬性。" #: ../../deprecations/pending-removal-in-future.rst:122 msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." @@ -5012,629 +5007,519 @@ msgstr ":mod:`wsgiref`:``SimpleHandler.stdout.write()`` 不應該進行部分 #: ../../deprecations/pending-removal-in-future.rst:152 msgid "" -":mod:`xml.etree.ElementTree`: Testing the truth value of " -"an :class:`~xml.etree.ElementTree.Element` is deprecated. In a future " -"release it will always return ``True``. Prefer explicit ``len(elem)`` or " -"``elem is not None`` tests instead." +":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." +"etree.ElementTree.Element` is deprecated. In a future release it will always " +"return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests " +"instead." msgstr "" -":mod:`xml.etree.ElementTree`:已棄用" -"對 :class:`~xml.etree.ElementTree.Element` 的真值測試。在未來版本中,它將始終" -"回傳 ``True``。請改用明確的 ``len(elem)`` 或 ``elem is not None`` 測試。" +":mod:`xml.etree.ElementTree`:已棄用對 :class:`~xml.etree.ElementTree." +"Element` 的真值測試。在未來版本中,它將始終回傳 ``True``。請改用明確的 " +"``len(elem)`` 或 ``elem is not None`` 測試。" #: ../../deprecations/pending-removal-in-future.rst:157 msgid "" -":func:`sys._clear_type_cache` is deprecated: " -"use :func:`sys._clear_internal_caches` instead." +":func:`sys._clear_type_cache` is deprecated: use :func:`sys." +"_clear_internal_caches` instead." msgstr "" -":func:`sys._clear_type_cache` 已被棄用:請改" -"用 :func:`sys._clear_internal_caches`。" +":func:`sys._clear_type_cache` 已被棄用:請改用 :func:`sys." +"_clear_internal_caches`。" -#: ../../whatsnew/3.14.rst:2817 +#: ../../whatsnew/3.14.rst:2801 msgid "CPython bytecode changes" msgstr "CPython 位元組碼變更" -#: ../../whatsnew/3.14.rst:2819 +#: ../../whatsnew/3.14.rst:2803 msgid "" "Replaced the opcode ``BINARY_SUBSCR`` by :opcode:`BINARY_OP` with oparg " "``NB_SUBSCR``. (Contributed by Irit Katriel in :gh:`100239`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2824 +#: ../../whatsnew/3.14.rst:2808 msgid "C API changes" msgstr "C API 變更" -#: ../../whatsnew/3.14.rst:2829 +#: ../../whatsnew/3.14.rst:2811 +msgid "New features in the C API" +msgstr "C API 中的新功能" + +#: ../../whatsnew/3.14.rst:2813 msgid "" -"Add :c:func:`PyLong_GetSign` function to get the sign of :class:`int` " -"objects. (Contributed by Sergey B Kirpichev in :gh:`116560`.)" +"Add :c:func:`Py_PACK_VERSION` and :c:func:`Py_PACK_FULL_VERSION`, two new " +"macros for bit-packing Python version numbers. This is useful for " +"comparisons with :c:var:`Py_Version` or :c:macro:`PY_VERSION_HEX`. " +"(Contributed by Petr Viktorin in :gh:`128629`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2832 +#: ../../whatsnew/3.14.rst:2819 msgid "" -"Add a new :c:type:`PyUnicodeWriter` API to create a Python :class:`str` " -"object:" +"Add :c:func:`PyBytes_Join(sep, iterable) ` function, similar " +"to ``sep.join(iterable)`` in Python. (Contributed by Victor Stinner in :gh:" +"`121645`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2835 -msgid ":c:func:`PyUnicodeWriter_Create`" -msgstr ":c:func:`PyUnicodeWriter_Create`" +#: ../../whatsnew/3.14.rst:2823 +msgid "" +"Add functions to manipulate the configuration of the current runtime Python " +"interpreter (:ref:`PEP 741: Python configuration C API `):" +msgstr "" -#: ../../whatsnew/3.14.rst:2836 -msgid ":c:func:`PyUnicodeWriter_DecodeUTF8Stateful`" -msgstr ":c:func:`PyUnicodeWriter_DecodeUTF8Stateful`" +#: ../../whatsnew/3.14.rst:2827 +msgid ":c:func:`PyConfig_Get`" +msgstr ":c:func:`PyConfig_Get`" + +#: ../../whatsnew/3.14.rst:2828 +msgid ":c:func:`PyConfig_GetInt`" +msgstr ":c:func:`PyConfig_GetInt`" + +#: ../../whatsnew/3.14.rst:2829 +msgid ":c:func:`PyConfig_Set`" +msgstr ":c:func:`PyConfig_Set`" + +#: ../../whatsnew/3.14.rst:2830 +msgid ":c:func:`PyConfig_Names`" +msgstr ":c:func:`PyConfig_Names`" + +#: ../../whatsnew/3.14.rst:2834 +msgid "" +"Add functions to configure Python initialization (:ref:`PEP 741: Python " +"configuration C API `):" +msgstr "" +"新增用於配置 Python 初始化的函式(:ref:`PEP 741:Python 配置 C API `):" #: ../../whatsnew/3.14.rst:2837 -msgid ":c:func:`PyUnicodeWriter_Discard`" -msgstr ":c:func:`PyUnicodeWriter_Discard`" +msgid ":c:func:`Py_InitializeFromInitConfig`" +msgstr ":c:func:`Py_InitializeFromInitConfig`" #: ../../whatsnew/3.14.rst:2838 -msgid ":c:func:`PyUnicodeWriter_Finish`" -msgstr ":c:func:`PyUnicodeWriter_Finish`" +msgid ":c:func:`PyInitConfig_AddModule`" +msgstr ":c:func:`PyInitConfig_AddModule`" #: ../../whatsnew/3.14.rst:2839 -msgid ":c:func:`PyUnicodeWriter_Format`" -msgstr ":c:func:`PyUnicodeWriter_Format`" +msgid ":c:func:`PyInitConfig_Create`" +msgstr ":c:func:`PyInitConfig_Create`" #: ../../whatsnew/3.14.rst:2840 -msgid ":c:func:`PyUnicodeWriter_WriteASCII`" -msgstr ":c:func:`PyUnicodeWriter_WriteASCII`" +msgid ":c:func:`PyInitConfig_Free`" +msgstr ":c:func:`PyInitConfig_Free`" #: ../../whatsnew/3.14.rst:2841 -msgid ":c:func:`PyUnicodeWriter_WriteChar`" -msgstr ":c:func:`PyUnicodeWriter_WriteChar`" +msgid ":c:func:`PyInitConfig_FreeStrList`" +msgstr ":c:func:`PyInitConfig_FreeStrList`" #: ../../whatsnew/3.14.rst:2842 -msgid ":c:func:`PyUnicodeWriter_WriteRepr`" -msgstr ":c:func:`PyUnicodeWriter_WriteRepr`" +msgid ":c:func:`PyInitConfig_GetError`" +msgstr ":c:func:`PyInitConfig_GetError`" #: ../../whatsnew/3.14.rst:2843 -msgid ":c:func:`PyUnicodeWriter_WriteStr`" -msgstr ":c:func:`PyUnicodeWriter_WriteStr`" +msgid ":c:func:`PyInitConfig_GetExitCode`" +msgstr ":c:func:`PyInitConfig_GetExitCode`" #: ../../whatsnew/3.14.rst:2844 -msgid ":c:func:`PyUnicodeWriter_WriteSubstring`" -msgstr ":c:func:`PyUnicodeWriter_WriteSubstring`" +msgid ":c:func:`PyInitConfig_GetInt`" +msgstr ":c:func:`PyInitConfig_GetInt`" #: ../../whatsnew/3.14.rst:2845 -msgid ":c:func:`PyUnicodeWriter_WriteUCS4`" -msgstr ":c:func:`PyUnicodeWriter_WriteUCS4`" +msgid ":c:func:`PyInitConfig_GetStr`" +msgstr ":c:func:`PyInitConfig_GetStr`" #: ../../whatsnew/3.14.rst:2846 -msgid ":c:func:`PyUnicodeWriter_WriteUTF8`" -msgstr ":c:func:`PyUnicodeWriter_WriteUTF8`" +msgid ":c:func:`PyInitConfig_GetStrList`" +msgstr ":c:func:`PyInitConfig_GetStrList`" #: ../../whatsnew/3.14.rst:2847 -msgid ":c:func:`PyUnicodeWriter_WriteWideChar`" -msgstr ":c:func:`PyUnicodeWriter_WriteWideChar`" +msgid ":c:func:`PyInitConfig_HasOption`" +msgstr ":c:func:`PyInitConfig_HasOption`" + +#: ../../whatsnew/3.14.rst:2848 +msgid ":c:func:`PyInitConfig_SetInt`" +msgstr ":c:func:`PyInitConfig_SetInt`" #: ../../whatsnew/3.14.rst:2849 -msgid "(Contributed by Victor Stinner in :gh:`119182`.)" -msgstr "(由 Victor Stinner 於 :gh:`119182` 貢獻。)" +msgid ":c:func:`PyInitConfig_SetStr`" +msgstr ":c:func:`PyInitConfig_SetStr`" -#: ../../whatsnew/3.14.rst:2851 +#: ../../whatsnew/3.14.rst:2850 +msgid ":c:func:`PyInitConfig_SetStrList`" +msgstr ":c:func:`PyInitConfig_SetStrList`" + +#: ../../whatsnew/3.14.rst:2854 +msgid "" +"Add :c:func:`Py_fopen` function to open a file. This works similarly to the " +"standard C :c:func:`!fopen` function, instead accepting a Python object for " +"the *path* parameter and setting an exception on error. The corresponding " +"new :c:func:`Py_fclose` function should be used to close a file. " +"(Contributed by Victor Stinner in :gh:`127350`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:2862 +msgid "" +"Add :c:func:`Py_HashBuffer` to compute and return the hash value of a " +"buffer. (Contributed by Antoine Pitrou and Victor Stinner in :gh:`122854`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:2865 +msgid "" +"Add :c:func:`PyImport_ImportModuleAttr` and :c:func:" +"`PyImport_ImportModuleAttrString` helper functions to import a module and " +"get an attribute of the module. (Contributed by Victor Stinner in :gh:" +"`128911`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:2870 msgid "" "Add :c:func:`PyIter_NextItem` to replace :c:func:`PyIter_Next`, which has an " -"ambiguous return value. (Contributed by Irit Katriel and Erlend Aasland " -"in :gh:`105201`.)" +"ambiguous return value. (Contributed by Irit Katriel and Erlend Aasland in :" +"gh:`105201`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2855 +#: ../../whatsnew/3.14.rst:2874 +msgid "" +"Add :c:func:`PyLong_GetSign` function to get the sign of :class:`int` " +"objects. (Contributed by Sergey B Kirpichev in :gh:`116560`.)" +msgstr "" + +#: ../../whatsnew/3.14.rst:2877 msgid "" -"Add :c:func:`PyLong_IsPositive`, :c:func:`PyLong_IsNegative` " -"and :c:func:`PyLong_IsZero` for checking if :c:type:`PyLongObject` is " -"positive, negative, or zero, respectively. (Contributed by James Roy and " -"Sergey B Kirpichev in :gh:`126061`.)" +"Add :c:func:`PyLong_IsPositive`, :c:func:`PyLong_IsNegative` and :c:func:" +"`PyLong_IsZero` for checking if :c:type:`PyLongObject` is positive, " +"negative, or zero, respectively. (Contributed by James Roy and Sergey B " +"Kirpichev in :gh:`126061`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2860 +#: ../../whatsnew/3.14.rst:2882 msgid "" -"Add new functions to convert C ```` numbers from/to " -"Python :class:`int`:" +"Add new functions to convert C ```` numbers to/from Python :class:" +"`int` objects:" msgstr "" -#: ../../whatsnew/3.14.rst:2863 +#: ../../whatsnew/3.14.rst:2885 msgid ":c:func:`PyLong_AsInt32`" msgstr ":c:func:`PyLong_AsInt32`" -#: ../../whatsnew/3.14.rst:2864 +#: ../../whatsnew/3.14.rst:2886 msgid ":c:func:`PyLong_AsInt64`" msgstr ":c:func:`PyLong_AsInt64`" -#: ../../whatsnew/3.14.rst:2865 +#: ../../whatsnew/3.14.rst:2887 msgid ":c:func:`PyLong_AsUInt32`" msgstr ":c:func:`PyLong_AsUInt32`" -#: ../../whatsnew/3.14.rst:2866 +#: ../../whatsnew/3.14.rst:2888 msgid ":c:func:`PyLong_AsUInt64`" msgstr ":c:func:`PyLong_AsUInt64`" -#: ../../whatsnew/3.14.rst:2867 +#: ../../whatsnew/3.14.rst:2889 msgid ":c:func:`PyLong_FromInt32`" msgstr ":c:func:`PyLong_FromInt32`" -#: ../../whatsnew/3.14.rst:2868 +#: ../../whatsnew/3.14.rst:2890 msgid ":c:func:`PyLong_FromInt64`" msgstr ":c:func:`PyLong_FromInt64`" -#: ../../whatsnew/3.14.rst:2869 +#: ../../whatsnew/3.14.rst:2891 msgid ":c:func:`PyLong_FromUInt32`" msgstr ":c:func:`PyLong_FromUInt32`" -#: ../../whatsnew/3.14.rst:2870 +#: ../../whatsnew/3.14.rst:2892 msgid ":c:func:`PyLong_FromUInt64`" msgstr ":c:func:`PyLong_FromUInt64`" -#: ../../whatsnew/3.14.rst:2872 +#: ../../whatsnew/3.14.rst:2894 msgid "(Contributed by Victor Stinner in :gh:`120389`.)" msgstr "(由 Victor Stinner 於 :gh:`120389` 貢獻。)" -#: ../../whatsnew/3.14.rst:2874 -msgid "" -"Add :c:func:`PyBytes_Join(sep, iterable) ` function, similar " -"to ``sep.join(iterable)`` in Python. (Contributed by Victor Stinner " -"in :gh:`121645`.)" -msgstr "" - -#: ../../whatsnew/3.14.rst:2878 -msgid "" -"Add :c:func:`Py_HashBuffer` to compute and return the hash value of a " -"buffer. (Contributed by Antoine Pitrou and Victor Stinner in :gh:`122854`.)" -msgstr "" - -#: ../../whatsnew/3.14.rst:2881 -msgid "" -"Add functions to get and set the current runtime Python configuration " -"(:pep:`741`):" -msgstr "" - -#: ../../whatsnew/3.14.rst:2884 -msgid ":c:func:`PyConfig_Get`" -msgstr ":c:func:`PyConfig_Get`" - -#: ../../whatsnew/3.14.rst:2885 -msgid ":c:func:`PyConfig_GetInt`" -msgstr ":c:func:`PyConfig_GetInt`" - -#: ../../whatsnew/3.14.rst:2886 -msgid ":c:func:`PyConfig_Set`" -msgstr ":c:func:`PyConfig_Set`" - -#: ../../whatsnew/3.14.rst:2887 -msgid ":c:func:`PyConfig_Names`" -msgstr ":c:func:`PyConfig_Names`" - -#: ../../whatsnew/3.14.rst:2891 -msgid "Add functions to configure the Python initialization (:pep:`741`):" -msgstr "" - -#: ../../whatsnew/3.14.rst:2893 -msgid ":c:func:`Py_InitializeFromInitConfig`" -msgstr ":c:func:`Py_InitializeFromInitConfig`" - -#: ../../whatsnew/3.14.rst:2894 -msgid ":c:func:`PyInitConfig_AddModule`" -msgstr ":c:func:`PyInitConfig_AddModule`" - -#: ../../whatsnew/3.14.rst:2895 -msgid ":c:func:`PyInitConfig_Create`" -msgstr ":c:func:`PyInitConfig_Create`" - #: ../../whatsnew/3.14.rst:2896 -msgid ":c:func:`PyInitConfig_Free`" -msgstr ":c:func:`PyInitConfig_Free`" - -#: ../../whatsnew/3.14.rst:2897 -msgid ":c:func:`PyInitConfig_FreeStrList`" -msgstr ":c:func:`PyInitConfig_FreeStrList`" - -#: ../../whatsnew/3.14.rst:2898 -msgid ":c:func:`PyInitConfig_GetError`" -msgstr ":c:func:`PyInitConfig_GetError`" - -#: ../../whatsnew/3.14.rst:2899 -msgid ":c:func:`PyInitConfig_GetExitCode`" -msgstr ":c:func:`PyInitConfig_GetExitCode`" - -#: ../../whatsnew/3.14.rst:2900 -msgid ":c:func:`PyInitConfig_GetInt`" -msgstr ":c:func:`PyInitConfig_GetInt`" - -#: ../../whatsnew/3.14.rst:2901 -msgid ":c:func:`PyInitConfig_GetStr`" -msgstr ":c:func:`PyInitConfig_GetStr`" - -#: ../../whatsnew/3.14.rst:2902 -msgid ":c:func:`PyInitConfig_GetStrList`" -msgstr ":c:func:`PyInitConfig_GetStrList`" - -#: ../../whatsnew/3.14.rst:2903 -msgid ":c:func:`PyInitConfig_HasOption`" -msgstr ":c:func:`PyInitConfig_HasOption`" - -#: ../../whatsnew/3.14.rst:2904 -msgid ":c:func:`PyInitConfig_SetInt`" -msgstr ":c:func:`PyInitConfig_SetInt`" - -#: ../../whatsnew/3.14.rst:2905 -msgid ":c:func:`PyInitConfig_SetStr`" -msgstr ":c:func:`PyInitConfig_SetStr`" - -#: ../../whatsnew/3.14.rst:2906 -msgid ":c:func:`PyInitConfig_SetStrList`" -msgstr ":c:func:`PyInitConfig_SetStrList`" - -#: ../../whatsnew/3.14.rst:2910 msgid "" "Add a new import and export API for Python :class:`int` objects (:pep:`757`):" msgstr "" -#: ../../whatsnew/3.14.rst:2912 +#: ../../whatsnew/3.14.rst:2899 msgid ":c:func:`PyLong_GetNativeLayout`" msgstr ":c:func:`PyLong_GetNativeLayout`" -#: ../../whatsnew/3.14.rst:2913 +#: ../../whatsnew/3.14.rst:2900 msgid ":c:func:`PyLong_Export`" msgstr ":c:func:`PyLong_Export`" -#: ../../whatsnew/3.14.rst:2914 +#: ../../whatsnew/3.14.rst:2901 msgid ":c:func:`PyLong_FreeExport`" msgstr ":c:func:`PyLong_FreeExport`" -#: ../../whatsnew/3.14.rst:2915 +#: ../../whatsnew/3.14.rst:2902 msgid ":c:func:`PyLongWriter_Create`" msgstr ":c:func:`PyLongWriter_Create`" -#: ../../whatsnew/3.14.rst:2916 +#: ../../whatsnew/3.14.rst:2903 msgid ":c:func:`PyLongWriter_Finish`" msgstr ":c:func:`PyLongWriter_Finish`" -#: ../../whatsnew/3.14.rst:2917 +#: ../../whatsnew/3.14.rst:2904 msgid ":c:func:`PyLongWriter_Discard`" msgstr ":c:func:`PyLongWriter_Discard`" -#: ../../whatsnew/3.14.rst:2919 +#: ../../whatsnew/3.14.rst:2906 msgid "(Contributed by Sergey B Kirpichev and Victor Stinner in :gh:`102471`.)" msgstr "(由 Sergey B Kirpichev 和 Victor Stinner 於 :gh:`102471` 貢獻。)" -#: ../../whatsnew/3.14.rst:2921 -msgid "" -"Add :c:func:`PyType_GetBaseByToken` and :c:data:`Py_tp_token` slot for " -"easier superclass identification, which attempts to resolve the `type " -"checking issue `__ " -"mentioned in :pep:`630`. (Contributed in :gh:`124153`.)" -msgstr "" - -#: ../../whatsnew/3.14.rst:2926 +#: ../../whatsnew/3.14.rst:2908 msgid "" -"Add :c:func:`PyUnicode_Equal` function to the limited C API: test if two " -"strings are equal. (Contributed by Victor Stinner in :gh:`124502`.)" +"Add :c:func:`PyMonitoring_FireBranchLeftEvent` and :c:func:" +"`PyMonitoring_FireBranchRightEvent` for generating :monitoring-event:" +"`BRANCH_LEFT` and :monitoring-event:`BRANCH_RIGHT` events, respectively. " +"(Contributed by Mark Shannon in :gh:`122548`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2930 +#: ../../whatsnew/3.14.rst:2914 msgid "" "Add :c:func:`PyType_Freeze` function to make a type immutable. (Contributed " "by Victor Stinner in :gh:`121654`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2933 +#: ../../whatsnew/3.14.rst:2917 msgid "" -"Add :c:func:`PyUnstable_Object_EnableDeferredRefcount` for enabling deferred " -"reference counting, as outlined in :pep:`703`." +"Add :c:func:`PyType_GetBaseByToken` and :c:data:`Py_tp_token` slot for " +"easier superclass identification, which attempts to resolve the type " +"checking issue mentioned in :pep:`PEP 630 <630#type-checking>`. (Contributed " +"in :gh:`124153`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2936 +#: ../../whatsnew/3.14.rst:2922 msgid "" -"Add :c:func:`PyMonitoring_FireBranchLeftEvent` " -"and :c:func:`PyMonitoring_FireBranchRightEvent` for generating :monitoring-" -"event:`BRANCH_LEFT` and :monitoring-event:`BRANCH_RIGHT` events, " -"respectively." +"Add a new :c:func:`PyUnicode_Equal` function to test if two strings are " +"equal. The function is also added to the Limited C API. (Contributed by " +"Victor Stinner in :gh:`124502`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2941 +#: ../../whatsnew/3.14.rst:2927 msgid "" -"Add :c:func:`Py_fopen` function to open a file. Similar to the :c:func:`!" -"fopen` function, but the *path* parameter is a Python object and an " -"exception is set on error. Add also :c:func:`Py_fclose` function to close a " -"file. (Contributed by Victor Stinner in :gh:`127350`.)" +"Add a new :c:type:`PyUnicodeWriter` API to create a Python :class:`str` " +"object, with the following functions:" msgstr "" -#: ../../whatsnew/3.14.rst:2947 -msgid "" -"The ``k`` and ``K`` formats in :c:func:`PyArg_ParseTuple` and similar " -"functions now use :meth:`~object.__index__` if available, like all other " -"integer formats. (Contributed by Serhiy Storchaka in :gh:`112068`.)" -msgstr "" +#: ../../whatsnew/3.14.rst:2930 +msgid ":c:func:`PyUnicodeWriter_Create`" +msgstr ":c:func:`PyUnicodeWriter_Create`" -#: ../../whatsnew/3.14.rst:2952 -msgid "" -"Add macros :c:func:`Py_PACK_VERSION` and :c:func:`Py_PACK_FULL_VERSION` for " -"bit-packing Python version numbers. (Contributed by Petr Viktorin " -"in :gh:`128629`.)" -msgstr "" +#: ../../whatsnew/3.14.rst:2931 +msgid ":c:func:`PyUnicodeWriter_DecodeUTF8Stateful`" +msgstr ":c:func:`PyUnicodeWriter_DecodeUTF8Stateful`" -#: ../../whatsnew/3.14.rst:2956 -msgid "" -"Add :c:func:`PyUnstable_IsImmortal` for determining whether an object " -"is :term:`immortal`, for debugging purposes." -msgstr "" +#: ../../whatsnew/3.14.rst:2932 +msgid ":c:func:`PyUnicodeWriter_Discard`" +msgstr ":c:func:`PyUnicodeWriter_Discard`" -#: ../../whatsnew/3.14.rst:2959 -msgid "" -"Add :c:func:`PyImport_ImportModuleAttr` " -"and :c:func:`PyImport_ImportModuleAttrString` helper functions to import a " -"module and get an attribute of the module. (Contributed by Victor Stinner " -"in :gh:`128911`.)" -msgstr "" +#: ../../whatsnew/3.14.rst:2933 +msgid ":c:func:`PyUnicodeWriter_Finish`" +msgstr ":c:func:`PyUnicodeWriter_Finish`" -#: ../../whatsnew/3.14.rst:2964 -msgid "" -"Add support for a new ``p`` format unit in :c:func:`Py_BuildValue` that " -"allows taking a C integer and produces a Python :class:`bool` object. " -"(Contributed by Pablo Galindo in :issue:`45325`.)" -msgstr "" +#: ../../whatsnew/3.14.rst:2934 +msgid ":c:func:`PyUnicodeWriter_Format`" +msgstr ":c:func:`PyUnicodeWriter_Format`" -#: ../../whatsnew/3.14.rst:2968 -msgid "" -"Add :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary` to determine if " -"an object is a unique temporary object on the interpreter's operand stack. " -"This can be used in some cases as a replacement for checking " -"if :c:func:`Py_REFCNT` is ``1`` for Python objects passed as arguments to C " -"API functions." -msgstr "" +#: ../../whatsnew/3.14.rst:2935 +msgid ":c:func:`PyUnicodeWriter_WriteASCII`" +msgstr ":c:func:`PyUnicodeWriter_WriteASCII`" -#: ../../whatsnew/3.14.rst:2973 -msgid "" -"Add :c:func:`PyUnstable_Object_IsUniquelyReferenced` as a replacement for " -"``Py_REFCNT(op) == 1`` on :term:`free threaded ` builds. " -"(Contributed by Peter Bierma in :gh:`133140`.)" -msgstr "" +#: ../../whatsnew/3.14.rst:2936 +msgid ":c:func:`PyUnicodeWriter_WriteChar`" +msgstr ":c:func:`PyUnicodeWriter_WriteChar`" -#: ../../whatsnew/3.14.rst:2979 -msgid "Limited C API changes" -msgstr "" +#: ../../whatsnew/3.14.rst:2937 +msgid ":c:func:`PyUnicodeWriter_WriteRepr`" +msgstr ":c:func:`PyUnicodeWriter_WriteRepr`" -#: ../../whatsnew/3.14.rst:2981 -msgid "" -"In the limited C API 3.14 and newer, :c:func:`Py_TYPE` " -"and :c:func:`Py_REFCNT` are now implemented as an opaque function call to " -"hide implementation details. (Contributed by Victor Stinner in :gh:`120600` " -"and :gh:`124127`.)" -msgstr "" +#: ../../whatsnew/3.14.rst:2938 +msgid ":c:func:`PyUnicodeWriter_WriteStr`" +msgstr ":c:func:`PyUnicodeWriter_WriteStr`" -#: ../../whatsnew/3.14.rst:2986 -msgid "" -"Remove " -"the :c:macro:`PySequence_Fast_GET_SIZE`, :c:macro:`PySequence_Fast_GET_ITEM` " -"and :c:macro:`PySequence_Fast_ITEMS` macros from the limited C API, since " -"these macros never worked in the limited C API. " -"Keep :c:func:`PySequence_Fast` in the limited C API. (Contributed by Victor " -"Stinner in :gh:`91417`.)" -msgstr "" +#: ../../whatsnew/3.14.rst:2939 +msgid ":c:func:`PyUnicodeWriter_WriteSubstring`" +msgstr ":c:func:`PyUnicodeWriter_WriteSubstring`" -#: ../../whatsnew/3.14.rst:2998 -msgid "" -"The :c:macro:`!Py_HUGE_VAL` macro is :term:`soft deprecated`, use :c:macro:`!" -"Py_INFINITY` instead. (Contributed by Sergey B Kirpichev in :gh:`120026`.)" -msgstr "" +#: ../../whatsnew/3.14.rst:2940 +msgid ":c:func:`PyUnicodeWriter_WriteUCS4`" +msgstr ":c:func:`PyUnicodeWriter_WriteUCS4`" -#: ../../whatsnew/3.14.rst:3002 +#: ../../whatsnew/3.14.rst:2941 +msgid ":c:func:`PyUnicodeWriter_WriteUTF8`" +msgstr ":c:func:`PyUnicodeWriter_WriteUTF8`" + +#: ../../whatsnew/3.14.rst:2942 +msgid ":c:func:`PyUnicodeWriter_WriteWideChar`" +msgstr ":c:func:`PyUnicodeWriter_WriteWideChar`" + +#: ../../whatsnew/3.14.rst:2944 +msgid "(Contributed by Victor Stinner in :gh:`119182`.)" +msgstr "(由 Victor Stinner 於 :gh:`119182` 貢獻。)" + +#: ../../whatsnew/3.14.rst:2946 msgid "" -"Macros :c:macro:`!Py_IS_NAN`, :c:macro:`!Py_IS_INFINITY` and :c:macro:`!" -"Py_IS_FINITE` are :term:`soft deprecated`, use instead :c:macro:`!" -"isnan`, :c:macro:`!isinf` and :c:macro:`!isfinite` available " -"from :file:`math.h` since C99. (Contributed by Sergey B Kirpichev " -"in :gh:`119613`.)" +"The ``k`` and ``K`` formats in :c:func:`PyArg_ParseTuple` and similar " +"functions now use :meth:`~object.__index__` if available, like all other " +"integer formats. (Contributed by Serhiy Storchaka in :gh:`112068`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3008 +#: ../../whatsnew/3.14.rst:2951 msgid "" -"Non-tuple sequences are deprecated as argument for the ``(items)`` format " -"unit in :c:func:`PyArg_ParseTuple` and other :ref:`argument parsing ` functions if *items* contains format units which store " -"a :ref:`borrowed buffer ` or a :term:`borrowed " -"reference`. (Contributed by Serhiy Storchaka in :gh:`50333`.)" +"Add support for a new ``p`` format unit in :c:func:`Py_BuildValue` that " +"produces a Python :class:`bool` object from a C integer. (Contributed by " +"Pablo Galindo in :issue:`45325`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3015 +#: ../../whatsnew/3.14.rst:2955 msgid "" -"The previously undocumented function :c:func:`PySequence_In` is :term:`soft " -"deprecated`. Use :c:func:`PySequence_Contains` instead. (Contributed by Yuki " -"Kobayashi in :gh:`127896`.)" +"Add :c:func:`PyUnstable_IsImmortal` for determining if an object is :term:" +"`immortal`, for debugging purposes. (Contributed by Peter Bierma in :gh:" +"`128509`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3021 +#: ../../whatsnew/3.14.rst:2959 msgid "" -"The ``PyMonitoring_FireBranchEvent`` function is deprecated and should be " -"replaced with calls to :c:func:`PyMonitoring_FireBranchLeftEvent` " -"and :c:func:`PyMonitoring_FireBranchRightEvent`." +"Add :c:func:`PyUnstable_Object_EnableDeferredRefcount` for enabling deferred " +"reference counting, as outlined in :pep:`703`." msgstr "" -#: ../../whatsnew/3.14.rst:3025 +#: ../../whatsnew/3.14.rst:2962 msgid "" -"The following private functions are deprecated and planned for removal in " -"Python 3.18:" +"Add :c:func:`PyUnstable_Object_IsUniquelyReferenced` as a replacement for " +"``Py_REFCNT(op) == 1`` on :term:`free threaded ` builds. " +"(Contributed by Peter Bierma in :gh:`133140`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3028 -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:6 -msgid ":c:func:`!_PyBytes_Join`: use :c:func:`PyBytes_Join`." -msgstr ":c:func:`!_PyBytes_Join`:請改用 :c:func:`PyBytes_Join`。" - -#: ../../whatsnew/3.14.rst:3029 -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:7 +#: ../../whatsnew/3.14.rst:2967 msgid "" -":c:func:`!_PyDict_GetItemStringWithError`: " -"use :c:func:`PyDict_GetItemStringRef`." +"Add :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary` to determine if " +"an object is a unique temporary object on the interpreter's operand stack. " +"This can be used in some cases as a replacement for checking if :c:func:" +"`Py_REFCNT` is ``1`` for Python objects passed as arguments to C API " +"functions. (Contributed by Sam Gross in :gh:`133164`.)" msgstr "" -":c:func:`!_PyDict_GetItemStringWithError`:請改" -"用 :c:func:`PyDict_GetItemStringRef`。" -#: ../../whatsnew/3.14.rst:3030 -msgid ":c:func:`!_PyDict_Pop()`: use :c:func:`PyDict_Pop`." +#: ../../whatsnew/3.14.rst:2977 +msgid "Limited C API changes" msgstr "" -#: ../../whatsnew/3.14.rst:3031 -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:9 -msgid ":c:func:`!_PyLong_Sign()`: use :c:func:`PyLong_GetSign`." -msgstr ":c:func:`!_PyLong_Sign()`:請改用 :c:func:`PyLong_GetSign`。" - -#: ../../whatsnew/3.14.rst:3032 -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:10 +#: ../../whatsnew/3.14.rst:2979 msgid "" -":c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`: " -"use :c:func:`PyLongWriter_Create`." +"In the limited C API version 3.14 and newer, :c:func:`Py_TYPE` and :c:func:" +"`Py_REFCNT` are now implemented as an opaque function call to hide " +"implementation details. (Contributed by Victor Stinner in :gh:`120600` and :" +"gh:`124127`.)" msgstr "" -":c:func:`!_PyLong_FromDigits` 和 :c:func:`!_PyLong_New`:請改" -"用 :c:func:`PyLongWriter_Create`。" -#: ../../whatsnew/3.14.rst:3034 -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:12 +#: ../../whatsnew/3.14.rst:2984 msgid "" -":c:func:`!_PyThreadState_UncheckedGet`: " -"use :c:func:`PyThreadState_GetUnchecked`." +"Remove the :c:macro:`PySequence_Fast_GET_SIZE`, :c:macro:" +"`PySequence_Fast_GET_ITEM`, and :c:macro:`PySequence_Fast_ITEMS` macros from " +"the limited C API, since they have always been broken in the limited C API. " +"(Contributed by Victor Stinner in :gh:`91417`.)" msgstr "" -":c:func:`!_PyThreadState_UncheckedGet`:請改" -"用 :c:func:`PyThreadState_GetUnchecked`。" -#: ../../whatsnew/3.14.rst:3035 -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:13 -msgid ":c:func:`!_PyUnicode_AsString`: use :c:func:`PyUnicode_AsUTF8`." -msgstr ":c:func:`!_PyUnicode_AsString`:請改用 :c:func:`PyUnicode_AsUTF8`。" +#: ../../whatsnew/3.14.rst:2995 +msgid "Removed C APIs" +msgstr "被移除的 C API" -#: ../../whatsnew/3.14.rst:3036 -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:14 +#: ../../whatsnew/3.14.rst:2997 msgid "" -":c:func:`!_PyUnicodeWriter_Init`: replace ``_PyUnicodeWriter_Init(&writer)`` " -"with :c:func:`writer = PyUnicodeWriter_Create(0) `." +"Creating :c:data:`immutable types ` with mutable " +"bases was deprecated in Python 3.12, and now raises a :exc:`TypeError`. " +"(Contributed by Nikita Sobolev in :gh:`119775`.)" msgstr "" -":c:func:`!_PyUnicodeWriter_Init`:將 ``_PyUnicodeWriter_Init(&writer)`` 替換" -"為 :c:func:`writer = PyUnicodeWriter_Create(0) `。" -#: ../../whatsnew/3.14.rst:3039 -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:17 +#: ../../whatsnew/3.14.rst:3002 msgid "" -":c:func:`!_PyUnicodeWriter_Finish`: replace " -"``_PyUnicodeWriter_Finish(&writer)`` " -"with :c:func:`PyUnicodeWriter_Finish(writer) `." +"Remove ``PyDictObject.ma_version_tag`` member, which was deprecated in " +"Python 3.12. Use the :c:func:`PyDict_AddWatcher` API instead. (Contributed " +"by Sam Gross in :gh:`124296`.)" msgstr "" -":c:func:`!_PyUnicodeWriter_Finish`:將 ``_PyUnicodeWriter_Finish(&writer)`` " -"替換為 :c:func:`PyUnicodeWriter_Finish(writer) `。" -#: ../../whatsnew/3.14.rst:3042 -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:20 +#: ../../whatsnew/3.14.rst:3007 msgid "" -":c:func:`!_PyUnicodeWriter_Dealloc`: replace " -"``_PyUnicodeWriter_Dealloc(&writer)`` " -"with :c:func:`PyUnicodeWriter_Discard(writer) `." +"Remove the private ``_Py_InitializeMain()`` function. It was a :term:" +"`provisional API` added to Python 3.8 by :pep:`587`. (Contributed by Victor " +"Stinner in :gh:`129033`.)" msgstr "" -":c:func:`!_PyUnicodeWriter_Dealloc`:將 " -"``_PyUnicodeWriter_Dealloc(&writer)`` 替換" -"為 :c:func:`PyUnicodeWriter_Discard(writer) `。" -#: ../../whatsnew/3.14.rst:3045 -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:23 +#: ../../whatsnew/3.14.rst:3011 msgid "" -":c:func:`!_PyUnicodeWriter_WriteChar`: replace " -"``_PyUnicodeWriter_WriteChar(&writer, ch)`` " -"with :c:func:`PyUnicodeWriter_WriteChar(writer, ch) " -"`." +"Remove the undocumented APIs :c:macro:`!Py_C_RECURSION_LIMIT` and :c:member:" +"`!PyThreadState.c_recursion_remaining`. These were added in 3.13 and have " +"been removed without deprecation. Use :c:func:`Py_EnterRecursiveCall` to " +"guard against runaway recursion in C code. (Removed by Petr Viktorin in :gh:" +"`133079`, see also :gh:`130396`.)" msgstr "" -":c:func:`!_PyUnicodeWriter_WriteChar`:將 " -"``_PyUnicodeWriter_WriteChar(&writer, ch)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteChar(writer, ch) " -"`。" -#: ../../whatsnew/3.14.rst:3048 -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:26 +#: ../../whatsnew/3.14.rst:3022 +msgid "Deprecated C APIs" +msgstr "已棄用的 C API" + +#: ../../whatsnew/3.14.rst:3024 msgid "" -":c:func:`!_PyUnicodeWriter_WriteStr`: replace " -"``_PyUnicodeWriter_WriteStr(&writer, str)`` " -"with :c:func:`PyUnicodeWriter_WriteStr(writer, str) " -"`." +"The :c:macro:`!Py_HUGE_VAL` macro is now :term:`soft deprecated`. Use :c:" +"macro:`!Py_INFINITY` instead. (Contributed by Sergey B Kirpichev in :gh:" +"`120026`.)" msgstr "" -":c:func:`!_PyUnicodeWriter_WriteStr`:將 " -"``_PyUnicodeWriter_WriteStr(&writer, str)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteStr(writer, str) " -"`。" -#: ../../whatsnew/3.14.rst:3051 -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:29 +#: ../../whatsnew/3.14.rst:3028 msgid "" -":c:func:`!_PyUnicodeWriter_WriteSubstring`: replace " -"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` " -"with :c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " -"`." +"The :c:macro:`!Py_IS_NAN`, :c:macro:`!Py_IS_INFINITY`, and :c:macro:`!" +"Py_IS_FINITE` macros are now :term:`soft deprecated`. Use :c:macro:`!" +"isnan`, :c:macro:`!isinf` and :c:macro:`!isfinite` instead, available from :" +"file:`math.h` since C99. (Contributed by Sergey B Kirpichev in :gh:`119613`.)" msgstr "" -":c:func:`!_PyUnicodeWriter_WriteSubstring`:將 " -"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " -"`。" -#: ../../whatsnew/3.14.rst:3054 +#: ../../whatsnew/3.14.rst:3034 msgid "" -":c:func:`!_PyUnicodeWriter_WriteASCIIString`: replace " -"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` " -"with :c:func:`PyUnicodeWriter_WriteASCII(writer, str) " -"`." +"Non-tuple sequences are now deprecated as argument for the ``(items)`` " +"format unit in :c:func:`PyArg_ParseTuple` and other :ref:`argument parsing " +"` functions if *items* contains format units which store a :ref:" +"`borrowed buffer ` or a :term:`borrowed reference`. " +"(Contributed by Serhiy Storchaka in :gh:`50333`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3057 -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:35 +#: ../../whatsnew/3.14.rst:3041 msgid "" -":c:func:`!_PyUnicodeWriter_WriteLatin1String`: replace " -"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` " -"with :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " -"`." +"The ``_PyMonitoring_FireBranchEvent`` function is now deprecated and should " +"be replaced with calls to :c:func:`PyMonitoring_FireBranchLeftEvent` and :c:" +"func:`PyMonitoring_FireBranchRightEvent`." msgstr "" -":c:func:`!_PyUnicodeWriter_WriteLatin1String`:將 " -"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " -"`。" -#: ../../whatsnew/3.14.rst:3060 -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:40 -msgid ":c:func:`!_Py_HashPointer`: use :c:func:`Py_HashPointer`." -msgstr ":c:func:`!_Py_HashPointer`:請改用 :c:func:`Py_HashPointer`。" - -#: ../../whatsnew/3.14.rst:3061 -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:41 -msgid ":c:func:`!_Py_fopen_obj`: use :c:func:`Py_fopen`." -msgstr ":c:func:`!_Py_fopen_obj`:請改用 :c:func:`Py_fopen`。" - -#: ../../whatsnew/3.14.rst:3063 +#: ../../whatsnew/3.14.rst:3046 msgid "" -"The `pythoncapi-compat project`_ can be used to get these new public " -"functions on Python 3.13 and older. (Contributed by Victor Stinner " -"in :gh:`128863`.)" +"The previously undocumented function :c:func:`PySequence_In` is now :term:" +"`soft deprecated`. Use :c:func:`PySequence_Contains` instead. (Contributed " +"by Yuki Kobayashi in :gh:`127896`.)" msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:4 msgid "" -"The :c:func:`PyImport_ImportModuleNoBlock`: " -"Use :c:func:`PyImport_ImportModule` instead." +"The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:" +"`PyImport_ImportModule` instead." msgstr "" -":c:func:`PyImport_ImportModuleNoBlock`:請改" -"用 :c:func:`PyImport_ImportModule`。" +":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:" +"`PyImport_ImportModule`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:6 msgid "" -":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: " -"Use :c:func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project " -"`__ can be used to " -"get :c:func:`PyWeakref_GetRef` on Python 3.12 and older." +":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" +"func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project `__ can be used to get :c:func:" +"`PyWeakref_GetRef` on Python 3.12 and older." msgstr "" -":c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT`:請改" -"用 :c:func:`PyWeakref_GetRef`。可以使用 `pythoncapi-compat 專案 `__\\ 來為 Python 3.12 和更早版本取" -"得 :c:func:`PyWeakref_GetRef`。" +":c:func:`PyWeakref_GetObject` 和 :c:func:`PyWeakref_GET_OBJECT`:請改用 :c:" +"func:`PyWeakref_GetRef`。可以使用 `pythoncapi-compat 專案 `__\\ 來為 Python 3.12 和更早版本取得 :c:func:" +"`PyWeakref_GetRef`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:10 msgid "" -":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: " -"Use :c:type:`wchar_t` instead." +":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:" +"type:`wchar_t` instead." msgstr "" -":c:type:`Py_UNICODE` 型別與 :c:macro:`!Py_UNICODE_WIDE` 巨集:請改" -"用 :c:type:`wchar_t`。" +":c:type:`Py_UNICODE` 型別與 :c:macro:`!Py_UNICODE_WIDE` 巨集:請改用 :c:type:" +"`wchar_t`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:12 msgid "" @@ -5649,8 +5534,8 @@ msgid "" "than :class:`str`, such as :class:`bytes`." msgstr "" ":c:func:`!PyUnicode_AsDecodedUnicode`:請改用 :c:func:`PyCodec_Decode`;請注" -"意某些編解碼器(例如 \"base64\")可能會回傳非 :class:`str` 的型別,例" -"如 :class:`bytes`。" +"意某些編解碼器(例如 \"base64\")可能會回傳非 :class:`str` 的型別,例如 :" +"class:`bytes`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 msgid "" @@ -5665,8 +5550,8 @@ msgid "" "than :class:`bytes`, such as :class:`str`." msgstr "" ":c:func:`!PyUnicode_AsEncodedUnicode`:請改用 :c:func:`PyCodec_Encode`;請注" -"意某些編解碼器(例如 \"base64\")可能會回傳非 :class:`bytes` 的型別,例" -"如 :class:`str`。" +"意某些編解碼器(例如 \"base64\")可能會回傳非 :class:`bytes` 的型別,例如 :" +"class:`str`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:22 msgid "Python initialization functions, deprecated in Python 3.13:" @@ -5683,37 +5568,35 @@ msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:27 msgid "" ":c:func:`Py_GetPrefix`: Use :c:func:`PyConfig_Get(\"base_prefix\") " -"` (:data:`sys.base_prefix`) instead. " -"Use :c:func:`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) " -"if :ref:`virtual environments ` need to be handled." +"` (:data:`sys.base_prefix`) instead. Use :c:func:" +"`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) if :ref:" +"`virtual environments ` need to be handled." msgstr "" ":c:func:`Py_GetPrefix`:請改用 :c:func:`PyConfig_Get(\"base_prefix\") " "` (:data:`sys.base_prefix`)。如果需要處理\\ :ref:`虛擬環境 " -"`,請改用 :c:func:`PyConfig_Get(\"prefix\") ` " -"(:data:`sys.prefix`)。" +"`,請改用 :c:func:`PyConfig_Get(\"prefix\") ` (:data:" +"`sys.prefix`)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:32 msgid "" ":c:func:`Py_GetExecPrefix`: Use :c:func:`PyConfig_Get(\"base_exec_prefix\") " -"` (:data:`sys.base_exec_prefix`) instead. " -"Use :c:func:`PyConfig_Get(\"exec_prefix\") ` " -"(:data:`sys.exec_prefix`) if :ref:`virtual environments ` need to " -"be handled." +"` (:data:`sys.base_exec_prefix`) instead. Use :c:func:" +"`PyConfig_Get(\"exec_prefix\") ` (:data:`sys.exec_prefix`) if :" +"ref:`virtual environments ` need to be handled." msgstr "" -":c:func:`Py_GetExecPrefix`:請改" -"用 :c:func:`PyConfig_Get(\"base_exec_prefix\") ` " -"(:data:`sys.base_exec_prefix`)。如果需要處理\\ :ref:`虛擬環境 `,請" -"改用 :c:func:`PyConfig_Get(\"exec_prefix\") ` " -"(:data:`sys.exec_prefix`)。" +":c:func:`Py_GetExecPrefix`:請改用 :c:func:" +"`PyConfig_Get(\"base_exec_prefix\") ` (:data:`sys." +"base_exec_prefix`)。如果需要處理\\ :ref:`虛擬環境 `,請改用 :c:" +"func:`PyConfig_Get(\"exec_prefix\") ` (:data:`sys." +"exec_prefix`)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:38 msgid "" ":c:func:`Py_GetProgramFullPath`: Use :c:func:`PyConfig_Get(\"executable\") " "` (:data:`sys.executable`) instead." msgstr "" -":c:func:`Py_GetProgramFullPath`:請改" -"用 :c:func:`PyConfig_Get(\"executable\") ` " -"(:data:`sys.executable`)。" +":c:func:`Py_GetProgramFullPath`:請改用 :c:func:" +"`PyConfig_Get(\"executable\") ` (:data:`sys.executable`)。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:41 msgid "" @@ -5768,13 +5651,13 @@ msgid "" ":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" "warnings.filters` instead." msgstr "" -":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` " -"和 :data:`!warnings.filters`。" +":c:func:`PySys_ResetWarnOptions`:請改為清除 :data:`sys.warnoptions` 和 :" +"data:`!warnings.filters`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:65 msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used " -"with :c:type:`PyConfig` instead." +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` instead." msgstr "" "應改用帶有 :c:type:`PyConfig` 的 :c:func:`Py_InitializeFromConfig` API。" @@ -5784,108 +5667,108 @@ msgstr "全域配置變數:" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:70 msgid "" -":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` " -"or :c:func:`PyConfig_Get(\"parser_debug\") ` instead." +":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` or :c:func:" +"`PyConfig_Get(\"parser_debug\") ` instead." msgstr "" -":c:var:`Py_DebugFlag`:請改用 :c:member:`PyConfig.parser_debug` " -"或 :c:func:`PyConfig_Get(\"parser_debug\") `。" +":c:var:`Py_DebugFlag`:請改用 :c:member:`PyConfig.parser_debug` 或 :c:func:" +"`PyConfig_Get(\"parser_debug\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:73 msgid "" -":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` " -"or :c:func:`PyConfig_Get(\"verbose\") ` instead." +":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` or :c:func:" +"`PyConfig_Get(\"verbose\") ` instead." msgstr "" -":c:var:`Py_VerboseFlag`:請改用 :c:member:`PyConfig.verbose` " -"或 :c:func:`PyConfig_Get(\"verbose\") `。" +":c:var:`Py_VerboseFlag`:請改用 :c:member:`PyConfig.verbose` 或 :c:func:" +"`PyConfig_Get(\"verbose\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:76 msgid "" -":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` " -"or :c:func:`PyConfig_Get(\"quiet\") ` instead." +":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` or :c:func:" +"`PyConfig_Get(\"quiet\") ` instead." msgstr "" -":c:var:`Py_QuietFlag`:請改用 :c:member:`PyConfig.quiet` " -"或 :c:func:`PyConfig_Get(\"quiet\") `。" +":c:var:`Py_QuietFlag`:請改用 :c:member:`PyConfig.quiet` 或 :c:func:" +"`PyConfig_Get(\"quiet\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:79 msgid "" -":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` " -"or :c:func:`PyConfig_Get(\"interactive\") ` instead." +":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` or :c:func:" +"`PyConfig_Get(\"interactive\") ` instead." msgstr "" -":c:var:`Py_InteractiveFlag`:請改用 :c:member:`PyConfig.interactive` " -"或 :c:func:`PyConfig_Get(\"interactive\") `。" +":c:var:`Py_InteractiveFlag`:請改用 :c:member:`PyConfig.interactive` 或 :c:" +"func:`PyConfig_Get(\"interactive\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:82 msgid "" -":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` " -"or :c:func:`PyConfig_Get(\"inspect\") ` instead." +":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` or :c:func:" +"`PyConfig_Get(\"inspect\") ` instead." msgstr "" -":c:var:`Py_InspectFlag`:請改用 :c:member:`PyConfig.inspect` " -"或 :c:func:`PyConfig_Get(\"inspect\") `。" +":c:var:`Py_InspectFlag`:請改用 :c:member:`PyConfig.inspect` 或 :c:func:" +"`PyConfig_Get(\"inspect\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:85 msgid "" -":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` " -"or :c:func:`PyConfig_Get(\"optimization_level\") ` instead." +":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` or :c:" +"func:`PyConfig_Get(\"optimization_level\") ` instead." msgstr "" -":c:var:`Py_OptimizeFlag`:請改用 :c:member:`PyConfig.optimization_level` " -"或 :c:func:`PyConfig_Get(\"optimization_level\") `。" +":c:var:`Py_OptimizeFlag`:請改用 :c:member:`PyConfig.optimization_level` 或 :" +"c:func:`PyConfig_Get(\"optimization_level\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:88 msgid "" -":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` " -"or :c:func:`PyConfig_Get(\"site_import\") ` instead." +":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` or :c:func:" +"`PyConfig_Get(\"site_import\") ` instead." msgstr "" -":c:var:`Py_NoSiteFlag`:請改用 :c:member:`PyConfig.site_import` " -"或 :c:func:`PyConfig_Get(\"site_import\") `。" +":c:var:`Py_NoSiteFlag`:請改用 :c:member:`PyConfig.site_import` 或 :c:func:" +"`PyConfig_Get(\"site_import\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:91 msgid "" -":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` " -"or :c:func:`PyConfig_Get(\"bytes_warning\") ` instead." +":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` or :c:" +"func:`PyConfig_Get(\"bytes_warning\") ` instead." msgstr "" -":c:var:`Py_BytesWarningFlag`:請改用 :c:member:`PyConfig.bytes_warning` " -"或 :c:func:`PyConfig_Get(\"bytes_warning\") `。" +":c:var:`Py_BytesWarningFlag`:請改用 :c:member:`PyConfig.bytes_warning` 或 :" +"c:func:`PyConfig_Get(\"bytes_warning\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:94 msgid "" -":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` " -"or :c:func:`PyConfig_Get(\"pathconfig_warnings\") ` instead." +":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` or :c:" +"func:`PyConfig_Get(\"pathconfig_warnings\") ` instead." msgstr "" -":c:var:`Py_FrozenFlag`:請改用 :c:member:`PyConfig.pathconfig_warnings` " -"或 :c:func:`PyConfig_Get(\"pathconfig_warnings\") `。" +":c:var:`Py_FrozenFlag`:請改用 :c:member:`PyConfig.pathconfig_warnings` 或 :" +"c:func:`PyConfig_Get(\"pathconfig_warnings\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:97 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " "or :c:func:`PyConfig_Get(\"use_environment\") ` instead." msgstr "" -":c:var:`Py_IgnoreEnvironmentFlag`:請改" -"用 :c:member:`PyConfig.use_environment` " -"或 :c:func:`PyConfig_Get(\"use_environment\") `。" +":c:var:`Py_IgnoreEnvironmentFlag`:請改用 :c:member:`PyConfig." +"use_environment` 或 :c:func:`PyConfig_Get(\"use_environment\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:100 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " "or :c:func:`PyConfig_Get(\"write_bytecode\") ` instead." msgstr "" -":c:var:`Py_DontWriteBytecodeFlag`:請改" -"用 :c:member:`PyConfig.write_bytecode` " -"或 :c:func:`PyConfig_Get(\"write_bytecode\") `。" +":c:var:`Py_DontWriteBytecodeFlag`:請改用 :c:member:`PyConfig." +"write_bytecode` 或 :c:func:`PyConfig_Get(\"write_bytecode\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:103 msgid "" -":c:var:`Py_NoUserSiteDirectory`: " -"Use :c:member:`PyConfig.user_site_directory` " -"or :c:func:`PyConfig_Get(\"user_site_directory\") ` instead." +":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig." +"user_site_directory` or :c:func:`PyConfig_Get(\"user_site_directory\") " +"` instead." msgstr "" -":c:var:`Py_NoUserSiteDirectory`:請改" -"用 :c:member:`PyConfig.user_site_directory` " -"或 :c:func:`PyConfig_Get(\"user_site_directory\") `。" +":c:var:`Py_NoUserSiteDirectory`:請改用 :c:member:`PyConfig." +"user_site_directory` 或 :c:func:`PyConfig_Get(\"user_site_directory\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:106 msgid "" -":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` " -"or :c:func:`PyConfig_Get(\"buffered_stdio\") ` instead." +":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` or :" +"c:func:`PyConfig_Get(\"buffered_stdio\") ` instead." msgstr "" ":c:var:`Py_UnbufferedStdioFlag`:請改用 :c:member:`PyConfig.buffered_stdio` " "或 :c:func:`PyConfig_Get(\"buffered_stdio\") `。" @@ -5902,70 +5785,69 @@ msgstr "" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:113 msgid "" -":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` " -"or :c:func:`PyConfig_Get(\"isolated\") ` instead." +":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` or :c:func:" +"`PyConfig_Get(\"isolated\") ` instead." msgstr "" -":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated` " -"或 :c:func:`PyConfig_Get(\"isolated\") `。" +":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated` 或 :c:func:" +"`PyConfig_Get(\"isolated\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:116 msgid "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: " -"Use :c:member:`PyPreConfig.legacy_windows_fs_encoding` " -"or :c:func:`PyConfig_Get(\"legacy_windows_fs_encoding\") ` " -"instead." +":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig." +"legacy_windows_fs_encoding` or :c:func:" +"`PyConfig_Get(\"legacy_windows_fs_encoding\") ` instead." msgstr "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改" -"用 :c:member:`PyPreConfig.legacy_windows_fs_encoding` " -"或 :c:func:`PyConfig_Get(\"legacy_windows_fs_encoding\") `。" +":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改用 :c:member:`PyPreConfig." +"legacy_windows_fs_encoding` 或 :c:func:" +"`PyConfig_Get(\"legacy_windows_fs_encoding\") `。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:119 msgid "" -":c:var:`Py_LegacyWindowsStdioFlag`: " -"Use :c:member:`PyConfig.legacy_windows_stdio` " -"or :c:func:`PyConfig_Get(\"legacy_windows_stdio\") ` instead." +":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig." +"legacy_windows_stdio` or :c:func:`PyConfig_Get(\"legacy_windows_stdio\") " +"` instead." msgstr "" -":c:var:`Py_LegacyWindowsStdioFlag`:請改" -"用 :c:member:`PyConfig.legacy_windows_stdio` " -"或 :c:func:`PyConfig_Get(\"legacy_windows_stdio\") `。" +":c:var:`Py_LegacyWindowsStdioFlag`:請改用 :c:member:`PyConfig." +"legacy_windows_stdio` 或 :c:func:`PyConfig_Get(\"legacy_windows_stdio\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:122 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`, :c:var:`!" -"Py_HasFileSystemDefaultEncoding`: " -"Use :c:member:`PyConfig.filesystem_encoding` " -"or :c:func:`PyConfig_Get(\"filesystem_encoding\") ` instead." +"Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig." +"filesystem_encoding` or :c:func:`PyConfig_Get(\"filesystem_encoding\") " +"` instead." msgstr "" ":c:var:`!Py_FileSystemDefaultEncoding`、:c:var:`!" -"Py_HasFileSystemDefaultEncoding`:請改" -"用 :c:member:`PyConfig.filesystem_encoding` " -"或 :c:func:`PyConfig_Get(\"filesystem_encoding\") `。" +"Py_HasFileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." +"filesystem_encoding` 或 :c:func:`PyConfig_Get(\"filesystem_encoding\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:125 msgid "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: " -"Use :c:member:`PyConfig.filesystem_errors` " -"or :c:func:`PyConfig_Get(\"filesystem_errors\") ` instead." +":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig." +"filesystem_errors` or :c:func:`PyConfig_Get(\"filesystem_errors\") " +"` instead." msgstr "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改" -"用 :c:member:`PyConfig.filesystem_errors` " -"或 :c:func:`PyConfig_Get(\"filesystem_errors\") `。" +":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改用 :c:member:`PyConfig." +"filesystem_errors` 或 :c:func:`PyConfig_Get(\"filesystem_errors\") " +"`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:128 msgid "" -":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` " -"or :c:func:`PyConfig_Get(\"utf8_mode\") ` instead. " -"(see :c:func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` or :c:func:" +"`PyConfig_Get(\"utf8_mode\") ` instead. (see :c:func:" +"`Py_PreInitialize`)" msgstr "" -":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode` " -"或 :c:func:`PyConfig_Get(\"utf8_mode\") `。(請參" -"閱 :c:func:`Py_PreInitialize`)" +":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode` 或 :c:func:" +"`PyConfig_Get(\"utf8_mode\") `。(請參閱 :c:func:" +"`Py_PreInitialize`)" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:133 msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used " -"with :c:type:`PyConfig` to set these options. Or :c:func:`PyConfig_Get` can " -"be used to get these options at runtime." +"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" +"`PyConfig` to set these options. Or :c:func:`PyConfig_Get` can be used to " +"get these options at runtime." msgstr "" "應改用帶有 :c:type:`PyConfig` 的 :c:func:`Py_InitializeFromConfig` API 來設定" "這些選項。或者也可以使用 :c:func:`PyConfig_Get` 在執行時取得這些選項。" @@ -5979,40 +5861,155 @@ msgid "Pending removal in Python 3.18" msgstr "Python 3.18 中待移除的項目" #: ../../deprecations/c-api-pending-removal-in-3.18.rst:4 -msgid "Deprecated private functions (:gh:`128863`):" -msgstr "被棄用的私有函式 (:gh:`128863`):" +msgid "" +"The following private functions are deprecated and planned for removal in " +"Python 3.18:" +msgstr "以下私有函式已被棄用,並計劃在 Python 3.18 中移除:" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:7 +msgid ":c:func:`!_PyBytes_Join`: use :c:func:`PyBytes_Join`." +msgstr ":c:func:`!_PyBytes_Join`:請改用 :c:func:`PyBytes_Join`。" #: ../../deprecations/c-api-pending-removal-in-3.18.rst:8 -msgid ":c:func:`!_PyDict_Pop()`: :c:func:`PyDict_Pop`." +msgid "" +":c:func:`!_PyDict_GetItemStringWithError`: use :c:func:" +"`PyDict_GetItemStringRef`." +msgstr "" +":c:func:`!_PyDict_GetItemStringWithError`:請改用 :c:func:" +"`PyDict_GetItemStringRef`。" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:9 +msgid ":c:func:`!_PyDict_Pop()`: use :c:func:`PyDict_Pop`." msgstr ":c:func:`!_PyDict_Pop()`:請改用 :c:func:`PyDict_Pop`。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:32 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:10 +msgid ":c:func:`!_PyLong_Sign()`: use :c:func:`PyLong_GetSign`." +msgstr ":c:func:`!_PyLong_Sign()`:請改用 :c:func:`PyLong_GetSign`。" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:11 +msgid "" +":c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`: use :c:func:" +"`PyLongWriter_Create`." +msgstr "" +":c:func:`!_PyLong_FromDigits` 和 :c:func:`!_PyLong_New`:請改用 :c:func:" +"`PyLongWriter_Create`。" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:13 +msgid "" +":c:func:`!_PyThreadState_UncheckedGet`: use :c:func:" +"`PyThreadState_GetUnchecked`." +msgstr "" +":c:func:`!_PyThreadState_UncheckedGet`:請改用 :c:func:" +"`PyThreadState_GetUnchecked`。" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:14 +msgid ":c:func:`!_PyUnicode_AsString`: use :c:func:`PyUnicode_AsUTF8`." +msgstr ":c:func:`!_PyUnicode_AsString`:請改用 :c:func:`PyUnicode_AsUTF8`。" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:15 +msgid "" +":c:func:`!_PyUnicodeWriter_Init`: replace ``_PyUnicodeWriter_Init(&writer)`` " +"with :c:func:`writer = PyUnicodeWriter_Create(0) `." +msgstr "" +":c:func:`!_PyUnicodeWriter_Init`:將 ``_PyUnicodeWriter_Init(&writer)`` 替換" +"為 :c:func:`writer = PyUnicodeWriter_Create(0) `。" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:18 +msgid "" +":c:func:`!_PyUnicodeWriter_Finish`: replace " +"``_PyUnicodeWriter_Finish(&writer)`` with :c:func:" +"`PyUnicodeWriter_Finish(writer) `." +msgstr "" +":c:func:`!_PyUnicodeWriter_Finish`:將 ``_PyUnicodeWriter_Finish(&writer)`` " +"替換為 :c:func:`PyUnicodeWriter_Finish(writer) `。" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:21 +msgid "" +":c:func:`!_PyUnicodeWriter_Dealloc`: replace " +"``_PyUnicodeWriter_Dealloc(&writer)`` with :c:func:" +"`PyUnicodeWriter_Discard(writer) `." +msgstr "" +":c:func:`!_PyUnicodeWriter_Dealloc`:將 " +"``_PyUnicodeWriter_Dealloc(&writer)`` 替換為 :c:func:" +"`PyUnicodeWriter_Discard(writer) `。" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:24 +msgid "" +":c:func:`!_PyUnicodeWriter_WriteChar`: replace " +"``_PyUnicodeWriter_WriteChar(&writer, ch)`` with :c:func:" +"`PyUnicodeWriter_WriteChar(writer, ch) `." +msgstr "" +":c:func:`!_PyUnicodeWriter_WriteChar`:將 " +"``_PyUnicodeWriter_WriteChar(&writer, ch)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteChar(writer, ch) `。" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:27 +msgid "" +":c:func:`!_PyUnicodeWriter_WriteStr`: replace " +"``_PyUnicodeWriter_WriteStr(&writer, str)`` with :c:func:" +"`PyUnicodeWriter_WriteStr(writer, str) `." +msgstr "" +":c:func:`!_PyUnicodeWriter_WriteStr`:將 " +"``_PyUnicodeWriter_WriteStr(&writer, str)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteStr(writer, str) `。" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:30 +msgid "" +":c:func:`!_PyUnicodeWriter_WriteSubstring`: replace " +"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` with :c:func:" +"`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " +"`." +msgstr "" +":c:func:`!_PyUnicodeWriter_WriteSubstring`:將 " +"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " +"`。" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:33 msgid "" ":c:func:`!_PyUnicodeWriter_WriteASCIIString`: replace " -"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` " -"with :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " -"`." +"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` with :c:func:" +"`PyUnicodeWriter_WriteASCII(writer, str) `." msgstr "" ":c:func:`!_PyUnicodeWriter_WriteASCIIString`:將 " -"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` 替換" -"為 :c:func:`PyUnicodeWriter_WriteUTF8(writer, str) " -"`。" +"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteASCII(writer, str) `。" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:36 +msgid "" +":c:func:`!_PyUnicodeWriter_WriteLatin1String`: replace " +"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` with :c:func:" +"`PyUnicodeWriter_WriteUTF8(writer, str) `." +msgstr "" +":c:func:`!_PyUnicodeWriter_WriteLatin1String`:將 " +"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` 替換為 :c:func:" +"`PyUnicodeWriter_WriteUTF8(writer, str) `。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:38 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:39 msgid ":c:func:`!_PyUnicodeWriter_Prepare`: (no replacement)." msgstr ":c:func:`!_PyUnicodeWriter_Prepare`:(無替代方案)。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:39 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:40 msgid ":c:func:`!_PyUnicodeWriter_PrepareKind`: (no replacement)." msgstr ":c:func:`!_PyUnicodeWriter_PrepareKind`:(無替代方案)。" -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:43 +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:41 +msgid ":c:func:`!_Py_HashPointer`: use :c:func:`Py_HashPointer`." +msgstr ":c:func:`!_Py_HashPointer`:請改用 :c:func:`Py_HashPointer`。" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:42 +msgid ":c:func:`!_Py_fopen_obj`: use :c:func:`Py_fopen`." +msgstr ":c:func:`!_Py_fopen_obj`:請改用 :c:func:`Py_fopen`。" + +#: ../../deprecations/c-api-pending-removal-in-3.18.rst:44 msgid "" "The `pythoncapi-compat project `__ can be used to get these new public functions on Python 3.13 and older." +">`__ can be used to get these new public functions on Python 3.13 and older. " +"(Contributed by Victor Stinner in :gh:`128863`.)" msgstr "" "可以使用 `pythoncapi-compat project `__ 來取得這些於 Python 3.13 及更早版本的新公開函式。" +"compat/>`__ 來取得這些於 Python 3.13 及更早版本的新公開函式。(由 " +"Victor Stinner 在 :gh:`128863` 貢獻)" #: ../../deprecations/c-api-pending-removal-in-future.rst:4 msgid "" @@ -6033,8 +6030,8 @@ msgid "" ":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " "instead." msgstr "" -":c:func:`PyErr_NormalizeException`:請改" -"用 :c:func:`PyErr_GetRaisedException`。" +":c:func:`PyErr_NormalizeException`:請改用 :c:func:" +"`PyErr_GetRaisedException`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:13 msgid "" @@ -6054,11 +6051,11 @@ msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:19 msgid "" -":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` " -"and :c:func:`PySlice_AdjustIndices` instead." +":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:" +"`PySlice_AdjustIndices` instead." msgstr "" -":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` " -"和 :c:func:`PySlice_AdjustIndices`。" +":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:" +"`PySlice_AdjustIndices`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:21 msgid ":c:func:`PyUnicode_READY`: Unneeded since Python 3.12" @@ -6080,8 +6077,8 @@ msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead." msgstr "" -":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼" -"叫 :c:func:`PyObject_Hash`。" +":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼叫 :c:func:" +"`PyObject_Hash`。" #: ../../deprecations/c-api-pending-removal-in-future.rst:29 msgid "Thread Local Storage (TLS) API:" @@ -6117,60 +6114,31 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" -#: ../../whatsnew/3.14.rst:3081 -msgid "" -"Creating :c:data:`immutable types ` with mutable " -"bases was deprecated since 3.12 and now raises a :exc:`TypeError`." -msgstr "" - -#: ../../whatsnew/3.14.rst:3084 -msgid "" -"Remove ``PyDictObject.ma_version_tag`` member which was deprecated since " -"Python 3.12. Use the :c:func:`PyDict_AddWatcher` API instead. (Contributed " -"by Sam Gross in :gh:`124296`.)" -msgstr "" - -#: ../../whatsnew/3.14.rst:3088 -msgid "" -"Remove the private ``_Py_InitializeMain()`` function. It was " -"a :term:`provisional API` added to Python 3.8 by :pep:`587`. (Contributed by " -"Victor Stinner in :gh:`129033`.)" -msgstr "" - -#: ../../whatsnew/3.14.rst:3092 -msgid "" -"The undocumented APIs :c:macro:`!Py_C_RECURSION_LIMIT` and :c:member:`!" -"PyThreadState.c_recursion_remaining`, added in 3.13, are removed without a " -"deprecation period. Please use :c:func:`Py_EnterRecursiveCall` to guard " -"against runaway recursion in C code. (Removed in :gh:`133079`, see " -"also :gh:`130396`.)" -msgstr "" - -#: ../../whatsnew/3.14.rst:3101 +#: ../../whatsnew/3.14.rst:3063 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.14.rst:3103 +#: ../../whatsnew/3.14.rst:3065 msgid "" "GNU Autoconf 2.72 is now required to generate :file:`configure`. " "(Contributed by Erlend Aasland in :gh:`115765`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3106 +#: ../../whatsnew/3.14.rst:3068 msgid "" "``wasm32-unknown-emscripten`` is now a :pep:`11` tier 3 platform. " -"(Contributed by R. Hood Chatham in :gh:`127146`, :gh:`127683`, " -"and :gh:`136931`.)" +"(Contributed by R. Hood Chatham in :gh:`127146`, :gh:`127683`, and :gh:" +"`136931`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3109 +#: ../../whatsnew/3.14.rst:3071 msgid "" "``#pragma``-based linking with ``python3*.lib`` can now be switched off " "with :c:expr:`Py_NO_LINK_LIB`. (Contributed by Jean-Christophe Fillion-Robin " "in :gh:`82909`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3113 +#: ../../whatsnew/3.14.rst:3075 msgid "" "CPython now enables a set of recommended compiler options by default for " "improved security. Use the :option:`--disable-safety` :file:`configure` " @@ -6178,31 +6146,31 @@ msgid "" "larger set of compiler options, albeit with a performance cost." msgstr "" -#: ../../whatsnew/3.14.rst:3119 +#: ../../whatsnew/3.14.rst:3081 msgid "" "The ``WITH_FREELISTS`` macro and ``--without-freelists`` :file:`configure` " "option have been removed." msgstr "" -#: ../../whatsnew/3.14.rst:3122 +#: ../../whatsnew/3.14.rst:3084 msgid "" "The new :file:`configure` option :option:`--with-tail-call-interp` may be " "used to enable the experimental tail call interpreter. See :ref:`whatsnew314-" "tail-call` for further details." msgstr "" -#: ../../whatsnew/3.14.rst:3126 +#: ../../whatsnew/3.14.rst:3088 msgid "" "To disable the new remote debugging support, use the :option:`--without-" "remote-debug` :file:`configure` option. This may be useful for security " "reasons." msgstr "" -#: ../../whatsnew/3.14.rst:3133 +#: ../../whatsnew/3.14.rst:3095 msgid ":file:`build-details.json`" msgstr "" -#: ../../whatsnew/3.14.rst:3135 +#: ../../whatsnew/3.14.rst:3097 msgid "" "Installations of Python now contain a new file, :file:`build-details.json`. " "This is a static JSON document containing build details for CPython, to " @@ -6210,7 +6178,7 @@ msgid "" "cases such as Python launchers, cross-compilation, and so on." msgstr "" -#: ../../whatsnew/3.14.rst:3141 +#: ../../whatsnew/3.14.rst:3103 msgid "" ":file:`build-details.json` must be installed in the platform-independent " "standard library directory. This corresponds to the :ref:`'stdlib' " @@ -6218,17 +6186,17 @@ msgid "" "by running ``sysconfig.get_path('stdlib')``." msgstr "" -#: ../../whatsnew/3.14.rst:3147 +#: ../../whatsnew/3.14.rst:3109 msgid "" ":pep:`739` -- ``build-details.json`` 1.0 -- a static description file for " "Python build details" msgstr "" -#: ../../whatsnew/3.14.rst:3153 +#: ../../whatsnew/3.14.rst:3115 msgid "Discontinuation of PGP signatures" msgstr "" -#: ../../whatsnew/3.14.rst:3155 +#: ../../whatsnew/3.14.rst:3117 msgid "" "PGP (Pretty Good Privacy) signatures will not be provided for releases of " "Python 3.14 or future versions. To verify CPython artifacts, users must use " @@ -6236,178 +6204,191 @@ msgid "" "sigstore/>`__. Releases have been signed using Sigstore_ since Python 3.11." msgstr "" -#: ../../whatsnew/3.14.rst:3161 +#: ../../whatsnew/3.14.rst:3123 msgid "This change in release process was specified in :pep:`761`." msgstr "" -#: ../../whatsnew/3.14.rst:3167 +#: ../../whatsnew/3.14.rst:3129 msgid "Porting to Python 3.14" msgstr "移植至 Python 3.14" -#: ../../whatsnew/3.14.rst:3169 +#: ../../whatsnew/3.14.rst:3131 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "本節列出了前面描述的更改以及可能需要更改程式碼的其他錯誤修復。" -#: ../../whatsnew/3.14.rst:3174 +#: ../../whatsnew/3.14.rst:3136 msgid "Changes in the Python API" msgstr "Python API 的變更" -#: ../../whatsnew/3.14.rst:3176 +#: ../../whatsnew/3.14.rst:3138 msgid "" -":class:`functools.partial` is now a method descriptor. Wrap it " -"in :func:`staticmethod` if you want to preserve the old behavior. " -"(Contributed by Serhiy Storchaka and Dominykas Grigonis in :gh:`121027`.)" +":class:`functools.partial` is now a method descriptor. Wrap it in :func:" +"`staticmethod` if you want to preserve the old behavior. (Contributed by " +"Serhiy Storchaka and Dominykas Grigonis in :gh:`121027`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3180 +#: ../../whatsnew/3.14.rst:3142 msgid "" "The :ref:`garbage collector is now incremental `, which means that the behavior of :func:`gc.collect` changes slightly:" msgstr "" -#: ../../whatsnew/3.14.rst:3187 +#: ../../whatsnew/3.14.rst:3149 msgid "" "The :func:`locale.nl_langinfo` function now temporarily sets the " "``LC_CTYPE`` locale in some cases. This temporary change affects other " "threads. (Contributed by Serhiy Storchaka in :gh:`69998`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3192 +#: ../../whatsnew/3.14.rst:3154 msgid "" ":class:`types.UnionType` is now an alias for :class:`typing.Union`, causing " "changes in some behaviors. See :ref:`above ` for " "more details. (Contributed by Jelle Zijlstra in :gh:`105499`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3197 +#: ../../whatsnew/3.14.rst:3159 msgid "" -"The runtime behavior of annotations has changed in various ways; " -"see :ref:`above ` for details. While most code that " -"interacts with annotations should continue to work, some undocumented " -"details may behave differently." +"The runtime behavior of annotations has changed in various ways; see :ref:" +"`above ` for details. While most code that interacts " +"with annotations should continue to work, some undocumented details may " +"behave differently." msgstr "" -#: ../../whatsnew/3.14.rst:3204 +#: ../../whatsnew/3.14.rst:3166 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.14.rst:3206 +#: ../../whatsnew/3.14.rst:3168 msgid "" ":c:func:`Py_Finalize` now deletes all interned strings. This is backwards " "incompatible to any C extension that holds onto an interned string after a " -"call to :c:func:`Py_Finalize` and is then reused after a call " -"to :c:func:`Py_Initialize`. Any issues arising from this behavior will " -"normally result in crashes during the execution of the subsequent call " -"to :c:func:`Py_Initialize` from accessing uninitialized memory. To fix, use " -"an address sanitizer to identify any use-after-free coming from an interned " -"string and deallocate it during module shutdown. (Contributed by Eddie " -"Elizondo in :gh:`113601`.)" +"call to :c:func:`Py_Finalize` and is then reused after a call to :c:func:" +"`Py_Initialize`. Any issues arising from this behavior will normally result " +"in crashes during the execution of the subsequent call to :c:func:" +"`Py_Initialize` from accessing uninitialized memory. To fix, use an address " +"sanitizer to identify any use-after-free coming from an interned string and " +"deallocate it during module shutdown. (Contributed by Eddie Elizondo in :gh:" +"`113601`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3216 +#: ../../whatsnew/3.14.rst:3178 msgid "" -"The :ref:`Unicode Exception Objects ` C API now raises " -"a :exc:`TypeError` if its exception argument is not a :exc:`UnicodeError` " +"The :ref:`Unicode Exception Objects ` C API now raises a :" +"exc:`TypeError` if its exception argument is not a :exc:`UnicodeError` " "object. (Contributed by Bénédikt Tran in :gh:`127691`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3223 +#: ../../whatsnew/3.14.rst:3185 msgid "" "The interpreter internally avoids some reference count modifications when " "loading objects onto the operands stack by :term:`borrowing ` references when possible. This can lead to smaller reference " "count values compared to previous Python versions. C API extensions that " "checked :c:func:`Py_REFCNT` of ``1`` to determine if an function argument is " -"not referenced by any other code should instead " -"use :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary` as a safer " -"replacement." +"not referenced by any other code should instead use :c:func:" +"`PyUnstable_Object_IsUniqueReferencedTemporary` as a safer replacement." msgstr "" -#: ../../whatsnew/3.14.rst:3232 +#: ../../whatsnew/3.14.rst:3194 msgid "Private functions promoted to public C APIs:" msgstr "" -#: ../../whatsnew/3.14.rst:3234 +#: ../../whatsnew/3.14.rst:3196 msgid "``_PyBytes_Join()``: :c:func:`PyBytes_Join`" msgstr "" -#: ../../whatsnew/3.14.rst:3235 +#: ../../whatsnew/3.14.rst:3197 msgid "``_PyLong_IsNegative()``: :c:func:`PyLong_IsNegative`" msgstr "" -#: ../../whatsnew/3.14.rst:3236 +#: ../../whatsnew/3.14.rst:3198 msgid "``_PyLong_IsPositive()``: :c:func:`PyLong_IsPositive`" msgstr "" -#: ../../whatsnew/3.14.rst:3237 +#: ../../whatsnew/3.14.rst:3199 msgid "``_PyLong_IsZero()``: :c:func:`PyLong_IsZero`" msgstr "" -#: ../../whatsnew/3.14.rst:3238 +#: ../../whatsnew/3.14.rst:3200 msgid "``_PyLong_Sign()``: :c:func:`PyLong_GetSign`" msgstr "" -#: ../../whatsnew/3.14.rst:3239 +#: ../../whatsnew/3.14.rst:3201 msgid "``_PyUnicodeWriter_Dealloc()``: :c:func:`PyUnicodeWriter_Discard`" msgstr "" -#: ../../whatsnew/3.14.rst:3240 +#: ../../whatsnew/3.14.rst:3202 msgid "``_PyUnicodeWriter_Finish()``: :c:func:`PyUnicodeWriter_Finish`" msgstr "" -#: ../../whatsnew/3.14.rst:3241 +#: ../../whatsnew/3.14.rst:3203 msgid "``_PyUnicodeWriter_Init()``: use :c:func:`PyUnicodeWriter_Create`" msgstr "" -#: ../../whatsnew/3.14.rst:3242 +#: ../../whatsnew/3.14.rst:3204 msgid "``_PyUnicodeWriter_Prepare()``: (no replacement)" msgstr "" -#: ../../whatsnew/3.14.rst:3243 +#: ../../whatsnew/3.14.rst:3205 msgid "``_PyUnicodeWriter_PrepareKind()``: (no replacement)" msgstr "" -#: ../../whatsnew/3.14.rst:3244 +#: ../../whatsnew/3.14.rst:3206 msgid "``_PyUnicodeWriter_WriteChar()``: :c:func:`PyUnicodeWriter_WriteChar`" msgstr "" -#: ../../whatsnew/3.14.rst:3245 +#: ../../whatsnew/3.14.rst:3207 msgid "``_PyUnicodeWriter_WriteStr()``: :c:func:`PyUnicodeWriter_WriteStr`" msgstr "" -#: ../../whatsnew/3.14.rst:3246 -msgid "``_PyUnicodeWriter_WriteSubstring()``: :c:func:`PyUnicodeWriter_WriteSubstring`" +#: ../../whatsnew/3.14.rst:3208 +msgid "" +"``_PyUnicodeWriter_WriteSubstring()``: :c:func:" +"`PyUnicodeWriter_WriteSubstring`" msgstr "" -#: ../../whatsnew/3.14.rst:3247 +#: ../../whatsnew/3.14.rst:3209 msgid "``_PyUnicode_EQ()``: :c:func:`PyUnicode_Equal`" msgstr "" -#: ../../whatsnew/3.14.rst:3248 +#: ../../whatsnew/3.14.rst:3210 msgid "``_PyUnicode_Equal()``: :c:func:`PyUnicode_Equal`" msgstr "" -#: ../../whatsnew/3.14.rst:3249 +#: ../../whatsnew/3.14.rst:3211 msgid "" "``_Py_GetConfig()``: :c:func:`PyConfig_Get` and :c:func:`PyConfig_GetInt`" msgstr "" -#: ../../whatsnew/3.14.rst:3250 +#: ../../whatsnew/3.14.rst:3212 msgid "``_Py_HashBytes()``: :c:func:`Py_HashBuffer`" msgstr "" -#: ../../whatsnew/3.14.rst:3251 +#: ../../whatsnew/3.14.rst:3213 msgid "``_Py_fopen_obj()``: :c:func:`Py_fopen`" msgstr "" -#: ../../whatsnew/3.14.rst:3252 +#: ../../whatsnew/3.14.rst:3214 msgid "``PyMutex_IsLocked()`` : :c:func:`PyMutex_IsLocked`" msgstr "" -#: ../../whatsnew/3.14.rst:3254 +#: ../../whatsnew/3.14.rst:3216 msgid "" "The `pythoncapi-compat project`_ can be used to get most of these new " "functions on Python 3.13 and older." msgstr "" + +#~ msgid ":c:func:`!_PyDict_Pop()`: :c:func:`PyDict_Pop`." +#~ msgstr ":c:func:`!_PyDict_Pop()`:請改用 :c:func:`PyDict_Pop`。" + +#~ msgid "" +#~ ":c:func:`!_PyUnicodeWriter_WriteASCIIString`: replace " +#~ "``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` with :c:func:" +#~ "`PyUnicodeWriter_WriteUTF8(writer, str) `." +#~ msgstr "" +#~ ":c:func:`!_PyUnicodeWriter_WriteASCIIString`:將 " +#~ "``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` 替換為 :c:func:" +#~ "`PyUnicodeWriter_WriteUTF8(writer, str) `。" diff --git a/whatsnew/3.5.po b/whatsnew/3.5.po index 84004b38cd..684096e689 100644 --- a/whatsnew/3.5.po +++ b/whatsnew/3.5.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-09-10 20:44+0800\n" +"POT-Creation-Date: 2025-09-18 00:15+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -126,10 +126,10 @@ msgstr "CPython 實作改進:" #: ../../whatsnew/3.5.rst:96 msgid "" -"When the ``LC_TYPE`` locale is the POSIX locale (``C`` " -"locale), :py:data:`sys.stdin` and :py:data:`sys.stdout` now use the " -"``surrogateescape`` error handler, instead of the ``strict`` error handler. " -"(Contributed by Victor Stinner in :issue:`19977`.)" +"When the ``LC_TYPE`` locale is the POSIX locale (``C`` locale), :py:data:" +"`sys.stdin` and :py:data:`sys.stdout` now use the ``surrogateescape`` error " +"handler, instead of the ``strict`` error handler. (Contributed by Victor " +"Stinner in :issue:`19977`.)" msgstr "" #: ../../whatsnew/3.5.rst:101 @@ -193,9 +193,8 @@ msgstr "安全性改進:" #: ../../whatsnew/3.5.rst:138 msgid "" "SSLv3 is now disabled throughout the standard library. It can still be " -"enabled by instantiating a :class:`ssl.SSLContext` manually. " -"(See :issue:`22638` for more details; this change was backported to CPython " -"3.4 and 2.7.)" +"enabled by instantiating a :class:`ssl.SSLContext` manually. (See :issue:" +"`22638` for more details; this change was backported to CPython 3.4 and 2.7.)" msgstr "" #: ../../whatsnew/3.5.rst:143 @@ -400,10 +399,9 @@ msgstr "" #: ../../whatsnew/3.5.rst:253 msgid "" -"Starting with CPython 3.5.2, ``__aiter__`` can directly " -"return :term:`asynchronous iterators `. Returning " -"an :term:`awaitable` object will result in " -"a :exc:`PendingDeprecationWarning`." +"Starting with CPython 3.5.2, ``__aiter__`` can directly return :term:" +"`asynchronous iterators `. Returning an :term:" +"`awaitable` object will result in a :exc:`PendingDeprecationWarning`." msgstr "" #: ../../whatsnew/3.5.rst:259 @@ -426,11 +424,10 @@ msgstr "" msgid "" ":pep:`465` adds the ``@`` infix operator for matrix multiplication. " "Currently, no builtin Python types implement the new operator, however, it " -"can be implemented by " -"defining :meth:`~object.__matmul__`, :meth:`~object.__rmatmul__`, " -"and :meth:`~object.__imatmul__` for regular, reflected, and in-place matrix " -"multiplication. The semantics of these methods is similar to that of methods " -"defining other infix arithmetic operators." +"can be implemented by defining :meth:`~object.__matmul__`, :meth:`~object." +"__rmatmul__`, and :meth:`~object.__imatmul__` for regular, reflected, and in-" +"place matrix multiplication. The semantics of these methods is similar to " +"that of methods defining other infix arithmetic operators." msgstr "" #: ../../whatsnew/3.5.rst:282 @@ -661,8 +658,8 @@ msgstr "PEP 484 - 型別提示" #: ../../whatsnew/3.5.rst:408 msgid "" -"Function annotation syntax has been a Python feature since version 3.0 " -"(:pep:`3107`), however the semantics of annotations has been left undefined." +"Function annotation syntax has been a Python feature since version 3.0 (:pep:" +"`3107`), however the semantics of annotations has been left undefined." msgstr "" #: ../../whatsnew/3.5.rst:411 @@ -696,18 +693,18 @@ msgstr "" #: ../../whatsnew/3.5.rst:426 msgid "" -"While these annotations are available at runtime through the " -"usual :attr:`~object.__annotations__` attribute, *no automatic type checking " -"happens at runtime*. Instead, it is assumed that a separate off-line type " -"checker (e.g. `mypy `_) will be used for on-demand " -"source code analysis." +"While these annotations are available at runtime through the usual :attr:" +"`~object.__annotations__` attribute, *no automatic type checking happens at " +"runtime*. Instead, it is assumed that a separate off-line type checker (e." +"g. `mypy `_) will be used for on-demand source code " +"analysis." msgstr "" #: ../../whatsnew/3.5.rst:432 msgid "" -"The type system supports unions, generic types, and a special type " -"named :class:`~typing.Any` which is consistent with (i.e. assignable to and " -"from) all types." +"The type system supports unions, generic types, and a special type named :" +"class:`~typing.Any` which is consistent with (i.e. assignable to and from) " +"all types." msgstr "" #: ../../whatsnew/3.5.rst:438 @@ -860,32 +857,37 @@ msgstr ":mod:`faulthandler` 模組的函式;" #: ../../whatsnew/3.5.rst:520 msgid "" -":mod:`os` " -"functions: :func:`~os.fchdir`, :func:`~os.fchmod`, :func:`~os.fchown`, :func:`~os.fdatasync`, :func:`~os.fstat`, :func:`~os.fstatvfs`, :func:`~os.fsync`, :func:`~os.ftruncate`, :func:`~os.mkfifo`, :func:`~os.mknod`, :func:`~os.open`, :func:`~os.posix_fadvise`, :func:`~os.posix_fallocate`, :func:`~os.pread`, :func:`~os.pwrite`, :func:`~os.read`, :func:`~os.readv`, :func:`~os.sendfile`, :func:`~os.wait3`, :func:`~os.wait4`, :func:`~os.wait`, :func:`~os.waitid`, :func:`~os.waitpid`, :func:`~os.write`, :func:`~os.writev`;" +":mod:`os` functions: :func:`~os.fchdir`, :func:`~os.fchmod`, :func:`~os." +"fchown`, :func:`~os.fdatasync`, :func:`~os.fstat`, :func:`~os.fstatvfs`, :" +"func:`~os.fsync`, :func:`~os.ftruncate`, :func:`~os.mkfifo`, :func:`~os." +"mknod`, :func:`~os.open`, :func:`~os.posix_fadvise`, :func:`~os." +"posix_fallocate`, :func:`~os.pread`, :func:`~os.pwrite`, :func:`~os.read`, :" +"func:`~os.readv`, :func:`~os.sendfile`, :func:`~os.wait3`, :func:`~os." +"wait4`, :func:`~os.wait`, :func:`~os.waitid`, :func:`~os.waitpid`, :func:" +"`~os.write`, :func:`~os.writev`;" msgstr "" #: ../../whatsnew/3.5.rst:530 msgid "" -"special cases: :func:`os.close` and :func:`os.dup2` now " -"ignore :py:const:`~errno.EINTR` errors; the syscall is not retried (see the " -"PEP for the rationale);" +"special cases: :func:`os.close` and :func:`os.dup2` now ignore :py:const:" +"`~errno.EINTR` errors; the syscall is not retried (see the PEP for the " +"rationale);" msgstr "" #: ../../whatsnew/3.5.rst:534 msgid "" -":mod:`select` functions: :func:`devpoll.poll() " -"`, :func:`epoll.poll() " -"`, :func:`kqueue.control() " -"`, :func:`poll.poll() " -"`, :func:`~select.select`;" +":mod:`select` functions: :func:`devpoll.poll() `, :func:" +"`epoll.poll() `, :func:`kqueue.control() `, :func:`poll.poll() `, :func:`~select.select`;" msgstr "" #: ../../whatsnew/3.5.rst:539 msgid "" -"methods of the :class:`~socket.socket` " -"class: :meth:`~socket.socket.accept`, :meth:`~socket.socket.connect` (except " -"for non-blocking " -"sockets), :meth:`~socket.socket.recv`, :meth:`~socket.socket.recvfrom`, :meth:`~socket.socket.recvmsg`, :meth:`~socket.socket.send`, :meth:`~socket.socket.sendall`, :meth:`~socket.socket.sendmsg`, :meth:`~socket.socket.sendto`;" +"methods of the :class:`~socket.socket` class: :meth:`~socket.socket." +"accept`, :meth:`~socket.socket.connect` (except for non-blocking sockets), :" +"meth:`~socket.socket.recv`, :meth:`~socket.socket.recvfrom`, :meth:`~socket." +"socket.recvmsg`, :meth:`~socket.socket.send`, :meth:`~socket.socket." +"sendall`, :meth:`~socket.socket.sendmsg`, :meth:`~socket.socket.sendto`;" msgstr "" #: ../../whatsnew/3.5.rst:546 @@ -922,18 +924,18 @@ msgstr "" #: ../../whatsnew/3.5.rst:568 msgid "" ":pep:`479` changes the behavior of generators: when a ``StopIteration`` " -"exception is raised inside a generator, it is replaced with " -"a :exc:`RuntimeError` before it exits the generator frame. The main goal of " -"this change is to ease debugging in the situation where an " -"unguarded :func:`next` call raises ``StopIteration`` and causes the " -"iteration controlled by the generator to terminate silently. This is " -"particularly pernicious in combination with the ``yield from`` construct." +"exception is raised inside a generator, it is replaced with a :exc:" +"`RuntimeError` before it exits the generator frame. The main goal of this " +"change is to ease debugging in the situation where an unguarded :func:`next` " +"call raises ``StopIteration`` and causes the iteration controlled by the " +"generator to terminate silently. This is particularly pernicious in " +"combination with the ``yield from`` construct." msgstr "" #: ../../whatsnew/3.5.rst:576 msgid "" -"This is a backwards incompatible change, so to enable the new behavior, " -"a :term:`__future__` import is necessary::" +"This is a backwards incompatible change, so to enable the new behavior, a :" +"term:`__future__` import is necessary::" msgstr "" #: ../../whatsnew/3.5.rst:579 @@ -1080,15 +1082,15 @@ msgstr "" #: ../../whatsnew/3.5.rst:665 msgid "" -":pep:`488` does away with the concept of ``.pyo`` files. This means that " -"``.pyc`` files represent both unoptimized and optimized bytecode. To prevent " +":pep:`488` does away with the concept of ``.pyo`` files. This means that ``." +"pyc`` files represent both unoptimized and optimized bytecode. To prevent " "the need to constantly regenerate bytecode files, ``.pyc`` files now have an " "optional ``opt-`` tag in their name when the bytecode is optimized. This has " "the side-effect of no more bytecode file name clashes when running under " "either :option:`-O` or :option:`-OO`. Consequently, bytecode files generated " -"from :option:`-O`, and :option:`-OO` may now exist " -"simultaneously. :func:`importlib.util.cache_from_source` has an updated API " -"to help with this change." +"from :option:`-O`, and :option:`-OO` may now exist simultaneously. :func:" +"`importlib.util.cache_from_source` has an updated API to help with this " +"change." msgstr "" #: ../../whatsnew/3.5.rst:677 @@ -1144,22 +1146,22 @@ msgstr "" #: ../../whatsnew/3.5.rst:710 msgid "" -"The :option:`-b` option now affects comparisons of :class:`bytes` " -"with :class:`int`. (Contributed by Serhiy Storchaka in :issue:`23681`.)" +"The :option:`-b` option now affects comparisons of :class:`bytes` with :" +"class:`int`. (Contributed by Serhiy Storchaka in :issue:`23681`.)" msgstr "" #: ../../whatsnew/3.5.rst:713 msgid "" "New Kazakh ``kz1048`` and Tajik ``koi8_t`` :ref:`codecs `. (Contributed by Serhiy Storchaka in :issue:`22682` " -"and :issue:`22681`.)" +"encodings>`. (Contributed by Serhiy Storchaka in :issue:`22682` and :issue:" +"`22681`.)" msgstr "" #: ../../whatsnew/3.5.rst:716 msgid "" -"Property docstrings are now writable. This is especially useful " -"for :func:`collections.namedtuple` docstrings. (Contributed by Berker Peksag " -"in :issue:`24064`.)" +"Property docstrings are now writable. This is especially useful for :func:" +"`collections.namedtuple` docstrings. (Contributed by Berker Peksag in :issue:" +"`24064`.)" msgstr "" #: ../../whatsnew/3.5.rst:720 @@ -1212,8 +1214,8 @@ msgstr "" #: ../../whatsnew/3.5.rst:753 msgid "" -"The module implementation has been contributed by Paul Moore " -"in :issue:`23491`." +"The module implementation has been contributed by Paul Moore in :issue:" +"`23491`." msgstr "模組實作由 Paul Moore 在 :issue:`23491` 貢獻。" #: ../../whatsnew/3.5.rst:758 @@ -1230,10 +1232,10 @@ msgstr "argparse" #: ../../whatsnew/3.5.rst:767 msgid "" -"The :class:`~argparse.ArgumentParser` class now allows " -"disabling :ref:`abbreviated usage ` of long options by " -"setting :ref:`allow_abbrev` to ``False``. (Contributed by Jonathan Paugh, " -"Steven Bethard, paul j3 and Daniel Eriksson in :issue:`14910`.)" +"The :class:`~argparse.ArgumentParser` class now allows disabling :ref:" +"`abbreviated usage ` of long options by setting :ref:" +"`allow_abbrev` to ``False``. (Contributed by Jonathan Paugh, Steven " +"Bethard, paul j3 and Daniel Eriksson in :issue:`14910`.)" msgstr "" #: ../../whatsnew/3.5.rst:774 @@ -1243,8 +1245,8 @@ msgstr "asyncio" #: ../../whatsnew/3.5.rst:776 msgid "" "Since the :mod:`asyncio` module is :term:`provisional `, " -"all changes introduced in Python 3.5 have also been backported to Python " -"3.4.x." +"all changes introduced in Python 3.5 have also been backported to Python 3.4." +"x." msgstr "" #: ../../whatsnew/3.5.rst:779 @@ -1253,9 +1255,9 @@ msgstr "Python 3.4.0 以來 :mod:`asyncio` 模組的顯著變更:" #: ../../whatsnew/3.5.rst:781 msgid "" -"New debugging APIs: :meth:`loop.set_debug() ` " -"and :meth:`loop.get_debug() ` methods. (Contributed " -"by Victor Stinner.)" +"New debugging APIs: :meth:`loop.set_debug() ` and :" +"meth:`loop.get_debug() ` methods. (Contributed by " +"Victor Stinner.)" msgstr "" #: ../../whatsnew/3.5.rst:785 @@ -1281,24 +1283,23 @@ msgstr "" #: ../../whatsnew/3.5.rst:799 msgid "" -"A new :meth:`transport.get_write_buffer_limits() " -"` method to inquire for " -"*high-* and *low-* water limits of the flow control. (Contributed by Victor " -"Stinner.)" +"A new :meth:`transport.get_write_buffer_limits() ` method to inquire for *high-* and *low-* water " +"limits of the flow control. (Contributed by Victor Stinner.)" msgstr "" #: ../../whatsnew/3.5.rst:804 msgid "" -"The :func:`!async` function is deprecated in favor " -"of :func:`~asyncio.ensure_future`. (Contributed by Yury Selivanov.)" +"The :func:`!async` function is deprecated in favor of :func:`~asyncio." +"ensure_future`. (Contributed by Yury Selivanov.)" msgstr "" #: ../../whatsnew/3.5.rst:808 msgid "" -"New :meth:`loop.set_task_factory() ` " -"and :meth:`loop.get_task_factory() ` methods " -"to customize the task factory that :meth:`loop.create_task() " -"` method uses. (Contributed by Yury Selivanov.)" +"New :meth:`loop.set_task_factory() ` and :" +"meth:`loop.get_task_factory() ` methods to " +"customize the task factory that :meth:`loop.create_task() ` method uses. (Contributed by Yury Selivanov.)" msgstr "" #: ../../whatsnew/3.5.rst:815 @@ -1309,8 +1310,8 @@ msgstr "" #: ../../whatsnew/3.5.rst:819 msgid "" -"The ``JoinableQueue`` class was removed, in favor of " -"the :class:`asyncio.Queue` class. (Contributed by Victor Stinner.)" +"The ``JoinableQueue`` class was removed, in favor of the :class:`asyncio." +"Queue` class. (Contributed by Victor Stinner.)" msgstr "" #: ../../whatsnew/3.5.rst:823 @@ -1359,9 +1360,9 @@ msgstr "" #: ../../whatsnew/3.5.rst:851 msgid "" -"New :meth:`loop.get_exception_handler() " -"` method to get the current exception " -"handler. (Contributed by Yury Selivanov.)" +"New :meth:`loop.get_exception_handler() ` method to get the current exception handler. " +"(Contributed by Yury Selivanov.)" msgstr "" #: ../../whatsnew/3.5.rst:855 @@ -1373,8 +1374,8 @@ msgstr "" #: ../../whatsnew/3.5.rst:860 msgid "" -"The :meth:`loop.create_connection() ` " -"and :meth:`loop.create_server() ` methods are " +"The :meth:`loop.create_connection() ` and :" +"meth:`loop.create_server() ` methods are " "optimized to avoid calling the system ``getaddrinfo`` function if the " "address is already resolved. (Contributed by A. Jesse Jiryu Davis.)" msgstr "" @@ -1423,10 +1424,10 @@ msgstr "code" #: ../../whatsnew/3.5.rst:896 msgid "" -"The :func:`InteractiveInterpreter.showtraceback() " -"` method now prints the full " -"chained traceback, just like the interactive interpreter. (Contributed by " -"Claudiu Popa in :issue:`17442`.)" +"The :func:`InteractiveInterpreter.showtraceback() ` method now prints the full chained " +"traceback, just like the interactive interpreter. (Contributed by Claudiu " +"Popa in :issue:`17442`.)" msgstr "" #: ../../whatsnew/3.5.rst:902 @@ -1436,8 +1437,8 @@ msgstr "collections" #: ../../whatsnew/3.5.rst:906 msgid "" "The :class:`~collections.OrderedDict` class is now implemented in C, which " -"makes it 4 to 100 times faster. (Contributed by Eric Snow " -"in :issue:`16991`.)" +"makes it 4 to 100 times faster. (Contributed by Eric Snow in :issue:" +"`16991`.)" msgstr "" #: ../../whatsnew/3.5.rst:909 @@ -1449,13 +1450,12 @@ msgstr "" #: ../../whatsnew/3.5.rst:913 msgid "" -"The :class:`~collections.deque` class now " -"defines :meth:`~collections.deque.index`, :meth:`~collections.deque.insert`, " -"and :meth:`~collections.deque.copy`, and supports the ``+`` and ``*`` " -"operators. This allows deques to be recognized as " -"a :class:`~collections.abc.MutableSequence` and improves their " -"substitutability for lists. (Contributed by Raymond Hettinger " -"in :issue:`23704`.)" +"The :class:`~collections.deque` class now defines :meth:`~collections.deque." +"index`, :meth:`~collections.deque.insert`, and :meth:`~collections.deque." +"copy`, and supports the ``+`` and ``*`` operators. This allows deques to be " +"recognized as a :class:`~collections.abc.MutableSequence` and improves their " +"substitutability for lists. (Contributed by Raymond Hettinger in :issue:" +"`23704`.)" msgstr "" #: ../../whatsnew/3.5.rst:920 @@ -1481,10 +1481,11 @@ msgstr "(由 Berker Peksag 在 :issue:`24064` 中貢獻。)" #: ../../whatsnew/3.5.rst:929 msgid "" -"The :class:`~collections.UserString` class now implements " -"the :meth:`~object.__getnewargs__`, :meth:`~object.__rmod__`, :meth:`~str.casefold`, :meth:`~str.format_map`, :meth:`~str.isprintable`, " -"and :meth:`~str.maketrans` methods to match the corresponding methods " -"of :class:`str`. (Contributed by Joe Jevnik in :issue:`22189`.)" +"The :class:`~collections.UserString` class now implements the :meth:`~object." +"__getnewargs__`, :meth:`~object.__rmod__`, :meth:`~str.casefold`, :meth:" +"`~str.format_map`, :meth:`~str.isprintable`, and :meth:`~str.maketrans` " +"methods to match the corresponding methods of :class:`str`. (Contributed by " +"Joe Jevnik in :issue:`22189`.)" msgstr "" #: ../../whatsnew/3.5.rst:937 @@ -1493,10 +1494,9 @@ msgstr "collections.abc" #: ../../whatsnew/3.5.rst:939 msgid "" -"The :meth:`Sequence.index() ` method " -"now accepts *start* and *stop* arguments to match the corresponding methods " -"of :class:`tuple`, :class:`list`, etc. (Contributed by Devin Jeanpierre " -"in :issue:`23086`.)" +"The :meth:`!Sequence.index` method now accepts *start* and *stop* arguments " +"to match the corresponding methods of :class:`tuple`, :class:`list`, etc. " +"(Contributed by Devin Jeanpierre in :issue:`23086`.)" msgstr "" #: ../../whatsnew/3.5.rst:944 @@ -1507,9 +1507,10 @@ msgstr "" #: ../../whatsnew/3.5.rst:947 msgid "" -"New :class:`~collections.abc.Awaitable`, :class:`~collections.abc.Coroutine`, :class:`~collections.abc.AsyncIterator`, " -"and :class:`~collections.abc.AsyncIterable` abstract base classes. " -"(Contributed by Yury Selivanov in :issue:`24184`.)" +"New :class:`~collections.abc.Awaitable`, :class:`~collections.abc." +"Coroutine`, :class:`~collections.abc.AsyncIterator`, and :class:" +"`~collections.abc.AsyncIterable` abstract base classes. (Contributed by Yury " +"Selivanov in :issue:`24184`.)" msgstr "" #: ../../whatsnew/3.5.rst:952 @@ -1525,8 +1526,8 @@ msgstr "compileall" #: ../../whatsnew/3.5.rst:959 msgid "" "A new :mod:`compileall` option, :samp:`-j {N}`, allows running *N* workers " -"simultaneously to perform parallel bytecode compilation. " -"The :func:`~compileall.compile_dir` function has a corresponding ``workers`` " +"simultaneously to perform parallel bytecode compilation. The :func:" +"`~compileall.compile_dir` function has a corresponding ``workers`` " "parameter. (Contributed by Claudiu Popa in :issue:`16104`.)" msgstr "" @@ -1540,11 +1541,10 @@ msgstr "" msgid "" "The ``-q`` command line option can now be specified more than once, in which " "case all output, including errors, will be suppressed. The corresponding " -"``quiet`` parameter " -"in :func:`~compileall.compile_dir`, :func:`~compileall.compile_file`, " -"and :func:`~compileall.compile_path` can now accept an integer value " -"indicating the level of output suppression. (Contributed by Thomas Kluyver " -"in :issue:`21338`.)" +"``quiet`` parameter in :func:`~compileall.compile_dir`, :func:`~compileall." +"compile_file`, and :func:`~compileall.compile_path` can now accept an " +"integer value indicating the level of output suppression. (Contributed by " +"Thomas Kluyver in :issue:`21338`.)" msgstr "" #: ../../whatsnew/3.5.rst:976 @@ -1573,10 +1573,10 @@ msgstr "configparser" #: ../../whatsnew/3.5.rst:991 msgid "" ":mod:`configparser` now provides a way to customize the conversion of values " -"by specifying a dictionary of converters in " -"the :class:`~configparser.ConfigParser` constructor, or by defining them as " -"methods in ``ConfigParser`` subclasses. Converters defined in a parser " -"instance are inherited by its section proxies." +"by specifying a dictionary of converters in the :class:`~configparser." +"ConfigParser` constructor, or by defining them as methods in " +"``ConfigParser`` subclasses. Converters defined in a parser instance are " +"inherited by its section proxies." msgstr "" #: ../../whatsnew/3.5.rst:997 @@ -1673,10 +1673,10 @@ msgstr "curses" #: ../../whatsnew/3.5.rst:1047 msgid "" -"The new :func:`~curses.update_lines_cols` function updates " -"the :data:`~curses.LINES` and :data:`~curses.COLS` module variables. This " -"is useful for detecting manual screen resizing. (Contributed by Arnon Yaari " -"in :issue:`4254`.)" +"The new :func:`~curses.update_lines_cols` function updates the :data:" +"`~curses.LINES` and :data:`~curses.COLS` module variables. This is useful " +"for detecting manual screen resizing. (Contributed by Arnon Yaari in :issue:" +"`4254`.)" msgstr "" #: ../../whatsnew/3.5.rst:1053 @@ -1686,8 +1686,8 @@ msgstr "dbm" #: ../../whatsnew/3.5.rst:1055 msgid "" ":func:`dumb.open ` always creates a new database when the " -"flag has the value ``\"n\"``. (Contributed by Claudiu Popa " -"in :issue:`18039`.)" +"flag has the value ``\"n\"``. (Contributed by Claudiu Popa in :issue:" +"`18039`.)" msgstr "" #: ../../whatsnew/3.5.rst:1060 @@ -1699,8 +1699,8 @@ msgid "" "The charset of HTML documents generated by :meth:`HtmlDiff.make_file() " "` can now be customized by using a new *charset* " "keyword-only argument. The default charset of HTML document changed from " -"``\"ISO-8859-1\"`` to ``\"utf-8\"``. (Contributed by Berker Peksag " -"in :issue:`2052`.)" +"``\"ISO-8859-1\"`` to ``\"utf-8\"``. (Contributed by Berker Peksag in :issue:" +"`2052`.)" msgstr "" #: ../../whatsnew/3.5.rst:1069 @@ -1734,10 +1734,9 @@ msgstr "doctest" #: ../../whatsnew/3.5.rst:1089 msgid "" -"The :func:`~doctest.DocTestSuite` function returns an " -"empty :class:`unittest.TestSuite` if *module* contains no docstrings, " -"instead of raising :exc:`ValueError`. (Contributed by Glenn Jones " -"in :issue:`15916`.)" +"The :func:`~doctest.DocTestSuite` function returns an empty :class:`unittest." +"TestSuite` if *module* contains no docstrings, instead of raising :exc:" +"`ValueError`. (Contributed by Glenn Jones in :issue:`15916`.)" msgstr "" #: ../../whatsnew/3.5.rst:1095 @@ -1746,20 +1745,19 @@ msgstr "email" #: ../../whatsnew/3.5.rst:1097 msgid "" -"A new policy option :attr:`Policy.mangle_from_ " -"` controls whether or not lines that start " -"with ``\"From \"`` in email bodies are prefixed with a ``\">\"`` character " -"by generators. The default is ``True`` for :attr:`~email.policy.compat32` " -"and ``False`` for all other policies. (Contributed by Milan Oberkirch " -"in :issue:`20098`.)" +"A new policy option :attr:`Policy.mangle_from_ ` controls whether or not lines that start with ``\"From \"`` " +"in email bodies are prefixed with a ``\">\"`` character by generators. The " +"default is ``True`` for :attr:`~email.policy.compat32` and ``False`` for all " +"other policies. (Contributed by Milan Oberkirch in :issue:`20098`.)" msgstr "" #: ../../whatsnew/3.5.rst:1103 msgid "" -"A new :meth:`Message.get_content_disposition() " -"` method provides easy access " -"to a canonical value for the :mailheader:`Content-Disposition` header. " -"(Contributed by Abhilash Raj in :issue:`21083`.)" +"A new :meth:`Message.get_content_disposition() ` method provides easy access to a canonical value " +"for the :mailheader:`Content-Disposition` header. (Contributed by Abhilash " +"Raj in :issue:`21083`.)" msgstr "" #: ../../whatsnew/3.5.rst:1109 @@ -1767,9 +1765,9 @@ msgid "" "A new policy option :attr:`EmailPolicy.utf8 ` " "can be set to ``True`` to encode email headers using the UTF-8 charset " "instead of using encoded words. This allows ``Messages`` to be formatted " -"according to :rfc:`6532` and used with an SMTP server that supports " -"the :rfc:`6531` ``SMTPUTF8`` extension. (Contributed by R. David Murray " -"in :issue:`24211`.)" +"according to :rfc:`6532` and used with an SMTP server that supports the :rfc:" +"`6531` ``SMTPUTF8`` extension. (Contributed by R. David Murray in :issue:" +"`24211`.)" msgstr "" #: ../../whatsnew/3.5.rst:1116 @@ -1813,10 +1811,10 @@ msgstr "faulthandler" #: ../../whatsnew/3.5.rst:1139 msgid "" -"The :func:`~faulthandler.enable`, :func:`~faulthandler.register`, :func:`~faulthandler.dump_traceback` " -"and :func:`~faulthandler.dump_traceback_later` functions now accept file " -"descriptors in addition to file-like objects. (Contributed by Wei Wu " -"in :issue:`23566`.)" +"The :func:`~faulthandler.enable`, :func:`~faulthandler.register`, :func:" +"`~faulthandler.dump_traceback` and :func:`~faulthandler." +"dump_traceback_later` functions now accept file descriptors in addition to " +"file-like objects. (Contributed by Wei Wu in :issue:`23566`.)" msgstr "" #: ../../whatsnew/3.5.rst:1147 @@ -1848,8 +1846,8 @@ msgstr "gzip" #: ../../whatsnew/3.5.rst:1167 msgid "" "The *mode* argument of the :class:`~gzip.GzipFile` constructor now accepts " -"``\"x\"`` to request exclusive creation. (Contributed by Tim Heaney " -"in :issue:`19222`.)" +"``\"x\"`` to request exclusive creation. (Contributed by Tim Heaney in :" +"issue:`19222`.)" msgstr "" #: ../../whatsnew/3.5.rst:1173 @@ -1903,11 +1901,10 @@ msgstr "http.client" #: ../../whatsnew/3.5.rst:1202 msgid "" -":meth:`HTTPConnection.getresponse() " -"` now raises " -"a :exc:`~http.client.RemoteDisconnected` exception when a remote server " -"connection is closed unexpectedly. Additionally, if " -"a :exc:`ConnectionError` (of which ``RemoteDisconnected`` is a subclass) is " +":meth:`HTTPConnection.getresponse() ` now raises a :exc:`~http.client.RemoteDisconnected` exception " +"when a remote server connection is closed unexpectedly. Additionally, if a :" +"exc:`ConnectionError` (of which ``RemoteDisconnected`` is a subclass) is " "raised, the client socket is now closed automatically, and will reconnect on " "the next request::" msgstr "" @@ -1943,10 +1940,10 @@ msgstr "idlelib 與 IDLE" #: ../../whatsnew/3.5.rst:1224 msgid "" "Since idlelib implements the IDLE shell and editor and is not intended for " -"import by other programs, it gets improvements with every release. " -"See :file:`Lib/idlelib/NEWS.txt` for a cumulative list of changes since " -"3.4.0, as well as changes made in future 3.5.x releases. This file is also " -"available from the IDLE :menuselection:`Help --> About IDLE` dialog." +"import by other programs, it gets improvements with every release. See :" +"file:`Lib/idlelib/NEWS.txt` for a cumulative list of changes since 3.4.0, as " +"well as changes made in future 3.5.x releases. This file is also available " +"from the IDLE :menuselection:`Help --> About IDLE` dialog." msgstr "" #: ../../whatsnew/3.5.rst:1232 @@ -1963,12 +1960,12 @@ msgstr "" #: ../../whatsnew/3.5.rst:1239 msgid "" -"The :mod:`imaplib` module now supports :rfc:`5161` (ENABLE Extension) " -"and :rfc:`6855` (UTF-8 Support) via the :meth:`IMAP4.enable() " -"` method. A new :attr:`IMAP4.utf8_enabled " -"` attribute tracks whether or not :rfc:`6855` " -"support is enabled. (Contributed by Milan Oberkirch, R. David Murray, and " -"Maciej Szulik in :issue:`21800`.)" +"The :mod:`imaplib` module now supports :rfc:`5161` (ENABLE Extension) and :" +"rfc:`6855` (UTF-8 Support) via the :meth:`IMAP4.enable() ` method. A new :attr:`IMAP4.utf8_enabled ` attribute tracks whether or not :rfc:`6855` support is " +"enabled. (Contributed by Milan Oberkirch, R. David Murray, and Maciej Szulik " +"in :issue:`21800`.)" msgstr "" #: ../../whatsnew/3.5.rst:1246 @@ -1984,10 +1981,10 @@ msgstr "imghdr" #: ../../whatsnew/3.5.rst:1254 msgid "" -"The :func:`!what` function now recognizes the `OpenEXR `_ format (contributed by Martin Vignali and Claudiu Popa " -"in :issue:`20295`), and the `WebP `_ " -"format (contributed by Fabrice Aneche and Claudiu Popa in :issue:`20197`.)" +"The :func:`!what` function now recognizes the `OpenEXR `_ format (contributed by Martin Vignali and Claudiu Popa in :issue:" +"`20295`), and the `WebP `_ format " +"(contributed by Fabrice Aneche and Claudiu Popa in :issue:`20197`.)" msgstr "" #: ../../whatsnew/3.5.rst:1262 @@ -2003,11 +2000,11 @@ msgstr "" #: ../../whatsnew/3.5.rst:1268 msgid "" -"The :func:`abc.InspectLoader.source_to_code() " -"` method is now a static " -"method. This makes it easier to initialize a module object with code " -"compiled from a string by running ``exec(code, module.__dict__)``. " -"(Contributed by Brett Cannon in :issue:`21156`.)" +"The :func:`abc.InspectLoader.source_to_code() ` method is now a static method. This makes it easier to " +"initialize a module object with code compiled from a string by running " +"``exec(code, module.__dict__)``. (Contributed by Brett Cannon in :issue:" +"`21156`.)" msgstr "" #: ../../whatsnew/3.5.rst:1274 @@ -2026,15 +2023,15 @@ msgstr "inspect" #: ../../whatsnew/3.5.rst:1284 msgid "" "Both the :class:`~inspect.Signature` and :class:`~inspect.Parameter` classes " -"are now picklable and hashable. (Contributed by Yury Selivanov " -"in :issue:`20726` and :issue:`20334`.)" +"are now picklable and hashable. (Contributed by Yury Selivanov in :issue:" +"`20726` and :issue:`20334`.)" msgstr "" #: ../../whatsnew/3.5.rst:1288 msgid "" -"A new :meth:`BoundArguments.apply_defaults() " -"` method provides a way to set " -"default values for missing arguments::" +"A new :meth:`BoundArguments.apply_defaults() ` method provides a way to set default values for missing " +"arguments::" msgstr "" #: ../../whatsnew/3.5.rst:1292 @@ -2057,34 +2054,34 @@ msgstr "(由 Yury Selivanov 在 :issue:`24190` 中貢獻。)" #: ../../whatsnew/3.5.rst:1300 msgid "" -"A new class method :meth:`Signature.from_callable() " -"` makes subclassing " -"of :class:`~inspect.Signature` easier. (Contributed by Yury Selivanov and " -"Eric Snow in :issue:`17373`.)" +"A new class method :meth:`Signature.from_callable() ` makes subclassing of :class:`~inspect.Signature` easier. " +"(Contributed by Yury Selivanov and Eric Snow in :issue:`17373`.)" msgstr "" #: ../../whatsnew/3.5.rst:1305 msgid "" "The :func:`~inspect.signature` function now accepts a *follow_wrapped* " "optional keyword argument, which, when set to ``False``, disables automatic " -"following of ``__wrapped__`` links. (Contributed by Yury Selivanov " -"in :issue:`20691`.)" +"following of ``__wrapped__`` links. (Contributed by Yury Selivanov in :issue:" +"`20691`.)" msgstr "" #: ../../whatsnew/3.5.rst:1310 msgid "" "A set of new functions to inspect :term:`coroutine functions ` and :term:`coroutine objects ` has been " -"added: :func:`~inspect.iscoroutine`, :func:`~inspect.iscoroutinefunction`, :func:`~inspect.isawaitable`, :func:`~inspect.getcoroutinelocals`, " -"and :func:`~inspect.getcoroutinestate`. (Contributed by Yury Selivanov " -"in :issue:`24017` and :issue:`24400`.)" +"function>` and :term:`coroutine objects ` has been added: :func:" +"`~inspect.iscoroutine`, :func:`~inspect.iscoroutinefunction`, :func:" +"`~inspect.isawaitable`, :func:`~inspect.getcoroutinelocals`, and :func:" +"`~inspect.getcoroutinestate`. (Contributed by Yury Selivanov in :issue:" +"`24017` and :issue:`24400`.)" msgstr "" #: ../../whatsnew/3.5.rst:1318 msgid "" -"The :func:`~inspect.stack`, :func:`~inspect.trace`, :func:`~inspect.getouterframes`, " -"and :func:`~inspect.getinnerframes` functions now return a list of named " -"tuples. (Contributed by Daniel Shahaf in :issue:`16808`.)" +"The :func:`~inspect.stack`, :func:`~inspect.trace`, :func:`~inspect." +"getouterframes`, and :func:`~inspect.getinnerframes` functions now return a " +"list of named tuples. (Contributed by Daniel Shahaf in :issue:`16808`.)" msgstr "" #: ../../whatsnew/3.5.rst:1325 @@ -2094,10 +2091,10 @@ msgstr "io" #: ../../whatsnew/3.5.rst:1327 msgid "" "A new :meth:`BufferedIOBase.readinto1() ` " -"method, that uses at most one call to the underlying raw " -"stream's :meth:`RawIOBase.read() ` " -"or :meth:`RawIOBase.readinto() ` methods. " -"(Contributed by Nikolaus Rath in :issue:`20578`.)" +"method, that uses at most one call to the underlying raw stream's :meth:" +"`RawIOBase.read() ` or :meth:`RawIOBase.readinto() ` methods. (Contributed by Nikolaus Rath in :issue:" +"`20578`.)" msgstr "" #: ../../whatsnew/3.5.rst:1335 @@ -2131,9 +2128,9 @@ msgstr "(由 Peter Moody 和 Antoine Pitrou 在 :issue:`16531` 中貢獻。) #: ../../whatsnew/3.5.rst:1349 msgid "" -"A new :attr:`~ipaddress.IPv4Address.reverse_pointer` attribute for " -"the :class:`~ipaddress.IPv4Address` and :class:`~ipaddress.IPv6Address` " -"classes returns the name of the reverse DNS PTR record::" +"A new :attr:`~ipaddress.IPv4Address.reverse_pointer` attribute for the :" +"class:`~ipaddress.IPv4Address` and :class:`~ipaddress.IPv6Address` classes " +"returns the name of the reverse DNS PTR record::" msgstr "" #: ../../whatsnew/3.5.rst:1353 @@ -2166,14 +2163,14 @@ msgstr "json" msgid "" "The :mod:`json.tool` command line interface now preserves the order of keys " "in JSON objects passed in input. The new ``--sort-keys`` option can be used " -"to sort the keys alphabetically. (Contributed by Berker Peksag " -"in :issue:`21650`.)" +"to sort the keys alphabetically. (Contributed by Berker Peksag in :issue:" +"`21650`.)" msgstr "" #: ../../whatsnew/3.5.rst:1372 msgid "" -"JSON decoder now raises :exc:`~json.JSONDecodeError` instead " -"of :exc:`ValueError` to provide better context information about the error. " +"JSON decoder now raises :exc:`~json.JSONDecodeError` instead of :exc:" +"`ValueError` to provide better context information about the error. " "(Contributed by Serhiy Storchaka in :issue:`19361`.)" msgstr "" @@ -2233,10 +2230,10 @@ msgstr "logging" #: ../../whatsnew/3.5.rst:1409 msgid "" -"All logging methods " -"(:class:`~logging.Logger` :meth:`~logging.Logger.log`, :meth:`~logging.Logger.exception`, :meth:`~logging.Logger.critical`, :meth:`~logging.Logger.debug`, " -"etc.), now accept exception instances as an *exc_info* argument, in addition " -"to boolean values and exception tuples::" +"All logging methods (:class:`~logging.Logger` :meth:`~logging.Logger.log`, :" +"meth:`~logging.Logger.exception`, :meth:`~logging.Logger.critical`, :meth:" +"`~logging.Logger.debug`, etc.), now accept exception instances as an " +"*exc_info* argument, in addition to boolean values and exception tuples::" msgstr "" #: ../../whatsnew/3.5.rst:1415 @@ -2263,8 +2260,8 @@ msgstr "(由 Yury Selivanov 在 :issue:`20537` 中貢獻。)" msgid "" "The :class:`handlers.HTTPHandler ` class now " "accepts an optional :class:`ssl.SSLContext` instance to configure SSL " -"settings used in an HTTP connection. (Contributed by Alex Gaynor " -"in :issue:`22788`.)" +"settings used in an HTTP connection. (Contributed by Alex Gaynor in :issue:" +"`22788`.)" msgstr "" #: ../../whatsnew/3.5.rst:1429 @@ -2292,9 +2289,9 @@ msgstr "math" #: ../../whatsnew/3.5.rst:1447 msgid "" -"Two new constants have been added to the :mod:`math` " -"module: :data:`~math.inf` and :data:`~math.nan`. (Contributed by Mark " -"Dickinson in :issue:`23185`.)" +"Two new constants have been added to the :mod:`math` module: :data:`~math." +"inf` and :data:`~math.nan`. (Contributed by Mark Dickinson in :issue:" +"`23185`.)" msgstr "" #: ../../whatsnew/3.5.rst:1450 @@ -2318,10 +2315,9 @@ msgstr "multiprocessing" #: ../../whatsnew/3.5.rst:1461 msgid "" -":func:`sharedctypes.synchronized() " -"` objects now support " -"the :term:`context manager` protocol. (Contributed by Charles-François " -"Natali in :issue:`21565`.)" +":func:`sharedctypes.synchronized() ` objects now support the :term:`context manager` protocol. " +"(Contributed by Charles-François Natali in :issue:`21565`.)" msgstr "" #: ../../whatsnew/3.5.rst:1467 @@ -2330,16 +2326,16 @@ msgstr "operator" #: ../../whatsnew/3.5.rst:1469 msgid "" -":func:`~operator.attrgetter`, :func:`~operator.itemgetter`, " -"and :func:`~operator.methodcaller` objects now support pickling. " -"(Contributed by Josh Rosenberg and Serhiy Storchaka in :issue:`22955`.)" +":func:`~operator.attrgetter`, :func:`~operator.itemgetter`, and :func:" +"`~operator.methodcaller` objects now support pickling. (Contributed by Josh " +"Rosenberg and Serhiy Storchaka in :issue:`22955`.)" msgstr "" #: ../../whatsnew/3.5.rst:1473 msgid "" "New :func:`~operator.matmul` and :func:`~operator.imatmul` functions to " -"perform matrix multiplication. (Contributed by Benjamin Peterson " -"in :issue:`21176`.)" +"perform matrix multiplication. (Contributed by Benjamin Peterson in :issue:" +"`21176`.)" msgstr "" #: ../../whatsnew/3.5.rst:1479 @@ -2348,22 +2344,21 @@ msgstr "os" #: ../../whatsnew/3.5.rst:1481 msgid "" -"The new :func:`~os.scandir` function returning an iterator " -"of :class:`~os.DirEntry` objects has been added. If " -"possible, :func:`~os.scandir` extracts file attributes while scanning a " -"directory, removing the need to perform subsequent system calls to determine " -"file type or attributes, which may significantly improve performance. " -"(Contributed by Ben Hoyt with the help of Victor Stinner in :issue:`22524`.)" +"The new :func:`~os.scandir` function returning an iterator of :class:`~os." +"DirEntry` objects has been added. If possible, :func:`~os.scandir` extracts " +"file attributes while scanning a directory, removing the need to perform " +"subsequent system calls to determine file type or attributes, which may " +"significantly improve performance. (Contributed by Ben Hoyt with the help " +"of Victor Stinner in :issue:`22524`.)" msgstr "" #: ../../whatsnew/3.5.rst:1488 msgid "" -"On Windows, a new :attr:`stat_result.st_file_attributes " -"` attribute is now available. It " -"corresponds to the ``dwFileAttributes`` member of the " -"``BY_HANDLE_FILE_INFORMATION`` structure returned by " -"``GetFileInformationByHandle()``. (Contributed by Ben Hoyt " -"in :issue:`21719`.)" +"On Windows, a new :attr:`stat_result.st_file_attributes ` attribute is now available. It corresponds to the " +"``dwFileAttributes`` member of the ``BY_HANDLE_FILE_INFORMATION`` structure " +"returned by ``GetFileInformationByHandle()``. (Contributed by Ben Hoyt in :" +"issue:`21719`.)" msgstr "" #: ../../whatsnew/3.5.rst:1494 @@ -2377,8 +2372,8 @@ msgstr "" #: ../../whatsnew/3.5.rst:1499 msgid "" "New :func:`~os.get_blocking` and :func:`~os.set_blocking` functions allow " -"getting and setting a file descriptor's blocking mode " -"(:const:`~os.O_NONBLOCK`.) (Contributed by Victor Stinner in :issue:`22054`.)" +"getting and setting a file descriptor's blocking mode (:const:`~os." +"O_NONBLOCK`.) (Contributed by Victor Stinner in :issue:`22054`.)" msgstr "" #: ../../whatsnew/3.5.rst:1503 @@ -2392,8 +2387,8 @@ msgstr "" #: ../../whatsnew/3.5.rst:1506 msgid "" "There is a new :func:`os.path.commonpath` function returning the longest " -"common sub-path of each passed pathname. Unlike " -"the :func:`os.path.commonprefix` function, it always returns a valid path::" +"common sub-path of each passed pathname. Unlike the :func:`os.path." +"commonprefix` function, it always returns a valid path::" msgstr "" #: ../../whatsnew/3.5.rst:1511 @@ -2461,18 +2456,16 @@ msgstr "" msgid "" "A new :meth:`Path.home() ` class method can be used to " "get a :class:`~pathlib.Path` instance representing the user’s home " -"directory. (Contributed by Victor Salgado and Mayank Tripathi " -"in :issue:`19777`.)" +"directory. (Contributed by Victor Salgado and Mayank Tripathi in :issue:" +"`19777`.)" msgstr "" #: ../../whatsnew/3.5.rst:1548 msgid "" -"New :meth:`Path.write_text() " -"`, :meth:`Path.read_text() " -"`, :meth:`Path.write_bytes() " -"`, :meth:`Path.read_bytes() " -"` methods to simplify read/write operations on " -"files." +"New :meth:`Path.write_text() `, :meth:`Path." +"read_text() `, :meth:`Path.write_bytes() `, :meth:`Path.read_bytes() ` " +"methods to simplify read/write operations on files." msgstr "" #: ../../whatsnew/3.5.rst:1554 @@ -2565,10 +2558,11 @@ msgstr "" #: ../../whatsnew/3.5.rst:1604 msgid "" -"The :class:`re.error ` exceptions have new " -"attributes, :attr:`~re.PatternError.msg`, :attr:`~re.PatternError.pattern`, :attr:`~re.PatternError.pos`, :attr:`~re.PatternError.lineno`, " -"and :attr:`~re.PatternError.colno`, that provide better context information " -"about the error::" +"The :class:`re.error ` exceptions have new attributes, :" +"attr:`~re.PatternError.msg`, :attr:`~re.PatternError.pattern`, :attr:`~re." +"PatternError.pos`, :attr:`~re.PatternError.lineno`, and :attr:`~re." +"PatternError.colno`, that provide better context information about the " +"error::" msgstr "" #: ../../whatsnew/3.5.rst:1610 @@ -2670,9 +2664,9 @@ msgstr "" #: ../../whatsnew/3.5.rst:1676 msgid "" -"The :class:`!SMTPServer` class now advertises the ``8BITMIME`` extension " -"(:rfc:`6152`) if *decode_data* has been set ``True``. If the client " -"specifies ``BODY=8BITMIME`` on the ``MAIL`` command, it is passed to :meth:`!" +"The :class:`!SMTPServer` class now advertises the ``8BITMIME`` extension (:" +"rfc:`6152`) if *decode_data* has been set ``True``. If the client specifies " +"``BODY=8BITMIME`` on the ``MAIL`` command, it is passed to :meth:`!" "SMTPServer.process_message` via the *mail_options* keyword. (Contributed by " "Milan Oberkirch and R. David Murray in :issue:`21795`.)" msgstr "" @@ -2709,16 +2703,16 @@ msgstr "" msgid "" "The :meth:`SMTP.set_debuglevel() ` method now " "accepts an additional debuglevel (2), which enables timestamps in debug " -"messages. (Contributed by Gavin Chappell and Maciej Szulik " -"in :issue:`16914`.)" +"messages. (Contributed by Gavin Chappell and Maciej Szulik in :issue:" +"`16914`.)" msgstr "" #: ../../whatsnew/3.5.rst:1707 msgid "" -"Both the :meth:`SMTP.sendmail() ` " -"and :meth:`SMTP.send_message() ` methods now " -"support :rfc:`6531` (SMTPUTF8). (Contributed by Milan Oberkirch and R. David " -"Murray in :issue:`22027`.)" +"Both the :meth:`SMTP.sendmail() ` and :meth:`SMTP." +"send_message() ` methods now support :rfc:`6531` " +"(SMTPUTF8). (Contributed by Milan Oberkirch and R. David Murray in :issue:" +"`22027`.)" msgstr "" #: ../../whatsnew/3.5.rst:1714 @@ -2727,9 +2721,8 @@ msgstr "sndhdr" #: ../../whatsnew/3.5.rst:1716 msgid "" -"The :func:`!what` and :func:`!whathdr` functions now return " -"a :func:`~collections.namedtuple`. (Contributed by Claudiu Popa " -"in :issue:`18615`.)" +"The :func:`!what` and :func:`!whathdr` functions now return a :func:" +"`~collections.namedtuple`. (Contributed by Claudiu Popa in :issue:`18615`.)" msgstr "" #: ../../whatsnew/3.5.rst:1722 @@ -2745,10 +2738,10 @@ msgstr "" #: ../../whatsnew/3.5.rst:1727 msgid "" "A new :meth:`socket.sendfile() ` method allows " -"sending a file over a socket by using the high-" -"performance :func:`os.sendfile` function on UNIX, resulting in uploads being " -"from 2 to 3 times faster than when using plain :meth:`socket.send() " -"`. (Contributed by Giampaolo Rodola' in :issue:`17552`.)" +"sending a file over a socket by using the high-performance :func:`os." +"sendfile` function on UNIX, resulting in uploads being from 2 to 3 times " +"faster than when using plain :meth:`socket.send() `. " +"(Contributed by Giampaolo Rodola' in :issue:`17552`.)" msgstr "" #: ../../whatsnew/3.5.rst:1733 @@ -2762,9 +2755,9 @@ msgstr "" #: ../../whatsnew/3.5.rst:1738 msgid "" "The *backlog* argument of the :meth:`socket.listen() ` " -"method is now optional. By default it is set to :data:`SOMAXCONN " -"` or to ``128``, whichever is less. (Contributed by " -"Charles-François Natali in :issue:`21455`.)" +"method is now optional. By default it is set to :data:`SOMAXCONN ` or to ``128``, whichever is less. (Contributed by Charles-" +"François Natali in :issue:`21455`.)" msgstr "" #: ../../whatsnew/3.5.rst:1745 @@ -2782,12 +2775,11 @@ msgstr "(由 Geert Jansen 在 :issue:`21965` 中貢獻。)" #: ../../whatsnew/3.5.rst:1754 msgid "" "The new :class:`~ssl.SSLObject` class has been added to provide SSL protocol " -"support for cases when the network I/O capabilities " -"of :class:`~ssl.SSLSocket` are not necessary or are suboptimal. " -"``SSLObject`` represents an SSL protocol instance, but does not implement " -"any network I/O methods, and instead provides a memory buffer interface. " -"The new :class:`~ssl.MemoryBIO` class can be used to pass data between " -"Python and an SSL protocol instance." +"support for cases when the network I/O capabilities of :class:`~ssl." +"SSLSocket` are not necessary or are suboptimal. ``SSLObject`` represents an " +"SSL protocol instance, but does not implement any network I/O methods, and " +"instead provides a memory buffer interface. The new :class:`~ssl.MemoryBIO` " +"class can be used to pass data between Python and an SSL protocol instance." msgstr "" #: ../../whatsnew/3.5.rst:1761 @@ -2814,23 +2806,23 @@ msgstr "(由 Benjamin Peterson 在 :issue:`20188` 中貢獻。)" #: ../../whatsnew/3.5.rst:1774 msgid "" "Where OpenSSL support is present, the :mod:`ssl` module now implements the " -"*Application-Layer Protocol Negotiation* TLS extension as described " -"in :rfc:`7301`." +"*Application-Layer Protocol Negotiation* TLS extension as described in :rfc:" +"`7301`." msgstr "" #: ../../whatsnew/3.5.rst:1778 msgid "" -"The new :meth:`SSLContext.set_alpn_protocols() " -"` can be used to specify which protocols " -"a socket should advertise during the TLS handshake." +"The new :meth:`SSLContext.set_alpn_protocols() ` can be used to specify which protocols a socket should " +"advertise during the TLS handshake." msgstr "" #: ../../whatsnew/3.5.rst:1782 msgid "" -"The new :meth:`SSLSocket.selected_alpn_protocol() " -"` returns the protocol that was " -"selected during the TLS handshake. The :const:`~ssl.HAS_ALPN` flag indicates " -"whether ALPN support is present." +"The new :meth:`SSLSocket.selected_alpn_protocol() ` returns the protocol that was selected during the " +"TLS handshake. The :const:`~ssl.HAS_ALPN` flag indicates whether ALPN " +"support is present." msgstr "" #: ../../whatsnew/3.5.rst:1789 @@ -2840,23 +2832,22 @@ msgstr "其他變更" #: ../../whatsnew/3.5.rst:1791 msgid "" "There is a new :meth:`SSLSocket.version() ` method to " -"query the actual protocol version in use. (Contributed by Antoine Pitrou " -"in :issue:`20421`.)" +"query the actual protocol version in use. (Contributed by Antoine Pitrou in :" +"issue:`20421`.)" msgstr "" #: ../../whatsnew/3.5.rst:1795 msgid "" -"The :class:`~ssl.SSLSocket` class now implements a :meth:`!" -"SSLSocket.sendfile` method. (Contributed by Giampaolo Rodola' " -"in :issue:`17552`.)" +"The :class:`~ssl.SSLSocket` class now implements a :meth:`!SSLSocket." +"sendfile` method. (Contributed by Giampaolo Rodola' in :issue:`17552`.)" msgstr "" #: ../../whatsnew/3.5.rst:1799 msgid "" -"The :meth:`!SSLSocket.send` method now raises either " -"the :exc:`ssl.SSLWantReadError` or :exc:`ssl.SSLWantWriteError` exception on " -"a non-blocking socket if the operation would block. Previously, it would " -"return ``0``. (Contributed by Nikolaus Rath in :issue:`20951`.)" +"The :meth:`!SSLSocket.send` method now raises either the :exc:`ssl." +"SSLWantReadError` or :exc:`ssl.SSLWantWriteError` exception on a non-" +"blocking socket if the operation would block. Previously, it would return " +"``0``. (Contributed by Nikolaus Rath in :issue:`20951`.)" msgstr "" #: ../../whatsnew/3.5.rst:1804 @@ -2870,19 +2861,18 @@ msgstr "" msgid "" "New :meth:`!SSLObject.shared_ciphers` and :meth:`SSLSocket.shared_ciphers() " "` methods return the list of ciphers sent by " -"the client during the handshake. (Contributed by Benjamin Peterson " -"in :issue:`23186`.)" +"the client during the handshake. (Contributed by Benjamin Peterson in :issue:" +"`23186`.)" msgstr "" #: ../../whatsnew/3.5.rst:1813 msgid "" -"The :meth:`SSLSocket.do_handshake() " -"`, :meth:`SSLSocket.read() " -"`, :meth:`!SSLSocket.shutdown`, " -"and :meth:`SSLSocket.write() ` methods of " -"the :class:`~ssl.SSLSocket` class no longer reset the socket timeout every " -"time bytes are received or sent. The socket timeout is now the maximum total " -"duration of the method. (Contributed by Victor Stinner in :issue:`23853`.)" +"The :meth:`SSLSocket.do_handshake() `, :meth:" +"`SSLSocket.read() `, :meth:`!SSLSocket.shutdown`, and :" +"meth:`SSLSocket.write() ` methods of the :class:`~ssl." +"SSLSocket` class no longer reset the socket timeout every time bytes are " +"received or sent. The socket timeout is now the maximum total duration of " +"the method. (Contributed by Victor Stinner in :issue:`23853`.)" msgstr "" #: ../../whatsnew/3.5.rst:1821 @@ -2890,8 +2880,8 @@ msgid "" "The :func:`!match_hostname` function now supports matching of IP addresses. " "(Contributed by Antoine Pitrou in :issue:`23239`.)" msgstr "" -":func:`!match_hostname` 函式現在支援 IP 位址的比對。(由 Antoine Pitrou " -"在 :issue:`23239` 中貢獻。)" +":func:`!match_hostname` 函式現在支援 IP 位址的比對。(由 Antoine Pitrou 在 :" +"issue:`23239` 中貢獻。)" #: ../../whatsnew/3.5.rst:1826 msgid "sqlite3" @@ -2918,11 +2908,10 @@ msgid "" "does not need to maintain compatibility with earlier Python versions. " "(Contributed by Thomas Kluyver in :issue:`23342`.)" msgstr "" -"新增 :func:`~subprocess.run` 函式。它運行指定的命令並回傳一" -"個 :class:`~subprocess.CompletedProcess` 物件,該物件描述了一個已完成的行程。" -"新的 API 更加一致,並且是以較為推薦方法來叫用子行程,適用於不需要與早期 " -"Python 版本保持相容性的 Python 程式碼。(由 Thomas Kluyver 在 :issue:`23342` " -"中貢獻。)" +"新增 :func:`~subprocess.run` 函式。它運行指定的命令並回傳一個 :class:" +"`~subprocess.CompletedProcess` 物件,該物件描述了一個已完成的行程。新的 API " +"更加一致,並且是以較為推薦方法來叫用子行程,適用於不需要與早期 Python 版本保" +"持相容性的 Python 程式碼。(由 Thomas Kluyver 在 :issue:`23342` 中貢獻。)" #: ../../whatsnew/3.5.rst:1849 msgid "" @@ -2980,8 +2969,8 @@ msgstr "sysconfig" #: ../../whatsnew/3.5.rst:1881 msgid "" "The name of the user scripts directory on Windows now includes the first two " -"components of the Python version. (Contributed by Paul Moore " -"in :issue:`23437`.)" +"components of the Python version. (Contributed by Paul Moore in :issue:" +"`23437`.)" msgstr "" #: ../../whatsnew/3.5.rst:1887 @@ -2991,16 +2980,16 @@ msgstr "tarfile" #: ../../whatsnew/3.5.rst:1889 msgid "" "The *mode* argument of the :func:`~tarfile.open` function now accepts " -"``\"x\"`` to request exclusive creation. (Contributed by Berker Peksag " -"in :issue:`21717`.)" +"``\"x\"`` to request exclusive creation. (Contributed by Berker Peksag in :" +"issue:`21717`.)" msgstr "" #: ../../whatsnew/3.5.rst:1892 msgid "" -"The :meth:`TarFile.extractall() ` " -"and :meth:`TarFile.extract() ` methods now take a " -"keyword argument *numeric_owner*. If set to ``True``, the extracted files " -"and directories will be owned by the numeric ``uid`` and ``gid`` from the " +"The :meth:`TarFile.extractall() ` and :meth:" +"`TarFile.extract() ` methods now take a keyword " +"argument *numeric_owner*. If set to ``True``, the extracted files and " +"directories will be owned by the numeric ``uid`` and ``gid`` from the " "tarfile. If set to ``False`` (the default, and the behavior in versions " "prior to 3.5), they will be owned by the named user and group in the " "tarfile. (Contributed by Michael Vogt and Eric Smith in :issue:`23193`.)" @@ -3020,10 +3009,9 @@ msgstr "threading" #: ../../whatsnew/3.5.rst:1909 msgid "" -"Both the :meth:`Lock.acquire() ` " -"and :meth:`RLock.acquire() ` methods now use a " -"monotonic clock for timeout management. (Contributed by Victor Stinner " -"in :issue:`22043`.)" +"Both the :meth:`Lock.acquire() ` and :meth:`RLock." +"acquire() ` methods now use a monotonic clock for " +"timeout management. (Contributed by Victor Stinner in :issue:`22043`.)" msgstr "" #: ../../whatsnew/3.5.rst:1916 @@ -3035,8 +3023,8 @@ msgid "" "The :func:`~time.monotonic` function is now always available. (Contributed " "by Victor Stinner in :issue:`22043`.)" msgstr "" -":func:`~time.monotonic` 函式現在總是可用的。(由 Victor Stinner " -"在 :issue:`22043` 中貢獻。)" +":func:`~time.monotonic` 函式現在總是可用的。(由 Victor Stinner 在 :issue:" +"`22043` 中貢獻。)" #: ../../whatsnew/3.5.rst:1923 msgid "timeit" @@ -3081,10 +3069,9 @@ msgstr "" #: ../../whatsnew/3.5.rst:1953 msgid "" -"New lightweight " -"classes: :class:`~traceback.TracebackException`, :class:`~traceback.StackSummary`, " -"and :class:`~traceback.FrameSummary`. (Contributed by Robert Collins " -"in :issue:`17911`.)" +"New lightweight classes: :class:`~traceback.TracebackException`, :class:" +"`~traceback.StackSummary`, and :class:`~traceback.FrameSummary`. " +"(Contributed by Robert Collins in :issue:`17911`.)" msgstr "" #: ../../whatsnew/3.5.rst:1957 @@ -3101,16 +3088,16 @@ msgstr "types" #: ../../whatsnew/3.5.rst:1965 msgid "" "A new :func:`~types.coroutine` function to transform :term:`generator " -"` and :class:`generator-like " -"` objects into :term:`awaitables `. " -"(Contributed by Yury Selivanov in :issue:`24017`.)" +"` and :class:`generator-like ` objects into :term:`awaitables `. (Contributed by " +"Yury Selivanov in :issue:`24017`.)" msgstr "" #: ../../whatsnew/3.5.rst:1971 msgid "" -"A new type called :class:`~types.CoroutineType`, which is used " -"for :term:`coroutine` objects created by :keyword:`async def` functions. " -"(Contributed by Yury Selivanov in :issue:`24400`.)" +"A new type called :class:`~types.CoroutineType`, which is used for :term:" +"`coroutine` objects created by :keyword:`async def` functions. (Contributed " +"by Yury Selivanov in :issue:`24400`.)" msgstr "" #: ../../whatsnew/3.5.rst:1977 @@ -3131,13 +3118,13 @@ msgstr "unittest" #: ../../whatsnew/3.5.rst:1986 msgid "" -"The :meth:`TestLoader.loadTestsFromModule() " -"` method now accepts a keyword-only " -"argument *pattern* which is passed to ``load_tests`` as the third argument. " -"Found packages are now checked for ``load_tests`` regardless of whether " -"their path matches *pattern*, because it is impossible for a package name to " -"match the default pattern. (Contributed by Robert Collins and Barry A. " -"Warsaw in :issue:`16662`.)" +"The :meth:`TestLoader.loadTestsFromModule() ` method now accepts a keyword-only argument *pattern* " +"which is passed to ``load_tests`` as the third argument. Found packages are " +"now checked for ``load_tests`` regardless of whether their path matches " +"*pattern*, because it is impossible for a package name to match the default " +"pattern. (Contributed by Robert Collins and Barry A. Warsaw in :issue:" +"`16662`.)" msgstr "" #: ../../whatsnew/3.5.rst:1993 @@ -3170,24 +3157,24 @@ msgstr "" #: ../../whatsnew/3.5.rst:2012 msgid "" -"A new :meth:`Mock.assert_not_called() " -"` method to check if the mock object " -"was called. (Contributed by Kushal Das in :issue:`21262`.)" +"A new :meth:`Mock.assert_not_called() ` method to check if the mock object was called. " +"(Contributed by Kushal Das in :issue:`21262`.)" msgstr "" #: ../../whatsnew/3.5.rst:2016 msgid "" -"The :class:`~unittest.mock.MagicMock` class now " -"supports :meth:`~object.__truediv__`, :meth:`~object.__divmod__` " -"and :meth:`~object.__matmul__` operators. (Contributed by Johannes Baiter " -"in :issue:`20968`, and Håkan Lövdahl in :issue:`23581` and :issue:`23568`.)" +"The :class:`~unittest.mock.MagicMock` class now supports :meth:`~object." +"__truediv__`, :meth:`~object.__divmod__` and :meth:`~object.__matmul__` " +"operators. (Contributed by Johannes Baiter in :issue:`20968`, and Håkan " +"Lövdahl in :issue:`23581` and :issue:`23568`.)" msgstr "" #: ../../whatsnew/3.5.rst:2022 msgid "" -"It is no longer necessary to explicitly pass ``create=True`` to " -"the :func:`~unittest.mock.patch` function when patching builtin names. " -"(Contributed by Kushal Das in :issue:`17660`.)" +"It is no longer necessary to explicitly pass ``create=True`` to the :func:" +"`~unittest.mock.patch` function when patching builtin names. (Contributed by " +"Kushal Das in :issue:`17660`.)" msgstr "" #: ../../whatsnew/3.5.rst:2028 @@ -3196,38 +3183,35 @@ msgstr "urllib" #: ../../whatsnew/3.5.rst:2030 msgid "" -"A new :class:`request.HTTPPasswordMgrWithPriorAuth " -"` class allows HTTP Basic " -"Authentication credentials to be managed so as to eliminate unnecessary " -"``401`` response handling, or to unconditionally send credentials on the " -"first request in order to communicate with servers that return a ``404`` " -"response instead of a ``401`` if the ``Authorization`` header is not sent. " -"(Contributed by Matej Cepl in :issue:`19494` and Akshit Khurana " -"in :issue:`7159`.)" +"A new :class:`request.HTTPPasswordMgrWithPriorAuth ` class allows HTTP Basic Authentication " +"credentials to be managed so as to eliminate unnecessary ``401`` response " +"handling, or to unconditionally send credentials on the first request in " +"order to communicate with servers that return a ``404`` response instead of " +"a ``401`` if the ``Authorization`` header is not sent. (Contributed by Matej " +"Cepl in :issue:`19494` and Akshit Khurana in :issue:`7159`.)" msgstr "" #: ../../whatsnew/3.5.rst:2039 msgid "" -"A new *quote_via* argument for the :func:`parse.urlencode() " -"` function provides a way to control the encoding of " -"query parts if needed. (Contributed by Samwyse and Arnon Yaari " -"in :issue:`13866`.)" +"A new *quote_via* argument for the :func:`parse.urlencode() ` function provides a way to control the encoding of query parts " +"if needed. (Contributed by Samwyse and Arnon Yaari in :issue:`13866`.)" msgstr "" #: ../../whatsnew/3.5.rst:2044 msgid "" -"The :func:`request.urlopen() ` function accepts " -"an :class:`ssl.SSLContext` object as a *context* argument, which will be " -"used for the HTTPS connection. (Contributed by Alex Gaynor " -"in :issue:`22366`.)" +"The :func:`request.urlopen() ` function accepts an :" +"class:`ssl.SSLContext` object as a *context* argument, which will be used " +"for the HTTPS connection. (Contributed by Alex Gaynor in :issue:`22366`.)" msgstr "" #: ../../whatsnew/3.5.rst:2048 msgid "" -"The :func:`parse.urljoin() ` was updated to use " -"the :rfc:`3986` semantics for the resolution of relative URLs, rather " -"than :rfc:`1808` and :rfc:`2396`. (Contributed by Demian Brecht and Senthil " -"Kumaran in :issue:`22118`.)" +"The :func:`parse.urljoin() ` was updated to use the :" +"rfc:`3986` semantics for the resolution of relative URLs, rather than :rfc:" +"`1808` and :rfc:`2396`. (Contributed by Demian Brecht and Senthil Kumaran " +"in :issue:`22118`.)" msgstr "" #: ../../whatsnew/3.5.rst:2055 @@ -3236,9 +3220,9 @@ msgstr "wsgiref" #: ../../whatsnew/3.5.rst:2057 msgid "" -"The *headers* argument of the :class:`headers.Headers " -"` class constructor is now optional. (Contributed " -"by Pablo Torres Navarrete and SilentGhost in :issue:`5800`.)" +"The *headers* argument of the :class:`headers.Headers ` class constructor is now optional. (Contributed by Pablo Torres " +"Navarrete and SilentGhost in :issue:`5800`.)" msgstr "" #: ../../whatsnew/3.5.rst:2063 @@ -3265,9 +3249,9 @@ msgstr "xml.sax" #: ../../whatsnew/3.5.rst:2077 msgid "" -"SAX parsers now support a character stream of " -"the :class:`xmlreader.InputSource ` object. " -"(Contributed by Serhiy Storchaka in :issue:`2175`.)" +"SAX parsers now support a character stream of the :class:`xmlreader." +"InputSource ` object. (Contributed by Serhiy " +"Storchaka in :issue:`2175`.)" msgstr "" #: ../../whatsnew/3.5.rst:2081 @@ -3301,10 +3285,10 @@ msgstr "其他模組層級的變更" #: ../../whatsnew/3.5.rst:2099 msgid "" -"Many functions in the :mod:`mmap`, :mod:`!" -"ossaudiodev`, :mod:`socket`, :mod:`ssl`, and :mod:`codecs` modules now " -"accept writable :term:`bytes-like objects `. (Contributed " -"by Serhiy Storchaka in :issue:`23001`.)" +"Many functions in the :mod:`mmap`, :mod:`!ossaudiodev`, :mod:`socket`, :mod:" +"`ssl`, and :mod:`codecs` modules now accept writable :term:`bytes-like " +"objects `. (Contributed by Serhiy Storchaka in :issue:" +"`23001`.)" msgstr "" #: ../../whatsnew/3.5.rst:2106 @@ -3314,9 +3298,9 @@ msgstr "最佳化" #: ../../whatsnew/3.5.rst:2108 msgid "" "The :func:`os.walk` function has been sped up by 3 to 5 times on POSIX " -"systems, and by 7 to 20 times on Windows. This was done using the " -"new :func:`os.scandir` function, which exposes file information from the " -"underlying ``readdir`` or ``FindFirstFile``/``FindNextFile`` system calls. " +"systems, and by 7 to 20 times on Windows. This was done using the new :func:" +"`os.scandir` function, which exposes file information from the underlying " +"``readdir`` or ``FindFirstFile``/``FindNextFile`` system calls. " "(Contributed by Ben Hoyt with help from Victor Stinner in :issue:`23605`.)" msgstr "" @@ -3324,18 +3308,19 @@ msgstr "" msgid "" "Construction of ``bytes(int)`` (filled by zero bytes) is faster and uses " "less memory for large objects. ``calloc()`` is used instead of ``malloc()`` " -"to allocate memory for these objects. (Contributed by Victor Stinner " -"in :issue:`21233`.)" +"to allocate memory for these objects. (Contributed by Victor Stinner in :" +"issue:`21233`.)" msgstr "" #: ../../whatsnew/3.5.rst:2119 msgid "" -"Some operations on :mod:`ipaddress` :class:`~ipaddress.IPv4Network` " -"and :class:`~ipaddress.IPv6Network` have been massively sped up, such " -"as :meth:`~ipaddress.IPv4Network.subnets`, :meth:`~ipaddress.IPv4Network.supernet`, :func:`~ipaddress.summarize_address_range`, :func:`~ipaddress.collapse_addresses`. " -"The speed up can range from 3 to 15 times. (Contributed by Antoine Pitrou, " -"Michel Albert, and Markus " -"in :issue:`21486`, :issue:`21487`, :issue:`20826`, :issue:`23266`.)" +"Some operations on :mod:`ipaddress` :class:`~ipaddress.IPv4Network` and :" +"class:`~ipaddress.IPv6Network` have been massively sped up, such as :meth:" +"`~ipaddress.IPv4Network.subnets`, :meth:`~ipaddress.IPv4Network.supernet`, :" +"func:`~ipaddress.summarize_address_range`, :func:`~ipaddress." +"collapse_addresses`. The speed up can range from 3 to 15 times. (Contributed " +"by Antoine Pitrou, Michel Albert, and Markus in :issue:`21486`, :issue:" +"`21487`, :issue:`20826`, :issue:`23266`.)" msgstr "" #: ../../whatsnew/3.5.rst:2127 @@ -3347,16 +3332,16 @@ msgstr "" #: ../../whatsnew/3.5.rst:2130 msgid "" "Many operations on :class:`io.BytesIO` are now 50% to 100% faster. " -"(Contributed by Serhiy Storchaka in :issue:`15381` and David Wilson " -"in :issue:`22003`.)" +"(Contributed by Serhiy Storchaka in :issue:`15381` and David Wilson in :" +"issue:`22003`.)" msgstr "" #: ../../whatsnew/3.5.rst:2134 msgid "" "The :func:`marshal.dumps` function is now faster: 65--85% with versions 3 " "and 4, 20--25% with versions 0 to 2 on typical data, and up to 5 times in " -"best cases. (Contributed by Serhiy Storchaka in :issue:`20416` " -"and :issue:`23344`.)" +"best cases. (Contributed by Serhiy Storchaka in :issue:`20416` and :issue:" +"`23344`.)" msgstr "" #: ../../whatsnew/3.5.rst:2139 @@ -3381,16 +3366,16 @@ msgstr "" #: ../../whatsnew/3.5.rst:2149 msgid "" "The :c:func:`PyObject_IsInstance` and :c:func:`PyObject_IsSubclass` " -"functions have been sped up in the common case that the second argument " -"has :class:`type` as its metaclass. (Contributed Georg Brandl by " -"in :issue:`22540`.)" +"functions have been sped up in the common case that the second argument has :" +"class:`type` as its metaclass. (Contributed Georg Brandl by in :issue:" +"`22540`.)" msgstr "" #: ../../whatsnew/3.5.rst:2154 msgid "" "Method caching was slightly improved, yielding up to 5% performance " -"improvement in some benchmarks. (Contributed by Antoine Pitrou " -"in :issue:`22847`.)" +"improvement in some benchmarks. (Contributed by Antoine Pitrou in :issue:" +"`22847`.)" msgstr "" #: ../../whatsnew/3.5.rst:2158 @@ -3410,16 +3395,15 @@ msgid "" "Instantiation of :class:`fractions.Fraction` is now up to 30% faster. " "(Contributed by Stefan Behnel in :issue:`22464`.)" msgstr "" -":class:`fractions.Fraction` 的實例化現在快了 30%。(由 Stefan Behnel " -"在 :issue:`22464` 中貢獻。)" +":class:`fractions.Fraction` 的實例化現在快了 30%。(由 Stefan Behnel 在 :" +"issue:`22464` 中貢獻。)" #: ../../whatsnew/3.5.rst:2167 msgid "" -"String " -"methods :meth:`~str.find`, :meth:`~str.rfind`, :meth:`~str.split`, :meth:`~str.partition` " -"and the :keyword:`in` string operator are now significantly faster for " -"searching 1-character substrings. (Contributed by Serhiy Storchaka " -"in :issue:`23573`.)" +"String methods :meth:`~str.find`, :meth:`~str.rfind`, :meth:`~str.split`, :" +"meth:`~str.partition` and the :keyword:`in` string operator are now " +"significantly faster for searching 1-character substrings. (Contributed by " +"Serhiy Storchaka in :issue:`23573`.)" msgstr "" #: ../../whatsnew/3.5.rst:2174 @@ -3465,15 +3449,15 @@ msgstr "(由 Victor Stinner 在 :issue:`18395` 中貢獻。)" #: ../../whatsnew/3.5.rst:2191 msgid "" "A new :c:func:`PyCodec_NameReplaceErrors` function to replace the unicode " -"encode error with ``\\N{...}`` escapes. (Contributed by Serhiy Storchaka " -"in :issue:`19676`.)" +"encode error with ``\\N{...}`` escapes. (Contributed by Serhiy Storchaka in :" +"issue:`19676`.)" msgstr "" #: ../../whatsnew/3.5.rst:2195 msgid "" "A new :c:func:`PyErr_FormatV` function similar to :c:func:`PyErr_Format`, " -"but accepts a :c:type:`va_list` argument. (Contributed by Antoine Pitrou " -"in :issue:`18711`.)" +"but accepts a :c:type:`va_list` argument. (Contributed by Antoine Pitrou in :" +"issue:`18711`.)" msgstr "" #: ../../whatsnew/3.5.rst:2199 @@ -3481,23 +3465,23 @@ msgid "" "A new :c:data:`PyExc_RecursionError` exception. (Contributed by Georg Brandl " "in :issue:`19235`.)" msgstr "" -"新增 :c:data:`PyExc_RecursionError` 例外。(由 Georg Brandl " -"在 :issue:`19235` 中貢獻。)" +"新增 :c:data:`PyExc_RecursionError` 例外。(由 Georg Brandl 在 :issue:" +"`19235` 中貢獻。)" #: ../../whatsnew/3.5.rst:2202 msgid "" "New :c:func:`PyModule_FromDefAndSpec`, :c:func:`PyModule_FromDefAndSpec2`, " "and :c:func:`PyModule_ExecDef` functions introduced by :pep:`489` -- multi-" -"phase extension module initialization. (Contributed by Petr Viktorin " -"in :issue:`24268`.)" +"phase extension module initialization. (Contributed by Petr Viktorin in :" +"issue:`24268`.)" msgstr "" #: ../../whatsnew/3.5.rst:2207 msgid "" -"New :c:func:`PyNumber_MatrixMultiply` " -"and :c:func:`PyNumber_InPlaceMatrixMultiply` functions to perform matrix " -"multiplication. (Contributed by Benjamin Peterson in :issue:`21176`. See " -"also :pep:`465` for details.)" +"New :c:func:`PyNumber_MatrixMultiply` and :c:func:" +"`PyNumber_InPlaceMatrixMultiply` functions to perform matrix multiplication. " +"(Contributed by Benjamin Peterson in :issue:`21176`. See also :pep:`465` " +"for details.)" msgstr "" #: ../../whatsnew/3.5.rst:2213 @@ -3605,8 +3589,8 @@ msgstr "已棄用的 Python 行為" msgid "" "Raising the :exc:`StopIteration` exception inside a generator will now " "generate a silent :exc:`PendingDeprecationWarning`, which will become a non-" -"silent deprecation warning in Python 3.6 and will trigger " -"a :exc:`RuntimeError` in Python 3.7. See :ref:`PEP 479: Change StopIteration " +"silent deprecation warning in Python 3.6 and will trigger a :exc:" +"`RuntimeError` in Python 3.7. See :ref:`PEP 479: Change StopIteration " "handling inside generators ` for details." msgstr "" @@ -3632,8 +3616,8 @@ msgstr "" #: ../../whatsnew/3.5.rst:2296 msgid "" -"The :func:`!asyncio.async` function is deprecated in favor " -"of :func:`~asyncio.ensure_future`." +"The :func:`!asyncio.async` function is deprecated in favor of :func:" +"`~asyncio.ensure_future`." msgstr "" #: ../../whatsnew/3.5.rst:2299 @@ -3647,20 +3631,19 @@ msgstr "" #: ../../whatsnew/3.5.rst:2305 msgid "" -"Directly assigning values to " -"the :attr:`~http.cookies.Morsel.key`, :attr:`~http.cookies.Morsel.value` " -"and :attr:`~http.cookies.Morsel.coded_value` of :class:`http.cookies.Morsel` " -"objects is deprecated. Use the :meth:`~http.cookies.Morsel.set` method " -"instead. In addition, the undocumented *LegalChars* parameter " -"of :meth:`~http.cookies.Morsel.set` is deprecated, and is now ignored." +"Directly assigning values to the :attr:`~http.cookies.Morsel.key`, :attr:" +"`~http.cookies.Morsel.value` and :attr:`~http.cookies.Morsel.coded_value` " +"of :class:`http.cookies.Morsel` objects is deprecated. Use the :meth:`~http." +"cookies.Morsel.set` method instead. In addition, the undocumented " +"*LegalChars* parameter of :meth:`~http.cookies.Morsel.set` is deprecated, " +"and is now ignored." msgstr "" #: ../../whatsnew/3.5.rst:2312 msgid "" -"Passing a format string as keyword argument *format_string* to " -"the :meth:`~string.Formatter.format` method of the :class:`string.Formatter` " -"class has been deprecated. (Contributed by Serhiy Storchaka " -"in :issue:`23671`.)" +"Passing a format string as keyword argument *format_string* to the :meth:" +"`~string.Formatter.format` method of the :class:`string.Formatter` class has " +"been deprecated. (Contributed by Serhiy Storchaka in :issue:`23671`.)" msgstr "" #: ../../whatsnew/3.5.rst:2317 @@ -3674,9 +3657,9 @@ msgstr "" #: ../../whatsnew/3.5.rst:2322 msgid "" "The previously undocumented ``from_function`` and ``from_builtin`` methods " -"of :class:`inspect.Signature` are deprecated. Use the " -"new :meth:`Signature.from_callable() ` " -"method instead. (Contributed by Yury Selivanov in :issue:`24248`.)" +"of :class:`inspect.Signature` are deprecated. Use the new :meth:`Signature." +"from_callable() ` method instead. " +"(Contributed by Yury Selivanov in :issue:`24248`.)" msgstr "" #: ../../whatsnew/3.5.rst:2327 @@ -3687,10 +3670,10 @@ msgstr "" #: ../../whatsnew/3.5.rst:2330 msgid "" -"The :mod:`inspect` :func:`~inspect.getfullargspec`, :func:`~inspect.getcallargs`, " -"and :func:`!formatargspec` functions are deprecated in favor of " -"the :func:`inspect.signature` API. (Contributed by Yury Selivanov " -"in :issue:`20438`.)" +"The :mod:`inspect` :func:`~inspect.getfullargspec`, :func:`~inspect." +"getcallargs`, and :func:`!formatargspec` functions are deprecated in favor " +"of the :func:`inspect.signature` API. (Contributed by Yury Selivanov in :" +"issue:`20438`.)" msgstr "" #: ../../whatsnew/3.5.rst:2335 @@ -3715,10 +3698,10 @@ msgstr "" #: ../../whatsnew/3.5.rst:2346 msgid "" -"The undocumented and unofficial *use_load_tests* default argument of " -"the :meth:`unittest.TestLoader.loadTestsFromModule` method now is deprecated " -"and ignored. (Contributed by Robert Collins and Barry A. Warsaw " -"in :issue:`16662`.)" +"The undocumented and unofficial *use_load_tests* default argument of the :" +"meth:`unittest.TestLoader.loadTestsFromModule` method now is deprecated and " +"ignored. (Contributed by Robert Collins and Barry A. Warsaw in :issue:" +"`16662`.)" msgstr "" #: ../../whatsnew/3.5.rst:2353 @@ -3808,16 +3791,16 @@ msgstr "" msgid "" "Before Python 3.5, a :class:`datetime.time` object was considered to be " "false if it represented midnight in UTC. This behavior was considered " -"obscure and error-prone and has been removed in Python 3.5. " -"See :issue:`13936` for full details." +"obscure and error-prone and has been removed in Python 3.5. See :issue:" +"`13936` for full details." msgstr "" #: ../../whatsnew/3.5.rst:2408 msgid "" -"The :meth:`!ssl.SSLSocket.send` method now raises " -"either :exc:`ssl.SSLWantReadError` or :exc:`ssl.SSLWantWriteError` on a non-" -"blocking socket if the operation would block. Previously, it would return " -"``0``. (Contributed by Nikolaus Rath in :issue:`20951`.)" +"The :meth:`!ssl.SSLSocket.send` method now raises either :exc:`ssl." +"SSLWantReadError` or :exc:`ssl.SSLWantWriteError` on a non-blocking socket " +"if the operation would block. Previously, it would return ``0``. " +"(Contributed by Nikolaus Rath in :issue:`20951`.)" msgstr "" #: ../../whatsnew/3.5.rst:2413 @@ -3831,12 +3814,12 @@ msgstr "" #: ../../whatsnew/3.5.rst:2420 msgid "" -"The deprecated \"strict\" mode and argument " -"of :class:`~html.parser.HTMLParser`, :meth:`!HTMLParser.error`, and " -"the :exc:`!HTMLParserError` exception have been removed. (Contributed by " -"Ezio Melotti in :issue:`15114`.) The *convert_charrefs* argument " -"of :class:`~html.parser.HTMLParser` is now ``True`` by default. " -"(Contributed by Berker Peksag in :issue:`21047`.)" +"The deprecated \"strict\" mode and argument of :class:`~html.parser." +"HTMLParser`, :meth:`!HTMLParser.error`, and the :exc:`!HTMLParserError` " +"exception have been removed. (Contributed by Ezio Melotti in :issue:" +"`15114`.) The *convert_charrefs* argument of :class:`~html.parser." +"HTMLParser` is now ``True`` by default. (Contributed by Berker Peksag in :" +"issue:`21047`.)" msgstr "" #: ../../whatsnew/3.5.rst:2426 @@ -3850,11 +3833,11 @@ msgstr "" #: ../../whatsnew/3.5.rst:2432 msgid "" -"If the current directory is set to a directory that no longer exists " -"then :exc:`FileNotFoundError` will no longer be raised and " -"instead :meth:`~importlib.machinery.FileFinder.find_spec` will return " -"``None`` **without** caching ``None`` in :data:`sys.path_importer_cache`, " -"which is different than the typical case (:issue:`22834`)." +"If the current directory is set to a directory that no longer exists then :" +"exc:`FileNotFoundError` will no longer be raised and instead :meth:" +"`~importlib.machinery.FileFinder.find_spec` will return ``None`` **without** " +"caching ``None`` in :data:`sys.path_importer_cache`, which is different than " +"the typical case (:issue:`22834`)." msgstr "" #: ../../whatsnew/3.5.rst:2438 @@ -3889,29 +3872,28 @@ msgstr "" #: ../../whatsnew/3.5.rst:2459 msgid "" "The :class:`http.cookies.Morsel` dict-like interface has been made self " -"consistent: morsel comparison now takes " -"the :attr:`~http.cookies.Morsel.key` and :attr:`~http.cookies.Morsel.value` " -"into account, :meth:`~http.cookies.Morsel.copy` now results in " -"a :class:`~http.cookies.Morsel` instance rather than a :class:`dict`, " -"and :meth:`~http.cookies.Morsel.update` will now raise an exception if any " -"of the keys in the update dictionary are invalid. In addition, the " -"undocumented *LegalChars* parameter of :func:`~http.cookies.Morsel.set` is " -"deprecated and is now ignored. (Contributed by Demian Brecht " -"in :issue:`2211`.)" +"consistent: morsel comparison now takes the :attr:`~http.cookies.Morsel." +"key` and :attr:`~http.cookies.Morsel.value` into account, :meth:`~http." +"cookies.Morsel.copy` now results in a :class:`~http.cookies.Morsel` instance " +"rather than a :class:`dict`, and :meth:`~http.cookies.Morsel.update` will " +"now raise an exception if any of the keys in the update dictionary are " +"invalid. In addition, the undocumented *LegalChars* parameter of :func:" +"`~http.cookies.Morsel.set` is deprecated and is now ignored. (Contributed " +"by Demian Brecht in :issue:`2211`.)" msgstr "" #: ../../whatsnew/3.5.rst:2469 msgid "" ":pep:`488` has removed ``.pyo`` files from Python and introduced the " -"optional ``opt-`` tag in ``.pyc`` file names. " -"The :func:`importlib.util.cache_from_source` has gained an *optimization* " -"parameter to help control the ``opt-`` tag. Because of this, the " -"*debug_override* parameter of the function is now deprecated. ``.pyo`` files " -"are also no longer supported as a file argument to the Python interpreter " -"and thus serve no purpose when distributed on their own (i.e. sourceless " -"code distribution). Due to the fact that the magic number for bytecode has " -"changed in Python 3.5, all old ``.pyo`` files from previous versions of " -"Python are invalid regardless of this PEP." +"optional ``opt-`` tag in ``.pyc`` file names. The :func:`importlib.util." +"cache_from_source` has gained an *optimization* parameter to help control " +"the ``opt-`` tag. Because of this, the *debug_override* parameter of the " +"function is now deprecated. ``.pyo`` files are also no longer supported as a " +"file argument to the Python interpreter and thus serve no purpose when " +"distributed on their own (i.e. sourceless code distribution). Due to the " +"fact that the magic number for bytecode has changed in Python 3.5, all old " +"``.pyo`` files from previous versions of Python are invalid regardless of " +"this PEP." msgstr "" #: ../../whatsnew/3.5.rst:2480 @@ -3955,17 +3937,16 @@ msgid "" "duplicated if the inherited documentation is appropriate. To suppress an " "inherited string, an empty string must be specified (or the documentation " "may be filled in). This change affects the output of the :mod:`pydoc` " -"module and the :func:`help` function. (Contributed by Serhiy Storchaka " -"in :issue:`15582`.)" +"module and the :func:`help` function. (Contributed by Serhiy Storchaka in :" +"issue:`15582`.)" msgstr "" #: ../../whatsnew/3.5.rst:2507 msgid "" "Nested :func:`functools.partial` calls are now flattened. If you were " -"relying on the previous behavior, you can now either add an attribute to " -"a :func:`functools.partial` object or you can create a subclass " -"of :func:`functools.partial`. (Contributed by Alexander Belopolsky " -"in :issue:`7830`.)" +"relying on the previous behavior, you can now either add an attribute to a :" +"func:`functools.partial` object or you can create a subclass of :func:" +"`functools.partial`. (Contributed by Alexander Belopolsky in :issue:`7830`.)" msgstr "" #: ../../whatsnew/3.5.rst:2514 @@ -3981,8 +3962,8 @@ msgstr "" #: ../../whatsnew/3.5.rst:2521 msgid "" -"The :c:type:`!PyMemAllocator` structure was renamed " -"to :c:type:`PyMemAllocatorEx` and a new ``calloc`` field was added." +"The :c:type:`!PyMemAllocator` structure was renamed to :c:type:" +"`PyMemAllocatorEx` and a new ``calloc`` field was added." msgstr "" #: ../../whatsnew/3.5.rst:2524 @@ -3997,17 +3978,17 @@ msgstr "" msgid "" "Because the lack of the :attr:`~type.__module__` attribute breaks pickling " "and introspection, a deprecation warning is now raised for builtin types " -"without the :attr:`~type.__module__` attribute. This will be " -"an :exc:`AttributeError` in the future. (Contributed by Serhiy Storchaka " -"in :issue:`20204`.)" +"without the :attr:`~type.__module__` attribute. This will be an :exc:" +"`AttributeError` in the future. (Contributed by Serhiy Storchaka in :issue:" +"`20204`.)" msgstr "" #: ../../whatsnew/3.5.rst:2535 msgid "" -"As part of the :pep:`492` implementation, the ``tp_reserved`` slot " -"of :c:type:`PyTypeObject` was replaced with " -"a :c:member:`~PyTypeObject.tp_as_async` slot. Refer to :ref:`coro-objects` " -"for new types, structures and functions." +"As part of the :pep:`492` implementation, the ``tp_reserved`` slot of :c:" +"type:`PyTypeObject` was replaced with a :c:member:`~PyTypeObject." +"tp_as_async` slot. Refer to :ref:`coro-objects` for new types, structures " +"and functions." msgstr "" #: ../../whatsnew/3.5.rst:2542 @@ -4035,8 +4016,8 @@ msgstr "" #: ../../whatsnew/3.5.rst:2556 msgid "" -"More selective regeneration targets are also defined - " -"see :source:`Makefile.pre.in` for details." +"More selective regeneration targets are also defined - see :source:`Makefile." +"pre.in` for details." msgstr "" #: ../../whatsnew/3.5.rst:2559 ../../whatsnew/3.5.rst:2572