diff --git a/howto/enum.po b/howto/enum.po index cbddd1538c..b4df357415 100644 --- a/howto/enum.po +++ b/howto/enum.po @@ -1268,7 +1268,7 @@ msgstr "" #: ../../howto/enum.rst:657 msgid "The *start* parameter was added." -msgstr "" +msgstr "新增 *start* 參數。" #: ../../howto/enum.rst:662 msgid "Derived Enumerations" diff --git a/library/ast.po b/library/ast.po index 6100aef028..606599a2e3 100644 --- a/library/ast.po +++ b/library/ast.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-19 00:15+0000\n" +"POT-Creation-Date: 2025-12-30 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-" @@ -188,7 +188,7 @@ msgid "" "int? end_col_offset)\n" "\n" " arguments = (arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs,\n" -" expr* kw_defaults, arg? kwarg, expr* defaults)\n" +" expr?* kw_defaults, arg? kwarg, expr* defaults)\n" "\n" " arg = (identifier arg, expr? annotation, string? type_comment)\n" " attributes (int lineno, int col_offset, int? end_lineno, int? " @@ -413,9 +413,10 @@ msgid "" "removed in Python 3.14, and their functionality has been replaced with :" "class:`ast.Constant`." msgstr "" -"過去的 Python 版本提供了 AST 類別 :class:`!ast.Num`、:class:`!ast.Str`、:class:`!ast.Bytes`" -"、:class:`!ast.NameConstant` 和 :class:`!ast.Ellipsis`,這些類別在 Python 3.8 中已被棄用。" -"這些類別在 Python 3.14 中被移除,其功能已被 :class:`ast.Constant` 取代。" +"過去的 Python 版本提供了 AST 類別 :class:`!ast.Num`、:class:`!ast.Str`、:" +"class:`!ast.Bytes`、:class:`!ast.NameConstant` 和 :class:`!ast.Ellipsis`,這" +"些類別在 Python 3.8 中已被棄用。這些類別在 Python 3.14 中被移除,其功能已被 :" +"class:`ast.Constant` 取代。" #: ../../library/ast.rst:152 msgid "" @@ -4270,8 +4271,8 @@ msgid "" "constant nodes." msgstr "" ":meth:`!visit_Num`、:meth:`!visit_Str`、:meth:`!visit_Bytes`、:meth:`!" -"visit_NameConstant` 和 :meth:`!visit_Ellipsis` 方法在 Python 3.14+ 中將不會被呼叫。" -"請改為新增 :meth:`visit_Constant` 方法來處理所有常數節點。" +"visit_NameConstant` 和 :meth:`!visit_Ellipsis` 方法在 Python 3.14+ 中將不會被" +"呼叫。請改為新增 :meth:`visit_Constant` 方法來處理所有常數節點。" #: ../../library/ast.rst:2447 msgid "" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 27a025e3b4..6a57552148 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-10-26 00:15+0000\n" +"POT-Creation-Date: 2026-01-01 00:17+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-" @@ -371,7 +371,7 @@ msgstr "" "thread) 的 :class:`threading.Thread` 名稱,以便於除錯。" #: ../../library/concurrent.futures.rst:188 -#: ../../library/concurrent.futures.rst:393 +#: ../../library/concurrent.futures.rst:398 msgid "Added the *initializer* and *initargs* arguments." msgstr "新增 *initializer* 與 *initargs* 引數。" @@ -526,7 +526,7 @@ msgstr "" #: ../../library/concurrent.futures.rst:310 msgid "" "The executor may replace uncaught exceptions from *initializer* with :class:" -"`~concurrent.futures.interpreter.ExecutionFailed`." +"`~concurrent.interpreters.ExecutionFailed`." msgstr "" #: ../../library/concurrent.futures.rst:313 @@ -545,11 +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.interpreters." +"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.interpreters.ExecutionFailed` instance instead." msgstr "" #: ../../library/concurrent.futures.rst:332 @@ -650,7 +650,14 @@ msgstr "" "數的情況下,將預設使用 \"spawn\" 做為 multiprocessing 啟動方法。此功能與 " "\"fork\" 啟動方法不相容。" -#: ../../library/concurrent.futures.rst:382 +#: ../../library/concurrent.futures.rst:383 +msgid "" +"Bugs have been reported when using the *max_tasks_per_child* feature that " +"can result in the :class:`ProcessPoolExecutor` hanging in some " +"circumstances. Follow its eventual resolution in :gh:`115634`." +msgstr "" + +#: ../../library/concurrent.futures.rst:387 msgid "" "When one of the worker processes terminates abruptly, a :exc:`~concurrent." "futures.process.BrokenProcessPool` error is now raised. Previously, " @@ -661,21 +668,21 @@ msgstr "" "BrokenProcessPool` 錯誤。在過去,此行為是未定義的 (undefined),但對 executor " "或其 future 的操作經常會發生凍結或死鎖。" -#: ../../library/concurrent.futures.rst:389 +#: ../../library/concurrent.futures.rst:394 msgid "" "The *mp_context* argument was added to allow users to control the " "start_method for worker processes created by the pool." msgstr "" "新增了 *mp_context* 引數以允許使用者控制由池所建立的工作行程的 start_method。" -#: ../../library/concurrent.futures.rst:395 +#: ../../library/concurrent.futures.rst:400 msgid "" "The *max_tasks_per_child* argument was added to allow users to control the " "lifetime of workers in the pool." msgstr "" "新增了 *max_tasks_per_child* 引數以允許使用者控制池中 worker 的生命週期。" -#: ../../library/concurrent.futures.rst:399 +#: ../../library/concurrent.futures.rst:404 msgid "" "On POSIX systems, if your application has multiple threads and the :mod:" "`multiprocessing` context uses the ``\"fork\"`` start method: The :func:`os." @@ -688,13 +695,13 @@ msgstr "" "能會引發 :exc:`DeprecationWarning`。傳遞一個 *mp_context* 以配置為使用不同的" "啟動方法。更多說明請參閱 :func:`os.fork` 文件。" -#: ../../library/concurrent.futures.rst:407 +#: ../../library/concurrent.futures.rst:412 msgid "" "*max_workers* uses :func:`os.process_cpu_count` by default, instead of :func:" "`os.cpu_count`." msgstr "" -#: ../../library/concurrent.futures.rst:411 +#: ../../library/concurrent.futures.rst:416 msgid "" "The default process start method (see :ref:`multiprocessing-start-methods`) " "changed away from *fork*. If you require the *fork* start method for :class:" @@ -702,7 +709,7 @@ msgid "" "get_context(\"fork\")``." msgstr "" -#: ../../library/concurrent.futures.rst:419 +#: ../../library/concurrent.futures.rst:424 msgid "" "Attempt to terminate all living worker processes immediately by calling :" "meth:`Process.terminate ` on each of " @@ -710,14 +717,14 @@ msgid "" "all other resources associated with the executor are freed." msgstr "" -#: ../../library/concurrent.futures.rst:424 -#: ../../library/concurrent.futures.rst:436 +#: ../../library/concurrent.futures.rst:429 +#: ../../library/concurrent.futures.rst:441 msgid "" "After calling this method the caller should no longer submit tasks to the " "executor." msgstr "" -#: ../../library/concurrent.futures.rst:431 +#: ../../library/concurrent.futures.rst:436 msgid "" "Attempt to kill all living worker processes immediately by calling :meth:" "`Process.kill ` on each of them. Internally, " @@ -725,11 +732,11 @@ msgid "" "resources associated with the executor are freed." msgstr "" -#: ../../library/concurrent.futures.rst:444 +#: ../../library/concurrent.futures.rst:449 msgid "ProcessPoolExecutor Example" msgstr "ProcessPoolExecutor 範例" -#: ../../library/concurrent.futures.rst:447 +#: ../../library/concurrent.futures.rst:452 msgid "" "import concurrent.futures\n" "import math\n" @@ -797,11 +804,11 @@ msgstr "" "if __name__ == '__main__':\n" " main()" -#: ../../library/concurrent.futures.rst:482 +#: ../../library/concurrent.futures.rst:487 msgid "Future Objects" msgstr "Future 物件" -#: ../../library/concurrent.futures.rst:484 +#: ../../library/concurrent.futures.rst:489 msgid "" "The :class:`Future` class encapsulates the asynchronous execution of a " "callable. :class:`Future` instances are created by :meth:`Executor.submit`." @@ -809,7 +816,7 @@ msgstr "" ":class:`Future` 類別封裝了可呼叫物件的非同步執行。:class:`Future` 實例由 :" "meth:`Executor.submit` 建立。" -#: ../../library/concurrent.futures.rst:489 +#: ../../library/concurrent.futures.rst:494 msgid "" "Encapsulates the asynchronous execution of a callable. :class:`Future` " "instances are created by :meth:`Executor.submit` and should not be created " @@ -818,7 +825,7 @@ msgstr "" "封裝可呼叫物件的非同步執行。:class:`Future` 實例由 :meth:`Executor.submit` 建" "立,且除測試外不應直接建立。" -#: ../../library/concurrent.futures.rst:495 +#: ../../library/concurrent.futures.rst:500 msgid "" "Attempt to cancel the call. If the call is currently being executed or " "finished running and cannot be cancelled then the method will return " @@ -828,22 +835,22 @@ msgstr "" "嘗試取消呼叫。如果呼叫目前正在執行或已完成運行且無法取消,則該方法將回傳 " "``False``,否則呼叫將被取消並且該方法將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:502 +#: ../../library/concurrent.futures.rst:507 msgid "Return ``True`` if the call was successfully cancelled." msgstr "如果該呼叫成功被取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:506 +#: ../../library/concurrent.futures.rst:511 msgid "" "Return ``True`` if the call is currently being executed and cannot be " "cancelled." msgstr "如果呼叫正在執行且無法取消,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:511 +#: ../../library/concurrent.futures.rst:516 msgid "" "Return ``True`` if the call was successfully cancelled or finished running." msgstr "如果呼叫成功被取消或結束運行,則回傳 ``True``。" -#: ../../library/concurrent.futures.rst:516 +#: ../../library/concurrent.futures.rst:521 msgid "" "Return the value returned by the call. If the call hasn't yet completed then " "this method will wait up to *timeout* seconds. If the call hasn't completed " @@ -855,19 +862,19 @@ msgstr "" "叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。*timeout* 可以是整數" "或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:523 -#: ../../library/concurrent.futures.rst:537 +#: ../../library/concurrent.futures.rst:528 +#: ../../library/concurrent.futures.rst:542 msgid "" "If the future is cancelled before completing then :exc:`.CancelledError` " "will be raised." msgstr "如果 future 在完成之前被取消,那麼 :exc:`.CancelledError` 將被引發。" -#: ../../library/concurrent.futures.rst:526 +#: ../../library/concurrent.futures.rst:531 msgid "" "If the call raised an exception, this method will raise the same exception." msgstr "如果該呼叫引發了例外,此方法將引發相同的例外。" -#: ../../library/concurrent.futures.rst:530 +#: ../../library/concurrent.futures.rst:535 msgid "" "Return the exception raised by the call. If the call hasn't yet completed " "then this method will wait up to *timeout* seconds. If the call hasn't " @@ -879,11 +886,11 @@ msgstr "" "呼叫在 *timeout* 秒內未完成,則會引發 :exc:`TimeoutError`。 *timeout* 可以是" "整數或浮點數。如果未指定 *timeout* 或為 ``None``,則等待時間就不會有限制。" -#: ../../library/concurrent.futures.rst:540 +#: ../../library/concurrent.futures.rst:545 msgid "If the call completed without raising, ``None`` is returned." msgstr "如果呼叫在沒有引發的情況下完成,則回傳 ``None``。" -#: ../../library/concurrent.futures.rst:544 +#: ../../library/concurrent.futures.rst:549 msgid "" "Attaches the callable *fn* to the future. *fn* will be called, with the " "future as its only argument, when the future is cancelled or finishes " @@ -892,7 +899,7 @@ msgstr "" "將可呼叫的 *fn* 附加到 future 上。當 future 被取消或完成運行時,*fn* 將被以 " "future 作為其唯一引數來呼叫。" -#: ../../library/concurrent.futures.rst:548 +#: ../../library/concurrent.futures.rst:553 msgid "" "Added callables are called in the order that they were added and are always " "called in a thread belonging to the process that added them. If the " @@ -904,19 +911,19 @@ msgstr "" "如果可呼叫物件引發 :exc:`Exception` 子類別,它將被記錄 (log) 並忽略。如果可呼" "叫物件引發 :exc:`BaseException` 子類別,該行為未定義。" -#: ../../library/concurrent.futures.rst:554 +#: ../../library/concurrent.futures.rst:559 msgid "" "If the future has already completed or been cancelled, *fn* will be called " "immediately." msgstr "如果 future 已經完成或被取消,*fn* 將立即被呼叫。" -#: ../../library/concurrent.futures.rst:557 +#: ../../library/concurrent.futures.rst:562 msgid "" "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:562 +#: ../../library/concurrent.futures.rst:567 msgid "" "This method should only be called by :class:`Executor` implementations " "before executing the work associated with the :class:`Future` and by unit " @@ -925,7 +932,7 @@ msgstr "" "此方法只能在與 :class:`Future` 關聯的工作被執行之前於 :class:`Executor` 實作" "中呼叫,或者在單元測試中呼叫。" -#: ../../library/concurrent.futures.rst:566 +#: ../../library/concurrent.futures.rst:571 msgid "" "If the method returns ``False`` then the :class:`Future` was cancelled, i." "e. :meth:`Future.cancel` was called and returned ``True``. Any threads " @@ -936,7 +943,7 @@ msgstr "" "cancel` 被呼叫並回傳 ``True``。任何等待 :class:`Future` 完成的執行緒(即透" "過 :func:`as_completed` 或 :func:`wait`)將被喚醒。" -#: ../../library/concurrent.futures.rst:571 +#: ../../library/concurrent.futures.rst:576 msgid "" "If the method returns ``True`` then the :class:`Future` was not cancelled " "and has been put in the running state, i.e. calls to :meth:`Future.running` " @@ -945,7 +952,7 @@ msgstr "" "如果該方法回傳 ``True`` 則代表 :class:`Future` 未被取消並已進入運行狀態,意即" "呼叫 :meth:`Future.running` 將回傳 ``True``。" -#: ../../library/concurrent.futures.rst:575 +#: ../../library/concurrent.futures.rst:580 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." @@ -953,20 +960,20 @@ msgstr "" "此方法只能呼叫一次,且不能在呼叫 :meth:`Future.set_result` 或 :meth:`Future." "set_exception` 之後呼叫。" -#: ../../library/concurrent.futures.rst:581 +#: ../../library/concurrent.futures.rst:586 msgid "" "Sets the result of the work associated with the :class:`Future` to *result*." msgstr "將與 :class:`Future` 關聯的工作結果設定為 *result*。" -#: ../../library/concurrent.futures.rst:584 -#: ../../library/concurrent.futures.rst:597 +#: ../../library/concurrent.futures.rst:589 +#: ../../library/concurrent.futures.rst:602 msgid "" "This method should only be used by :class:`Executor` implementations and " "unit tests." msgstr "此方法只能在 :class:`Executor` 實作中和單元測試中使用。" -#: ../../library/concurrent.futures.rst:587 -#: ../../library/concurrent.futures.rst:600 +#: ../../library/concurrent.futures.rst:592 +#: ../../library/concurrent.futures.rst:605 msgid "" "This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:" "`Future` is already done." @@ -974,18 +981,18 @@ msgstr "" "如果 :class:`Future` 已經完成,此方法會引發 :exc:`concurrent.futures." "InvalidStateError`。" -#: ../../library/concurrent.futures.rst:594 +#: ../../library/concurrent.futures.rst:599 msgid "" "Sets the result of the work associated with the :class:`Future` to the :" "class:`Exception` *exception*." msgstr "" "將與 :class:`Future` 關聯的工作結果設定為 :class:`Exception` *exception*。" -#: ../../library/concurrent.futures.rst:606 +#: ../../library/concurrent.futures.rst:611 msgid "Module Functions" msgstr "模組函式" -#: ../../library/concurrent.futures.rst:610 +#: ../../library/concurrent.futures.rst:615 msgid "" "Wait for the :class:`Future` instances (possibly created by different :class:" "`Executor` instances) given by *fs* to complete. Duplicate futures given to " @@ -1001,7 +1008,7 @@ msgstr "" "完成的 future(已完成或被取消的 future)。第二組名為 ``not_done``,包含未完成" "的 future(未定或運行中的 future)。" -#: ../../library/concurrent.futures.rst:618 +#: ../../library/concurrent.futures.rst:623 msgid "" "*timeout* can be used to control the maximum number of seconds to wait " "before returning. *timeout* can be an int or float. If *timeout* is not " @@ -1010,25 +1017,25 @@ msgstr "" "*timeout* 可用於控制回傳前等待的最大秒數。*timeout* 可以是整數或浮點數。如果" "未指定 *timeout* 或為 ``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:622 +#: ../../library/concurrent.futures.rst:627 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "*return_when* 表示此函式應回傳的時間。它必須是以下常數之一:" -#: ../../library/concurrent.futures.rst:628 +#: ../../library/concurrent.futures.rst:633 msgid "Constant" msgstr "常數" -#: ../../library/concurrent.futures.rst:629 +#: ../../library/concurrent.futures.rst:634 msgid "Description" msgstr "描述" -#: ../../library/concurrent.futures.rst:632 +#: ../../library/concurrent.futures.rst:637 msgid "The function will return when any future finishes or is cancelled." msgstr "當任何 future 完成或被取消時,該函式就會回傳。" -#: ../../library/concurrent.futures.rst:635 +#: ../../library/concurrent.futures.rst:640 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:" @@ -1037,11 +1044,11 @@ msgstr "" "該函式會在任何 future 透過引發例外而完結時回傳。如果 future 沒有引發例外,那" "麼它等同於 :const:`ALL_COMPLETED`。" -#: ../../library/concurrent.futures.rst:640 +#: ../../library/concurrent.futures.rst:645 msgid "The function will return when all futures finish or are cancelled." msgstr "當所有 future 都完成或被取消時,該函式才會回傳。" -#: ../../library/concurrent.futures.rst:644 +#: ../../library/concurrent.futures.rst:649 msgid "" "Returns an iterator over the :class:`Future` instances (possibly created by " "different :class:`Executor` instances) given by *fs* that yields futures as " @@ -1061,36 +1068,36 @@ msgstr "" "`TimeoutError`。*timeout* 可以是整數或浮點數。如果未指定 *timeout* 或為 " "``None``,則等待時間就沒有限制。" -#: ../../library/concurrent.futures.rst:657 +#: ../../library/concurrent.futures.rst:662 msgid ":pep:`3148` -- futures - execute computations asynchronously" msgstr ":pep:`3148` -- futures - 非同步地執行運算" -#: ../../library/concurrent.futures.rst:658 +#: ../../library/concurrent.futures.rst:663 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "描述此功能並提出被包含於 Python 標準函式庫中的提案。" -#: ../../library/concurrent.futures.rst:663 +#: ../../library/concurrent.futures.rst:668 msgid "Exception classes" msgstr "例外類別" -#: ../../library/concurrent.futures.rst:669 +#: ../../library/concurrent.futures.rst:674 msgid "Raised when a future is cancelled." msgstr "當 future 被取消時引發。" -#: ../../library/concurrent.futures.rst:673 +#: ../../library/concurrent.futures.rst:678 msgid "" "A deprecated alias of :exc:`TimeoutError`, raised when a future operation " "exceeds the given timeout." msgstr "" ":exc:`TimeoutError` 的棄用別名,在 future 操作超過給定超時 (timeout) 時引發。" -#: ../../library/concurrent.futures.rst:678 +#: ../../library/concurrent.futures.rst:683 msgid "This class was made an alias of :exc:`TimeoutError`." msgstr "這個類別是 :exc:`TimeoutError` 的別名。" -#: ../../library/concurrent.futures.rst:683 +#: ../../library/concurrent.futures.rst:688 msgid "" "Derived from :exc:`RuntimeError`, this exception class is raised when an " "executor is broken for some reason, and cannot be used to submit or execute " @@ -1099,13 +1106,13 @@ msgstr "" "衍生自 :exc:`RuntimeError`,當執行器因某種原因損壞時會引發此例外類別,並且不" "能用於提交或執行新任務。" -#: ../../library/concurrent.futures.rst:691 +#: ../../library/concurrent.futures.rst:696 msgid "" "Raised when an operation is performed on a future that is not allowed in the " "current state." msgstr "目前狀態下不允許的 future 操作被執行時而引發。" -#: ../../library/concurrent.futures.rst:700 +#: ../../library/concurrent.futures.rst:705 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class " "is raised when one of the workers of a :class:`~concurrent.futures." @@ -1114,7 +1121,7 @@ msgstr "" "衍生自 :exc:`~concurrent.futures.BrokenExecutor`,當 :class:`~concurrent." "futures.ThreadPoolExecutor` 的其中一個 worker 初始化失敗時會引發此例外類別。" -#: ../../library/concurrent.futures.rst:711 +#: ../../library/concurrent.futures.rst:716 msgid "" "Derived from :exc:`~concurrent.futures.thread.BrokenThreadPool`, this " "exception class is raised when one of the workers of a :class:`~concurrent." @@ -1124,14 +1131,7 @@ msgstr "" "`~concurrent.futures.InterpreterPoolExecutor` 的其中一個 worker 初始化失敗時" "會引發此例外類別。" -#: ../../library/concurrent.futures.rst:720 -msgid "" -"Raised from :class:`~concurrent.futures.InterpreterPoolExecutor` when the " -"given initializer fails or from :meth:`~concurrent.futures.Executor.submit` " -"when there's an uncaught exception from the submitted task." -msgstr "" - -#: ../../library/concurrent.futures.rst:731 +#: ../../library/concurrent.futures.rst:727 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:" "`RuntimeError`), this exception class is raised when one of the workers of " diff --git a/library/functions.po b/library/functions.po index 35df0fe612..880b4c3cf1 100644 --- a/library/functions.po +++ b/library/functions.po @@ -2694,11 +2694,11 @@ msgstr "``mode`` 和 ``flags`` 引數可能會被原始的呼叫所修改或推 #: ../../library/functions.rst:1536 msgid "The *opener* parameter was added." -msgstr "增加了 *opener* 參數。" +msgstr "新增 *opener* 參數。" #: ../../library/functions.rst:1537 msgid "The ``'x'`` mode was added." -msgstr "增加了 ``'x'`` 模式。" +msgstr "新增 ``'x'`` 模式。" #: ../../library/functions.rst:1538 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." diff --git a/library/imaplib.po b/library/imaplib.po index 48f89ff653..d1d70d69c3 100644 --- a/library/imaplib.po +++ b/library/imaplib.po @@ -86,7 +86,7 @@ msgstr "" #: ../../library/imaplib.rst:55 msgid "Support for the :keyword:`with` statement was added." -msgstr "" +msgstr "新增對 :keyword:`with` 陳述式的支援。" #: ../../library/imaplib.rst:58 ../../library/imaplib.rst:112 msgid "The optional *timeout* parameter was added." diff --git a/library/inspect.po b/library/inspect.po index c20412236a..c120b003c3 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-11-18 00:15+0000\n" +"POT-Creation-Date: 2025-12-29 00:16+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-" @@ -74,19 +74,19 @@ msgid "class" msgstr "" #: ../../library/inspect.rst:48 ../../library/inspect.rst:63 -#: ../../library/inspect.rst:81 ../../library/inspect.rst:295 +#: ../../library/inspect.rst:81 ../../library/inspect.rst:301 msgid "__doc__" msgstr "__doc__" #: ../../library/inspect.rst:48 ../../library/inspect.rst:63 -#: ../../library/inspect.rst:81 ../../library/inspect.rst:295 +#: ../../library/inspect.rst:81 ../../library/inspect.rst:301 msgid "documentation string" msgstr "" #: ../../library/inspect.rst:50 ../../library/inspect.rst:65 #: ../../library/inspect.rst:83 ../../library/inspect.rst:248 -#: ../../library/inspect.rst:265 ../../library/inspect.rst:278 -#: ../../library/inspect.rst:297 +#: ../../library/inspect.rst:265 ../../library/inspect.rst:281 +#: ../../library/inspect.rst:303 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:267 ../../library/inspect.rst:280 -#: ../../library/inspect.rst:300 +#: ../../library/inspect.rst:267 ../../library/inspect.rst:283 +#: ../../library/inspect.rst:306 msgid "__qualname__" msgstr "__qualname__" #: ../../library/inspect.rst:53 ../../library/inspect.rst:68 #: ../../library/inspect.rst:86 ../../library/inspect.rst:250 -#: ../../library/inspect.rst:267 ../../library/inspect.rst:280 -#: ../../library/inspect.rst:300 +#: ../../library/inspect.rst:267 ../../library/inspect.rst:283 +#: ../../library/inspect.rst:306 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:302 +#: ../../library/inspect.rst:74 ../../library/inspect.rst:308 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:272 ../../library/inspect.rst:285 +#: ../../library/inspect.rst:272 ../../library/inspect.rst:288 msgid "frame" msgstr "" @@ -356,7 +356,7 @@ msgid "used to clear all references to local variables" msgstr "" #: ../../library/inspect.rst:175 ../../library/inspect.rst:259 -#: ../../library/inspect.rst:276 ../../library/inspect.rst:289 +#: ../../library/inspect.rst:279 ../../library/inspect.rst:295 msgid "code" msgstr "code(程式碼)" @@ -529,7 +529,7 @@ msgid "generator" msgstr "" #: ../../library/inspect.rst:248 ../../library/inspect.rst:265 -#: ../../library/inspect.rst:278 +#: ../../library/inspect.rst:281 msgid "name" msgstr "" @@ -549,7 +549,7 @@ msgstr "" msgid "gi_suspended" msgstr "" -#: ../../library/inspect.rst:256 +#: ../../library/inspect.rst:256 ../../library/inspect.rst:276 msgid "is the generator suspended?" msgstr "" @@ -573,7 +573,7 @@ msgstr "" msgid "ag_await" msgstr "ag_await" -#: ../../library/inspect.rst:269 ../../library/inspect.rst:282 +#: ../../library/inspect.rst:269 ../../library/inspect.rst:285 msgid "object being awaited on, or ``None``" msgstr "" @@ -586,76 +586,100 @@ msgid "ag_running" msgstr "ag_running" #: ../../library/inspect.rst:276 +msgid "ag_suspended" +msgstr "" + +#: ../../library/inspect.rst:279 msgid "ag_code" msgstr "ag_code" -#: ../../library/inspect.rst:278 +#: ../../library/inspect.rst:281 msgid "coroutine" msgstr "coroutine" -#: ../../library/inspect.rst:282 +#: ../../library/inspect.rst:285 msgid "cr_await" msgstr "cr_await" -#: ../../library/inspect.rst:285 +#: ../../library/inspect.rst:288 msgid "cr_frame" msgstr "cr_frame" -#: ../../library/inspect.rst:287 +#: ../../library/inspect.rst:290 msgid "cr_running" msgstr "cr_running" -#: ../../library/inspect.rst:287 +#: ../../library/inspect.rst:290 msgid "is the coroutine running?" msgstr "" -#: ../../library/inspect.rst:289 +#: ../../library/inspect.rst:292 +msgid "cr_suspended" +msgstr "" + +#: ../../library/inspect.rst:292 +msgid "is the coroutine suspended?" +msgstr "" + +#: ../../library/inspect.rst:295 msgid "cr_code" msgstr "cr_code" -#: ../../library/inspect.rst:291 +#: ../../library/inspect.rst:297 msgid "cr_origin" msgstr "cr_origin" -#: ../../library/inspect.rst:291 +#: ../../library/inspect.rst:297 msgid "where coroutine was created, or ``None``. See |coroutine-origin-link|" msgstr "" -#: ../../library/inspect.rst:295 +#: ../../library/inspect.rst:301 msgid "builtin" msgstr "" -#: ../../library/inspect.rst:297 +#: ../../library/inspect.rst:303 msgid "original name of this function or method" msgstr "" -#: ../../library/inspect.rst:302 +#: ../../library/inspect.rst:308 msgid "instance to which a method is bound, or ``None``" msgstr "" -#: ../../library/inspect.rst:309 +#: ../../library/inspect.rst:315 msgid "Add ``__qualname__`` and ``gi_yieldfrom`` attributes to generators." -msgstr "將 ``__qualname__`` 和 ``gi_yieldfrom`` 屬性加到產生器。" +msgstr "新增產生器的 ``__qualname__`` 和 ``gi_yieldfrom`` 屬性。" -#: ../../library/inspect.rst:311 +#: ../../library/inspect.rst:317 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:316 +#: ../../library/inspect.rst:322 msgid "Add ``cr_origin`` attribute to coroutines." msgstr "新增協程的 ``cr_origin`` 屬性。" -#: ../../library/inspect.rst:320 +#: ../../library/inspect.rst:326 msgid "Add ``__builtins__`` attribute to functions." msgstr "新增函式的 ``__builtins__`` 屬性。" -#: ../../library/inspect.rst:324 +#: ../../library/inspect.rst:330 +msgid "Add ``gi_suspended`` attribute to generators." +msgstr "新增產生器的 ``gi_suspended`` 屬性。" + +#: ../../library/inspect.rst:334 +msgid "Add ``cr_suspended`` attribute to coroutines." +msgstr "新增協程的 ``cr_suspended`` 屬性。" + +#: ../../library/inspect.rst:338 +msgid "Add ``ag_suspended`` attribute to async generators." +msgstr "新增非同步產生器的 ``ag_suspended`` 屬性。" + +#: ../../library/inspect.rst:342 msgid "Add ``f_generator`` attribute to frames." msgstr "新增 ``f_generator`` 屬性到 frame。" -#: ../../library/inspect.rst:328 +#: ../../library/inspect.rst:346 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 " @@ -663,14 +687,14 @@ msgid "" "the predicate returns a true value are included." msgstr "" -#: ../../library/inspect.rst:335 +#: ../../library/inspect.rst:353 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:342 +#: ../../library/inspect.rst:360 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 " @@ -678,7 +702,7 @@ msgid "" "that satisfy a given predicate." msgstr "" -#: ../../library/inspect.rst:349 +#: ../../library/inspect.rst:367 msgid "" ":func:`getmembers_static` may not be able to retrieve all members that " "getmembers can fetch (like dynamically created attributes) and may find " @@ -687,7 +711,7 @@ msgid "" "cases." msgstr "" -#: ../../library/inspect.rst:360 +#: ../../library/inspect.rst:378 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 " @@ -696,62 +720,62 @@ msgid "" "``None`` is returned." msgstr "" -#: ../../library/inspect.rst:366 +#: ../../library/inspect.rst:384 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:370 +#: ../../library/inspect.rst:388 msgid "The function is based directly on :mod:`importlib`." msgstr "此函式直接基於 :mod:`importlib`。" -#: ../../library/inspect.rst:376 +#: ../../library/inspect.rst:394 msgid "Return ``True`` if the object is a module." msgstr "如果物件是模組,則回傳 ``True``。" -#: ../../library/inspect.rst:381 +#: ../../library/inspect.rst:399 msgid "" "Return ``True`` if the object is a class, whether built-in or created in " "Python code." msgstr "" -#: ../../library/inspect.rst:387 +#: ../../library/inspect.rst:405 msgid "Return ``True`` if the object is a bound method written in Python." msgstr "" -#: ../../library/inspect.rst:392 +#: ../../library/inspect.rst:410 msgid "Return ``True`` if the object is a :term:`package`." msgstr "如果物件是 :term:`package`,則回傳 ``True``。" -#: ../../library/inspect.rst:399 +#: ../../library/inspect.rst:417 msgid "" "Return ``True`` if the object is a Python function, which includes functions " "created by a :term:`lambda` expression." msgstr "" -#: ../../library/inspect.rst:405 +#: ../../library/inspect.rst:423 msgid "Return ``True`` if the object is a Python generator function." msgstr "如果物件是 Python 產生器函式,則回傳 ``True``。" -#: ../../library/inspect.rst:407 +#: ../../library/inspect.rst:425 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is a Python generator function." msgstr "" -#: ../../library/inspect.rst:411 +#: ../../library/inspect.rst:429 msgid "" "Functions wrapped in :func:`functools.partialmethod` now return ``True`` if " "the wrapped function is a Python generator function." msgstr "" -#: ../../library/inspect.rst:417 +#: ../../library/inspect.rst:435 msgid "Return ``True`` if the object is a generator." msgstr "如果物件是產生器,則回傳 ``True``。" -#: ../../library/inspect.rst:422 +#: ../../library/inspect.rst:440 msgid "" "Return ``True`` if the object is a :term:`coroutine function` (a function " "defined with an :keyword:`async def` syntax), a :func:`functools.partial` " @@ -759,60 +783,60 @@ msgid "" "`markcoroutinefunction`." msgstr "" -#: ../../library/inspect.rst:429 +#: ../../library/inspect.rst:447 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is a :term:`coroutine function`." msgstr "" -#: ../../library/inspect.rst:433 +#: ../../library/inspect.rst:451 msgid "" "Sync functions marked with :func:`markcoroutinefunction` now return ``True``." msgstr "" -#: ../../library/inspect.rst:437 ../../library/inspect.rst:507 +#: ../../library/inspect.rst:455 ../../library/inspect.rst:525 msgid "" "Functions wrapped in :func:`functools.partialmethod` now return ``True`` if " "the wrapped function is a :term:`coroutine function`." msgstr "" -#: ../../library/inspect.rst:444 +#: ../../library/inspect.rst:462 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:447 +#: ../../library/inspect.rst:465 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:450 +#: ../../library/inspect.rst:468 msgid "" "When possible, using an :keyword:`async def` function is preferred. Also " "acceptable is calling the function and testing the return with :func:" "`iscoroutine`." msgstr "" -#: ../../library/inspect.rst:459 +#: ../../library/inspect.rst:477 msgid "" "Return ``True`` if the object is a :term:`coroutine` created by an :keyword:" "`async def` function." msgstr "" -#: ../../library/inspect.rst:467 +#: ../../library/inspect.rst:485 msgid "" "Return ``True`` if the object can be used in :keyword:`await` expression." msgstr "" -#: ../../library/inspect.rst:469 +#: ../../library/inspect.rst:487 msgid "" "Can also be used to distinguish generator-based coroutines from regular " "generators:" msgstr "" -#: ../../library/inspect.rst:472 +#: ../../library/inspect.rst:490 msgid "" "import types\n" "\n" @@ -836,13 +860,13 @@ msgstr "" "assert not isawaitable(gen())\n" "assert isawaitable(gen_coro())" -#: ../../library/inspect.rst:490 +#: ../../library/inspect.rst:508 msgid "" "Return ``True`` if the object is an :term:`asynchronous generator` function, " "for example:" msgstr "" -#: ../../library/inspect.rst:493 +#: ../../library/inspect.rst:511 msgid "" ">>> async def agen():\n" "... yield 1\n" @@ -856,65 +880,65 @@ msgstr "" ">>> inspect.isasyncgenfunction(agen)\n" "True" -#: ../../library/inspect.rst:503 +#: ../../library/inspect.rst:521 msgid "" "Functions wrapped in :func:`functools.partial` now return ``True`` if the " "wrapped function is an :term:`asynchronous generator` function." msgstr "" -#: ../../library/inspect.rst:513 +#: ../../library/inspect.rst:531 msgid "" "Return ``True`` if the object is an :term:`asynchronous generator iterator` " "created by an :term:`asynchronous generator` function." msgstr "" -#: ../../library/inspect.rst:520 +#: ../../library/inspect.rst:538 msgid "Return ``True`` if the object is a traceback." msgstr "" -#: ../../library/inspect.rst:525 +#: ../../library/inspect.rst:543 msgid "Return ``True`` if the object is a frame." msgstr "" -#: ../../library/inspect.rst:530 +#: ../../library/inspect.rst:548 msgid "Return ``True`` if the object is a code." msgstr "如果物件是程式碼,則回傳 ``True``。" -#: ../../library/inspect.rst:535 +#: ../../library/inspect.rst:553 msgid "" "Return ``True`` if the object is a built-in function or a bound built-in " "method." msgstr "" -#: ../../library/inspect.rst:540 +#: ../../library/inspect.rst:558 msgid "" "Return ``True`` if the type of object is a :class:`~types.MethodWrapperType`." msgstr "" -#: ../../library/inspect.rst:542 +#: ../../library/inspect.rst:560 msgid "" "These are instances of :class:`~types.MethodWrapperType`, such as :meth:" "`~object.__str__`, :meth:`~object.__eq__` and :meth:`~object.__repr__`." msgstr "" -#: ../../library/inspect.rst:550 +#: ../../library/inspect.rst:568 msgid "" "Return ``True`` if the object is a user-defined or built-in function or " "method." msgstr "如果物件是使用者定義或內建的函式或方法,則回傳 ``True``。" -#: ../../library/inspect.rst:555 +#: ../../library/inspect.rst:573 msgid "Return ``True`` if the object is an abstract base class." msgstr "如果物件是抽象基底類別,則回傳 ``True``。" -#: ../../library/inspect.rst:560 +#: ../../library/inspect.rst:578 msgid "" "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:564 +#: ../../library/inspect.rst:582 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__` " @@ -923,7 +947,7 @@ msgid "" "sensible, and :attr:`~definition.__doc__` often is." msgstr "" -#: ../../library/inspect.rst:570 +#: ../../library/inspect.rst:588 msgid "" "Methods implemented via descriptors that also pass one of the other tests " "return ``False`` from the :func:`ismethoddescriptor` test, simply because " @@ -931,7 +955,7 @@ msgid "" "`~method.__func__` attribute (etc) when an object passes :func:`ismethod`." msgstr "" -#: ../../library/inspect.rst:576 +#: ../../library/inspect.rst:594 msgid "" "This function no longer incorrectly reports objects with :meth:`~object." "__get__` and :meth:`~object.__delete__`, but not :meth:`~object.__set__`, as " @@ -939,11 +963,11 @@ msgid "" "descriptors)." msgstr "" -#: ../../library/inspect.rst:584 +#: ../../library/inspect.rst:602 msgid "Return ``True`` if the object is a data descriptor." msgstr "如果物件是資料描述器,則回傳 ``True``。" -#: ../../library/inspect.rst:586 +#: ../../library/inspect.rst:604 msgid "" "Data descriptors have a :attr:`~object.__set__` or a :attr:`~object." "__delete__` method. Examples are properties (defined in Python), getsets, " @@ -954,33 +978,33 @@ msgid "" "and members have both of these attributes), but this is not guaranteed." msgstr "" -#: ../../library/inspect.rst:597 +#: ../../library/inspect.rst:615 msgid "Return ``True`` if the object is a getset descriptor." msgstr "" -#: ../../library/inspect.rst:601 +#: ../../library/inspect.rst:619 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``." msgstr "" -#: ../../library/inspect.rst:608 +#: ../../library/inspect.rst:626 msgid "Return ``True`` if the object is a member descriptor." msgstr "如果物件是成員描述器,則回傳 ``True``。" -#: ../../library/inspect.rst:612 +#: ../../library/inspect.rst:630 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``." msgstr "" -#: ../../library/inspect.rst:620 +#: ../../library/inspect.rst:638 msgid "Retrieving source code" msgstr "取得原始碼" -#: ../../library/inspect.rst:624 +#: ../../library/inspect.rst:642 msgid "" "Get the documentation string for an object, cleaned up with :func:" "`cleandoc`. If the documentation string for an object is not provided and " @@ -989,11 +1013,11 @@ msgid "" "documentation string is invalid or missing." msgstr "" -#: ../../library/inspect.rst:630 +#: ../../library/inspect.rst:648 msgid "Documentation strings are now inherited if not overridden." msgstr "" -#: ../../library/inspect.rst:636 +#: ../../library/inspect.rst:654 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 " @@ -1002,27 +1026,27 @@ msgid "" "been defined in C or the interactive shell." msgstr "" -#: ../../library/inspect.rst:645 +#: ../../library/inspect.rst:663 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:652 +#: ../../library/inspect.rst:670 msgid "" "Try to guess which module an object was defined in. Return ``None`` if the " "module cannot be determined." msgstr "" -#: ../../library/inspect.rst:658 +#: ../../library/inspect.rst:676 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:666 +#: ../../library/inspect.rst:684 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 " @@ -1033,13 +1057,13 @@ msgid "" "built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:675 ../../library/inspect.rst:689 +#: ../../library/inspect.rst:693 ../../library/inspect.rst:707 msgid "" ":exc:`OSError` is raised instead of :exc:`IOError`, now an alias of the " "former." msgstr "" -#: ../../library/inspect.rst:682 +#: ../../library/inspect.rst:700 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 " @@ -1048,13 +1072,13 @@ msgid "" "object is a built-in module, class, or function." msgstr "" -#: ../../library/inspect.rst:696 +#: ../../library/inspect.rst:714 msgid "" "Clean up indentation from docstrings that are indented to line up with " "blocks of code." msgstr "" -#: ../../library/inspect.rst:699 +#: ../../library/inspect.rst:717 msgid "" "All leading whitespace is removed from the first line. Any leading " "whitespace that can be uniformly removed from the second line onwards is " @@ -1062,22 +1086,22 @@ msgid "" "Also, all tabs are expanded to spaces." msgstr "" -#: ../../library/inspect.rst:708 +#: ../../library/inspect.rst:726 msgid "Introspecting callables with the Signature object" msgstr "" -#: ../../library/inspect.rst:712 +#: ../../library/inspect.rst:730 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:719 +#: ../../library/inspect.rst:737 msgid "Return a :class:`Signature` object for the given *callable*:" msgstr "" -#: ../../library/inspect.rst:721 +#: ../../library/inspect.rst:739 msgid "" ">>> from inspect import signature\n" ">>> def foo(a, *, b:int, **kwargs):\n" @@ -1109,13 +1133,13 @@ msgstr "" ">>> sig.parameters['b'].annotation\n" "" -#: ../../library/inspect.rst:738 +#: ../../library/inspect.rst:756 msgid "" "Accepts a wide range of Python callables, from plain functions and classes " "to :func:`functools.partial` objects." msgstr "" -#: ../../library/inspect.rst:741 +#: ../../library/inspect.rst:759 msgid "" "If some of the annotations are strings (e.g., because ``from __future__ " "import annotations`` was used), :func:`signature` will attempt to " @@ -1130,7 +1154,7 @@ msgid "" "STRING`` to return annotations in string format." msgstr "" -#: ../../library/inspect.rst:755 +#: ../../library/inspect.rst:773 msgid "" "Raises :exc:`ValueError` if no signature can be provided, and :exc:" "`TypeError` if that type of object is not supported. Also, if the " @@ -1139,36 +1163,36 @@ msgid "" "get_annotations` could potentially raise any kind of exception." msgstr "" -#: ../../library/inspect.rst:761 +#: ../../library/inspect.rst:779 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:765 +#: ../../library/inspect.rst:783 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:771 ../../library/inspect.rst:907 +#: ../../library/inspect.rst:789 ../../library/inspect.rst:925 msgid "The *globals*, *locals*, and *eval_str* parameters were added." msgstr "" -#: ../../library/inspect.rst:774 +#: ../../library/inspect.rst:792 msgid "The *annotation_format* parameter was added." -msgstr "" +msgstr "新增了 *annotation_format* 參數。" -#: ../../library/inspect.rst:779 +#: ../../library/inspect.rst:797 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:785 +#: ../../library/inspect.rst:803 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 " @@ -1176,14 +1200,14 @@ msgid "" "semantics." msgstr "" -#: ../../library/inspect.rst:793 +#: ../../library/inspect.rst:811 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:798 +#: ../../library/inspect.rst:816 msgid "" "The optional *parameters* argument is a sequence of :class:`Parameter` " "objects, which is validated to check that there are no parameters with " @@ -1192,54 +1216,54 @@ msgid "" "defaults follow parameters without defaults." msgstr "" -#: ../../library/inspect.rst:804 +#: ../../library/inspect.rst:822 msgid "" "The optional *return_annotation* argument can be an arbitrary Python object. " "It represents the \"return\" annotation of the callable." msgstr "" -#: ../../library/inspect.rst:807 +#: ../../library/inspect.rst:825 msgid "" ":class:`!Signature` objects are *immutable*. Use :meth:`Signature.replace` " "or :func:`copy.replace` to make a modified copy." msgstr "" -#: ../../library/inspect.rst:810 +#: ../../library/inspect.rst:828 msgid ":class:`!Signature` objects are now picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:815 +#: ../../library/inspect.rst:833 msgid "A special class-level marker to specify absence of a return annotation." msgstr "" -#: ../../library/inspect.rst:819 +#: ../../library/inspect.rst:837 msgid "" "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:823 ../../library/inspect.rst:1187 +#: ../../library/inspect.rst:841 ../../library/inspect.rst:1205 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:830 +#: ../../library/inspect.rst:848 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:835 +#: ../../library/inspect.rst:853 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:841 +#: ../../library/inspect.rst:859 msgid "" "Works the same way as :meth:`Signature.bind`, but allows the omission of " "some required arguments (mimics :func:`functools.partial` behavior.) " @@ -1247,7 +1271,7 @@ msgid "" "arguments do not match the signature." msgstr "" -#: ../../library/inspect.rst:848 +#: ../../library/inspect.rst:866 msgid "" "Create a new :class:`Signature` instance based on the instance :meth:" "`replace` was invoked on. It is possible to pass different *parameters* and/" @@ -1256,7 +1280,7 @@ msgid "" "Signature`, pass in :attr:`Signature.empty`." msgstr "" -#: ../../library/inspect.rst:856 +#: ../../library/inspect.rst:874 msgid "" ">>> def test(a, b):\n" "... pass\n" @@ -1274,24 +1298,24 @@ msgstr "" ">>> str(new_sig)\n" "\"(a, b) -> 'new return anno'\"" -#: ../../library/inspect.rst:866 +#: ../../library/inspect.rst:884 msgid "" ":class:`Signature` objects are also supported by the generic function :func:" "`copy.replace`." msgstr "" -#: ../../library/inspect.rst:871 +#: ../../library/inspect.rst:889 msgid "Create a string representation of the :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:873 +#: ../../library/inspect.rst:891 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:878 +#: ../../library/inspect.rst:896 msgid "" "If *quote_annotation_strings* is False, :term:`annotations ` in " "the signature are displayed without opening and closing quotation marks if " @@ -1300,21 +1324,21 @@ msgid "" "annotations`` was used." msgstr "" -#: ../../library/inspect.rst:886 +#: ../../library/inspect.rst:904 msgid "The *unquote_annotations* parameter was added." -msgstr "" +msgstr "新增了 *unquote_annotations* 參數。" -#: ../../library/inspect.rst:891 +#: ../../library/inspect.rst:909 msgid "" "Return a :class:`Signature` (or its subclass) object for a given callable " "*obj*." msgstr "" -#: ../../library/inspect.rst:894 +#: ../../library/inspect.rst:912 msgid "This method simplifies subclassing of :class:`Signature`:" msgstr "" -#: ../../library/inspect.rst:896 +#: ../../library/inspect.rst:914 msgid "" "class MySignature(Signature):\n" " pass\n" @@ -1326,129 +1350,129 @@ msgstr "" "sig = MySignature.from_callable(sum)\n" "assert isinstance(sig, MySignature)" -#: ../../library/inspect.rst:903 +#: ../../library/inspect.rst:921 msgid "Its behavior is otherwise identical to that of :func:`signature`." msgstr "" -#: ../../library/inspect.rst:913 +#: ../../library/inspect.rst:931 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." msgstr "" -#: ../../library/inspect.rst:917 +#: ../../library/inspect.rst:935 msgid "Parameter objects are now picklable and :term:`hashable`." msgstr "" -#: ../../library/inspect.rst:922 +#: ../../library/inspect.rst:940 msgid "" "A special class-level marker to specify absence of default values and " "annotations." msgstr "" -#: ../../library/inspect.rst:927 +#: ../../library/inspect.rst:945 msgid "" "The name of the parameter as a string. The name must be a valid Python " "identifier." msgstr "" -#: ../../library/inspect.rst:932 +#: ../../library/inspect.rst:950 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:936 +#: ../../library/inspect.rst:954 msgid "" "These parameter names are now exposed by this module as names like " "``implicit0``." msgstr "" -#: ../../library/inspect.rst:942 +#: ../../library/inspect.rst:960 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:947 +#: ../../library/inspect.rst:965 msgid "" "The annotation for the parameter. If the parameter has no annotation, this " "attribute is set to :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:952 +#: ../../library/inspect.rst:970 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:" msgstr "" -#: ../../library/inspect.rst:959 +#: ../../library/inspect.rst:977 msgid "Name" msgstr "名稱" -#: ../../library/inspect.rst:959 +#: ../../library/inspect.rst:977 msgid "Meaning" msgstr "意義" -#: ../../library/inspect.rst:961 +#: ../../library/inspect.rst:979 msgid "*POSITIONAL_ONLY*" msgstr "*POSITIONAL_ONLY*" -#: ../../library/inspect.rst:961 +#: ../../library/inspect.rst:979 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:966 +#: ../../library/inspect.rst:984 msgid "*POSITIONAL_OR_KEYWORD*" msgstr "*POSITIONAL_OR_KEYWORD*" -#: ../../library/inspect.rst:966 +#: ../../library/inspect.rst:984 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:971 +#: ../../library/inspect.rst:989 msgid "*VAR_POSITIONAL*" msgstr "*VAR_POSITIONAL*" -#: ../../library/inspect.rst:971 +#: ../../library/inspect.rst:989 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:976 +#: ../../library/inspect.rst:994 msgid "*KEYWORD_ONLY*" msgstr "*KEYWORD_ONLY*" -#: ../../library/inspect.rst:976 +#: ../../library/inspect.rst:994 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:981 +#: ../../library/inspect.rst:999 msgid "*VAR_KEYWORD*" msgstr "*VAR_KEYWORD*" -#: ../../library/inspect.rst:981 +#: ../../library/inspect.rst:999 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:987 +#: ../../library/inspect.rst:1005 msgid "Example: print all keyword-only arguments without default values:" msgstr "" -#: ../../library/inspect.rst:989 +#: ../../library/inspect.rst:1007 msgid "" ">>> def foo(a, b, *, c, d=10):\n" "... pass\n" @@ -1470,15 +1494,15 @@ msgstr "" "... print('Parameter:', param)\n" "Parameter: c" -#: ../../library/inspect.rst:1003 +#: ../../library/inspect.rst:1021 msgid "Describes an enum value of :attr:`Parameter.kind`." msgstr "" -#: ../../library/inspect.rst:1007 +#: ../../library/inspect.rst:1025 msgid "Example: print all descriptions of arguments:" msgstr "範例:列印所有引數的描述:" -#: ../../library/inspect.rst:1009 +#: ../../library/inspect.rst:1027 msgid "" ">>> def foo(a, b, *, c, d=10):\n" "... pass\n" @@ -1502,7 +1526,7 @@ msgstr "" "keyword-only\n" "keyword-only" -#: ../../library/inspect.rst:1024 +#: ../../library/inspect.rst:1042 msgid "" "Create a new :class:`Parameter` instance based on the instance replaced was " "invoked on. To override a :class:`!Parameter` attribute, pass the " @@ -1510,7 +1534,7 @@ msgid "" "a :class:`!Parameter`, pass :attr:`Parameter.empty`." msgstr "" -#: ../../library/inspect.rst:1029 +#: ../../library/inspect.rst:1047 msgid "" ">>> from inspect import Parameter\n" ">>> param = Parameter('foo', Parameter.KEYWORD_ONLY, default=42)\n" @@ -1534,83 +1558,83 @@ msgstr "" ">>> str(param.replace(default=Parameter.empty, annotation='spam'))\n" "\"foo: 'spam'\"" -#: ../../library/inspect.rst:1042 +#: ../../library/inspect.rst:1060 msgid "" ":class:`Parameter` objects are also supported by the generic function :func:" "`copy.replace`." msgstr "" -#: ../../library/inspect.rst:1045 +#: ../../library/inspect.rst:1063 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:1052 +#: ../../library/inspect.rst:1070 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:1057 +#: ../../library/inspect.rst:1075 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`." msgstr "" -#: ../../library/inspect.rst:1061 +#: ../../library/inspect.rst:1079 msgid "" "Should be used in conjunction with :attr:`Signature.parameters` for any " "argument processing purposes." msgstr "" -#: ../../library/inspect.rst:1066 +#: ../../library/inspect.rst:1084 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." msgstr "" -#: ../../library/inspect.rst:1071 +#: ../../library/inspect.rst:1089 msgid "" ":attr:`arguments` is now of type :class:`dict`. Formerly, it was of type :" "class:`collections.OrderedDict`." msgstr "" -#: ../../library/inspect.rst:1077 +#: ../../library/inspect.rst:1095 msgid "" "A tuple of positional arguments values. Dynamically computed from the :attr:" "`arguments` attribute." msgstr "" -#: ../../library/inspect.rst:1082 +#: ../../library/inspect.rst:1100 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." msgstr "" -#: ../../library/inspect.rst:1088 +#: ../../library/inspect.rst:1106 msgid "A reference to the parent :class:`Signature` object." msgstr "" -#: ../../library/inspect.rst:1092 +#: ../../library/inspect.rst:1110 msgid "Set default values for missing arguments." msgstr "為遺漏的引數設定預設值。" -#: ../../library/inspect.rst:1094 +#: ../../library/inspect.rst:1112 msgid "" "For variable-positional arguments (``*args``) the default is an empty tuple." msgstr "" -#: ../../library/inspect.rst:1097 +#: ../../library/inspect.rst:1115 msgid "" "For variable-keyword arguments (``**kwargs``) the default is an empty dict." msgstr "" -#: ../../library/inspect.rst:1100 +#: ../../library/inspect.rst:1118 msgid "" ">>> def foo(a, b='ham', *args): pass\n" ">>> ba = inspect.signature(foo).bind('spam')\n" @@ -1624,13 +1648,13 @@ msgstr "" ">>> ba.arguments\n" "{'a': 'spam', 'b': 'ham', 'args': ()}" -#: ../../library/inspect.rst:1110 +#: ../../library/inspect.rst:1128 msgid "" "The :attr:`args` and :attr:`kwargs` properties can be used to invoke " "functions:" msgstr "" -#: ../../library/inspect.rst:1113 +#: ../../library/inspect.rst:1131 msgid "" "def test(a, *, b):\n" " ...\n" @@ -1646,19 +1670,19 @@ msgstr "" "ba = sig.bind(10, b=20)\n" "test(*ba.args, **ba.kwargs)" -#: ../../library/inspect.rst:1125 +#: ../../library/inspect.rst:1143 msgid ":pep:`362` - Function Signature Object." msgstr ":pep:`362` - 函式簽名物件。" -#: ../../library/inspect.rst:1126 +#: ../../library/inspect.rst:1144 msgid "The detailed specification, implementation details and examples." msgstr "詳細的規格、實作細節和範例。" -#: ../../library/inspect.rst:1132 +#: ../../library/inspect.rst:1150 msgid "Classes and functions" msgstr "類別與函式" -#: ../../library/inspect.rst:1136 +#: ../../library/inspect.rst:1154 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 " @@ -1669,13 +1693,13 @@ msgid "" "will appear multiple times." msgstr "" -#: ../../library/inspect.rst:1147 +#: ../../library/inspect.rst:1165 msgid "" "Get the names and default values of a Python function's parameters. A :term:" "`named tuple` is returned:" msgstr "" -#: ../../library/inspect.rst:1150 +#: ../../library/inspect.rst:1168 msgid "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" @@ -1683,7 +1707,7 @@ msgstr "" "``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, " "annotations)``" -#: ../../library/inspect.rst:1153 +#: ../../library/inspect.rst:1171 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 " @@ -1698,7 +1722,7 @@ msgid "" "report the function return value annotation (if any)." msgstr "" -#: ../../library/inspect.rst:1168 +#: ../../library/inspect.rst:1186 msgid "" "Note that :func:`signature` and :ref:`Signature Object ` provide the recommended API for callable introspection, and support " @@ -1708,14 +1732,14 @@ msgid "" "``inspect`` module API." msgstr "" -#: ../../library/inspect.rst:1175 +#: ../../library/inspect.rst:1193 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:1180 +#: ../../library/inspect.rst:1198 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 " @@ -1723,7 +1747,7 @@ msgid "" "code migrating away from the legacy :func:`!getargspec` API." msgstr "" -#: ../../library/inspect.rst:1195 +#: ../../library/inspect.rst:1213 msgid "" "Get information about arguments passed into a particular frame. A :term:" "`named tuple` ``ArgInfo(args, varargs, keywords, locals)`` is returned. " @@ -1732,18 +1756,18 @@ msgid "" "dictionary of the given frame." msgstr "" -#: ../../library/inspect.rst:1202 ../../library/inspect.rst:1212 +#: ../../library/inspect.rst:1220 ../../library/inspect.rst:1230 msgid "This function was inadvertently marked as deprecated in Python 3.5." msgstr "" -#: ../../library/inspect.rst:1207 +#: ../../library/inspect.rst:1225 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." msgstr "" -#: ../../library/inspect.rst:1217 +#: ../../library/inspect.rst:1235 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 " @@ -1751,7 +1775,7 @@ msgid "" "user-defined metatype is in use, cls will be the first element of the tuple." msgstr "" -#: ../../library/inspect.rst:1225 +#: ../../library/inspect.rst:1243 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 " @@ -1764,7 +1788,7 @@ msgid "" "example:" msgstr "" -#: ../../library/inspect.rst:1234 +#: ../../library/inspect.rst:1252 msgid "" ">>> from inspect import getcallargs\n" ">>> def f(a, b=1, *pos, **named):\n" @@ -1794,11 +1818,11 @@ msgstr "" "...\n" "TypeError: f() missing 1 required positional argument: 'a'" -#: ../../library/inspect.rst:1251 +#: ../../library/inspect.rst:1269 msgid "Use :meth:`Signature.bind` and :meth:`Signature.bind_partial` instead." msgstr "請改用 :meth:`Signature.bind` 與 :meth:`Signature.bind_partial`。" -#: ../../library/inspect.rst:1257 +#: ../../library/inspect.rst:1275 msgid "" "Get the mapping of external name references in a Python function or method " "*func* to their current values. A :term:`named tuple` " @@ -1810,18 +1834,18 @@ msgid "" "builtins." msgstr "" -#: ../../library/inspect.rst:1266 +#: ../../library/inspect.rst:1284 msgid "" ":exc:`TypeError` is raised if *func* is not a Python function or method." msgstr "如果 *func* 不是 Python 函式或方法,則引發 :exc:`TypeError`。" -#: ../../library/inspect.rst:1273 +#: ../../library/inspect.rst:1291 msgid "" "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:1276 +#: ../../library/inspect.rst:1294 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 " @@ -1831,37 +1855,37 @@ msgid "" "``__signature__`` attribute defined." msgstr "" -#: ../../library/inspect.rst:1283 +#: ../../library/inspect.rst:1301 msgid ":exc:`ValueError` is raised if a cycle is encountered." msgstr "如果遇到循環,則引發 :exc:`ValueError`。" -#: ../../library/inspect.rst:1290 +#: ../../library/inspect.rst:1308 msgid "Compute the annotations dict for an object." msgstr "" -#: ../../library/inspect.rst:1292 +#: ../../library/inspect.rst:1310 msgid "" "This is an alias for :func:`annotationlib.get_annotations`; see the " "documentation of that function for more information." msgstr "" -#: ../../library/inspect.rst:1297 +#: ../../library/inspect.rst:1315 msgid "" "This function may execute arbitrary code contained in annotations. See :ref:" "`annotationlib-security` for more information." msgstr "" -#: ../../library/inspect.rst:1302 +#: ../../library/inspect.rst:1320 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:1310 +#: ../../library/inspect.rst:1328 msgid "The interpreter stack" msgstr "直譯器堆疊" -#: ../../library/inspect.rst:1312 +#: ../../library/inspect.rst:1330 msgid "" "Some of the following functions return :class:`FrameInfo` objects. For " "backwards compatibility these objects allow tuple-like operations on all " @@ -1869,95 +1893,95 @@ msgid "" "may be removed in the future." msgstr "" -#: ../../library/inspect.rst:1321 +#: ../../library/inspect.rst:1339 msgid "The :ref:`frame object ` that the record corresponds to." msgstr "" -#: ../../library/inspect.rst:1325 +#: ../../library/inspect.rst:1343 msgid "" "The file name associated with the code being executed by the frame this " "record corresponds to." msgstr "" -#: ../../library/inspect.rst:1330 +#: ../../library/inspect.rst:1348 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:1335 +#: ../../library/inspect.rst:1353 msgid "" "The function name that is being executed by the frame this record " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1339 +#: ../../library/inspect.rst:1357 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:1344 ../../library/inspect.rst:1383 +#: ../../library/inspect.rst:1362 ../../library/inspect.rst:1401 msgid "" "The index of the current line being executed in the :attr:`code_context` " "list." msgstr "" -#: ../../library/inspect.rst:1348 +#: ../../library/inspect.rst:1366 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:1352 +#: ../../library/inspect.rst:1370 msgid "Return a :term:`named tuple` instead of a :class:`tuple`." msgstr "" -#: ../../library/inspect.rst:1355 +#: ../../library/inspect.rst:1373 msgid "" ":class:`!FrameInfo` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1364 +#: ../../library/inspect.rst:1382 msgid "" "The file name associated with the code being executed by the frame this " "traceback corresponds to." msgstr "" -#: ../../library/inspect.rst:1369 +#: ../../library/inspect.rst:1387 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:1374 +#: ../../library/inspect.rst:1392 msgid "" "The function name that is being executed by the frame this traceback " "corresponds to." msgstr "" -#: ../../library/inspect.rst:1378 +#: ../../library/inspect.rst:1396 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:1387 +#: ../../library/inspect.rst:1405 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:1392 +#: ../../library/inspect.rst:1410 msgid "" ":class:`!Traceback` is now a class instance (that is backwards compatible " "with the previous :term:`named tuple`)." msgstr "" -#: ../../library/inspect.rst:1399 +#: ../../library/inspect.rst:1417 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 " @@ -1969,7 +1993,7 @@ msgid "" "consumption which occurs." msgstr "" -#: ../../library/inspect.rst:1407 +#: ../../library/inspect.rst:1425 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 :" @@ -1977,7 +2001,7 @@ msgid "" "disabled when Python was compiled or using :func:`gc.disable`. For example::" msgstr "" -#: ../../library/inspect.rst:1412 +#: ../../library/inspect.rst:1430 msgid "" "def handle_stackframe_without_leak():\n" " frame = inspect.currentframe()\n" @@ -1987,31 +2011,31 @@ msgid "" " del frame" msgstr "" -#: ../../library/inspect.rst:1419 +#: ../../library/inspect.rst:1437 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:1423 +#: ../../library/inspect.rst:1441 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:1430 +#: ../../library/inspect.rst:1448 msgid "" "Get information about a frame or traceback object. A :class:`Traceback` " "object is returned." msgstr "" -#: ../../library/inspect.rst:1433 +#: ../../library/inspect.rst:1451 msgid "A :class:`Traceback` object is returned instead of a named tuple." msgstr "" -#: ../../library/inspect.rst:1438 +#: ../../library/inspect.rst:1456 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 " @@ -2019,19 +2043,19 @@ msgid "" "represents the outermost call on *frame*'s stack." msgstr "" -#: ../../library/inspect.rst:1443 ../../library/inspect.rst:1458 -#: ../../library/inspect.rst:1484 ../../library/inspect.rst:1499 +#: ../../library/inspect.rst:1461 ../../library/inspect.rst:1476 +#: ../../library/inspect.rst:1502 ../../library/inspect.rst:1517 msgid "" "A list of :term:`named tuples ` ``FrameInfo(frame, filename, " "lineno, function, code_context, index)`` is returned." msgstr "" -#: ../../library/inspect.rst:1448 ../../library/inspect.rst:1463 -#: ../../library/inspect.rst:1489 ../../library/inspect.rst:1504 +#: ../../library/inspect.rst:1466 ../../library/inspect.rst:1481 +#: ../../library/inspect.rst:1507 ../../library/inspect.rst:1522 msgid "A list of :class:`FrameInfo` objects is returned." msgstr "回傳一個 :class:`FrameInfo` 物件串列。" -#: ../../library/inspect.rst:1453 +#: ../../library/inspect.rst:1471 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 " @@ -2039,11 +2063,11 @@ msgid "" "represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1468 +#: ../../library/inspect.rst:1486 msgid "Return the frame object for the caller's stack frame." msgstr "" -#: ../../library/inspect.rst:1472 +#: ../../library/inspect.rst:1490 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 " @@ -2051,14 +2075,14 @@ msgid "" "``None``." msgstr "" -#: ../../library/inspect.rst:1480 +#: ../../library/inspect.rst:1498 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:1494 +#: ../../library/inspect.rst:1512 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 " @@ -2066,11 +2090,11 @@ msgid "" "entry represents where the exception was raised." msgstr "" -#: ../../library/inspect.rst:1508 +#: ../../library/inspect.rst:1526 msgid "Fetching attributes statically" msgstr "" -#: ../../library/inspect.rst:1510 +#: ../../library/inspect.rst:1528 msgid "" "Both :func:`getattr` and :func:`hasattr` can trigger code execution when " "fetching or checking for the existence of attributes. Descriptors, like " @@ -2078,20 +2102,20 @@ msgid "" "`~object.__getattribute__` may be called." msgstr "" -#: ../../library/inspect.rst:1516 +#: ../../library/inspect.rst:1534 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." msgstr "" -#: ../../library/inspect.rst:1522 +#: ../../library/inspect.rst:1540 msgid "" "Retrieve attributes without triggering dynamic lookup via the descriptor " "protocol, :meth:`~object.__getattr__` or :meth:`~object.__getattribute__`." msgstr "" -#: ../../library/inspect.rst:1526 +#: ../../library/inspect.rst:1544 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 " @@ -2099,27 +2123,27 @@ msgid "" "return descriptors objects instead of instance members." msgstr "" -#: ../../library/inspect.rst:1532 +#: ../../library/inspect.rst:1550 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:1538 +#: ../../library/inspect.rst:1556 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:1542 +#: ../../library/inspect.rst:1560 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:1546 +#: ../../library/inspect.rst:1564 msgid "" "# example code for resolving the builtin descriptor types\n" "class _foo:\n" @@ -2142,11 +2166,11 @@ msgid "" " pass" msgstr "" -#: ../../library/inspect.rst:1568 +#: ../../library/inspect.rst:1586 msgid "Current State of Generators, Coroutines, and Asynchronous Generators" msgstr "" -#: ../../library/inspect.rst:1570 +#: ../../library/inspect.rst:1588 msgid "" "When implementing coroutine schedulers and for other advanced uses of " "generators, it is useful to determine whether a generator is currently " @@ -2155,32 +2179,32 @@ msgid "" "generator to be determined easily." msgstr "" -#: ../../library/inspect.rst:1578 +#: ../../library/inspect.rst:1596 msgid "Get current state of a generator-iterator." msgstr "" -#: ../../library/inspect.rst:1580 ../../library/inspect.rst:1596 -#: ../../library/inspect.rst:1613 +#: ../../library/inspect.rst:1598 ../../library/inspect.rst:1614 +#: ../../library/inspect.rst:1631 msgid "Possible states are:" msgstr "" -#: ../../library/inspect.rst:1582 +#: ../../library/inspect.rst:1600 msgid "GEN_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1583 +#: ../../library/inspect.rst:1601 msgid "GEN_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1584 +#: ../../library/inspect.rst:1602 msgid "GEN_SUSPENDED: Currently suspended at a yield expression." msgstr "" -#: ../../library/inspect.rst:1585 +#: ../../library/inspect.rst:1603 msgid "GEN_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1591 +#: ../../library/inspect.rst:1609 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 " @@ -2188,23 +2212,23 @@ msgid "" "``cr_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1598 +#: ../../library/inspect.rst:1616 msgid "CORO_CREATED: Waiting to start execution." msgstr "" -#: ../../library/inspect.rst:1599 +#: ../../library/inspect.rst:1617 msgid "CORO_RUNNING: Currently being executed by the interpreter." msgstr "" -#: ../../library/inspect.rst:1600 +#: ../../library/inspect.rst:1618 msgid "CORO_SUSPENDED: Currently suspended at an await expression." msgstr "" -#: ../../library/inspect.rst:1601 +#: ../../library/inspect.rst:1619 msgid "CORO_CLOSED: Execution has completed." msgstr "" -#: ../../library/inspect.rst:1607 +#: ../../library/inspect.rst:1625 msgid "" "Get current state of an asynchronous generator object. The function is " "intended to be used with asynchronous iterator objects created by :keyword:" @@ -2213,30 +2237,30 @@ msgid "" "``ag_frame`` attributes." msgstr "" -#: ../../library/inspect.rst:1615 +#: ../../library/inspect.rst:1633 msgid "AGEN_CREATED: Waiting to start execution." msgstr "AGEN_CREATED: 等待開始執行。" -#: ../../library/inspect.rst:1616 +#: ../../library/inspect.rst:1634 msgid "AGEN_RUNNING: Currently being executed by the interpreter." msgstr "AGEN_RUNNING: 目前正在被直譯器執行。" -#: ../../library/inspect.rst:1617 +#: ../../library/inspect.rst:1635 msgid "AGEN_SUSPENDED: Currently suspended at a yield expression." msgstr "AGEN_SUSPENDED: 目前於 yield 運算式暫停。" -#: ../../library/inspect.rst:1618 +#: ../../library/inspect.rst:1636 msgid "AGEN_CLOSED: Execution has completed." msgstr "AGEN_CLOSED: 執行已完成。" -#: ../../library/inspect.rst:1622 +#: ../../library/inspect.rst:1640 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:1628 +#: ../../library/inspect.rst:1646 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. " @@ -2244,14 +2268,14 @@ msgid "" "generator, and all the same caveats apply." msgstr "" -#: ../../library/inspect.rst:1633 +#: ../../library/inspect.rst:1651 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:1639 +#: ../../library/inspect.rst:1657 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 " @@ -2259,90 +2283,90 @@ msgid "" "dictionary." msgstr "" -#: ../../library/inspect.rst:1648 +#: ../../library/inspect.rst:1666 msgid "" "This function is analogous to :func:`~inspect.getgeneratorlocals`, but works " "for coroutine objects created by :keyword:`async def` functions." msgstr "" -#: ../../library/inspect.rst:1655 +#: ../../library/inspect.rst:1673 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:1665 +#: ../../library/inspect.rst:1683 msgid "Code Objects Bit Flags" msgstr "" -#: ../../library/inspect.rst:1667 +#: ../../library/inspect.rst:1685 msgid "" "Python code objects have a :attr:`~codeobject.co_flags` attribute, which is " "a bitmap of the following flags:" msgstr "" -#: ../../library/inspect.rst:1672 +#: ../../library/inspect.rst:1690 msgid "The code object is optimized, using fast locals." msgstr "" -#: ../../library/inspect.rst:1676 +#: ../../library/inspect.rst:1694 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:1681 +#: ../../library/inspect.rst:1699 msgid "The code object has a variable positional parameter (``*args``-like)." msgstr "" -#: ../../library/inspect.rst:1685 +#: ../../library/inspect.rst:1703 msgid "The code object has a variable keyword parameter (``**kwargs``-like)." msgstr "" -#: ../../library/inspect.rst:1689 +#: ../../library/inspect.rst:1707 msgid "The flag is set when the code object is a nested function." msgstr "" -#: ../../library/inspect.rst:1693 +#: ../../library/inspect.rst:1711 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:1698 +#: ../../library/inspect.rst:1716 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:1706 +#: ../../library/inspect.rst:1724 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:1715 +#: ../../library/inspect.rst:1733 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:1723 +#: ../../library/inspect.rst:1741 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:1731 +#: ../../library/inspect.rst:1749 msgid "" "The flag is set when the code object is a function defined in class scope." msgstr "" -#: ../../library/inspect.rst:1737 +#: ../../library/inspect.rst:1755 msgid "" "The flags are specific to CPython, and may not be defined in other Python " "implementations. Furthermore, the flags are an implementation detail, and " @@ -2350,39 +2374,39 @@ msgid "" "use public APIs from the :mod:`inspect` module for any introspection needs." msgstr "" -#: ../../library/inspect.rst:1745 +#: ../../library/inspect.rst:1763 msgid "Buffer flags" msgstr "" -#: ../../library/inspect.rst:1749 +#: ../../library/inspect.rst:1767 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 `." msgstr "" -#: ../../library/inspect.rst:1753 +#: ../../library/inspect.rst:1771 msgid "The meaning of the flags is explained at :ref:`buffer-request-types`." msgstr "" -#: ../../library/inspect.rst:1780 +#: ../../library/inspect.rst:1798 msgid "Command-line interface" msgstr "命令列介面" -#: ../../library/inspect.rst:1782 +#: ../../library/inspect.rst:1800 msgid "" "The :mod:`inspect` module also provides a basic introspection capability " "from the command line." msgstr "" -#: ../../library/inspect.rst:1787 +#: ../../library/inspect.rst:1805 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:1793 +#: ../../library/inspect.rst:1811 msgid "" "Print information about the specified object rather than the source code" msgstr "" diff --git a/library/linecache.po b/library/linecache.po index 8e7f152f09..79226acf26 100644 --- a/library/linecache.po +++ b/library/linecache.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-12-28 00:16+0000\n" "PO-Revision-Date: 2025-07-07 23:50+0800\n" "Last-Translator: Weilin Du <1372449351@qq.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -31,14 +31,13 @@ msgstr "**原始碼:**\\ :source:`Lib/linecache.py`" msgid "" "The :mod:`linecache` module allows one to get any line from a Python source " "file, while attempting to optimize internally, using a cache, the common " -"case where many lines are read from a single file. This is used by " -"the :mod:`traceback` module to retrieve source lines for inclusion in the " -"formatted traceback." +"case where many lines are read from a single file. This is used by the :mod:" +"`traceback` module to retrieve source lines for inclusion in the formatted " +"traceback." msgstr "" ":mod:`linecache` 模組允許從 Python 原始碼檔案中取得任何一行。當嘗試在程式內部" -"進行最佳化,會使用快取,這是從單一檔案讀取許多行的常見情況。 這" -"被 :mod:`traceback` 模組用來擷取來自原始碼檔案的行,以包含在格式化的 " -"traceback 中。" +"進行最佳化,會使用快取,這是從單一檔案讀取許多行的常見情況。 這被 :mod:" +"`traceback` 模組用來擷取來自原始碼檔案的行,以包含在格式化的 traceback 中。" #: ../../library/linecache.rst:18 msgid "" @@ -46,9 +45,9 @@ msgid "" "uses :func:`tokenize.detect_encoding` to get the encoding of the file; in " "the absence of an encoding token, the file encoding defaults to UTF-8." msgstr "" -":func:`tokenize.open` 函式用來開啟檔案。這個函式使" -"用 :func:`tokenize.detect_encoding` 來取得檔案的編碼;在沒有編碼標記的情況" -"下,檔案編碼預設為 UTF-8。" +":func:`tokenize.open` 函式用來開啟檔案。這個函式使用 :func:`tokenize." +"detect_encoding` 來取得檔案的編碼;在沒有編碼標記的情況下,檔案編碼預設為 " +"UTF-8。" #: ../../library/linecache.rst:22 msgid "The :mod:`linecache` module defines the following functions:" @@ -66,21 +65,21 @@ msgstr "" #: ../../library/linecache.rst:33 msgid "" "If *filename* indicates a frozen module (starting with ``'\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1317,11 +1317,11 @@ msgstr "" msgid "Attribute name" msgstr "屬性名稱" -#: ../../library/logging.rst:995 ../../library/logging.rst:1370 +#: ../../library/logging.rst:995 ../../library/logging.rst:1375 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:995 ../../library/logging.rst:1370 +#: ../../library/logging.rst:995 ../../library/logging.rst:1375 msgid "Description" msgstr "描述" @@ -1330,7 +1330,8 @@ msgid "args" msgstr "args" #: ../../library/logging.rst:997 ../../library/logging.rst:1011 -#: ../../library/logging.rst:1039 ../../library/logging.rst:1057 +#: ../../library/logging.rst:1014 ../../library/logging.rst:1044 +#: ../../library/logging.rst:1062 msgid "You shouldn't need to format this yourself." msgstr "你不應該需要自己格式化它。" @@ -1381,250 +1382,260 @@ msgid "" msgstr "" #: ../../library/logging.rst:1014 +msgid "exc_text" +msgstr "" + +#: ../../library/logging.rst:1014 +msgid "" +"Exception information formatted as a string. This is set when :meth:" +"`Formatter.format` is invoked, or ``None`` if no exception has occurred." +msgstr "" + +#: ../../library/logging.rst:1019 msgid "filename" msgstr "filename" -#: ../../library/logging.rst:1014 +#: ../../library/logging.rst:1019 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:1014 +#: ../../library/logging.rst:1019 msgid "Filename portion of ``pathname``." msgstr "``pathname`` 的檔案名稱部分。" -#: ../../library/logging.rst:1016 +#: ../../library/logging.rst:1021 msgid "funcName" msgstr "funcName" -#: ../../library/logging.rst:1016 +#: ../../library/logging.rst:1021 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:1016 +#: ../../library/logging.rst:1021 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:1018 +#: ../../library/logging.rst:1023 msgid "levelname" msgstr "levelname" -#: ../../library/logging.rst:1018 +#: ../../library/logging.rst:1023 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:1018 +#: ../../library/logging.rst:1023 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:1022 +#: ../../library/logging.rst:1027 msgid "levelno" msgstr "levelno" -#: ../../library/logging.rst:1022 +#: ../../library/logging.rst:1027 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:1022 +#: ../../library/logging.rst:1027 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1032 msgid "lineno" msgstr "lineno" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1032 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:1027 +#: ../../library/logging.rst:1032 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:1030 +#: ../../library/logging.rst:1035 msgid "message" msgstr "message" -#: ../../library/logging.rst:1030 +#: ../../library/logging.rst:1035 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:1030 +#: ../../library/logging.rst:1035 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:1034 +#: ../../library/logging.rst:1039 msgid "module" msgstr "模組" -#: ../../library/logging.rst:1034 +#: ../../library/logging.rst:1039 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:1034 +#: ../../library/logging.rst:1039 msgid "Module (name portion of ``filename``)." msgstr "模組(``filename`` 的名稱部分)。" -#: ../../library/logging.rst:1036 +#: ../../library/logging.rst:1041 msgid "msecs" msgstr "msecs" -#: ../../library/logging.rst:1036 +#: ../../library/logging.rst:1041 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:1036 +#: ../../library/logging.rst:1041 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:1039 +#: ../../library/logging.rst:0 ../../library/logging.rst:1044 msgid "msg" msgstr "msg" -#: ../../library/logging.rst:1039 +#: ../../library/logging.rst:1044 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:1044 +#: ../../library/logging.rst:0 ../../library/logging.rst:1049 msgid "name" msgstr "name" -#: ../../library/logging.rst:1044 +#: ../../library/logging.rst:1049 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:1044 +#: ../../library/logging.rst:1049 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:1046 +#: ../../library/logging.rst:1051 msgid "pathname" msgstr "pathname" -#: ../../library/logging.rst:1046 +#: ../../library/logging.rst:1051 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:1046 +#: ../../library/logging.rst:1051 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:1049 +#: ../../library/logging.rst:1054 msgid "process" msgstr "process" -#: ../../library/logging.rst:1049 +#: ../../library/logging.rst:1054 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:1049 +#: ../../library/logging.rst:1054 msgid "Process ID (if available)." msgstr "行程 ID(如果可用)。" -#: ../../library/logging.rst:1051 +#: ../../library/logging.rst:1056 msgid "processName" msgstr "processName" -#: ../../library/logging.rst:1051 +#: ../../library/logging.rst:1056 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:1051 +#: ../../library/logging.rst:1056 msgid "Process name (if available)." msgstr "行程名稱(如果可用)。" -#: ../../library/logging.rst:1053 +#: ../../library/logging.rst:1058 msgid "relativeCreated" msgstr "relativeCreated" -#: ../../library/logging.rst:1053 +#: ../../library/logging.rst:1058 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:1053 +#: ../../library/logging.rst:1058 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:1057 +#: ../../library/logging.rst:1062 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:1057 +#: ../../library/logging.rst:1062 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:1063 +#: ../../library/logging.rst:1068 msgid "thread" msgstr "thread" -#: ../../library/logging.rst:1063 +#: ../../library/logging.rst:1068 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:1063 +#: ../../library/logging.rst:1068 msgid "Thread ID (if available)." msgstr "執行緒 ID(如果可用)。" -#: ../../library/logging.rst:1065 +#: ../../library/logging.rst:1070 msgid "threadName" msgstr "threadName" -#: ../../library/logging.rst:1065 +#: ../../library/logging.rst:1070 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:1065 +#: ../../library/logging.rst:1070 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:1067 +#: ../../library/logging.rst:1072 msgid "taskName" msgstr "taskName" -#: ../../library/logging.rst:1067 +#: ../../library/logging.rst:1072 msgid "``%(taskName)s``" msgstr "``%(taskName)s``" -#: ../../library/logging.rst:1067 +#: ../../library/logging.rst:1072 msgid ":class:`asyncio.Task` name (if available)." msgstr "" -#: ../../library/logging.rst:1070 +#: ../../library/logging.rst:1075 msgid "*processName* was added." msgstr "新增 *processName*。" -#: ../../library/logging.rst:1073 +#: ../../library/logging.rst:1078 msgid "*taskName* was added." msgstr "新增 *taskName*。" -#: ../../library/logging.rst:1079 +#: ../../library/logging.rst:1084 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:1081 +#: ../../library/logging.rst:1086 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 `." msgstr "" -#: ../../library/logging.rst:1087 +#: ../../library/logging.rst:1092 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance, an optional dict-like object (*extra*), " @@ -1635,7 +1646,7 @@ msgid "" "`LoggerAdapter` instance" msgstr "" -#: ../../library/logging.rst:1097 +#: ../../library/logging.rst:1102 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1644,15 +1655,15 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:1105 +#: ../../library/logging.rst:1110 msgid "Delegates to the underlying :attr:`!manager` on *logger*." msgstr "" -#: ../../library/logging.rst:1109 +#: ../../library/logging.rst:1114 msgid "Delegates to the underlying :meth:`!_log` method on *logger*." msgstr "" -#: ../../library/logging.rst:1111 +#: ../../library/logging.rst:1116 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1664,32 +1675,32 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:1122 +#: ../../library/logging.rst:1127 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." msgstr "" -#: ../../library/logging.rst:1128 +#: ../../library/logging.rst:1133 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:1138 msgid "The *extra* argument is now optional." msgstr "*extra* 引數現在是可選的。" -#: ../../library/logging.rst:1137 +#: ../../library/logging.rst:1142 msgid "The *merge_extra* parameter was added." msgstr "新增 *merge_extra* 參數。" -#: ../../library/logging.rst:1141 +#: ../../library/logging.rst:1146 msgid "Thread Safety" msgstr "執行緒安全" -#: ../../library/logging.rst:1143 +#: ../../library/logging.rst:1148 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this through using threading " @@ -1698,7 +1709,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:1148 +#: ../../library/logging.rst:1153 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 " @@ -1706,17 +1717,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:1155 +#: ../../library/logging.rst:1160 msgid "Module-Level Functions" msgstr "模組層級函式" -#: ../../library/logging.rst:1157 +#: ../../library/logging.rst:1162 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:1163 +#: ../../library/logging.rst:1168 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-" @@ -1726,14 +1737,14 @@ msgid "" "for not doing that, as mentioned in :ref:`logger`." msgstr "" -#: ../../library/logging.rst:1170 +#: ../../library/logging.rst:1175 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:1177 +#: ../../library/logging.rst:1182 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 " @@ -1742,7 +1753,7 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:1182 +#: ../../library/logging.rst:1187 msgid "" "class MyLogger(logging.getLoggerClass()):\n" " # ... override behaviour here" @@ -1750,37 +1761,37 @@ msgstr "" "class MyLogger(logging.getLoggerClass()):\n" " # ... 在這裡覆蓋其行為" -#: ../../library/logging.rst:1188 +#: ../../library/logging.rst:1193 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1190 +#: ../../library/logging.rst:1195 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:1195 +#: ../../library/logging.rst:1200 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1200 +#: ../../library/logging.rst:1205 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:1204 +#: ../../library/logging.rst:1209 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." msgstr "" -#: ../../library/logging.rst:1207 +#: ../../library/logging.rst:1212 msgid "" "For very short scripts or quick demonstrations of ``logging`` facilities, " "``debug`` and the other module-level functions may be convenient. However, " @@ -1790,38 +1801,38 @@ msgid "" "described at the beginning of this documentation." msgstr "" -#: ../../library/logging.rst:1217 +#: ../../library/logging.rst:1222 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:1223 +#: ../../library/logging.rst:1228 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:1226 +#: ../../library/logging.rst:1231 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:1233 +#: ../../library/logging.rst:1238 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:1239 +#: ../../library/logging.rst:1244 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:1245 +#: ../../library/logging.rst:1250 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 " @@ -1829,13 +1840,13 @@ msgid "" "exception handler." msgstr "" -#: ../../library/logging.rst:1251 +#: ../../library/logging.rst:1256 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:1256 +#: ../../library/logging.rst:1261 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 " @@ -1849,7 +1860,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1267 +#: ../../library/logging.rst:1272 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 " @@ -1857,13 +1868,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1272 +#: ../../library/logging.rst:1277 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1278 +#: ../../library/logging.rst:1283 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1873,24 +1884,24 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1285 +#: ../../library/logging.rst:1290 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1290 +#: ../../library/logging.rst:1295 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:1298 +#: ../../library/logging.rst:1303 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1300 +#: ../../library/logging.rst:1305 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1900,20 +1911,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1307 +#: ../../library/logging.rst:1312 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:1311 +#: ../../library/logging.rst:1316 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1314 +#: ../../library/logging.rst:1319 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 " @@ -1922,7 +1933,7 @@ msgid "" "vice versa." msgstr "" -#: ../../library/logging.rst:1320 +#: ../../library/logging.rst:1325 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. " @@ -1930,17 +1941,17 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1328 +#: ../../library/logging.rst:1333 msgid "" "Returns a handler with the specified *name*, or ``None`` if there is no " "handler with that name." msgstr "" -#: ../../library/logging.rst:1335 +#: ../../library/logging.rst:1340 msgid "Returns an immutable set of all known handler names." msgstr "" -#: ../../library/logging.rst:1341 +#: ../../library/logging.rst:1346 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1948,7 +1959,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1349 +#: ../../library/logging.rst:1354 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1957,13 +1968,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1355 +#: ../../library/logging.rst:1360 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:1358 +#: ../../library/logging.rst:1363 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 " @@ -1972,54 +1983,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1365 +#: ../../library/logging.rst:1370 msgid "The following keyword arguments are supported." msgstr "支援以下的關鍵字引數。" -#: ../../library/logging.rst:1372 +#: ../../library/logging.rst:1377 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1372 +#: ../../library/logging.rst:1377 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1376 +#: ../../library/logging.rst:1381 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1376 +#: ../../library/logging.rst:1381 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1380 +#: ../../library/logging.rst:1385 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1380 +#: ../../library/logging.rst:1385 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1385 +#: ../../library/logging.rst:1390 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1385 +#: ../../library/logging.rst:1390 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1388 +#: ../../library/logging.rst:1393 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1388 +#: ../../library/logging.rst:1393 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1399 +#: ../../library/logging.rst:1404 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1399 +#: ../../library/logging.rst:1404 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:1405 +#: ../../library/logging.rst:1410 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1405 +#: ../../library/logging.rst:1410 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 " @@ -2059,33 +2070,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1414 +#: ../../library/logging.rst:1419 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1414 +#: ../../library/logging.rst:1419 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:1420 +#: ../../library/logging.rst:1425 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1420 +#: ../../library/logging.rst:1425 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:1425 +#: ../../library/logging.rst:1430 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1425 +#: ../../library/logging.rst:1430 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 " @@ -2094,39 +2105,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1436 +#: ../../library/logging.rst:1441 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1439 +#: ../../library/logging.rst:1444 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:1445 +#: ../../library/logging.rst:1450 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1448 +#: ../../library/logging.rst:1453 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1453 +#: ../../library/logging.rst:1458 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:1457 +#: ../../library/logging.rst:1462 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:1464 +#: ../../library/logging.rst:1469 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 " @@ -2138,32 +2149,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1475 +#: ../../library/logging.rst:1480 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1477 +#: ../../library/logging.rst:1482 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1479 +#: ../../library/logging.rst:1484 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:1484 +#: ../../library/logging.rst:1489 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1486 +#: ../../library/logging.rst:1491 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1488 +#: ../../library/logging.rst:1493 msgid "The logger name." msgstr "" @@ -2171,7 +2182,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1489 +#: ../../library/logging.rst:1494 msgid "The logging level (numeric)." msgstr "" @@ -2179,7 +2190,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1490 +#: ../../library/logging.rst:1495 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -2187,19 +2198,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1491 +#: ../../library/logging.rst:1496 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1492 +#: ../../library/logging.rst:1497 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1493 +#: ../../library/logging.rst:1498 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1494 +#: ../../library/logging.rst:1499 msgid "An exception tuple, or ``None``." msgstr "" @@ -2207,7 +2218,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1495 +#: ../../library/logging.rst:1500 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -2215,7 +2226,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1497 +#: ../../library/logging.rst:1502 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -2225,15 +2236,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1499 +#: ../../library/logging.rst:1504 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1503 +#: ../../library/logging.rst:1508 msgid "Module-Level Attributes" msgstr "模組層級屬性" -#: ../../library/logging.rst:1507 +#: ../../library/logging.rst:1512 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``, " @@ -2244,15 +2255,15 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1519 +#: ../../library/logging.rst:1524 msgid "Used to see if exceptions during handling should be propagated." msgstr "" -#: ../../library/logging.rst:1521 +#: ../../library/logging.rst:1526 msgid "Default: ``True``." msgstr "" -#: ../../library/logging.rst:1523 +#: ../../library/logging.rst:1528 msgid "" "If :data:`raiseExceptions` is ``False``, exceptions get silently ignored. " "This is what is mostly wanted for a logging system - most users will not " @@ -2260,22 +2271,22 @@ msgid "" "application errors." msgstr "" -#: ../../library/logging.rst:1530 +#: ../../library/logging.rst:1535 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1532 +#: ../../library/logging.rst:1537 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1537 +#: ../../library/logging.rst:1542 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1540 +#: ../../library/logging.rst:1545 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -2284,46 +2295,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1545 +#: ../../library/logging.rst:1550 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)." msgstr "" -#: ../../library/logging.rst:1552 +#: ../../library/logging.rst:1557 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` 模組" -#: ../../library/logging.rst:1553 +#: ../../library/logging.rst:1558 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1555 +#: ../../library/logging.rst:1560 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../library/logging.rst:1556 +#: ../../library/logging.rst:1561 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1558 +#: ../../library/logging.rst:1563 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1559 +#: ../../library/logging.rst:1564 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1562 +#: ../../library/logging.rst:1567 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1563 +#: ../../library/logging.rst:1568 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/multiprocessing.po b/library/multiprocessing.po index 5b8b2c983c..5f1290c071 100644 --- a/library/multiprocessing.po +++ b/library/multiprocessing.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-12-16 00:15+0000\n" +"POT-Creation-Date: 2026-01-03 00:14+0000\n" "PO-Revision-Date: 2018-05-23 16:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -2185,9 +2185,9 @@ msgid "" msgstr "" #: ../../library/multiprocessing.rst:1471 -#: ../../library/multiprocessing.rst:2063 +#: ../../library/multiprocessing.rst:2066 msgid "The :meth:`~threading.Condition.wait_for` method was added." -msgstr "" +msgstr "新增 :meth:`~threading.Condition.wait_for` 方法。" #: ../../library/multiprocessing.rst:1476 msgid "A clone of :class:`threading.Event`." @@ -2376,7 +2376,7 @@ msgid "" msgstr "" #: ../../library/multiprocessing.rst:1665 -#: ../../library/multiprocessing.rst:1752 +#: ../../library/multiprocessing.rst:1755 msgid "" "*typecode_or_type* determines the type of the returned object: it is either " "a ctypes type or a one character typecode of the kind used by the :mod:" @@ -2431,14 +2431,17 @@ msgstr "" #: ../../library/multiprocessing.rst:1695 msgid "" "*typecode_or_type* determines the type of the elements of the returned " -"array: it is either a ctypes type or a one character typecode of the kind " -"used by the :mod:`array` module. If *size_or_initializer* is an integer, " -"then it determines the length of the array, and the array will be initially " -"zeroed. Otherwise, *size_or_initializer* is a sequence which is used to " -"initialize the array and whose length determines the length of the array." +"array: it is either a :ref:`ctypes type ` or " +"a one character typecode of the kind used by the :mod:`array` module with " +"the exception of ``'w'``, which is not supported. In addition, the ``'c'`` " +"typecode is an alias for :class:`ctypes.c_char`. If *size_or_initializer* " +"is an integer, then it determines the length of the array, and the array " +"will be initially zeroed. Otherwise, *size_or_initializer* is a sequence " +"which is used to initialize the array and whose length determines the length " +"of the array." msgstr "" -#: ../../library/multiprocessing.rst:1702 +#: ../../library/multiprocessing.rst:1705 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`Lock` or :class:" @@ -2448,28 +2451,28 @@ msgid "" "safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1709 +#: ../../library/multiprocessing.rst:1712 msgid "Note that *lock* is a keyword only argument." msgstr "" -#: ../../library/multiprocessing.rst:1711 +#: ../../library/multiprocessing.rst:1714 msgid "" "Note that an array of :data:`ctypes.c_char` has *value* and *raw* attributes " "which allow one to use it to store and retrieve strings." msgstr "" -#: ../../library/multiprocessing.rst:1716 +#: ../../library/multiprocessing.rst:1719 msgid "The :mod:`multiprocessing.sharedctypes` module" msgstr ":mod:`multiprocessing.sharedctypes` 模組" -#: ../../library/multiprocessing.rst:1721 +#: ../../library/multiprocessing.rst:1724 msgid "" "The :mod:`multiprocessing.sharedctypes` module provides functions for " "allocating :mod:`ctypes` objects from shared memory which can be inherited " "by child processes." msgstr "" -#: ../../library/multiprocessing.rst:1727 +#: ../../library/multiprocessing.rst:1730 msgid "" "Although it is possible to store a pointer in shared memory remember that " "this will refer to a location in the address space of a specific process. " @@ -2478,11 +2481,11 @@ msgid "" "may cause a crash." msgstr "" -#: ../../library/multiprocessing.rst:1735 +#: ../../library/multiprocessing.rst:1738 msgid "Return a ctypes array allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1737 +#: ../../library/multiprocessing.rst:1740 msgid "" "*typecode_or_type* determines the type of the elements of the returned " "array: it is either a ctypes type or a one character typecode of the kind " @@ -2492,40 +2495,40 @@ msgid "" "initialize the array and whose length determines the length of the array." msgstr "" -#: ../../library/multiprocessing.rst:1744 +#: ../../library/multiprocessing.rst:1747 msgid "" "Note that setting and getting an element is potentially non-atomic -- use :" "func:`Array` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1750 +#: ../../library/multiprocessing.rst:1753 msgid "Return a ctypes object allocated from shared memory." msgstr "" -#: ../../library/multiprocessing.rst:1756 +#: ../../library/multiprocessing.rst:1759 msgid "" "Note that setting and getting the value is potentially non-atomic -- use :" "func:`Value` instead to make sure that access is automatically synchronized " "using a lock." msgstr "" -#: ../../library/multiprocessing.rst:1760 +#: ../../library/multiprocessing.rst:1763 msgid "" "Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw`` " "attributes which allow one to use it to store and retrieve strings -- see " "documentation for :mod:`ctypes`." msgstr "" -#: ../../library/multiprocessing.rst:1766 +#: ../../library/multiprocessing.rst:1769 msgid "" "The same as :func:`RawArray` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "array." msgstr "" -#: ../../library/multiprocessing.rst:1770 -#: ../../library/multiprocessing.rst:1790 +#: ../../library/multiprocessing.rst:1773 +#: ../../library/multiprocessing.rst:1793 msgid "" "If *lock* is ``True`` (the default) then a new lock object is created to " "synchronize access to the value. If *lock* is a :class:`~multiprocessing." @@ -2535,128 +2538,128 @@ msgid "" "not necessarily be \"process-safe\"." msgstr "" -#: ../../library/multiprocessing.rst:1778 -#: ../../library/multiprocessing.rst:1797 -#: ../../library/multiprocessing.rst:1814 -#: ../../library/multiprocessing.rst:1935 +#: ../../library/multiprocessing.rst:1781 +#: ../../library/multiprocessing.rst:1800 +#: ../../library/multiprocessing.rst:1817 +#: ../../library/multiprocessing.rst:1938 msgid "" "*ctx* is a context object, or ``None`` (use the current context). If " "``None``, calling this may set the global start method. See :ref:`global-" "start-method` for more details." msgstr "" -#: ../../library/multiprocessing.rst:1782 -#: ../../library/multiprocessing.rst:1801 +#: ../../library/multiprocessing.rst:1785 +#: ../../library/multiprocessing.rst:1804 msgid "Note that *lock* and *ctx* are keyword-only parameters." msgstr "" -#: ../../library/multiprocessing.rst:1786 +#: ../../library/multiprocessing.rst:1789 msgid "" "The same as :func:`RawValue` except that depending on the value of *lock* a " "process-safe synchronization wrapper may be returned instead of a raw ctypes " "object." msgstr "" -#: ../../library/multiprocessing.rst:1805 +#: ../../library/multiprocessing.rst:1808 msgid "" "Return a ctypes object allocated from shared memory which is a copy of the " "ctypes object *obj*." msgstr "" -#: ../../library/multiprocessing.rst:1810 +#: ../../library/multiprocessing.rst:1813 msgid "" "Return a process-safe wrapper object for a ctypes object which uses *lock* " "to synchronize access. If *lock* is ``None`` (the default) then a :class:" "`multiprocessing.RLock` object is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1818 +#: ../../library/multiprocessing.rst:1821 msgid "" "A synchronized wrapper will have two methods in addition to those of the " "object it wraps: :meth:`get_obj` returns the wrapped object and :meth:" "`get_lock` returns the lock object used for synchronization." msgstr "" -#: ../../library/multiprocessing.rst:1822 +#: ../../library/multiprocessing.rst:1825 msgid "" "Note that accessing the ctypes object through the wrapper can be a lot " "slower than accessing the raw ctypes object." msgstr "" -#: ../../library/multiprocessing.rst:1825 +#: ../../library/multiprocessing.rst:1828 msgid "Synchronized objects support the :term:`context manager` protocol." msgstr "" -#: ../../library/multiprocessing.rst:1829 +#: ../../library/multiprocessing.rst:1832 msgid "" "The table below compares the syntax for creating shared ctypes objects from " "shared memory with the normal ctypes syntax. (In the table ``MyStruct`` is " "some subclass of :class:`ctypes.Structure`.)" msgstr "" -#: ../../library/multiprocessing.rst:1834 +#: ../../library/multiprocessing.rst:1837 msgid "ctypes" msgstr "ctypes" -#: ../../library/multiprocessing.rst:1834 +#: ../../library/multiprocessing.rst:1837 msgid "sharedctypes using type" msgstr "" -#: ../../library/multiprocessing.rst:1834 +#: ../../library/multiprocessing.rst:1837 msgid "sharedctypes using typecode" msgstr "" -#: ../../library/multiprocessing.rst:1836 +#: ../../library/multiprocessing.rst:1839 msgid "c_double(2.4)" msgstr "c_double(2.4)" -#: ../../library/multiprocessing.rst:1836 +#: ../../library/multiprocessing.rst:1839 msgid "RawValue(c_double, 2.4)" msgstr "RawValue(c_double, 2.4)" -#: ../../library/multiprocessing.rst:1836 +#: ../../library/multiprocessing.rst:1839 msgid "RawValue('d', 2.4)" msgstr "RawValue('d', 2.4)" -#: ../../library/multiprocessing.rst:1837 +#: ../../library/multiprocessing.rst:1840 msgid "MyStruct(4, 6)" msgstr "MyStruct(4, 6)" -#: ../../library/multiprocessing.rst:1837 +#: ../../library/multiprocessing.rst:1840 msgid "RawValue(MyStruct, 4, 6)" msgstr "RawValue(MyStruct, 4, 6)" -#: ../../library/multiprocessing.rst:1838 +#: ../../library/multiprocessing.rst:1841 msgid "(c_short * 7)()" msgstr "(c_short * 7)()" -#: ../../library/multiprocessing.rst:1838 +#: ../../library/multiprocessing.rst:1841 msgid "RawArray(c_short, 7)" msgstr "RawArray(c_short, 7)" -#: ../../library/multiprocessing.rst:1838 +#: ../../library/multiprocessing.rst:1841 msgid "RawArray('h', 7)" msgstr "RawArray('h', 7)" -#: ../../library/multiprocessing.rst:1839 +#: ../../library/multiprocessing.rst:1842 msgid "(c_int * 3)(9, 2, 8)" msgstr "(c_int * 3)(9, 2, 8)" -#: ../../library/multiprocessing.rst:1839 +#: ../../library/multiprocessing.rst:1842 msgid "RawArray(c_int, (9, 2, 8))" msgstr "RawArray(c_int, (9, 2, 8))" -#: ../../library/multiprocessing.rst:1839 +#: ../../library/multiprocessing.rst:1842 msgid "RawArray('i', (9, 2, 8))" msgstr "RawArray('i', (9, 2, 8))" -#: ../../library/multiprocessing.rst:1843 +#: ../../library/multiprocessing.rst:1846 msgid "" "Below is an example where a number of ctypes objects are modified by a child " "process::" msgstr "" -#: ../../library/multiprocessing.rst:1846 +#: ../../library/multiprocessing.rst:1849 msgid "" "from multiprocessing import Process, Lock\n" "from multiprocessing.sharedctypes import Value, Array\n" @@ -2722,11 +2725,11 @@ msgstr "" " print(s.value)\n" " print([(a.x, a.y) for a in A])" -#: ../../library/multiprocessing.rst:1881 +#: ../../library/multiprocessing.rst:1884 msgid "The results printed are ::" msgstr "" -#: ../../library/multiprocessing.rst:1883 +#: ../../library/multiprocessing.rst:1886 msgid "" "49\n" "0.1111111111111111\n" @@ -2738,11 +2741,11 @@ msgstr "" "HELLO WORLD\n" "[(3.515625, 39.0625), (33.0625, 4.0), (5.640625, 90.25)]" -#: ../../library/multiprocessing.rst:1894 +#: ../../library/multiprocessing.rst:1897 msgid "Managers" msgstr "" -#: ../../library/multiprocessing.rst:1896 +#: ../../library/multiprocessing.rst:1899 msgid "" "Managers provide a way to create data which can be shared between different " "processes, including sharing over a network between processes running on " @@ -2751,7 +2754,7 @@ msgid "" "proxies." msgstr "" -#: ../../library/multiprocessing.rst:1905 +#: ../../library/multiprocessing.rst:1908 msgid "" "Returns a started :class:`~multiprocessing.managers.SyncManager` object " "which can be used for sharing objects between processes. The returned " @@ -2759,31 +2762,31 @@ msgid "" "will create shared objects and return corresponding proxies." msgstr "" -#: ../../library/multiprocessing.rst:1913 +#: ../../library/multiprocessing.rst:1916 msgid "" "Manager processes will be shutdown as soon as they are garbage collected or " "their parent process exits. The manager classes are defined in the :mod:" "`multiprocessing.managers` module:" msgstr "" -#: ../../library/multiprocessing.rst:1919 +#: ../../library/multiprocessing.rst:1922 msgid "Create a BaseManager object." msgstr "建立一個 BaseManager 物件。" -#: ../../library/multiprocessing.rst:1921 +#: ../../library/multiprocessing.rst:1924 msgid "" "Once created one should call :meth:`start` or ``get_server()." "serve_forever()`` to ensure that the manager object refers to a started " "manager process." msgstr "" -#: ../../library/multiprocessing.rst:1924 +#: ../../library/multiprocessing.rst:1927 msgid "" "*address* is the address on which the manager process listens for new " "connections. If *address* is ``None`` then an arbitrary one is chosen." msgstr "" -#: ../../library/multiprocessing.rst:1927 +#: ../../library/multiprocessing.rst:1930 msgid "" "*authkey* is the authentication key which will be used to check the validity " "of incoming connections to the server process. If *authkey* is ``None`` " @@ -2791,13 +2794,13 @@ msgid "" "it must be a byte string." msgstr "" -#: ../../library/multiprocessing.rst:1932 +#: ../../library/multiprocessing.rst:1935 msgid "" "*serializer* must be ``'pickle'`` (use :mod:`pickle` serialization) or " "``'xmlrpclib'`` (use :mod:`xmlrpc.client` serialization)." msgstr "" -#: ../../library/multiprocessing.rst:1939 +#: ../../library/multiprocessing.rst:1942 msgid "" "*shutdown_timeout* is a timeout in seconds used to wait until the process " "used by the manager completes in the :meth:`shutdown` method. If the " @@ -2805,24 +2808,24 @@ msgid "" "also times out, the process is killed." msgstr "" -#: ../../library/multiprocessing.rst:1944 +#: ../../library/multiprocessing.rst:1947 msgid "Added the *shutdown_timeout* parameter." msgstr "新增 *shutdown_timeout* 參數。" -#: ../../library/multiprocessing.rst:1949 +#: ../../library/multiprocessing.rst:1952 msgid "" "Start a subprocess to start the manager. If *initializer* is not ``None`` " "then the subprocess will call ``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:1954 +#: ../../library/multiprocessing.rst:1957 msgid "" "Returns a :class:`Server` object which represents the actual server under " "the control of the Manager. The :class:`Server` object supports the :meth:" "`serve_forever` method::" msgstr "" -#: ../../library/multiprocessing.rst:1958 +#: ../../library/multiprocessing.rst:1961 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> manager = BaseManager(address=('', 50000), authkey=b'abc')\n" @@ -2834,15 +2837,15 @@ msgstr "" ">>> server = manager.get_server()\n" ">>> server.serve_forever()" -#: ../../library/multiprocessing.rst:1963 +#: ../../library/multiprocessing.rst:1966 msgid ":class:`Server` additionally has an :attr:`address` attribute." msgstr "" -#: ../../library/multiprocessing.rst:1967 +#: ../../library/multiprocessing.rst:1970 msgid "Connect a local manager object to a remote manager process::" msgstr "" -#: ../../library/multiprocessing.rst:1969 +#: ../../library/multiprocessing.rst:1972 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> m = BaseManager(address=('127.0.0.1', 50000), authkey=b'abc')\n" @@ -2852,29 +2855,29 @@ msgstr "" ">>> m = BaseManager(address=('127.0.0.1', 50000), authkey=b'abc')\n" ">>> m.connect()" -#: ../../library/multiprocessing.rst:1975 +#: ../../library/multiprocessing.rst:1978 msgid "" "Stop the process used by the manager. This is only available if :meth:" "`start` has been used to start the server process." msgstr "" -#: ../../library/multiprocessing.rst:1978 +#: ../../library/multiprocessing.rst:1981 msgid "This can be called multiple times." msgstr "" -#: ../../library/multiprocessing.rst:1982 +#: ../../library/multiprocessing.rst:1985 msgid "" "A classmethod which can be used for registering a type or callable with the " "manager class." msgstr "" -#: ../../library/multiprocessing.rst:1985 +#: ../../library/multiprocessing.rst:1988 msgid "" "*typeid* is a \"type identifier\" which is used to identify a particular " "type of shared object. This must be a string." msgstr "" -#: ../../library/multiprocessing.rst:1988 +#: ../../library/multiprocessing.rst:1991 msgid "" "*callable* is a callable used for creating objects for this type " "identifier. If a manager instance will be connected to the server using " @@ -2882,14 +2885,14 @@ msgid "" "then this can be left as ``None``." msgstr "" -#: ../../library/multiprocessing.rst:1994 +#: ../../library/multiprocessing.rst:1997 msgid "" "*proxytype* is a subclass of :class:`BaseProxy` which is used to create " "proxies for shared objects with this *typeid*. If ``None`` then a proxy " "class is created automatically." msgstr "" -#: ../../library/multiprocessing.rst:1998 +#: ../../library/multiprocessing.rst:2001 msgid "" "*exposed* is used to specify a sequence of method names which proxies for " "this typeid should be allowed to access using :meth:`BaseProxy." @@ -2900,7 +2903,7 @@ msgid "" "method and whose name does not begin with ``'_'``.)" msgstr "" -#: ../../library/multiprocessing.rst:2007 +#: ../../library/multiprocessing.rst:2010 msgid "" "*method_to_typeid* is a mapping used to specify the return type of those " "exposed methods which should return a proxy. It maps method names to typeid " @@ -2910,22 +2913,22 @@ msgid "" "returned by the method will be copied by value." msgstr "" -#: ../../library/multiprocessing.rst:2014 +#: ../../library/multiprocessing.rst:2017 msgid "" "*create_method* determines whether a method should be created with name " "*typeid* which can be used to tell the server process to create a new shared " "object and return a proxy for it. By default it is ``True``." msgstr "" -#: ../../library/multiprocessing.rst:2018 +#: ../../library/multiprocessing.rst:2021 msgid ":class:`BaseManager` instances also have one read-only property:" msgstr "" -#: ../../library/multiprocessing.rst:2022 +#: ../../library/multiprocessing.rst:2025 msgid "The address used by the manager." msgstr "" -#: ../../library/multiprocessing.rst:2024 +#: ../../library/multiprocessing.rst:2027 msgid "" "Manager objects support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` starts the server " @@ -2933,129 +2936,129 @@ msgid "" "object. :meth:`~contextmanager.__exit__` calls :meth:`shutdown`." msgstr "" -#: ../../library/multiprocessing.rst:2030 +#: ../../library/multiprocessing.rst:2033 msgid "" "In previous versions :meth:`~contextmanager.__enter__` did not start the " "manager's server process if it was not already started." msgstr "" -#: ../../library/multiprocessing.rst:2035 +#: ../../library/multiprocessing.rst:2038 msgid "" "A subclass of :class:`BaseManager` which can be used for the synchronization " "of processes. Objects of this type are returned by :func:`multiprocessing." "Manager`." msgstr "" -#: ../../library/multiprocessing.rst:2039 +#: ../../library/multiprocessing.rst:2042 msgid "" "Its methods create and return :ref:`multiprocessing-proxy_objects` for a " "number of commonly used data types to be synchronized across processes. This " "notably includes shared lists and dictionaries." msgstr "" -#: ../../library/multiprocessing.rst:2045 +#: ../../library/multiprocessing.rst:2048 msgid "" "Create a shared :class:`threading.Barrier` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2052 +#: ../../library/multiprocessing.rst:2055 msgid "" "Create a shared :class:`threading.BoundedSemaphore` object and return a " "proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2057 +#: ../../library/multiprocessing.rst:2060 msgid "" "Create a shared :class:`threading.Condition` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:2060 +#: ../../library/multiprocessing.rst:2063 msgid "" "If *lock* is supplied then it should be a proxy for a :class:`threading." "Lock` or :class:`threading.RLock` object." msgstr "" -#: ../../library/multiprocessing.rst:2068 +#: ../../library/multiprocessing.rst:2071 msgid "" "Create a shared :class:`threading.Event` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2072 +#: ../../library/multiprocessing.rst:2075 msgid "" "Create a shared :class:`threading.Lock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2076 +#: ../../library/multiprocessing.rst:2079 msgid "Create a shared :class:`Namespace` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2080 +#: ../../library/multiprocessing.rst:2083 msgid "Create a shared :class:`queue.Queue` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2084 +#: ../../library/multiprocessing.rst:2087 msgid "" "Create a shared :class:`threading.RLock` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2088 +#: ../../library/multiprocessing.rst:2091 msgid "" "Create a shared :class:`threading.Semaphore` object and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:2093 +#: ../../library/multiprocessing.rst:2096 msgid "Create an array and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2097 +#: ../../library/multiprocessing.rst:2100 msgid "" "Create an object with a writable ``value`` attribute and return a proxy for " "it." msgstr "" -#: ../../library/multiprocessing.rst:2104 +#: ../../library/multiprocessing.rst:2107 msgid "Create a shared :class:`dict` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2109 +#: ../../library/multiprocessing.rst:2112 msgid "Create a shared :class:`list` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2115 +#: ../../library/multiprocessing.rst:2118 msgid "Create a shared :class:`set` object and return a proxy for it." msgstr "" -#: ../../library/multiprocessing.rst:2117 +#: ../../library/multiprocessing.rst:2120 msgid ":class:`set` support was added." msgstr "已新增對 :class:`set` 的支援。" -#: ../../library/multiprocessing.rst:2120 +#: ../../library/multiprocessing.rst:2123 msgid "" "Shared objects are capable of being nested. For example, a shared container " "object such as a shared list can contain other shared objects which will all " "be managed and synchronized by the :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:2127 +#: ../../library/multiprocessing.rst:2130 msgid "A type that can register with :class:`SyncManager`." msgstr "" -#: ../../library/multiprocessing.rst:2129 +#: ../../library/multiprocessing.rst:2132 msgid "" "A namespace object has no public methods, but does have writable attributes. " "Its representation shows the values of its attributes." msgstr "" -#: ../../library/multiprocessing.rst:2132 +#: ../../library/multiprocessing.rst:2135 msgid "" "However, when using a proxy for a namespace object, an attribute beginning " "with ``'_'`` will be an attribute of the proxy and not an attribute of the " "referent:" msgstr "" -#: ../../library/multiprocessing.rst:2136 +#: ../../library/multiprocessing.rst:2139 msgid "" ">>> mp_context = multiprocessing.get_context('spawn')\n" ">>> manager = mp_context.Manager()\n" @@ -3067,18 +3070,18 @@ msgid "" "Namespace(x=10, y='hello')" msgstr "" -#: ../../library/multiprocessing.rst:2149 +#: ../../library/multiprocessing.rst:2152 msgid "Customized managers" msgstr "" -#: ../../library/multiprocessing.rst:2151 +#: ../../library/multiprocessing.rst:2154 msgid "" "To create one's own manager, one creates a subclass of :class:`BaseManager` " "and uses the :meth:`~BaseManager.register` classmethod to register new types " "or callables with the manager class. For example::" msgstr "" -#: ../../library/multiprocessing.rst:2155 +#: ../../library/multiprocessing.rst:2158 msgid "" "from multiprocessing.managers import BaseManager\n" "\n" @@ -3118,23 +3121,23 @@ msgstr "" " print(maths.add(4, 3)) # 印出 7\n" " print(maths.mul(7, 8)) # 印出 56" -#: ../../library/multiprocessing.rst:2176 +#: ../../library/multiprocessing.rst:2179 msgid "Using a remote manager" msgstr "" -#: ../../library/multiprocessing.rst:2178 +#: ../../library/multiprocessing.rst:2181 msgid "" "It is possible to run a manager server on one machine and have clients use " "it from other machines (assuming that the firewalls involved allow it)." msgstr "" -#: ../../library/multiprocessing.rst:2181 +#: ../../library/multiprocessing.rst:2184 msgid "" "Running the following commands creates a server for a single shared queue " "which remote clients can access::" msgstr "" -#: ../../library/multiprocessing.rst:2184 +#: ../../library/multiprocessing.rst:2187 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> from queue import Queue\n" @@ -3154,11 +3157,11 @@ msgstr "" ">>> s = m.get_server()\n" ">>> s.serve_forever()" -#: ../../library/multiprocessing.rst:2193 +#: ../../library/multiprocessing.rst:2196 msgid "One client can access the server as follows::" msgstr "" -#: ../../library/multiprocessing.rst:2195 +#: ../../library/multiprocessing.rst:2198 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> class QueueManager(BaseManager): pass\n" @@ -3178,11 +3181,11 @@ msgstr "" ">>> queue = m.get_queue()\n" ">>> queue.put('hello')" -#: ../../library/multiprocessing.rst:2203 +#: ../../library/multiprocessing.rst:2206 msgid "Another client can also use it::" msgstr "" -#: ../../library/multiprocessing.rst:2205 +#: ../../library/multiprocessing.rst:2208 msgid "" ">>> from multiprocessing.managers import BaseManager\n" ">>> class QueueManager(BaseManager): pass\n" @@ -3204,13 +3207,13 @@ msgstr "" ">>> queue.get()\n" "'hello'" -#: ../../library/multiprocessing.rst:2214 +#: ../../library/multiprocessing.rst:2217 msgid "" "Local processes can also access that queue, using the code from above on the " "client to access it remotely::" msgstr "" -#: ../../library/multiprocessing.rst:2217 +#: ../../library/multiprocessing.rst:2220 msgid "" ">>> from multiprocessing import Process, Queue\n" ">>> from multiprocessing.managers import BaseManager\n" @@ -3250,18 +3253,18 @@ msgstr "" ">>> s = m.get_server()\n" ">>> s.serve_forever()" -#: ../../library/multiprocessing.rst:2239 +#: ../../library/multiprocessing.rst:2242 msgid "Proxy Objects" msgstr "" -#: ../../library/multiprocessing.rst:2241 +#: ../../library/multiprocessing.rst:2244 msgid "" "A proxy is an object which *refers* to a shared object which lives " "(presumably) in a different process. The shared object is said to be the " "*referent* of the proxy. Multiple proxy objects may have the same referent." msgstr "" -#: ../../library/multiprocessing.rst:2245 +#: ../../library/multiprocessing.rst:2248 msgid "" "A proxy object has methods which invoke corresponding methods of its " "referent (although not every method of the referent will necessarily be " @@ -3269,7 +3272,7 @@ msgid "" "its referent can:" msgstr "" -#: ../../library/multiprocessing.rst:2249 +#: ../../library/multiprocessing.rst:2252 msgid "" ">>> mp_context = multiprocessing.get_context('spawn')\n" ">>> manager = mp_context.Manager()\n" @@ -3295,14 +3298,14 @@ msgstr "" ">>> l[2:5]\n" "[4, 9, 16]" -#: ../../library/multiprocessing.rst:2263 +#: ../../library/multiprocessing.rst:2266 msgid "" "Notice that applying :func:`str` to a proxy will return the representation " "of the referent, whereas applying :func:`repr` will return the " "representation of the proxy." msgstr "" -#: ../../library/multiprocessing.rst:2267 +#: ../../library/multiprocessing.rst:2270 msgid "" "An important feature of proxy objects is that they are picklable so they can " "be passed between processes. As such, a referent can contain :ref:" @@ -3310,7 +3313,7 @@ msgid "" "lists, dicts, and other :ref:`multiprocessing-proxy_objects`:" msgstr "" -#: ../../library/multiprocessing.rst:2272 +#: ../../library/multiprocessing.rst:2275 msgid "" ">>> a = manager.list()\n" ">>> b = manager.list()\n" @@ -3322,11 +3325,11 @@ msgid "" "['hello'] ['hello']" msgstr "" -#: ../../library/multiprocessing.rst:2283 +#: ../../library/multiprocessing.rst:2286 msgid "Similarly, dict and list proxies may be nested inside one another::" msgstr "" -#: ../../library/multiprocessing.rst:2285 +#: ../../library/multiprocessing.rst:2288 msgid "" ">>> l_outer = manager.list([ manager.dict() for i in range(2) ])\n" ">>> d_first_inner = l_outer[0]\n" @@ -3350,7 +3353,7 @@ msgstr "" ">>> print(l_outer[1])\n" "{'c': 3, 'z': 26}" -#: ../../library/multiprocessing.rst:2296 +#: ../../library/multiprocessing.rst:2299 msgid "" "If standard (non-proxy) :class:`list` or :class:`dict` objects are contained " "in a referent, modifications to those mutable values will not be propagated " @@ -3361,7 +3364,7 @@ msgid "" "assign the modified value to the container proxy::" msgstr "" -#: ../../library/multiprocessing.rst:2304 +#: ../../library/multiprocessing.rst:2307 msgid "" "# create a list proxy and append a mutable object (a dictionary)\n" "lproxy = manager.list()\n" @@ -3375,20 +3378,20 @@ msgid "" "lproxy[0] = d" msgstr "" -#: ../../library/multiprocessing.rst:2315 +#: ../../library/multiprocessing.rst:2318 msgid "" "This approach is perhaps less convenient than employing nested :ref:" "`multiprocessing-proxy_objects` for most use cases but also demonstrates a " "level of control over the synchronization." msgstr "" -#: ../../library/multiprocessing.rst:2321 +#: ../../library/multiprocessing.rst:2324 msgid "" "The proxy types in :mod:`multiprocessing` do nothing to support comparisons " "by value. So, for instance, we have:" msgstr "" -#: ../../library/multiprocessing.rst:2324 +#: ../../library/multiprocessing.rst:2327 msgid "" ">>> manager.list([1,2,3]) == [1,2,3]\n" "False" @@ -3396,48 +3399,48 @@ msgstr "" ">>> manager.list([1,2,3]) == [1,2,3]\n" "False" -#: ../../library/multiprocessing.rst:2329 +#: ../../library/multiprocessing.rst:2332 msgid "" "One should just use a copy of the referent instead when making comparisons." msgstr "" -#: ../../library/multiprocessing.rst:2333 +#: ../../library/multiprocessing.rst:2336 msgid "Proxy objects are instances of subclasses of :class:`BaseProxy`." msgstr "" -#: ../../library/multiprocessing.rst:2337 +#: ../../library/multiprocessing.rst:2340 msgid "Call and return the result of a method of the proxy's referent." msgstr "" -#: ../../library/multiprocessing.rst:2339 +#: ../../library/multiprocessing.rst:2342 msgid "" "If ``proxy`` is a proxy whose referent is ``obj`` then the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2341 +#: ../../library/multiprocessing.rst:2344 msgid "proxy._callmethod(methodname, args, kwds)" msgstr "proxy._callmethod(methodname, args, kwds)" -#: ../../library/multiprocessing.rst:2343 +#: ../../library/multiprocessing.rst:2346 msgid "will evaluate the expression ::" msgstr "" -#: ../../library/multiprocessing.rst:2345 +#: ../../library/multiprocessing.rst:2348 msgid "getattr(obj, methodname)(*args, **kwds)" msgstr "getattr(obj, methodname)(*args, **kwds)" -#: ../../library/multiprocessing.rst:2347 +#: ../../library/multiprocessing.rst:2350 msgid "in the manager's process." msgstr "" -#: ../../library/multiprocessing.rst:2349 +#: ../../library/multiprocessing.rst:2352 msgid "" "The returned value will be a copy of the result of the call or a proxy to a " "new shared object -- see documentation for the *method_to_typeid* argument " "of :meth:`BaseManager.register`." msgstr "" -#: ../../library/multiprocessing.rst:2353 +#: ../../library/multiprocessing.rst:2356 msgid "" "If an exception is raised by the call, then is re-raised by :meth:" "`_callmethod`. If some other exception is raised in the manager's process " @@ -3445,17 +3448,17 @@ msgid "" "meth:`_callmethod`." msgstr "" -#: ../../library/multiprocessing.rst:2358 +#: ../../library/multiprocessing.rst:2361 msgid "" "Note in particular that an exception will be raised if *methodname* has not " "been *exposed*." msgstr "" -#: ../../library/multiprocessing.rst:2361 +#: ../../library/multiprocessing.rst:2364 msgid "An example of the usage of :meth:`_callmethod`:" msgstr "" -#: ../../library/multiprocessing.rst:2363 +#: ../../library/multiprocessing.rst:2366 msgid "" ">>> l = manager.list(range(10))\n" ">>> l._callmethod('__len__')\n" @@ -3477,69 +3480,69 @@ msgstr "" "...\n" "IndexError: list index out of range" -#: ../../library/multiprocessing.rst:2377 +#: ../../library/multiprocessing.rst:2380 msgid "Return a copy of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2379 +#: ../../library/multiprocessing.rst:2382 msgid "If the referent is unpicklable then this will raise an exception." msgstr "" -#: ../../library/multiprocessing.rst:2383 +#: ../../library/multiprocessing.rst:2386 msgid "Return a representation of the proxy object." msgstr "" -#: ../../library/multiprocessing.rst:2387 +#: ../../library/multiprocessing.rst:2390 msgid "Return the representation of the referent." msgstr "" -#: ../../library/multiprocessing.rst:2391 +#: ../../library/multiprocessing.rst:2394 msgid "Cleanup" msgstr "" -#: ../../library/multiprocessing.rst:2393 +#: ../../library/multiprocessing.rst:2396 msgid "" "A proxy object uses a weakref callback so that when it gets garbage " "collected it deregisters itself from the manager which owns its referent." msgstr "" -#: ../../library/multiprocessing.rst:2396 +#: ../../library/multiprocessing.rst:2399 msgid "" "A shared object gets deleted from the manager process when there are no " "longer any proxies referring to it." msgstr "" -#: ../../library/multiprocessing.rst:2401 +#: ../../library/multiprocessing.rst:2404 msgid "Process Pools" msgstr "" -#: ../../library/multiprocessing.rst:2406 +#: ../../library/multiprocessing.rst:2409 msgid "" "One can create a pool of processes which will carry out tasks submitted to " "it with the :class:`Pool` class." msgstr "" -#: ../../library/multiprocessing.rst:2411 +#: ../../library/multiprocessing.rst:2414 msgid "" "A process pool object which controls a pool of worker processes to which " "jobs can be submitted. It supports asynchronous results with timeouts and " "callbacks and has a parallel map implementation." msgstr "" -#: ../../library/multiprocessing.rst:2415 +#: ../../library/multiprocessing.rst:2418 msgid "" "*processes* is the number of worker processes to use. If *processes* is " "``None`` then the number returned by :func:`os.process_cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2418 -#: ../../library/multiprocessing.rst:2984 +#: ../../library/multiprocessing.rst:2421 +#: ../../library/multiprocessing.rst:2987 msgid "" "If *initializer* is not ``None`` then each worker process will call " "``initializer(*initargs)`` when it starts." msgstr "" -#: ../../library/multiprocessing.rst:2421 +#: ../../library/multiprocessing.rst:2424 msgid "" "*maxtasksperchild* is the number of tasks a worker process can complete " "before it will exit and be replaced with a fresh worker process, to enable " @@ -3547,7 +3550,7 @@ msgid "" "which means worker processes will live as long as the pool." msgstr "" -#: ../../library/multiprocessing.rst:2426 +#: ../../library/multiprocessing.rst:2429 msgid "" "*context* can be used to specify the context used for starting the worker " "processes. Usually a pool is created using the function :func:" @@ -3557,13 +3560,13 @@ msgid "" "method if it has not been set already. See the :func:`get_context` function." msgstr "" -#: ../../library/multiprocessing.rst:2434 +#: ../../library/multiprocessing.rst:2437 msgid "" "Note that the methods of the pool object should only be called by the " "process which created the pool." msgstr "" -#: ../../library/multiprocessing.rst:2438 +#: ../../library/multiprocessing.rst:2441 msgid "" ":class:`multiprocessing.pool` objects have internal resources that need to " "be properly managed (like any other resource) by using the pool as a context " @@ -3571,28 +3574,28 @@ msgid "" "to do this can lead to the process hanging on finalization." msgstr "" -#: ../../library/multiprocessing.rst:2443 +#: ../../library/multiprocessing.rst:2446 msgid "" "Note that it is **not correct** to rely on the garbage collector to destroy " "the pool as CPython does not assure that the finalizer of the pool will be " "called (see :meth:`object.__del__` for more information)." msgstr "" -#: ../../library/multiprocessing.rst:2447 +#: ../../library/multiprocessing.rst:2450 msgid "Added the *maxtasksperchild* parameter." msgstr "新增 *maxtasksperchild* 參數。" -#: ../../library/multiprocessing.rst:2450 +#: ../../library/multiprocessing.rst:2453 msgid "Added the *context* parameter." msgstr "新增 *context* 參數。" -#: ../../library/multiprocessing.rst:2453 +#: ../../library/multiprocessing.rst:2456 msgid "" "*processes* uses :func:`os.process_cpu_count` by default, instead of :func:" "`os.cpu_count`." msgstr "" -#: ../../library/multiprocessing.rst:2459 +#: ../../library/multiprocessing.rst:2462 msgid "" "Worker processes within a :class:`Pool` typically live for the complete " "duration of the Pool's work queue. A frequent pattern found in other systems " @@ -3603,7 +3606,7 @@ msgid "" "ability to the end user." msgstr "" -#: ../../library/multiprocessing.rst:2469 +#: ../../library/multiprocessing.rst:2472 msgid "" "Call *func* with arguments *args* and keyword arguments *kwds*. It blocks " "until the result is ready. Given this blocks, :meth:`apply_async` is better " @@ -3611,14 +3614,14 @@ msgid "" "executed in one of the workers of the pool." msgstr "" -#: ../../library/multiprocessing.rst:2476 +#: ../../library/multiprocessing.rst:2479 msgid "" "A variant of the :meth:`apply` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2479 -#: ../../library/multiprocessing.rst:2510 +#: ../../library/multiprocessing.rst:2482 +#: ../../library/multiprocessing.rst:2513 msgid "" "If *callback* is specified then it should be a callable which accepts a " "single argument. When the result becomes ready *callback* is applied to it, " @@ -3626,60 +3629,60 @@ msgid "" "applied instead." msgstr "" -#: ../../library/multiprocessing.rst:2484 -#: ../../library/multiprocessing.rst:2515 +#: ../../library/multiprocessing.rst:2487 +#: ../../library/multiprocessing.rst:2518 msgid "" "If *error_callback* is specified then it should be a callable which accepts " "a single argument. If the target function fails, then the *error_callback* " "is called with the exception instance." msgstr "" -#: ../../library/multiprocessing.rst:2488 -#: ../../library/multiprocessing.rst:2519 +#: ../../library/multiprocessing.rst:2491 +#: ../../library/multiprocessing.rst:2522 msgid "" "Callbacks should complete immediately since otherwise the thread which " "handles the results will get blocked." msgstr "" -#: ../../library/multiprocessing.rst:2493 +#: ../../library/multiprocessing.rst:2496 msgid "" "A parallel equivalent of the :func:`map` built-in function (it supports only " "one *iterable* argument though, for multiple iterables see :meth:`starmap`). " "It blocks until the result is ready." msgstr "" -#: ../../library/multiprocessing.rst:2497 +#: ../../library/multiprocessing.rst:2500 msgid "" "This method chops the iterable into a number of chunks which it submits to " "the process pool as separate tasks. The (approximate) size of these chunks " "can be specified by setting *chunksize* to a positive integer." msgstr "" -#: ../../library/multiprocessing.rst:2501 +#: ../../library/multiprocessing.rst:2504 msgid "" "Note that it may cause high memory usage for very long iterables. Consider " "using :meth:`imap` or :meth:`imap_unordered` with explicit *chunksize* " "option for better efficiency." msgstr "" -#: ../../library/multiprocessing.rst:2507 +#: ../../library/multiprocessing.rst:2510 msgid "" "A variant of the :meth:`.map` method which returns a :class:" "`~multiprocessing.pool.AsyncResult` object." msgstr "" -#: ../../library/multiprocessing.rst:2524 +#: ../../library/multiprocessing.rst:2527 msgid "A lazier version of :meth:`.map`." msgstr "" -#: ../../library/multiprocessing.rst:2526 +#: ../../library/multiprocessing.rst:2529 msgid "" "The *chunksize* argument is the same as the one used by the :meth:`.map` " "method. For very long iterables using a large value for *chunksize* can " "make the job complete **much** faster than using the default value of ``1``." msgstr "" -#: ../../library/multiprocessing.rst:2531 +#: ../../library/multiprocessing.rst:2534 msgid "" "Also if *chunksize* is ``1`` then the :meth:`!next` method of the iterator " "returned by the :meth:`imap` method has an optional *timeout* parameter: " @@ -3687,65 +3690,65 @@ msgid "" "result cannot be returned within *timeout* seconds." msgstr "" -#: ../../library/multiprocessing.rst:2538 +#: ../../library/multiprocessing.rst:2541 msgid "" "The same as :meth:`imap` except that the ordering of the results from the " "returned iterator should be considered arbitrary. (Only when there is only " "one worker process is the order guaranteed to be \"correct\".)" msgstr "" -#: ../../library/multiprocessing.rst:2544 +#: ../../library/multiprocessing.rst:2547 msgid "" "Like :meth:`~multiprocessing.pool.Pool.map` except that the elements of the " "*iterable* are expected to be iterables that are unpacked as arguments." msgstr "" -#: ../../library/multiprocessing.rst:2548 +#: ../../library/multiprocessing.rst:2551 msgid "" "Hence an *iterable* of ``[(1,2), (3, 4)]`` results in ``[func(1,2), " "func(3,4)]``." msgstr "" -#: ../../library/multiprocessing.rst:2555 +#: ../../library/multiprocessing.rst:2558 msgid "" "A combination of :meth:`starmap` and :meth:`map_async` that iterates over " "*iterable* of iterables and calls *func* with the iterables unpacked. " "Returns a result object." msgstr "" -#: ../../library/multiprocessing.rst:2563 +#: ../../library/multiprocessing.rst:2566 msgid "" "Prevents any more tasks from being submitted to the pool. Once all the " "tasks have been completed the worker processes will exit." msgstr "" -#: ../../library/multiprocessing.rst:2568 +#: ../../library/multiprocessing.rst:2571 msgid "" "Stops the worker processes immediately without completing outstanding work. " "When the pool object is garbage collected :meth:`terminate` will be called " "immediately." msgstr "" -#: ../../library/multiprocessing.rst:2574 +#: ../../library/multiprocessing.rst:2577 msgid "" "Wait for the worker processes to exit. One must call :meth:`close` or :meth:" "`terminate` before using :meth:`join`." msgstr "" -#: ../../library/multiprocessing.rst:2577 +#: ../../library/multiprocessing.rst:2580 msgid "" "Pool objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the pool " "object, and :meth:`~contextmanager.__exit__` calls :meth:`terminate`." msgstr "" -#: ../../library/multiprocessing.rst:2585 +#: ../../library/multiprocessing.rst:2588 msgid "" "The class of the result returned by :meth:`Pool.apply_async` and :meth:`Pool." "map_async`." msgstr "" -#: ../../library/multiprocessing.rst:2590 +#: ../../library/multiprocessing.rst:2593 msgid "" "Return the result when it arrives. If *timeout* is not ``None`` and the " "result does not arrive within *timeout* seconds then :exc:`multiprocessing." @@ -3753,31 +3756,31 @@ msgid "" "exception will be reraised by :meth:`get`." msgstr "" -#: ../../library/multiprocessing.rst:2597 +#: ../../library/multiprocessing.rst:2600 msgid "Wait until the result is available or until *timeout* seconds pass." msgstr "" -#: ../../library/multiprocessing.rst:2601 +#: ../../library/multiprocessing.rst:2604 msgid "Return whether the call has completed." msgstr "" -#: ../../library/multiprocessing.rst:2605 +#: ../../library/multiprocessing.rst:2608 msgid "" "Return whether the call completed without raising an exception. Will raise :" "exc:`ValueError` if the result is not ready." msgstr "" -#: ../../library/multiprocessing.rst:2608 +#: ../../library/multiprocessing.rst:2611 msgid "" "If the result is not ready, :exc:`ValueError` is raised instead of :exc:" "`AssertionError`." msgstr "" -#: ../../library/multiprocessing.rst:2612 +#: ../../library/multiprocessing.rst:2615 msgid "The following example demonstrates the use of a pool::" msgstr "" -#: ../../library/multiprocessing.rst:2614 +#: ../../library/multiprocessing.rst:2617 msgid "" "from multiprocessing import Pool\n" "import time\n" @@ -3805,17 +3808,17 @@ msgid "" "TimeoutError" msgstr "" -#: ../../library/multiprocessing.rst:2639 +#: ../../library/multiprocessing.rst:2642 msgid "Listeners and Clients" msgstr "" -#: ../../library/multiprocessing.rst:2644 +#: ../../library/multiprocessing.rst:2647 msgid "" "Usually message passing between processes is done using queues or by using :" "class:`~Connection` objects returned by :func:`~multiprocessing.Pipe`." msgstr "" -#: ../../library/multiprocessing.rst:2648 +#: ../../library/multiprocessing.rst:2651 msgid "" "However, the :mod:`multiprocessing.connection` module allows some extra " "flexibility. It basically gives a high level message oriented API for " @@ -3824,46 +3827,46 @@ msgid "" "multiple connections at the same time." msgstr "" -#: ../../library/multiprocessing.rst:2657 +#: ../../library/multiprocessing.rst:2660 msgid "" "Send a randomly generated message to the other end of the connection and " "wait for a reply." msgstr "" -#: ../../library/multiprocessing.rst:2660 +#: ../../library/multiprocessing.rst:2663 msgid "" "If the reply matches the digest of the message using *authkey* as the key " "then a welcome message is sent to the other end of the connection. " "Otherwise :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2666 +#: ../../library/multiprocessing.rst:2669 msgid "" "Receive a message, calculate the digest of the message using *authkey* as " "the key, and then send the digest back." msgstr "" -#: ../../library/multiprocessing.rst:2669 +#: ../../library/multiprocessing.rst:2672 msgid "" "If a welcome message is not received, then :exc:`~multiprocessing." "AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2674 +#: ../../library/multiprocessing.rst:2677 msgid "" "Attempt to set up a connection to the listener which is using address " "*address*, returning a :class:`~Connection`." msgstr "" -#: ../../library/multiprocessing.rst:2677 +#: ../../library/multiprocessing.rst:2680 msgid "" "The type of the connection is determined by *family* argument, but this can " "generally be omitted since it can usually be inferred from the format of " "*address*. (See :ref:`multiprocessing-address-formats`)" msgstr "" -#: ../../library/multiprocessing.rst:2681 -#: ../../library/multiprocessing.rst:2716 +#: ../../library/multiprocessing.rst:2684 +#: ../../library/multiprocessing.rst:2719 msgid "" "If *authkey* is given and not ``None``, it should be a byte string and will " "be used as the secret key for an HMAC-based authentication challenge. No " @@ -3872,26 +3875,26 @@ msgid "" "`multiprocessing-auth-keys`." msgstr "" -#: ../../library/multiprocessing.rst:2689 +#: ../../library/multiprocessing.rst:2692 msgid "" "A wrapper for a bound socket or Windows named pipe which is 'listening' for " "connections." msgstr "" -#: ../../library/multiprocessing.rst:2692 +#: ../../library/multiprocessing.rst:2695 msgid "" "*address* is the address to be used by the bound socket or named pipe of the " "listener object." msgstr "" -#: ../../library/multiprocessing.rst:2697 +#: ../../library/multiprocessing.rst:2700 msgid "" "If an address of '0.0.0.0' is used, the address will not be a connectable " "end point on Windows. If you require a connectable end-point, you should use " "'127.0.0.1'." msgstr "" -#: ../../library/multiprocessing.rst:2701 +#: ../../library/multiprocessing.rst:2704 msgid "" "*family* is the type of socket (or named pipe) to use. This can be one of " "the strings ``'AF_INET'`` (for a TCP socket), ``'AF_UNIX'`` (for a Unix " @@ -3905,49 +3908,49 @@ msgid "" "using :func:`tempfile.mkstemp`." msgstr "" -#: ../../library/multiprocessing.rst:2712 +#: ../../library/multiprocessing.rst:2715 msgid "" "If the listener object uses a socket then *backlog* (1 by default) is passed " "to the :meth:`~socket.socket.listen` method of the socket once it has been " "bound." msgstr "" -#: ../../library/multiprocessing.rst:2724 +#: ../../library/multiprocessing.rst:2727 msgid "" "Accept a connection on the bound socket or named pipe of the listener object " "and return a :class:`~Connection` object. If authentication is attempted and " "fails, then :exc:`~multiprocessing.AuthenticationError` is raised." msgstr "" -#: ../../library/multiprocessing.rst:2731 +#: ../../library/multiprocessing.rst:2734 msgid "" "Close the bound socket or named pipe of the listener object. This is called " "automatically when the listener is garbage collected. However it is " "advisable to call it explicitly." msgstr "" -#: ../../library/multiprocessing.rst:2735 +#: ../../library/multiprocessing.rst:2738 msgid "Listener objects have the following read-only properties:" msgstr "" -#: ../../library/multiprocessing.rst:2739 +#: ../../library/multiprocessing.rst:2742 msgid "The address which is being used by the Listener object." msgstr "" -#: ../../library/multiprocessing.rst:2743 +#: ../../library/multiprocessing.rst:2746 msgid "" "The address from which the last accepted connection came. If this is " "unavailable then it is ``None``." msgstr "" -#: ../../library/multiprocessing.rst:2746 +#: ../../library/multiprocessing.rst:2749 msgid "" "Listener objects now support the context management protocol -- see :ref:" "`typecontextmanager`. :meth:`~contextmanager.__enter__` returns the " "listener object, and :meth:`~contextmanager.__exit__` calls :meth:`close`." msgstr "" -#: ../../library/multiprocessing.rst:2753 +#: ../../library/multiprocessing.rst:2756 msgid "" "Wait till an object in *object_list* is ready. Returns the list of those " "objects in *object_list* which are ready. If *timeout* is a float then the " @@ -3956,32 +3959,32 @@ msgid "" "zero timeout." msgstr "" -#: ../../library/multiprocessing.rst:2759 +#: ../../library/multiprocessing.rst:2762 msgid "" "For both POSIX and Windows, an object can appear in *object_list* if it is" msgstr "" -#: ../../library/multiprocessing.rst:2762 +#: ../../library/multiprocessing.rst:2765 msgid "a readable :class:`~multiprocessing.connection.Connection` object;" msgstr "" -#: ../../library/multiprocessing.rst:2763 +#: ../../library/multiprocessing.rst:2766 msgid "a connected and readable :class:`socket.socket` object; or" msgstr "" -#: ../../library/multiprocessing.rst:2764 +#: ../../library/multiprocessing.rst:2767 msgid "" "the :attr:`~multiprocessing.Process.sentinel` attribute of a :class:" "`~multiprocessing.Process` object." msgstr "" -#: ../../library/multiprocessing.rst:2767 +#: ../../library/multiprocessing.rst:2770 msgid "" "A connection or socket object is ready when there is data available to be " "read from it, or the other end has been closed." msgstr "" -#: ../../library/multiprocessing.rst:2770 +#: ../../library/multiprocessing.rst:2773 msgid "" "**POSIX**: ``wait(object_list, timeout)`` almost equivalent ``select." "select(object_list, [], [], timeout)``. The difference is that, if :func:" @@ -3989,7 +3992,7 @@ msgid "" "an error number of ``EINTR``, whereas :func:`wait` will not." msgstr "" -#: ../../library/multiprocessing.rst:2776 +#: ../../library/multiprocessing.rst:2779 msgid "" "**Windows**: An item in *object_list* must either be an integer handle which " "is waitable (according to the definition used by the documentation of the " @@ -3999,18 +4002,18 @@ msgid "" "handles.)" msgstr "" -#: ../../library/multiprocessing.rst:2786 +#: ../../library/multiprocessing.rst:2789 msgid "**Examples**" msgstr "" -#: ../../library/multiprocessing.rst:2788 +#: ../../library/multiprocessing.rst:2791 msgid "" "The following server code creates a listener which uses ``'secret " "password'`` as an authentication key. It then waits for a connection and " "sends some data to the client::" msgstr "" -#: ../../library/multiprocessing.rst:2792 +#: ../../library/multiprocessing.rst:2795 msgid "" "from multiprocessing.connection import Listener\n" "from array import array\n" @@ -4028,13 +4031,13 @@ msgid "" " conn.send_bytes(array('i', [42, 1729]))" msgstr "" -#: ../../library/multiprocessing.rst:2807 +#: ../../library/multiprocessing.rst:2810 msgid "" "The following code connects to the server and receives some data from the " "server::" msgstr "" -#: ../../library/multiprocessing.rst:2810 +#: ../../library/multiprocessing.rst:2813 msgid "" "from multiprocessing.connection import Client\n" "from array import array\n" @@ -4064,13 +4067,13 @@ msgstr "" " print(conn.recv_bytes_into(arr)) # => 8\n" " print(arr) # => array('i', [42, 1729, 0, 0, 0])" -#: ../../library/multiprocessing.rst:2824 +#: ../../library/multiprocessing.rst:2827 msgid "" "The following code uses :func:`~multiprocessing.connection.wait` to wait for " "messages from multiple processes at once::" msgstr "" -#: ../../library/multiprocessing.rst:2827 +#: ../../library/multiprocessing.rst:2830 msgid "" "from multiprocessing import Process, Pipe, current_process\n" "from multiprocessing.connection import wait\n" @@ -4104,23 +4107,23 @@ msgid "" " print(msg)" msgstr "" -#: ../../library/multiprocessing.rst:2862 +#: ../../library/multiprocessing.rst:2865 msgid "Address Formats" msgstr "" -#: ../../library/multiprocessing.rst:2864 +#: ../../library/multiprocessing.rst:2867 msgid "" "An ``'AF_INET'`` address is a tuple of the form ``(hostname, port)`` where " "*hostname* is a string and *port* is an integer." msgstr "" -#: ../../library/multiprocessing.rst:2867 +#: ../../library/multiprocessing.rst:2870 msgid "" "An ``'AF_UNIX'`` address is a string representing a filename on the " "filesystem." msgstr "" -#: ../../library/multiprocessing.rst:2870 +#: ../../library/multiprocessing.rst:2873 msgid "" "An ``'AF_PIPE'`` address is a string of the form :samp:`r'\\\\\\\\\\\\.\\" "\\pipe\\\\\\\\{PipeName}'`. To use :func:`Client` to connect to a named " @@ -4129,17 +4132,17 @@ msgid "" "instead." msgstr "" -#: ../../library/multiprocessing.rst:2875 +#: ../../library/multiprocessing.rst:2878 msgid "" "Note that any string beginning with two backslashes is assumed by default to " "be an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address." msgstr "" -#: ../../library/multiprocessing.rst:2882 +#: ../../library/multiprocessing.rst:2885 msgid "Authentication keys" msgstr "" -#: ../../library/multiprocessing.rst:2884 +#: ../../library/multiprocessing.rst:2887 msgid "" "When one uses :meth:`Connection.recv `, the data received " "is automatically unpickled. Unfortunately unpickling data from an untrusted " @@ -4147,7 +4150,7 @@ msgid "" "use the :mod:`hmac` module to provide digest authentication." msgstr "" -#: ../../library/multiprocessing.rst:2890 +#: ../../library/multiprocessing.rst:2893 msgid "" "An authentication key is a byte string which can be thought of as a " "password: once a connection is established both ends will demand proof that " @@ -4155,7 +4158,7 @@ msgid "" "using the same key does **not** involve sending the key over the connection.)" msgstr "" -#: ../../library/multiprocessing.rst:2896 +#: ../../library/multiprocessing.rst:2899 msgid "" "If authentication is requested but no authentication key is specified then " "the return value of ``current_process().authkey`` is used (see :class:" @@ -4166,17 +4169,17 @@ msgid "" "setting up connections between themselves." msgstr "" -#: ../../library/multiprocessing.rst:2904 +#: ../../library/multiprocessing.rst:2907 msgid "" "Suitable authentication keys can also be generated by using :func:`os." "urandom`." msgstr "" -#: ../../library/multiprocessing.rst:2908 +#: ../../library/multiprocessing.rst:2911 msgid "Logging" msgstr "" -#: ../../library/multiprocessing.rst:2910 +#: ../../library/multiprocessing.rst:2913 msgid "" "Some support for logging is available. Note, however, that the :mod:" "`logging` package does not use process shared locks so it is possible " @@ -4184,27 +4187,27 @@ msgid "" "mixed up." msgstr "" -#: ../../library/multiprocessing.rst:2917 +#: ../../library/multiprocessing.rst:2920 msgid "" "Returns the logger used by :mod:`multiprocessing`. If necessary, a new one " "will be created." msgstr "" -#: ../../library/multiprocessing.rst:2920 +#: ../../library/multiprocessing.rst:2923 msgid "" "When first created the logger has level :const:`logging.NOTSET` and no " "default handler. Messages sent to this logger will not by default propagate " "to the root logger." msgstr "" -#: ../../library/multiprocessing.rst:2924 +#: ../../library/multiprocessing.rst:2927 msgid "" "Note that on Windows child processes will only inherit the level of the " "parent process's logger -- any other customization of the logger will not be " "inherited." msgstr "" -#: ../../library/multiprocessing.rst:2931 +#: ../../library/multiprocessing.rst:2934 msgid "" "This function performs a call to :func:`get_logger` but in addition to " "returning the logger created by get_logger, it adds a handler which sends " @@ -4213,11 +4216,11 @@ msgid "" "``level`` argument." msgstr "" -#: ../../library/multiprocessing.rst:2937 +#: ../../library/multiprocessing.rst:2940 msgid "Below is an example session with logging turned on::" msgstr "" -#: ../../library/multiprocessing.rst:2939 +#: ../../library/multiprocessing.rst:2942 msgid "" ">>> import multiprocessing, logging\n" ">>> logger = multiprocessing.log_to_stderr()\n" @@ -4245,21 +4248,21 @@ msgstr "" "[INFO/MainProcess] sending shutdown message to manager\n" "[INFO/SyncManager-...] manager exiting with exitcode 0" -#: ../../library/multiprocessing.rst:2952 +#: ../../library/multiprocessing.rst:2955 msgid "For a full table of logging levels, see the :mod:`logging` module." msgstr "" -#: ../../library/multiprocessing.rst:2956 +#: ../../library/multiprocessing.rst:2959 msgid "The :mod:`multiprocessing.dummy` module" msgstr ":mod:`multiprocessing.dummy` 模組" -#: ../../library/multiprocessing.rst:2961 +#: ../../library/multiprocessing.rst:2964 msgid "" ":mod:`multiprocessing.dummy` replicates the API of :mod:`multiprocessing` " "but is no more than a wrapper around the :mod:`threading` module." msgstr "" -#: ../../library/multiprocessing.rst:2966 +#: ../../library/multiprocessing.rst:2969 msgid "" "In particular, the ``Pool`` function provided by :mod:`multiprocessing." "dummy` returns an instance of :class:`ThreadPool`, which is a subclass of :" @@ -4267,7 +4270,7 @@ msgid "" "worker threads rather than worker processes." msgstr "" -#: ../../library/multiprocessing.rst:2974 +#: ../../library/multiprocessing.rst:2977 msgid "" "A thread pool object which controls a pool of worker threads to which jobs " "can be submitted. :class:`ThreadPool` instances are fully interface " @@ -4277,18 +4280,18 @@ msgid "" "pool.Pool.terminate` manually." msgstr "" -#: ../../library/multiprocessing.rst:2981 +#: ../../library/multiprocessing.rst:2984 msgid "" "*processes* is the number of worker threads to use. If *processes* is " "``None`` then the number returned by :func:`os.process_cpu_count` is used." msgstr "" -#: ../../library/multiprocessing.rst:2987 +#: ../../library/multiprocessing.rst:2990 msgid "" "Unlike :class:`Pool`, *maxtasksperchild* and *context* cannot be provided." msgstr "" -#: ../../library/multiprocessing.rst:2991 +#: ../../library/multiprocessing.rst:2994 msgid "" "A :class:`ThreadPool` shares the same interface as :class:`Pool`, which is " "designed around a pool of processes and predates the introduction of the :" @@ -4298,7 +4301,7 @@ msgid "" "is not understood by any other libraries." msgstr "" -#: ../../library/multiprocessing.rst:2998 +#: ../../library/multiprocessing.rst:3001 msgid "" "Users should generally prefer to use :class:`concurrent.futures." "ThreadPoolExecutor`, which has a simpler interface that was designed around " @@ -4307,69 +4310,69 @@ msgid "" "`asyncio`." msgstr "" -#: ../../library/multiprocessing.rst:3008 +#: ../../library/multiprocessing.rst:3011 msgid "Programming guidelines" msgstr "" -#: ../../library/multiprocessing.rst:3010 +#: ../../library/multiprocessing.rst:3013 msgid "" "There are certain guidelines and idioms which should be adhered to when " "using :mod:`multiprocessing`." msgstr "" -#: ../../library/multiprocessing.rst:3015 +#: ../../library/multiprocessing.rst:3018 msgid "All start methods" msgstr "" -#: ../../library/multiprocessing.rst:3017 +#: ../../library/multiprocessing.rst:3020 msgid "The following applies to all start methods." msgstr "" -#: ../../library/multiprocessing.rst:3019 +#: ../../library/multiprocessing.rst:3022 msgid "Avoid shared state" msgstr "" -#: ../../library/multiprocessing.rst:3021 +#: ../../library/multiprocessing.rst:3024 msgid "" "As far as possible one should try to avoid shifting large amounts of data " "between processes." msgstr "" -#: ../../library/multiprocessing.rst:3024 +#: ../../library/multiprocessing.rst:3027 msgid "" "It is probably best to stick to using queues or pipes for communication " "between processes rather than using the lower level synchronization " "primitives." msgstr "" -#: ../../library/multiprocessing.rst:3028 +#: ../../library/multiprocessing.rst:3031 msgid "Picklability" msgstr "" -#: ../../library/multiprocessing.rst:3030 +#: ../../library/multiprocessing.rst:3033 msgid "Ensure that the arguments to the methods of proxies are picklable." msgstr "" -#: ../../library/multiprocessing.rst:3032 +#: ../../library/multiprocessing.rst:3035 msgid "Thread safety of proxies" msgstr "" -#: ../../library/multiprocessing.rst:3034 +#: ../../library/multiprocessing.rst:3037 msgid "" "Do not use a proxy object from more than one thread unless you protect it " "with a lock." msgstr "" -#: ../../library/multiprocessing.rst:3037 +#: ../../library/multiprocessing.rst:3040 msgid "" "(There is never a problem with different processes using the *same* proxy.)" msgstr "" -#: ../../library/multiprocessing.rst:3039 +#: ../../library/multiprocessing.rst:3042 msgid "Joining zombie processes" msgstr "" -#: ../../library/multiprocessing.rst:3041 +#: ../../library/multiprocessing.rst:3044 msgid "" "On POSIX when a process finishes but has not been joined it becomes a " "zombie. There should never be very many because each time a new process " @@ -4380,11 +4383,11 @@ msgid "" "explicitly join all the processes that you start." msgstr "" -#: ../../library/multiprocessing.rst:3049 +#: ../../library/multiprocessing.rst:3052 msgid "Better to inherit than pickle/unpickle" msgstr "" -#: ../../library/multiprocessing.rst:3051 +#: ../../library/multiprocessing.rst:3054 msgid "" "When using the *spawn* or *forkserver* start methods many types from :mod:" "`multiprocessing` need to be picklable so that child processes can use " @@ -4394,11 +4397,11 @@ msgid "" "inherit it from an ancestor process." msgstr "" -#: ../../library/multiprocessing.rst:3059 +#: ../../library/multiprocessing.rst:3062 msgid "Avoid terminating processes" msgstr "" -#: ../../library/multiprocessing.rst:3061 +#: ../../library/multiprocessing.rst:3064 msgid "" "Using the :meth:`Process.terminate ` " "method to stop a process is liable to cause any shared resources (such as " @@ -4406,18 +4409,18 @@ msgid "" "become broken or unavailable to other processes." msgstr "" -#: ../../library/multiprocessing.rst:3067 +#: ../../library/multiprocessing.rst:3070 msgid "" "Therefore it is probably best to only consider using :meth:`Process." "terminate ` on processes which never use " "any shared resources." msgstr "" -#: ../../library/multiprocessing.rst:3071 +#: ../../library/multiprocessing.rst:3074 msgid "Joining processes that use queues" msgstr "" -#: ../../library/multiprocessing.rst:3073 +#: ../../library/multiprocessing.rst:3076 msgid "" "Bear in mind that a process that has put items in a queue will wait before " "terminating until all the buffered items are fed by the \"feeder\" thread to " @@ -4426,7 +4429,7 @@ msgid "" "queue to avoid this behaviour.)" msgstr "" -#: ../../library/multiprocessing.rst:3079 +#: ../../library/multiprocessing.rst:3082 msgid "" "This means that whenever you use a queue you need to make sure that all " "items which have been put on the queue will eventually be removed before the " @@ -4435,11 +4438,11 @@ msgid "" "processes will be joined automatically." msgstr "" -#: ../../library/multiprocessing.rst:3085 +#: ../../library/multiprocessing.rst:3088 msgid "An example which will deadlock is the following::" msgstr "" -#: ../../library/multiprocessing.rst:3087 +#: ../../library/multiprocessing.rst:3090 msgid "" "from multiprocessing import Process, Queue\n" "\n" @@ -4454,17 +4457,17 @@ msgid "" " obj = queue.get()" msgstr "" -#: ../../library/multiprocessing.rst:3099 +#: ../../library/multiprocessing.rst:3102 msgid "" "A fix here would be to swap the last two lines (or simply remove the ``p." "join()`` line)." msgstr "" -#: ../../library/multiprocessing.rst:3102 +#: ../../library/multiprocessing.rst:3105 msgid "Explicitly pass resources to child processes" msgstr "" -#: ../../library/multiprocessing.rst:3104 +#: ../../library/multiprocessing.rst:3107 msgid "" "On POSIX using the *fork* start method, a child process can make use of a " "shared resource created in a parent process using a global resource. " @@ -4472,7 +4475,7 @@ msgid "" "for the child process." msgstr "" -#: ../../library/multiprocessing.rst:3109 +#: ../../library/multiprocessing.rst:3112 msgid "" "Apart from making the code (potentially) compatible with Windows and the " "other start methods this also ensures that as long as the child process is " @@ -4481,11 +4484,11 @@ msgid "" "collected in the parent process." msgstr "" -#: ../../library/multiprocessing.rst:3116 +#: ../../library/multiprocessing.rst:3119 msgid "So for instance ::" msgstr "" -#: ../../library/multiprocessing.rst:3118 +#: ../../library/multiprocessing.rst:3121 msgid "" "from multiprocessing import Process, Lock\n" "\n" @@ -4507,11 +4510,11 @@ msgstr "" " for i in range(10):\n" " Process(target=f).start()" -#: ../../library/multiprocessing.rst:3128 +#: ../../library/multiprocessing.rst:3131 msgid "should be rewritten as ::" msgstr "" -#: ../../library/multiprocessing.rst:3130 +#: ../../library/multiprocessing.rst:3133 msgid "" "from multiprocessing import Process, Lock\n" "\n" @@ -4533,25 +4536,25 @@ msgstr "" " for i in range(10):\n" " Process(target=f, args=(lock,)).start()" -#: ../../library/multiprocessing.rst:3140 +#: ../../library/multiprocessing.rst:3143 msgid "Beware of replacing :data:`sys.stdin` with a \"file like object\"" msgstr "" -#: ../../library/multiprocessing.rst:3142 +#: ../../library/multiprocessing.rst:3145 msgid ":mod:`multiprocessing` originally unconditionally called::" msgstr "" -#: ../../library/multiprocessing.rst:3144 +#: ../../library/multiprocessing.rst:3147 msgid "os.close(sys.stdin.fileno())" msgstr "os.close(sys.stdin.fileno())" -#: ../../library/multiprocessing.rst:3146 +#: ../../library/multiprocessing.rst:3149 msgid "" "in the :meth:`multiprocessing.Process._bootstrap` method --- this resulted " "in issues with processes-in-processes. This has been changed to::" msgstr "" -#: ../../library/multiprocessing.rst:3149 +#: ../../library/multiprocessing.rst:3152 msgid "" "sys.stdin.close()\n" "sys.stdin = open(os.open(os.devnull, os.O_RDONLY), closefd=False)" @@ -4559,7 +4562,7 @@ msgstr "" "sys.stdin.close()\n" "sys.stdin = open(os.open(os.devnull, os.O_RDONLY), closefd=False)" -#: ../../library/multiprocessing.rst:3152 +#: ../../library/multiprocessing.rst:3155 msgid "" "Which solves the fundamental issue of processes colliding with each other " "resulting in a bad file descriptor error, but introduces a potential danger " @@ -4569,14 +4572,14 @@ msgid "" "data being flushed to the object multiple times, resulting in corruption." msgstr "" -#: ../../library/multiprocessing.rst:3159 +#: ../../library/multiprocessing.rst:3162 msgid "" "If you write a file-like object and implement your own caching, you can make " "it fork-safe by storing the pid whenever you append to the cache, and " "discarding the cache when the pid changes. For example::" msgstr "" -#: ../../library/multiprocessing.rst:3163 +#: ../../library/multiprocessing.rst:3166 msgid "" "@property\n" "def cache(self):\n" @@ -4594,26 +4597,26 @@ msgstr "" " self._cache = []\n" " return self._cache" -#: ../../library/multiprocessing.rst:3171 +#: ../../library/multiprocessing.rst:3174 msgid "" "For more information, see :issue:`5155`, :issue:`5313` and :issue:`5331`" msgstr "" -#: ../../library/multiprocessing.rst:3177 +#: ../../library/multiprocessing.rst:3180 msgid "The *spawn* and *forkserver* start methods" msgstr "" -#: ../../library/multiprocessing.rst:3179 +#: ../../library/multiprocessing.rst:3182 msgid "" "There are a few extra restrictions which don't apply to the *fork* start " "method." msgstr "" -#: ../../library/multiprocessing.rst:3182 +#: ../../library/multiprocessing.rst:3185 msgid "More picklability" msgstr "" -#: ../../library/multiprocessing.rst:3184 +#: ../../library/multiprocessing.rst:3187 msgid "" "Ensure that all arguments to :class:`~multiprocessing.Process` are " "picklable. Also, if you subclass ``Process.__init__``, you must make sure " @@ -4621,11 +4624,11 @@ msgid "" "` method is called." msgstr "" -#: ../../library/multiprocessing.rst:3189 +#: ../../library/multiprocessing.rst:3192 msgid "Global variables" msgstr "" -#: ../../library/multiprocessing.rst:3191 +#: ../../library/multiprocessing.rst:3194 msgid "" "Bear in mind that if code run in a child process tries to access a global " "variable, then the value it sees (if any) may not be the same as the value " @@ -4633,30 +4636,30 @@ msgid "" "Process.start>` was called." msgstr "" -#: ../../library/multiprocessing.rst:3196 +#: ../../library/multiprocessing.rst:3199 msgid "" "However, global variables which are just module level constants cause no " "problems." msgstr "" -#: ../../library/multiprocessing.rst:3201 +#: ../../library/multiprocessing.rst:3204 msgid "Safe importing of main module" msgstr "" -#: ../../library/multiprocessing.rst:3203 +#: ../../library/multiprocessing.rst:3206 msgid "" "Make sure that the main module can be safely imported by a new Python " "interpreter without causing unintended side effects (such as starting a new " "process)." msgstr "" -#: ../../library/multiprocessing.rst:3207 +#: ../../library/multiprocessing.rst:3210 msgid "" "For example, using the *spawn* or *forkserver* start method running the " "following module would fail with a :exc:`RuntimeError`::" msgstr "" -#: ../../library/multiprocessing.rst:3211 +#: ../../library/multiprocessing.rst:3214 msgid "" "from multiprocessing import Process\n" "\n" @@ -4674,13 +4677,13 @@ msgstr "" "p = Process(target=foo)\n" "p.start()" -#: ../../library/multiprocessing.rst:3219 +#: ../../library/multiprocessing.rst:3222 msgid "" "Instead one should protect the \"entry point\" of the program by using ``if " "__name__ == '__main__':`` as follows::" msgstr "" -#: ../../library/multiprocessing.rst:3222 +#: ../../library/multiprocessing.rst:3225 msgid "" "from multiprocessing import Process, freeze_support, set_start_method\n" "\n" @@ -4704,33 +4707,33 @@ msgstr "" " p = Process(target=foo)\n" " p.start()" -#: ../../library/multiprocessing.rst:3233 +#: ../../library/multiprocessing.rst:3236 msgid "" "(The ``freeze_support()`` line can be omitted if the program will be run " "normally instead of frozen.)" msgstr "" -#: ../../library/multiprocessing.rst:3236 +#: ../../library/multiprocessing.rst:3239 msgid "" "This allows the newly spawned Python interpreter to safely import the module " "and then run the module's ``foo()`` function." msgstr "" -#: ../../library/multiprocessing.rst:3239 +#: ../../library/multiprocessing.rst:3242 msgid "" "Similar restrictions apply if a pool or manager is created in the main " "module." msgstr "" -#: ../../library/multiprocessing.rst:3246 +#: ../../library/multiprocessing.rst:3249 msgid "Examples" msgstr "範例" -#: ../../library/multiprocessing.rst:3248 +#: ../../library/multiprocessing.rst:3251 msgid "Demonstration of how to create and use customized managers and proxies:" msgstr "" -#: ../../library/multiprocessing.rst:3250 +#: ../../library/multiprocessing.rst:3253 msgid "" "from multiprocessing import freeze_support\n" "from multiprocessing.managers import BaseManager, BaseProxy\n" @@ -4824,11 +4827,11 @@ msgid "" " test()\n" msgstr "" -#: ../../library/multiprocessing.rst:3254 +#: ../../library/multiprocessing.rst:3257 msgid "Using :class:`~multiprocessing.pool.Pool`:" msgstr "使用 :class:`~multiprocessing.pool.Pool`:" -#: ../../library/multiprocessing.rst:3256 +#: ../../library/multiprocessing.rst:3259 msgid "" "import multiprocessing\n" "import time\n" @@ -4988,13 +4991,13 @@ msgid "" " test()\n" msgstr "" -#: ../../library/multiprocessing.rst:3260 +#: ../../library/multiprocessing.rst:3263 msgid "" "An example showing how to use queues to feed tasks to a collection of worker " "processes and collect the results:" msgstr "" -#: ../../library/multiprocessing.rst:3263 +#: ../../library/multiprocessing.rst:3266 msgid "" "import time\n" "import random\n" diff --git a/library/os.po b/library/os.po index 2af355b4e7..6806bd7e25 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-11-19 00:14+0000\n" +"POT-Creation-Date: 2025-12-28 00:16+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-" @@ -6380,7 +6380,7 @@ msgstr "" #: ../../library/os.rst:5617 msgid "" "If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is " -"set, :func:`cpu_count` returns the overridden value *n*." +"set, :func:`cpu_count` returns the override value *n*." msgstr "" #: ../../library/os.rst:5624 @@ -6406,7 +6406,7 @@ msgstr "" #: ../../library/os.rst:5640 msgid "" "If :option:`-X cpu_count <-X>` is given or :envvar:`PYTHON_CPU_COUNT` is " -"set, :func:`process_cpu_count` returns the overridden value *n*." +"set, :func:`process_cpu_count` returns the override value *n*." msgstr "" #: ../../library/os.rst:5643 diff --git a/library/smtplib.po b/library/smtplib.po index 544bbad52e..16f15c1198 100644 --- a/library/smtplib.po +++ b/library/smtplib.po @@ -105,7 +105,7 @@ msgstr "" #: ../../library/smtplib.rst:65 msgid "Support for the :keyword:`with` statement was added." -msgstr "" +msgstr "新增對 :keyword:`with` 陳述式的支援。" #: ../../library/smtplib.rst:68 msgid "*source_address* argument was added." diff --git a/library/socket.po b/library/socket.po index c7c44fa904..c534e66220 100644 --- a/library/socket.po +++ b/library/socket.po @@ -735,7 +735,7 @@ msgstr "" #: ../../library/socket.rst:498 msgid "NetBSD support was added." -msgstr "" +msgstr "新增對 NetBSD 的支援。" #: ../../library/socket.rst:501 msgid "Restored missing ``CAN_RAW_ERR_FILTER`` on Linux." diff --git a/library/subprocess.po b/library/subprocess.po index 23c4b21b71..f7e6879fde 100644 --- a/library/subprocess.po +++ b/library/subprocess.po @@ -1023,7 +1023,7 @@ msgstr "" #: ../../library/subprocess.rst:749 msgid "The :exc:`SubprocessError` base class was added." -msgstr "" +msgstr "新增 :exc:`SubprocessError` 基底類別。" #: ../../library/subprocess.rst:755 msgid "Security Considerations" diff --git a/library/textwrap.po b/library/textwrap.po index a6055637cb..e4d55aa166 100644 --- a/library/textwrap.po +++ b/library/textwrap.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-03 11:11+0800\n" +"POT-Creation-Date: 2025-12-31 00:16+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-" @@ -129,7 +129,7 @@ msgid "" "a single newline character in the output." msgstr "" -#: ../../library/textwrap.rst:94 ../../library/textwrap.rst:115 +#: ../../library/textwrap.rst:94 ../../library/textwrap.rst:119 msgid "For example::" msgstr "舉例來說: ::" @@ -145,21 +145,28 @@ msgid "" " print(repr(dedent(s))) # prints 'hello\\n world\\n'" msgstr "" -#: ../../library/textwrap.rst:108 +#: ../../library/textwrap.rst:105 +msgid "" +"The :func:`!dedent` function now correctly normalizes blank lines containing " +"only whitespace characters. Previously, the implementation only normalized " +"blank lines containing tabs and spaces." +msgstr "" + +#: ../../library/textwrap.rst:112 msgid "Add *prefix* to the beginning of selected lines in *text*." msgstr "" -#: ../../library/textwrap.rst:110 +#: ../../library/textwrap.rst:114 msgid "Lines are separated by calling ``text.splitlines(True)``." msgstr "" -#: ../../library/textwrap.rst:112 +#: ../../library/textwrap.rst:116 msgid "" "By default, *prefix* is added to all lines that do not consist solely of " "whitespace (including any line endings)." msgstr "" -#: ../../library/textwrap.rst:117 +#: ../../library/textwrap.rst:121 msgid "" ">>> s = 'hello\\n\\n \\nworld'\n" ">>> indent(s, ' ')\n" @@ -169,14 +176,14 @@ msgstr "" ">>> indent(s, ' ')\n" "' hello\\n\\n \\n world'" -#: ../../library/textwrap.rst:121 +#: ../../library/textwrap.rst:125 msgid "" "The optional *predicate* argument can be used to control which lines are " "indented. For example, it is easy to add *prefix* to even empty and " "whitespace-only lines::" msgstr "" -#: ../../library/textwrap.rst:125 +#: ../../library/textwrap.rst:129 msgid "" ">>> print(indent(s, '+ ', lambda line: True))\n" "+ hello\n" @@ -190,7 +197,7 @@ msgstr "" "+\n" "+ world" -#: ../../library/textwrap.rst:134 +#: ../../library/textwrap.rst:138 msgid "" ":func:`wrap`, :func:`fill` and :func:`shorten` work by creating a :class:" "`TextWrapper` instance and calling a single method on it. That instance is " @@ -199,29 +206,29 @@ msgid "" "class:`TextWrapper` object." msgstr "" -#: ../../library/textwrap.rst:140 +#: ../../library/textwrap.rst:144 msgid "" "Text is preferably wrapped on whitespaces and right after the hyphens in " "hyphenated words; only then will long words be broken if necessary, unless :" "attr:`TextWrapper.break_long_words` is set to false." msgstr "" -#: ../../library/textwrap.rst:146 +#: ../../library/textwrap.rst:150 msgid "" "The :class:`TextWrapper` constructor accepts a number of optional keyword " "arguments. Each keyword argument corresponds to an instance attribute, so " "for example ::" msgstr "" -#: ../../library/textwrap.rst:150 +#: ../../library/textwrap.rst:154 msgid "wrapper = TextWrapper(initial_indent=\"* \")" msgstr "wrapper = TextWrapper(initial_indent=\"* \")" -#: ../../library/textwrap.rst:152 +#: ../../library/textwrap.rst:156 msgid "is the same as ::" msgstr "" -#: ../../library/textwrap.rst:154 +#: ../../library/textwrap.rst:158 msgid "" "wrapper = TextWrapper()\n" "wrapper.initial_indent = \"* \"" @@ -229,20 +236,20 @@ msgstr "" "wrapper = TextWrapper()\n" "wrapper.initial_indent = \"* \"" -#: ../../library/textwrap.rst:157 +#: ../../library/textwrap.rst:161 msgid "" "You can reuse the same :class:`TextWrapper` object many times, and you can " "change any of its options through direct assignment to instance attributes " "between uses." msgstr "" -#: ../../library/textwrap.rst:161 +#: ../../library/textwrap.rst:165 msgid "" "The :class:`TextWrapper` instance attributes (and keyword arguments to the " "constructor) are as follows:" msgstr "" -#: ../../library/textwrap.rst:167 +#: ../../library/textwrap.rst:171 msgid "" "(default: ``70``) The maximum length of wrapped lines. As long as there are " "no individual words in the input text longer than :attr:`width`, :class:" @@ -250,20 +257,20 @@ msgid "" "`width` characters." msgstr "" -#: ../../library/textwrap.rst:175 +#: ../../library/textwrap.rst:179 msgid "" "(default: ``True``) If true, then all tab characters in *text* will be " "expanded to spaces using the :meth:`~str.expandtabs` method of *text*." msgstr "" -#: ../../library/textwrap.rst:181 +#: ../../library/textwrap.rst:185 msgid "" "(default: ``8``) If :attr:`expand_tabs` is true, then all tab characters in " "*text* will be expanded to zero or more spaces, depending on the current " "column and the given tab size." msgstr "" -#: ../../library/textwrap.rst:190 +#: ../../library/textwrap.rst:194 msgid "" "(default: ``True``) If true, after tab expansion but before wrapping, the :" "meth:`wrap` method will replace each whitespace character with a single " @@ -271,14 +278,14 @@ msgid "" "vertical tab, formfeed, and carriage return (``'\\t\\n\\v\\f\\r'``)." msgstr "" -#: ../../library/textwrap.rst:198 +#: ../../library/textwrap.rst:202 msgid "" "If :attr:`expand_tabs` is false and :attr:`replace_whitespace` is true, each " "tab character will be replaced by a single space, which is *not* the same as " "tab expansion." msgstr "" -#: ../../library/textwrap.rst:204 +#: ../../library/textwrap.rst:208 msgid "" "If :attr:`replace_whitespace` is false, newlines may appear in the middle of " "a line and cause strange output. For this reason, text should be split into " @@ -286,7 +293,7 @@ msgid "" "separately." msgstr "" -#: ../../library/textwrap.rst:212 +#: ../../library/textwrap.rst:216 msgid "" "(default: ``True``) If true, whitespace at the beginning and ending of every " "line (after wrapping but before indenting) is dropped. Whitespace at the " @@ -295,21 +302,21 @@ msgid "" "line is dropped." msgstr "" -#: ../../library/textwrap.rst:221 +#: ../../library/textwrap.rst:225 msgid "" "(default: ``''``) String that will be prepended to the first line of wrapped " "output. Counts towards the length of the first line. The empty string is " "not indented." msgstr "" -#: ../../library/textwrap.rst:228 +#: ../../library/textwrap.rst:232 msgid "" "(default: ``''``) String that will be prepended to all lines of wrapped " "output except the first. Counts towards the length of each line except the " "first." msgstr "" -#: ../../library/textwrap.rst:235 +#: ../../library/textwrap.rst:239 msgid "" "(default: ``False``) If true, :class:`TextWrapper` attempts to detect " "sentence endings and ensure that sentences are always separated by exactly " @@ -321,23 +328,23 @@ msgid "" "to detect the difference between \"Dr.\" in ::" msgstr "" -#: ../../library/textwrap.rst:244 +#: ../../library/textwrap.rst:248 msgid "[...] Dr. Frankenstein's monster [...]" msgstr "[...] Dr. Frankenstein's monster [...]" -#: ../../library/textwrap.rst:246 +#: ../../library/textwrap.rst:250 msgid "and \"Spot.\" in ::" msgstr "" -#: ../../library/textwrap.rst:248 +#: ../../library/textwrap.rst:252 msgid "[...] See Spot. See Spot run [...]" msgstr "[...] See Spot. See Spot run [...]" -#: ../../library/textwrap.rst:250 +#: ../../library/textwrap.rst:254 msgid ":attr:`fix_sentence_endings` is false by default." msgstr "" -#: ../../library/textwrap.rst:252 +#: ../../library/textwrap.rst:256 msgid "" "Since the sentence detection algorithm relies on ``string.lowercase`` for " "the definition of \"lowercase letter\", and a convention of using two spaces " @@ -345,7 +352,7 @@ msgid "" "English-language texts." msgstr "" -#: ../../library/textwrap.rst:260 +#: ../../library/textwrap.rst:264 msgid "" "(default: ``True``) If true, then words longer than :attr:`width` will be " "broken in order to ensure that no lines are longer than :attr:`width`. If " @@ -354,7 +361,7 @@ msgid "" "order to minimize the amount by which :attr:`width` is exceeded.)" msgstr "" -#: ../../library/textwrap.rst:269 +#: ../../library/textwrap.rst:273 msgid "" "(default: ``True``) If true, wrapping will occur preferably on whitespaces " "and right after hyphens in compound words, as it is customary in English. If " @@ -364,25 +371,25 @@ msgid "" "always allow breaking hyphenated words." msgstr "" -#: ../../library/textwrap.rst:279 +#: ../../library/textwrap.rst:283 msgid "" "(default: ``None``) If not ``None``, then the output will contain at most " "*max_lines* lines, with *placeholder* appearing at the end of the output." msgstr "" -#: ../../library/textwrap.rst:289 +#: ../../library/textwrap.rst:293 msgid "" "(default: ``' [...]'``) String that will appear at the end of the output " "text if it has been truncated." msgstr "" -#: ../../library/textwrap.rst:295 +#: ../../library/textwrap.rst:299 msgid "" ":class:`TextWrapper` also provides some public methods, analogous to the " "module-level convenience functions:" msgstr "" -#: ../../library/textwrap.rst:300 +#: ../../library/textwrap.rst:304 msgid "" "Wraps the single paragraph in *text* (a string) so every line is at most :" "attr:`width` characters long. All wrapping options are taken from instance " @@ -391,16 +398,16 @@ msgid "" "returned list is empty." msgstr "" -#: ../../library/textwrap.rst:309 +#: ../../library/textwrap.rst:313 msgid "" "Wraps the single paragraph in *text*, and returns a single string containing " "the wrapped paragraph." msgstr "" -#: ../../library/textwrap.rst:285 +#: ../../library/textwrap.rst:289 msgid "..." msgstr "..." -#: ../../library/textwrap.rst:285 +#: ../../library/textwrap.rst:289 msgid "placeholder" msgstr "placeholder(佔位符號)" diff --git a/library/traceback.po b/library/traceback.po index 82709ec956..3ebe988c64 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -258,7 +258,7 @@ msgstr "" #: ../../library/traceback.rst:207 msgid "*show_group* parameter was added." -msgstr "" +msgstr "新增 *show_group* 參數。" #: ../../library/traceback.rst:213 msgid "" diff --git a/library/tracemalloc.po b/library/tracemalloc.po index 08f0203255..dfdd9cbab8 100644 --- a/library/tracemalloc.po +++ b/library/tracemalloc.po @@ -1082,7 +1082,7 @@ msgstr "" #: ../../library/tracemalloc.rst:738 msgid "The :attr:`Traceback.total_nframe` attribute was added." -msgstr "" +msgstr "新增 :attr:`Traceback.total_nframe` 屬性。" #: ../../library/tracemalloc.rst:743 msgid "" diff --git a/library/urllib.request.po b/library/urllib.request.po index 7f794ed457..e244fbd198 100644 --- a/library/urllib.request.po +++ b/library/urllib.request.po @@ -327,7 +327,7 @@ msgstr "" #: ../../library/urllib.request.rst:174 msgid "The *add_scheme* parameter was added." -msgstr "" +msgstr "新增 *add_scheme* 參數。" #: ../../library/urllib.request.rst:180 msgid "" diff --git a/library/zoneinfo.po b/library/zoneinfo.po index 0badcc92a7..e9f6f15c1c 100644 --- a/library/zoneinfo.po +++ b/library/zoneinfo.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-08 00:15+0000\n" +"POT-Creation-Date: 2025-12-29 00:16+0000\n" "PO-Revision-Date: 2025-06-21 20:00+0800\n" "Last-Translator: Dr-XYZ \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -413,7 +413,13 @@ msgid "" "Objects created via this constructor cannot be pickled (see `pickling`_)." msgstr "透過此建構函式建立的物件無法被封裝(參閱 `pickling`_)。" -#: ../../library/zoneinfo.rst:211 +#: ../../library/zoneinfo.rst:209 +msgid "" +":exc:`ValueError` is raised if the data read from *file_obj* is not a valid " +"TZif file." +msgstr "" + +#: ../../library/zoneinfo.rst:214 msgid "" "An alternate constructor that bypasses the constructor's cache. It is " "identical to the primary constructor, but returns a new object on each call. " @@ -425,13 +431,13 @@ msgstr "" "一個新物件。這對於測試或示範目的最可能有用,但它也可以用來建立一個具有不同快" "取失效策略的系統。" -#: ../../library/zoneinfo.rst:217 +#: ../../library/zoneinfo.rst:220 msgid "" "Objects created via this constructor will also bypass the cache of a " "deserializing process when unpickled." msgstr "透過此建構函式建立的物件,在拆封時也會繞過去序列化過程的快取。" -#: ../../library/zoneinfo.rst:224 +#: ../../library/zoneinfo.rst:227 msgid "" "Using this constructor may change the semantics of your datetimes in " "surprising ways, only use it if you know that you need to." @@ -439,11 +445,11 @@ msgstr "" "使用此建構函式可能會以意想不到的方式改變你的 datetime 物件的語意,只有在你確" "定需要時才使用它。" -#: ../../library/zoneinfo.rst:227 +#: ../../library/zoneinfo.rst:230 msgid "The following class methods are also available:" msgstr "以下類別方法也可用:" -#: ../../library/zoneinfo.rst:231 +#: ../../library/zoneinfo.rst:234 msgid "" "A method for invalidating the cache on the ``ZoneInfo`` class. If no " "arguments are passed, all caches are invalidated and the next call to the " @@ -452,7 +458,7 @@ msgstr "" "一個用於使 ``ZoneInfo`` 類別上的快取失效的方法。如果沒有傳入引數,所有快取都" "會失效,且下一次對每個鍵的主要建構函式呼叫都將回傳一個新的實例。" -#: ../../library/zoneinfo.rst:235 +#: ../../library/zoneinfo.rst:238 msgid "" "If an iterable of key names is passed to the ``only_keys`` parameter, only " "the specified keys will be removed from the cache. Keys passed to " @@ -461,7 +467,7 @@ msgstr "" "如果將一個包含鍵名的可疊代物件傳遞給 ``only_keys`` 參數,則只有指定的鍵會從快" "取中移除。傳遞給 ``only_keys`` 但在快取中找不到的鍵會被忽略。" -#: ../../library/zoneinfo.rst:243 +#: ../../library/zoneinfo.rst:246 msgid "" "Invoking this function may change the semantics of datetimes using " "``ZoneInfo`` in surprising ways; this modifies module state and thus may " @@ -470,11 +476,11 @@ msgstr "" "呼叫此函式可能會以意想不到的方式改變使用 ``ZoneInfo`` 的 datetime 物件的語" "意;這會修改模組狀態,因此可能產生廣泛的影響。只有在你確定需要時才使用它。" -#: ../../library/zoneinfo.rst:248 +#: ../../library/zoneinfo.rst:251 msgid "The class has one attribute:" msgstr "該類別有一個屬性:" -#: ../../library/zoneinfo.rst:252 +#: ../../library/zoneinfo.rst:255 msgid "" "This is a read-only :term:`attribute` that returns the value of ``key`` " "passed to the constructor, which should be a lookup key in the IANA time " @@ -485,13 +491,13 @@ msgstr "" "值應為 IANA 時區資料庫中的查詢鍵(例如 ``America/New_York``、``Europe/" "Paris`` 或 ``Asia/Tokyo``)。" -#: ../../library/zoneinfo.rst:257 +#: ../../library/zoneinfo.rst:260 msgid "" "For zones constructed from file without specifying a ``key`` parameter, this " "will be set to ``None``." msgstr "對於從檔案建構且未指定 ``key`` 參數的時區,此屬性將被設定為 ``None``。" -#: ../../library/zoneinfo.rst:262 +#: ../../library/zoneinfo.rst:265 msgid "" "Although it is a somewhat common practice to expose these to end users, " "these values are designed to be primary keys for representing the relevant " @@ -503,11 +509,11 @@ msgstr "" "區的主鍵,而不一定是面向使用者的元素。像 CLDR(Unicode 通用地區資料儲存庫)這" "樣的專案可以用來從這些鍵中取得更友善的使用者字串。" -#: ../../library/zoneinfo.rst:269 +#: ../../library/zoneinfo.rst:272 msgid "String representations" msgstr "字串表示" -#: ../../library/zoneinfo.rst:271 +#: ../../library/zoneinfo.rst:274 msgid "" "The string representation returned when calling :py:class:`str` on a :class:" "`ZoneInfo` object defaults to using the :attr:`ZoneInfo.key` attribute (see " @@ -516,7 +522,7 @@ msgstr "" "在 :class:`ZoneInfo` 物件上呼叫 :py:class:`str` 時回傳的字串表示,預設使用 :" "attr:`ZoneInfo.key` 屬性(參閱屬性文件中的使用說明): ::" -#: ../../library/zoneinfo.rst:275 +#: ../../library/zoneinfo.rst:278 msgid "" ">>> zone = ZoneInfo(\"Pacific/Kwajalein\")\n" ">>> str(zone)\n" @@ -534,7 +540,7 @@ msgstr "" ">>> f\"{dt.isoformat()} [{dt.tzinfo}]\"\n" "'2020-04-01T03:15:00+12:00 [Pacific/Kwajalein]'" -#: ../../library/zoneinfo.rst:283 +#: ../../library/zoneinfo.rst:286 msgid "" "For objects constructed from a file without specifying a ``key`` parameter, " "``str`` falls back to calling :func:`repr`. ``ZoneInfo``'s ``repr`` is " @@ -545,11 +551,11 @@ msgstr "" "``ZoneInfo`` 的 ``repr`` 是實作定義的,且不保證在不同版本之間保持穩定,但保證" "它不會是一個有效的 ``ZoneInfo`` 鍵。" -#: ../../library/zoneinfo.rst:291 +#: ../../library/zoneinfo.rst:294 msgid "Pickle serialization" msgstr "封裝(Pickle)序列化" -#: ../../library/zoneinfo.rst:293 +#: ../../library/zoneinfo.rst:296 msgid "" "Rather than serializing all transition data, ``ZoneInfo`` objects are " "serialized by key, and ``ZoneInfo`` objects constructed from files (even " @@ -558,11 +564,11 @@ msgstr "" "``ZoneInfo`` 物件不是序列化所有轉換資料,而是按鍵進行序列化,而從檔案建構的 " "``ZoneInfo`` 物件(即使是那些指定了 ``key`` 值的物件)也無法被封裝。" -#: ../../library/zoneinfo.rst:297 +#: ../../library/zoneinfo.rst:300 msgid "The behavior of a ``ZoneInfo`` file depends on how it was constructed:" msgstr "``ZoneInfo`` 檔案的行為取決於它的建構方式:" -#: ../../library/zoneinfo.rst:299 +#: ../../library/zoneinfo.rst:302 msgid "" "``ZoneInfo(key)``: When constructed with the primary constructor, a " "``ZoneInfo`` object is serialized by key, and when deserialized, the " @@ -572,11 +578,11 @@ msgid "" "``ZoneInfo(\"Europe/Berlin\")``, one would expect the following behavior:" msgstr "" "``ZoneInfo(key)``:當使用主要建構函式建構時,``ZoneInfo`` 物件會按鍵序列化," -"而在去序列化時,去序列化過程會使用主要建構函式,因此這些物件會與指向相同" -"時區的其他參照是同一個物件。例如,如果 ``europe_berlin_pkl`` 是一個包含從 " +"而在去序列化時,去序列化過程會使用主要建構函式,因此這些物件會與指向相同時區" +"的其他參照是同一個物件。例如,如果 ``europe_berlin_pkl`` 是一個包含從 " "``ZoneInfo(\"Europe/Berlin\")`` 建構並封裝的字串,會預期以下行為:" -#: ../../library/zoneinfo.rst:307 +#: ../../library/zoneinfo.rst:310 msgid "" ">>> a = ZoneInfo(\"Europe/Berlin\")\n" ">>> b = pickle.loads(europe_berlin_pkl)\n" @@ -588,7 +594,7 @@ msgstr "" ">>> a is b\n" "True" -#: ../../library/zoneinfo.rst:314 +#: ../../library/zoneinfo.rst:317 msgid "" "``ZoneInfo.no_cache(key)``: When constructed from the cache-bypassing " "constructor, the ``ZoneInfo`` object is also serialized by key, but when " @@ -602,7 +608,7 @@ msgstr "" "``europe_berlin_pkl_nc`` 是一個包含從 ``ZoneInfo.no_cache(\"Europe/" "Berlin\")`` 建構並封裝的字串,會預期以下行為:" -#: ../../library/zoneinfo.rst:321 +#: ../../library/zoneinfo.rst:324 msgid "" ">>> a = ZoneInfo(\"Europe/Berlin\")\n" ">>> b = pickle.loads(europe_berlin_pkl_nc)\n" @@ -614,7 +620,7 @@ msgstr "" ">>> a is b\n" "False" -#: ../../library/zoneinfo.rst:328 +#: ../../library/zoneinfo.rst:331 msgid "" "``ZoneInfo.from_file(file_obj, /, key=None)``: When constructed from a file, " "the ``ZoneInfo`` object raises an exception on pickling. If an end user " @@ -628,7 +634,7 @@ msgstr "" "建議他們使用包裝器型別或自訂序列化函式:可以按鍵序列化,或儲存檔案物件的內容" "並將其序列化。" -#: ../../library/zoneinfo.rst:334 +#: ../../library/zoneinfo.rst:337 msgid "" "This method of serialization requires that the time zone data for the " "required key be available on both the serializing and deserializing side, " @@ -642,11 +648,11 @@ msgstr "" "函式的參照預期存在於序列化和去序列化環境中的方式相似。這也意味著,當在具有不" "同版本時區資料的環境中拆封一個封裝的 ``ZoneInfo`` 時,不保證結果的一致性。" -#: ../../library/zoneinfo.rst:342 +#: ../../library/zoneinfo.rst:345 msgid "Functions" msgstr "函式" -#: ../../library/zoneinfo.rst:346 +#: ../../library/zoneinfo.rst:349 msgid "" "Get a set containing all the valid keys for IANA time zones available " "anywhere on the time zone path. This is recalculated on every call to the " @@ -655,7 +661,7 @@ msgstr "" "取得一個集合,其中包含時區路徑上任何地方可用的所有 IANA 時區的有效鍵。這會在" "每次呼叫函式時重新計算。" -#: ../../library/zoneinfo.rst:350 +#: ../../library/zoneinfo.rst:353 msgid "" "This function only includes canonical zone names and does not include " "\"special\" zones such as those under the ``posix/`` and ``right/`` " @@ -664,7 +670,7 @@ msgstr "" "此函式僅包含規範的時區名稱,不包含「特殊」時區,例如 ``posix/`` 和 ``right/" "`` 目錄下的時區,或 ``posixrules`` 時區。" -#: ../../library/zoneinfo.rst:356 +#: ../../library/zoneinfo.rst:359 msgid "" "This function may open a large number of files, as the best way to determine " "if a file on the time zone path is a valid time zone is to read the \"magic " @@ -673,7 +679,7 @@ msgstr "" "此函式可能會開啟大量檔案,因為確定時區路徑上的檔案是否為有效時區的最佳方法是" "讀取開頭的「魔術字串」。" -#: ../../library/zoneinfo.rst:362 +#: ../../library/zoneinfo.rst:365 msgid "" "These values are not designed to be exposed to end-users; for user facing " "elements, applications should use something like CLDR (the Unicode Common " @@ -684,7 +690,7 @@ msgstr "" "(Unicode 通用地區資料儲存庫)這樣的工具來取得更友善的使用者字串。另請參閱關" "於 :attr:`ZoneInfo.key` 的警示說明。" -#: ../../library/zoneinfo.rst:369 +#: ../../library/zoneinfo.rst:372 msgid "" "Sets or resets the time zone search path (:data:`TZPATH`) for the module. " "When called with no arguments, :data:`TZPATH` is set to the default value." @@ -692,7 +698,7 @@ msgstr "" "為模組設定或重設時區搜尋路徑(:data:`TZPATH`)。當不帶引數呼叫時,:data:" "`TZPATH` 會被設定為預設值。" -#: ../../library/zoneinfo.rst:372 +#: ../../library/zoneinfo.rst:375 msgid "" "Calling ``reset_tzpath`` will not invalidate the :class:`ZoneInfo` cache, " "and so calls to the primary ``ZoneInfo`` constructor will only use the new " @@ -701,7 +707,7 @@ msgstr "" "呼叫 ``reset_tzpath`` 不會使 :class:`ZoneInfo` 快取失效,因此對主要 " "``ZoneInfo`` 建構函式的呼叫只會在快取未命中時才使用新的 ``TZPATH``。" -#: ../../library/zoneinfo.rst:376 +#: ../../library/zoneinfo.rst:379 msgid "" "The ``to`` parameter must be a :term:`sequence` of strings or :class:`os." "PathLike` and not a string, all of which must be absolute paths. :exc:" @@ -712,11 +718,11 @@ msgstr "" "`,而不是一個字串,其中所有元素都必須是絕對路徑。如果傳入的不是絕對" "路徑,將會引發 :exc:`ValueError` 例外。" -#: ../../library/zoneinfo.rst:382 +#: ../../library/zoneinfo.rst:385 msgid "Globals" msgstr "全域變數" -#: ../../library/zoneinfo.rst:386 +#: ../../library/zoneinfo.rst:389 msgid "" "A read-only sequence representing the time zone search path -- when " "constructing a ``ZoneInfo`` from a key, the key is joined to each entry in " @@ -725,13 +731,13 @@ msgstr "" "一個表示時區搜尋路徑的唯讀序列 —— 當從一個鍵建構 ``ZoneInfo`` 時,該鍵會與 " "``TZPATH`` 中的每個條目結合,並使用找到的第一個檔案。" -#: ../../library/zoneinfo.rst:390 +#: ../../library/zoneinfo.rst:393 msgid "" "``TZPATH`` may contain only absolute paths, never relative paths, regardless " "of how it is configured." msgstr "``TZPATH`` 只能包含絕對路徑,絕不能包含相對路徑,無論如何設定。" -#: ../../library/zoneinfo.rst:393 +#: ../../library/zoneinfo.rst:396 msgid "" "The object that ``zoneinfo.TZPATH`` points to may change in response to a " "call to :func:`reset_tzpath`, so it is recommended to use ``zoneinfo." @@ -742,18 +748,18 @@ msgstr "" "變,因此建議使用 ``zoneinfo.TZPATH``,而不是從 ``zoneinfo`` 引入 ``TZPATH`` " "或將一個長生命週期的變數賦值給 ``zoneinfo.TZPATH``。" -#: ../../library/zoneinfo.rst:398 +#: ../../library/zoneinfo.rst:401 msgid "" "For more information on configuring the time zone search path, see :ref:" "`zoneinfo_data_configuration`." msgstr "" "有關設定時區搜尋路徑的更多資訊,請參閱 :ref:`zoneinfo_data_configuration`。" -#: ../../library/zoneinfo.rst:402 +#: ../../library/zoneinfo.rst:405 msgid "Exceptions and warnings" msgstr "例外與警告" -#: ../../library/zoneinfo.rst:406 +#: ../../library/zoneinfo.rst:409 msgid "" "Raised when construction of a :class:`ZoneInfo` object fails because the " "specified key could not be found on the system. This is a subclass of :exc:" @@ -762,7 +768,7 @@ msgstr "" "當建構 :class:`ZoneInfo` 物件因在系統上找不到指定的鍵而失敗時引發。這是 :exc:" "`KeyError` 的一個子類別。" -#: ../../library/zoneinfo.rst:412 +#: ../../library/zoneinfo.rst:415 msgid "" "Raised when :envvar:`PYTHONTZPATH` contains an invalid component that will " "be filtered out, such as a relative path." diff --git a/reference/import.po b/reference/import.po index f8d7af23e3..2f459da707 100644 --- a/reference/import.po +++ b/reference/import.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-12-31 00:16+0000\n" "PO-Revision-Date: 2024-11-06 14:55+0800\n" "Last-Translator: Ken Cheng \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -27,13 +27,13 @@ msgid "" "Python code in one :term:`module` gains access to the code in another module " "by the process of :term:`importing` it. The :keyword:`import` statement is " "the most common way of invoking the import machinery, but it is not the only " -"way. Functions such as :func:`importlib.import_module` and built-" -"in :func:`__import__` can also be used to invoke the import machinery." +"way. Functions such as :func:`importlib.import_module` and built-in :func:" +"`__import__` can also be used to invoke the import machinery." msgstr "" "一個 :term:`module` 中的 Python 程式碼透過 :term:`importing` 的過程來存取另一" "個模組中的程式碼。:keyword:`import` 陳述式是叫用 (invoke) 引入機制最常見的方" -"法,但這不是唯一的方法。函式如 :func:`importlib.import_module` 以及內建函" -"式 :func:`__import__` 也可以用來叫用引入機制。" +"法,但這不是唯一的方法。函式如 :func:`importlib.import_module` 以及內建函式 :" +"func:`__import__` 也可以用來叫用引入機制。" #: ../../reference/import.rst:16 msgid "" @@ -42,8 +42,8 @@ msgid "" "local scope. The search operation of the :keyword:`!import` statement is " "defined as a call to the :func:`__import__` function, with the appropriate " "arguments. The return value of :func:`__import__` is used to perform the " -"name binding operation of the :keyword:`!import` statement. See " -"the :keyword:`!import` statement for the exact details of that name binding " +"name binding operation of the :keyword:`!import` statement. See the :" +"keyword:`!import` statement for the exact details of that name binding " "operation." msgstr "" ":keyword:`import` 陳述式結合了兩個操作:首先搜尋指定的模組,然後將搜尋結果繫" @@ -67,15 +67,14 @@ msgstr "" #: ../../reference/import.rst:31 msgid "" -"When an :keyword:`import` statement is executed, the standard " -"builtin :func:`__import__` function is called. Other mechanisms for invoking " -"the import system (such as :func:`importlib.import_module`) may choose to " -"bypass :func:`__import__` and use their own solutions to implement import " -"semantics." +"When an :keyword:`import` statement is executed, the standard builtin :func:" +"`__import__` function is called. Other mechanisms for invoking the import " +"system (such as :func:`importlib.import_module`) may choose to bypass :func:" +"`__import__` and use their own solutions to implement import semantics." msgstr "" "當執行 :keyword:`import` 陳述式時,會呼叫內建的 :func:`__import__` 函式。其他" -"叫用引入系統的機制(如 :func:`importlib.import_module`)可以選擇略" -"過 :func:`__import__`,並使用它們自己的解決方案來實作引入語意。" +"叫用引入系統的機制(如 :func:`importlib.import_module`)可以選擇略過 :func:" +"`__import__`,並使用它們自己的解決方案來實作引入語意。" #: ../../reference/import.rst:36 msgid "" @@ -87,15 +86,14 @@ msgid "" "using various hooks described in the sections below." msgstr "" "當模組首次被引入時,Python 會搜尋該模組,若找到則會建立一個模組物件 " -"[#fnmo]_,並對其進行初始化。如果找不到指定的模組,則會引" -"發 :exc:`ModuleNotFoundError`。當引入機制被叫用時,Python 會實作各種策略來搜" -"尋指定的模組。這些策略可以透過使用以下章節描述的各種 hook(掛鉤)來修改和擴" -"展。" +"[#fnmo]_,並對其進行初始化。如果找不到指定的模組,則會引發 :exc:" +"`ModuleNotFoundError`。當引入機制被叫用時,Python 會實作各種策略來搜尋指定的" +"模組。這些策略可以透過使用以下章節描述的各種 hook(掛鉤)來修改和擴展。" #: ../../reference/import.rst:43 msgid "" -"The import system has been updated to fully implement the second phase " -"of :pep:`302`. There is no longer any implicit import machinery - the full " +"The import system has been updated to fully implement the second phase of :" +"pep:`302`. There is no longer any implicit import machinery - the full " "import system is exposed through :data:`sys.meta_path`. In addition, native " "namespace package support has been implemented (see :pep:`420`)." msgstr "" @@ -115,10 +113,9 @@ msgid "" "import machinery. Refer to the :mod:`importlib` library documentation for " "additional detail." msgstr "" -":mod:`importlib` 模組提供了豐富的 API 來與引入系統互動。例" -"如,:func:`importlib.import_module` 提供了一個比內建的 :func:`__import__` 更" -"推薦且更簡單的 API 來叫用引入機制。更多詳細資訊請參閱 :mod:`importlib` 函式庫" -"文件。" +":mod:`importlib` 模組提供了豐富的 API 來與引入系統互動。例如,:func:" +"`importlib.import_module` 提供了一個比內建的 :func:`__import__` 更推薦且更簡" +"單的 API 來叫用引入機制。更多詳細資訊請參閱 :mod:`importlib` 函式庫文件。" #: ../../reference/import.rst:62 msgid "Packages" @@ -170,8 +167,8 @@ msgid "" msgstr "" "所有模組都有一個名稱。子套件的名稱與其父套件名稱之間用一個點來分隔,類似於 " "Python 的標準屬性存取語法。因此,你可能會有一個名為 :mod:`email` 的套件,該套" -"件又有一個名為 :mod:`email.mime` 的子套件,並且該子套件中有一個名" -"為 :mod:`email.mime.text` 的模組。" +"件又有一個名為 :mod:`email.mime` 的子套件,並且該子套件中有一個名為 :mod:" +"`email.mime.text` 的模組。" #: ../../reference/import.rst:93 msgid "Regular packages" @@ -183,18 +180,18 @@ msgid "" "package>` and :term:`namespace packages `. Regular " "packages are traditional packages as they existed in Python 3.2 and earlier. " "A regular package is typically implemented as a directory containing an " -"``__init__.py`` file. When a regular package is imported, this " -"``__init__.py`` file is implicitly executed, and the objects it defines are " -"bound to names in the package's namespace. The ``__init__.py`` file can " -"contain the same Python code that any other module can contain, and Python " -"will add some additional attributes to the module when it is imported." -msgstr "" -"Python 定義了兩種類型的套件,:term:`一般套件 `\\ 和" -"\\ :term:`命名空間套件 `。一般套件是 Python 3.2 及更早版本" -"中存在的傳統套件。一般套件通常實作成一個包含 ``__init__.py`` 檔案的目錄。當引" -"入一般套件時,該 ``__init__.py`` 檔案會被隱式執行,其定義的物件會繫結到該套件" -"的命名空間中的名稱。``__init__.py`` 檔案可以包含與任何其他模組相同的 Python " -"程式碼,並且 Python 會在引入時為該模組增加一些額外的屬性。" +"``__init__.py`` file. When a regular package is imported, this ``__init__." +"py`` file is implicitly executed, and the objects it defines are bound to " +"names in the package's namespace. The ``__init__.py`` file can contain the " +"same Python code that any other module can contain, and Python will add some " +"additional attributes to the module when it is imported." +msgstr "" +"Python 定義了兩種類型的套件,:term:`一般套件 `\\ 和\\ :term:" +"`命名空間套件 `。一般套件是 Python 3.2 及更早版本中存在的" +"傳統套件。一般套件通常實作成一個包含 ``__init__.py`` 檔案的目錄。當引入一般套" +"件時,該 ``__init__.py`` 檔案會被隱式執行,其定義的物件會繫結到該套件的命名空" +"間中的名稱。``__init__.py`` 檔案可以包含與任何其他模組相同的 Python 程式碼," +"並且 Python 會在引入時為該模組增加一些額外的屬性。" #: ../../reference/import.rst:108 msgid "" @@ -300,21 +297,21 @@ msgid "" msgstr "" "在開始搜尋之前,Python 需要被引入模組(或套件,但在本討論中,兩者的區別無關緊" "要)的完整\\ :term:`限定名稱 (qualified name) `。此名稱可能來" -"自 :keyword:`import` 陳述式的各種引數,或來" -"自 :func:`importlib.import_module` 或 :func:`__import__` 函式的參數。" +"自 :keyword:`import` 陳述式的各種引數,或來自 :func:`importlib." +"import_module` 或 :func:`__import__` 函式的參數。" #: ../../reference/import.rst:168 msgid "" "This name will be used in various phases of the import search, and it may be " "the dotted path to a submodule, e.g. ``foo.bar.baz``. In this case, Python " -"first tries to import ``foo``, then ``foo.bar``, and finally " -"``foo.bar.baz``. If any of the intermediate imports fail, " -"a :exc:`ModuleNotFoundError` is raised." +"first tries to import ``foo``, then ``foo.bar``, and finally ``foo.bar." +"baz``. If any of the intermediate imports fail, a :exc:`ModuleNotFoundError` " +"is raised." msgstr "" "此名稱將在引入搜尋的各個階段中使用,並且它可能是指向子模組的點分隔路徑,例如 " -"``foo.bar.baz``。在這種情況下,Python 會首先嘗試引入 ``foo``,然後是 " -"``foo.bar``,最後是 ``foo.bar.baz``。如果任何中間引入失敗,則會引" -"發 :exc:`ModuleNotFoundError`。" +"``foo.bar.baz``。在這種情況下,Python 會首先嘗試引入 ``foo``,然後是 ``foo." +"bar``,最後是 ``foo.bar.baz``。如果任何中間引入失敗,則會引發 :exc:" +"`ModuleNotFoundError`。" #: ../../reference/import.rst:175 msgid "The module cache" @@ -330,21 +327,21 @@ msgid "" "module object." msgstr "" "在引入搜尋過程中首先檢查的地方是 :data:`sys.modules`。此對映用作所有先前引入" -"過的模組的快取,包括中間路徑。因此,如果 ``foo.bar.baz`` 之前已被引" -"入,:data:`sys.modules` 將包含 ``foo``、``foo.bar`` 和 ``foo.bar.baz`` 的條" -"目。每個鍵的值都是相應的模組物件。" +"過的模組的快取,包括中間路徑。因此,如果 ``foo.bar.baz`` 之前已被引入,:data:" +"`sys.modules` 將包含 ``foo``、``foo.bar`` 和 ``foo.bar.baz`` 的條目。每個鍵的" +"值都是相應的模組物件。" #: ../../reference/import.rst:187 msgid "" "During import, the module name is looked up in :data:`sys.modules` and if " "present, the associated value is the module satisfying the import, and the " -"process completes. However, if the value is ``None``, then " -"a :exc:`ModuleNotFoundError` is raised. If the module name is missing, " -"Python will continue searching for the module." +"process completes. However, if the value is ``None``, then a :exc:" +"`ModuleNotFoundError` is raised. If the module name is missing, Python will " +"continue searching for the module." msgstr "" "在引入過程中,會在 :data:`sys.modules` 中查找模組名稱,如果存在,則相關的值為" -"滿足此引入的模組,此引入過程即完成。然而,如果值是 ``None``,則會引" -"發 :exc:`ModuleNotFoundError`。如果模組名稱不存在,Python 會繼續搜尋該模組。" +"滿足此引入的模組,此引入過程即完成。然而,如果值是 ``None``,則會引發 :exc:" +"`ModuleNotFoundError`。如果模組名稱不存在,Python 會繼續搜尋該模組。" #: ../../reference/import.rst:193 msgid "" @@ -352,8 +349,8 @@ msgid "" "associated module (as other modules may hold references to it), but it will " "invalidate the cache entry for the named module, causing Python to search " "anew for the named module upon its next import. The key can also be assigned " -"to ``None``, forcing the next import of the module to result in " -"a :exc:`ModuleNotFoundError`." +"to ``None``, forcing the next import of the module to result in a :exc:" +"`ModuleNotFoundError`." msgstr "" ":data:`sys.modules` 是可寫入的。刪除一個鍵可能不會銷毀相關聯的模組(因為其他" "模組可能持有對它的參照),但會使指定的模組的快取條目失效,導致 Python 在下一" @@ -364,14 +361,14 @@ msgstr "" msgid "" "Beware though, as if you keep a reference to the module object, invalidate " "its cache entry in :data:`sys.modules`, and then re-import the named module, " -"the two module objects will *not* be the same. By " -"contrast, :func:`importlib.reload` will reuse the *same* module object, and " -"simply reinitialise the module contents by rerunning the module's code." +"the two module objects will *not* be the same. By contrast, :func:`importlib." +"reload` will reuse the *same* module object, and simply reinitialise the " +"module contents by rerunning the module's code." msgstr "" "但請注意,如果你保留了對模組物件的參照,並在 :data:`sys.modules` 中使其快取條" -"目失效,然後重新引入指定的模組,這兩個模組物件將\\ *不會*\\ 相同。相比之" -"下,:func:`importlib.reload` 會重用\\ *相同的*\\ 模組物件,並透過重新執行模組" -"的程式碼來簡單地重新初始化模組內容。" +"目失效,然後重新引入指定的模組,這兩個模組物件將\\ *不會*\\ 相同。相比之下,:" +"func:`importlib.reload` 會重用\\ *相同的*\\ 模組物件,並透過重新執行模組的程" +"式碼來簡單地重新初始化模組內容。" #: ../../reference/import.rst:210 msgid "Finders and loaders" @@ -381,18 +378,18 @@ msgstr "尋檢器 (Finder) 與載入器 (Loader)" msgid "" "If the named module is not found in :data:`sys.modules`, then Python's " "import protocol is invoked to find and load the module. This protocol " -"consists of two conceptual objects, :term:`finders ` " -"and :term:`loaders `. A finder's job is to determine whether it can " -"find the named module using whatever strategy it knows about. Objects that " -"implement both of these interfaces are referred to as :term:`importers " -"` - they return themselves when they find that they can load the " -"requested module." +"consists of two conceptual objects, :term:`finders ` and :term:" +"`loaders `. A finder's job is to determine whether it can find the " +"named module using whatever strategy it knows about. Objects that implement " +"both of these interfaces are referred to as :term:`importers ` - " +"they return themselves when they find that they can load the requested " +"module." msgstr "" "如果在 :data:`sys.modules` 中找不到指定的模組,則會叫用 Python 的引入協定來尋" -"找並載入該模組。這個協定由兩個概念性物件組成,:term:`尋檢器 ` 和" -"\\ :term:`載入器 `。尋檢器的任務是使用其已知的策略來確定是否能找到命" -"名模組。實作這兩個介面的物件稱為\\ :term:`引入器 (importer) ` ——當" -"它們發現可以載入所請求的模組時,會回傳它們自己。" +"找並載入該模組。這個協定由兩個概念性物件組成,:term:`尋檢器 ` 和\\ :" +"term:`載入器 `。尋檢器的任務是使用其已知的策略來確定是否能找到命名模" +"組。實作這兩個介面的物件稱為\\ :term:`引入器 (importer) ` ——當它們" +"發現可以載入所請求的模組時,會回傳它們自己。" #: ../../reference/import.rst:225 msgid "" @@ -473,10 +470,10 @@ msgstr "" #: ../../reference/import.rst:269 msgid "" -"Import path hooks are called as part of :data:`sys.path` (or " -"``package.__path__``) processing, at the point where their associated path " -"item is encountered. Import path hooks are registered by adding new " -"callables to :data:`sys.path_hooks` as described below." +"Import path hooks are called as part of :data:`sys.path` (or ``package." +"__path__``) processing, at the point where their associated path item is " +"encountered. Import path hooks are registered by adding new callables to :" +"data:`sys.path_hooks` as described below." msgstr "" "引入路徑掛鉤被視為 :data:`sys.path`\\ (或 ``package.__path__``)處理過程的一" "部分來呼叫,當遇到與其相關聯的路徑項目時就會被觸發。引入路徑掛鉤透過將新的可" @@ -491,18 +488,17 @@ msgid "" "When the named module is not found in :data:`sys.modules`, Python next " "searches :data:`sys.meta_path`, which contains a list of meta path finder " "objects. These finders are queried in order to see if they know how to " -"handle the named module. Meta path finders must implement a method " -"called :meth:`~importlib.abc.MetaPathFinder.find_spec` which takes three " -"arguments: a name, an import path, and (optionally) a target module. The " -"meta path finder can use any strategy it wants to determine whether it can " -"handle the named module or not." -msgstr "" -"當在 :data:`sys.modules` 中找不到命名模組時,Python 接下來會搜" -"尋 :data:`sys.meta_path`,其中包含一個元路徑尋檢器物件串列。這些尋檢器會依次" -"被查詢,看它們是否知道如何處理命名模組。元路徑尋檢器必須實作一個名" -"為 :meth:`~importlib.abc.MetaPathFinder.find_spec` 的方法,該方法接收三個引" -"數:名稱、引入路徑和(可選的)目標模組。元路徑尋檢器可以使用任何策略來確定它" -"是否能處理命名模組。" +"handle the named module. Meta path finders must implement a method called :" +"meth:`~importlib.abc.MetaPathFinder.find_spec` which takes three arguments: " +"a name, an import path, and (optionally) a target module. The meta path " +"finder can use any strategy it wants to determine whether it can handle the " +"named module or not." +msgstr "" +"當在 :data:`sys.modules` 中找不到命名模組時,Python 接下來會搜尋 :data:`sys." +"meta_path`,其中包含一個元路徑尋檢器物件串列。這些尋檢器會依次被查詢,看它們" +"是否知道如何處理命名模組。元路徑尋檢器必須實作一個名為 :meth:`~importlib.abc." +"MetaPathFinder.find_spec` 的方法,該方法接收三個引數:名稱、引入路徑和(可選" +"的)目標模組。元路徑尋檢器可以使用任何策略來確定它是否能處理命名模組。" #: ../../reference/import.rst:291 msgid "" @@ -544,17 +540,16 @@ msgid "" "importing ``foo.bar.baz`` will first perform a top level import, calling " "``mpf.find_spec(\"foo\", None, None)`` on each meta path finder (``mpf``). " "After ``foo`` has been imported, ``foo.bar`` will be imported by traversing " -"the meta path a second time, calling ``mpf.find_spec(\"foo.bar\", " -"foo.__path__, None)``. Once ``foo.bar`` has been imported, the final " -"traversal will call ``mpf.find_spec(\"foo.bar.baz\", foo.bar.__path__, " -"None)``." +"the meta path a second time, calling ``mpf.find_spec(\"foo.bar\", foo." +"__path__, None)``. Once ``foo.bar`` has been imported, the final traversal " +"will call ``mpf.find_spec(\"foo.bar.baz\", foo.bar.__path__, None)``." msgstr "" "對於一個引入請求,元路徑可能會被遍歷多次。例如,假設參與的模組都沒有被快取," "則引入 ``foo.bar.baz`` 將首先執行頂層引入,對每個元路徑尋檢器(``mpf``)呼叫 " "``mpf.find_spec(\"foo\", None, None)``。當 ``foo`` 被引入後,將再次藉由遍歷元" "路徑引入 ``foo.bar``,並呼叫 ``mpf.find_spec(\"foo.bar\", foo.__path__, " -"None)``。當 ``foo.bar`` 被引入後,最後一次遍歷會呼叫 " -"``mpf.find_spec(\"foo.bar.baz\", foo.bar.__path__, None)``。" +"None)``。當 ``foo.bar`` 被引入後,最後一次遍歷會呼叫 ``mpf.find_spec(\"foo." +"bar.baz\", foo.bar.__path__, None)``。" #: ../../reference/import.rst:318 msgid "" @@ -581,27 +576,26 @@ msgid "" "The :meth:`~importlib.abc.MetaPathFinder.find_spec` method of meta path " "finders replaced :meth:`!find_module`, which is now deprecated. While it " "will continue to work without change, the import machinery will try it only " -"if the finder does not " -"implement :meth:`~importlib.abc.MetaPathFinder.find_spec`." +"if the finder does not implement :meth:`~importlib.abc.MetaPathFinder." +"find_spec`." msgstr "" -"元路徑尋檢器的 :meth:`~importlib.abc.MetaPathFinder.find_spec` 方法取代" -"了 :meth:`!find_module`,後者現在已被棄用。雖然它將繼續正常工作,但引入機制僅" -"在尋檢器未實作 :meth:`~importlib.abc.MetaPathFinder.find_spec` 時才會嘗試使用" -"它。" +"元路徑尋檢器的 :meth:`~importlib.abc.MetaPathFinder.find_spec` 方法取代了 :" +"meth:`!find_module`,後者現在已被棄用。雖然它將繼續正常工作,但引入機制僅在尋" +"檢器未實作 :meth:`~importlib.abc.MetaPathFinder.find_spec` 時才會嘗試使用它。" #: ../../reference/import.rst:334 msgid "" -"Use of :meth:`!find_module` by the import system now " -"raises :exc:`ImportWarning`." +"Use of :meth:`!find_module` by the import system now raises :exc:" +"`ImportWarning`." msgstr "引入系統現在使用 :meth:`!find_module` 時將引發 :exc:`ImportWarning`。" #: ../../reference/import.rst:338 msgid "" -":meth:`!find_module` has been removed. " -"Use :meth:`~importlib.abc.MetaPathFinder.find_spec` instead." +":meth:`!find_module` has been removed. Use :meth:`~importlib.abc." +"MetaPathFinder.find_spec` instead." msgstr "" -":meth:`!find_module` 已被移除。請改" -"用 :meth:`~importlib.abc.MetaPathFinder.find_spec`。" +":meth:`!find_module` 已被移除。請改用 :meth:`~importlib.abc.MetaPathFinder." +"find_spec`。" #: ../../reference/import.rst:344 msgid "Loading" @@ -682,8 +676,8 @@ msgstr "請注意下列細節:" #: ../../reference/import.rst:381 msgid "" -"If there is an existing module object with the given name " -"in :data:`sys.modules`, import will have already returned it." +"If there is an existing module object with the given name in :data:`sys." +"modules`, import will have already returned it." msgstr "" "如果 :data:`sys.modules` 中已存在具有給定名稱的模組物件,引入會已回傳該物件。" @@ -696,16 +690,16 @@ msgid "" "best." msgstr "" "在載入器執行模組程式碼之前,模組將已存在於 :data:`sys.modules` 中。這一點至關" -"重要,因為模組程式碼可能會(直接或間接)引入自己;事先將其增加" -"到 :data:`sys.modules` 可以預防類似無限遞迴以及多次重覆載入等情形。" +"重要,因為模組程式碼可能會(直接或間接)引入自己;事先將其增加到 :data:`sys." +"modules` 可以預防類似無限遞迴以及多次重覆載入等情形。" #: ../../reference/import.rst:390 msgid "" "If loading fails, the failing module -- and only the failing module -- gets " -"removed from :data:`sys.modules`. Any module already in " -"the :data:`sys.modules` cache, and any module that was successfully loaded " -"as a side-effect, must remain in the cache. This contrasts with reloading " -"where even the failing module is left in :data:`sys.modules`." +"removed from :data:`sys.modules`. Any module already in the :data:`sys." +"modules` cache, and any module that was successfully loaded as a side-" +"effect, must remain in the cache. This contrasts with reloading where even " +"the failing module is left in :data:`sys.modules`." msgstr "" "如果載入失敗,只有載入失敗的模組會從 :data:`sys.modules` 中刪除。任何已存在" "於 :data:`sys.modules` 快取中的模組,以及任何在載入失敗前成功載入的模組,都必" @@ -743,11 +737,11 @@ msgstr "" #: ../../reference/import.rst:408 msgid "" "The import system has taken over the boilerplate responsibilities of " -"loaders. These were previously performed by " -"the :meth:`importlib.abc.Loader.load_module` method." +"loaders. These were previously performed by the :meth:`importlib.abc.Loader." +"load_module` method." msgstr "" -"引入系統已接管載入器的模板 (boilerplate) 責任。之前是" -"由 :meth:`importlib.abc.Loader.load_module` 方法執行的。" +"引入系統已接管載入器的模板 (boilerplate) 責任。之前是由 :meth:`importlib.abc." +"Loader.load_module` 方法執行的。" #: ../../reference/import.rst:414 msgid "Loaders" @@ -761,8 +755,8 @@ msgid "" "returned from :meth:`~importlib.abc.Loader.exec_module` is ignored." msgstr "" "模組載入器提供了載入的關鍵功能:模組執行。引入機制會以單一引數(即要執行的模" -"組物件)呼叫 :meth:`importlib.abc.Loader.exec_module` 方法。任何" -"從 :meth:`~importlib.abc.Loader.exec_module` 回傳的值都會被忽略。" +"組物件)呼叫 :meth:`importlib.abc.Loader.exec_module` 方法。任何從 :meth:" +"`~importlib.abc.Loader.exec_module` 回傳的值都會被忽略。" #: ../../reference/import.rst:421 msgid "Loaders must satisfy the following requirements:" @@ -779,12 +773,12 @@ msgstr "" #: ../../reference/import.rst:427 msgid "" -"If the loader cannot execute the module, it should raise " -"an :exc:`ImportError`, although any other exception raised " -"during :meth:`~importlib.abc.Loader.exec_module` will be propagated." +"If the loader cannot execute the module, it should raise an :exc:" +"`ImportError`, although any other exception raised during :meth:`~importlib." +"abc.Loader.exec_module` will be propagated." msgstr "" -"如果載入器無法執行該模組,應引發 :exc:`ImportError`。不過," -"在 :meth:`~importlib.abc.Loader.exec_module` 中引發的任何其他例外也會被傳播。" +"如果載入器無法執行該模組,應引發 :exc:`ImportError`。不過,在 :meth:" +"`~importlib.abc.Loader.exec_module` 中引發的任何其他例外也會被傳播。" #: ../../reference/import.rst:431 msgid "" @@ -792,9 +786,9 @@ msgid "" "the :meth:`~importlib.abc.MetaPathFinder.find_spec` method would just return " "a spec with the loader set to ``self``." msgstr "" -"在許多情況下,尋檢器和載入器可以是同一個物件;在這種情況" -"下,:meth:`~importlib.abc.MetaPathFinder.find_spec` 方法只需回傳一個載入器設" -"為 ``self`` 的規格即可。" +"在許多情況下,尋檢器和載入器可以是同一個物件;在這種情況下,:meth:" +"`~importlib.abc.MetaPathFinder.find_spec` 方法只需回傳一個載入器設為 " +"``self`` 的規格即可。" #: ../../reference/import.rst:435 msgid "" @@ -816,13 +810,12 @@ msgstr "載入器的 :meth:`~importlib.abc.Loader.create_module` 方法。" #: ../../reference/import.rst:445 msgid "" -"The :meth:`~importlib.abc.Loader.load_module` method was replaced " -"by :meth:`~importlib.abc.Loader.exec_module` and the import machinery " -"assumed all the boilerplate responsibilities of loading." +"The :meth:`~importlib.abc.Loader.load_module` method was replaced by :meth:" +"`~importlib.abc.Loader.exec_module` and the import machinery assumed all the " +"boilerplate responsibilities of loading." msgstr "" -":meth:`~importlib.abc.Loader.load_module` 方法已" -"被 :meth:`~importlib.abc.Loader.exec_module` 取代,引入機制已承擔所有載入的模" -"板責任。" +":meth:`~importlib.abc.Loader.load_module` 方法已被 :meth:`~importlib.abc." +"Loader.exec_module` 取代,引入機制已承擔所有載入的模板責任。" #: ../../reference/import.rst:450 msgid "" @@ -846,16 +839,16 @@ msgstr "" #: ../../reference/import.rst:459 msgid "" -"If there is an existing module object with the given name " -"in :data:`sys.modules`, the loader must use that existing module. " -"(Otherwise, :func:`importlib.reload` will not work correctly.) If the named " -"module does not exist in :data:`sys.modules`, the loader must create a new " -"module object and add it to :data:`sys.modules`." +"If there is an existing module object with the given name in :data:`sys." +"modules`, the loader must use that existing module. (Otherwise, :func:" +"`importlib.reload` will not work correctly.) If the named module does not " +"exist in :data:`sys.modules`, the loader must create a new module object and " +"add it to :data:`sys.modules`." msgstr "" "如果 :data:`sys.modules` 中已存在具有給定名稱的模組物件,載入器必須使用該模組" -"(否則 :func:`importlib.reload` 將無法正常運作)。如果命名模組不存在" -"於 :data:`sys.modules` 中,載入器必須建立一個新的模組物件並將其新增" -"至 :data:`sys.modules`。" +"(否則 :func:`importlib.reload` 將無法正常運作)。如果命名模組不存在於 :data:" +"`sys.modules` 中,載入器必須建立一個新的模組物件並將其新增至 :data:`sys." +"modules`。" #: ../../reference/import.rst:465 msgid "" @@ -867,9 +860,9 @@ msgstr "" #: ../../reference/import.rst:469 msgid "" -"If loading fails, the loader must remove any modules it has inserted " -"into :data:`sys.modules`, but it must remove **only** the failing module(s), " -"and only if the loader itself has loaded the module(s) explicitly." +"If loading fails, the loader must remove any modules it has inserted into :" +"data:`sys.modules`, but it must remove **only** the failing module(s), and " +"only if the loader itself has loaded the module(s) explicitly." msgstr "" "如果載入失敗,載入器必須移除已經插入到 :data:`sys.modules` 中的任何模組,但" "\\ **只能**\\ 移除失敗的模組(們),且僅在載入器本身明確載入這些模組時才需移" @@ -880,16 +873,16 @@ msgid "" "A :exc:`DeprecationWarning` is raised when ``exec_module()`` is defined but " "``create_module()`` is not." msgstr "" -"當 ``exec_module()`` 已定義但未定義 ``create_module()`` 時,將引" -"發 :exc:`DeprecationWarning`。" +"當 ``exec_module()`` 已定義但未定義 ``create_module()`` 時,將引發 :exc:" +"`DeprecationWarning`。" #: ../../reference/import.rst:478 msgid "" "An :exc:`ImportError` is raised when ``exec_module()`` is defined but " "``create_module()`` is not." msgstr "" -"當 ``exec_module()`` 已定義但未定義 ``create_module()`` 時,將引" -"發 :exc:`ImportError`。" +"當 ``exec_module()`` 已定義但未定義 ``create_module()`` 時,將引發 :exc:" +"`ImportError`。" #: ../../reference/import.rst:482 msgid "Use of ``load_module()`` will raise :exc:`ImportWarning`." @@ -910,9 +903,9 @@ msgid "" msgstr "" "當使用任何機制(例如 ``importlib`` APIs、``import`` 或 ``import-from`` 陳述" "式,或內建的 ``__import__()``\\ )載入子模組時,會將子模組物件繫結到父模組的" -"命名空間中。例如,如果套件 ``spam`` 有一個子模組 ``foo``,則在引入 " -"``spam.foo`` 之後,``spam`` 將擁有一個名為 ``foo`` 的屬性,該屬性繫結到子模" -"組。我們假設你有以下的目錄結構: ::" +"命名空間中。例如,如果套件 ``spam`` 有一個子模組 ``foo``,則在引入 ``spam." +"foo`` 之後,``spam`` 將擁有一個名為 ``foo`` 的屬性,該屬性繫結到子模組。我們" +"假設你有以下的目錄結構: ::" #: ../../reference/import.rst:495 msgid "" @@ -957,13 +950,13 @@ msgstr "" msgid "" "Given Python's familiar name binding rules this might seem surprising, but " "it's actually a fundamental feature of the import system. The invariant " -"holding is that if you have ``sys.modules['spam']`` and " -"``sys.modules['spam.foo']`` (as you would after the above import), the " -"latter must appear as the ``foo`` attribute of the former." +"holding is that if you have ``sys.modules['spam']`` and ``sys.modules['spam." +"foo']`` (as you would after the above import), the latter must appear as the " +"``foo`` attribute of the former." msgstr "" "鑑於 Python 相似的名稱繫結規則,這可能看起來有些出人意料,但這實際上是引入系" -"統的一個基本特性。不變的是如果你擁有 ``sys.modules['spam']`` 和 " -"``sys.modules['spam.foo']``\\ (就像上述引入後那樣),那麼後者必須作為前者的 " +"統的一個基本特性。不變的是如果你擁有 ``sys.modules['spam']`` 和 ``sys." +"modules['spam.foo']``\\ (就像上述引入後那樣),那麼後者必須作為前者的 " "``foo`` 屬性出現。" #: ../../reference/import.rst:521 @@ -997,8 +990,8 @@ msgstr "" msgid "" "The module's spec is exposed as :attr:`module.__spec__`. Setting :attr:`!" "__spec__` appropriately applies equally to :ref:`modules initialized during " -"interpreter startup `. The one exception is ``__main__``, " -"where :attr:`!__spec__` is :ref:`set to None in some cases `." +"interpreter startup `. The one exception is ``__main__``, where :" +"attr:`!__spec__` is :ref:`set to None in some cases `." msgstr "" "模組的規格以 :attr:`module.__spec__` 的形式公開。適當地設定 :attr:`!" "__spec__` 同樣適用於\\ :ref:`在直譯器啟動期間初始化的模組 `。唯一的" @@ -1018,19 +1011,19 @@ msgstr "" #: ../../reference/import.rst:550 msgid "" -"The :attr:`~module.__path__` attribute should be a (possibly " -"empty) :term:`sequence` of strings enumerating the locations where the " -"package's submodules will be found. By definition, if a module has a :attr:`!" -"__path__` attribute, it is a :term:`package`." +"The :attr:`~module.__path__` attribute should be a (possibly empty) :term:" +"`sequence` of strings enumerating the locations where the package's " +"submodules will be found. By definition, if a module has a :attr:`!__path__` " +"attribute, it is a :term:`package`." msgstr "" #: ../../reference/import.rst:555 msgid "" "A package's :attr:`~module.__path__` attribute is used during imports of its " -"subpackages. Within the import machinery, it functions much the same " -"as :data:`sys.path`, i.e. providing a list of locations to search for " -"modules during import. However, :attr:`!__path__` is typically much more " -"constrained than :data:`!sys.path`." +"subpackages. Within the import machinery, it functions much the same as :" +"data:`sys.path`, i.e. providing a list of locations to search for modules " +"during import. However, :attr:`!__path__` is typically much more constrained " +"than :data:`!sys.path`." msgstr "" #: ../../reference/import.rst:562 @@ -1042,13 +1035,12 @@ msgstr "" #: ../../reference/import.rst:566 msgid "" -"A package's ``__init__.py`` file may set or alter the " -"package's :attr:`~module.__path__` attribute, and this was typically the way " -"namespace packages were implemented prior to :pep:`420`. With the adoption " -"of :pep:`420`, namespace packages no longer need to supply ``__init__.py`` " -"files containing only :attr:`!__path__` manipulation code; the import " -"machinery automatically sets :attr:`!__path__` correctly for the namespace " -"package." +"A package's ``__init__.py`` file may set or alter the package's :attr:" +"`~module.__path__` attribute, and this was typically the way namespace " +"packages were implemented prior to :pep:`420`. With the adoption of :pep:" +"`420`, namespace packages no longer need to supply ``__init__.py`` files " +"containing only :attr:`!__path__` manipulation code; the import machinery " +"automatically sets :attr:`!__path__` correctly for the namespace package." msgstr "" #: ../../reference/import.rst:575 @@ -1067,9 +1059,9 @@ msgid "" "If the module has a spec (``__spec__``), the import machinery will try to " "generate a repr from it. If that fails or there is no spec, the import " "system will craft a default repr using whatever information is available on " -"the module. It will try to use the ``module.__name__``, " -"``module.__file__``, and ``module.__loader__`` as input into the repr, with " -"defaults for whatever information is missing." +"the module. It will try to use the ``module.__name__``, ``module." +"__file__``, and ``module.__loader__`` as input into the repr, with defaults " +"for whatever information is missing." msgstr "" #: ../../reference/import.rst:588 @@ -1124,14 +1116,14 @@ msgstr "" msgid "" "Python also supports \"hash-based\" cache files, which store a hash of the " "source file's contents rather than its metadata. There are two variants of " -"hash-based ``.pyc`` files: checked and unchecked. For checked hash-based " -"``.pyc`` files, Python validates the cache file by hashing the source file " -"and comparing the resulting hash with the hash in the cache file. If a " -"checked hash-based cache file is found to be invalid, Python regenerates it " -"and writes a new checked hash-based cache file. For unchecked hash-based " -"``.pyc`` files, Python simply assumes the cache file is valid if it exists. " -"Hash-based ``.pyc`` files validation behavior may be overridden with " -"the :option:`--check-hash-based-pycs` flag." +"hash-based ``.pyc`` files: checked and unchecked. For checked hash-based ``." +"pyc`` files, Python validates the cache file by hashing the source file and " +"comparing the resulting hash with the hash in the cache file. If a checked " +"hash-based cache file is found to be invalid, Python regenerates it and " +"writes a new checked hash-based cache file. For unchecked hash-based ``." +"pyc`` files, Python simply assumes the cache file is valid if it exists. " +"Hash-based ``.pyc`` files validation behavior may be overridden with the :" +"option:`--check-hash-based-pycs` flag." msgstr "" #: ../../reference/import.rst:630 @@ -1147,10 +1139,10 @@ msgstr "" #: ../../reference/import.rst:641 msgid "" "As mentioned previously, Python comes with several default meta path " -"finders. One of these, called the :term:`path based finder` " -"(:class:`~importlib.machinery.PathFinder`), searches an :term:`import path`, " -"which contains a list of :term:`path entries `. Each path entry " -"names a location to search for modules." +"finders. One of these, called the :term:`path based finder` (:class:" +"`~importlib.machinery.PathFinder`), searches an :term:`import path`, which " +"contains a list of :term:`path entries `. Each path entry names " +"a location to search for modules." msgstr "" #: ../../reference/import.rst:647 @@ -1165,10 +1157,10 @@ msgid "" "The default set of path entry finders implement all the semantics for " "finding modules on the file system, handling special file types such as " "Python source code (``.py`` files), Python byte code (``.pyc`` files) and " -"shared libraries (e.g. ``.so`` files). When supported by " -"the :mod:`zipimport` module in the standard library, the default path entry " -"finders also handle loading all of these file types (other than shared " -"libraries) from zipfiles." +"shared libraries (e.g. ``.so`` files). When supported by the :mod:" +"`zipimport` module in the standard library, the default path entry finders " +"also handle loading all of these file types (other than shared libraries) " +"from zipfiles." msgstr "" #: ../../reference/import.rst:658 @@ -1192,8 +1184,8 @@ msgstr "" #: ../../reference/import.rst:670 msgid "" "A word of warning: this section and the previous both use the term *finder*, " -"distinguishing between them by using the terms :term:`meta path finder` " -"and :term:`path entry finder`. These two types of finders are very similar, " +"distinguishing between them by using the terms :term:`meta path finder` and :" +"term:`path entry finder`. These two types of finders are very similar, " "support similar protocols, and function in similar ways during the import " "process, but it's important to keep in mind that they are subtly different. " "In particular, meta path finders operate at the beginning of the import " @@ -1222,19 +1214,18 @@ msgstr "" #: ../../reference/import.rst:698 msgid "" -"As a meta path finder, the :term:`path based finder` implements " -"the :meth:`~importlib.abc.MetaPathFinder.find_spec` protocol previously " -"described, however it exposes additional hooks that can be used to customize " -"how modules are found and loaded from the :term:`import path`." +"As a meta path finder, the :term:`path based finder` implements the :meth:" +"`~importlib.abc.MetaPathFinder.find_spec` protocol previously described, " +"however it exposes additional hooks that can be used to customize how " +"modules are found and loaded from the :term:`import path`." msgstr "" #: ../../reference/import.rst:703 msgid "" -"Three variables are used by the :term:`path based " -"finder`, :data:`sys.path`, :data:`sys.path_hooks` " -"and :data:`sys.path_importer_cache`. The ``__path__`` attributes on package " -"objects are also used. These provide additional ways that the import " -"machinery can be customized." +"Three variables are used by the :term:`path based finder`, :data:`sys." +"path`, :data:`sys.path_hooks` and :data:`sys.path_importer_cache`. The " +"``__path__`` attributes on package objects are also used. These provide " +"additional ways that the import machinery can be customized." msgstr "" #: ../../reference/import.rst:708 @@ -1243,10 +1234,10 @@ msgid "" "modules and packages. It is initialized from the :envvar:`PYTHONPATH` " "environment variable and various other installation- and implementation-" "specific defaults. Entries in :data:`sys.path` can name directories on the " -"file system, zip files, and potentially other \"locations\" (see " -"the :mod:`site` module) that should be searched for modules, such as URLs, " -"or database queries. Only strings should be present on :data:`sys.path`; " -"all other data types are ignored." +"file system, zip files, and potentially other \"locations\" (see the :mod:" +"`site` module) that should be searched for modules, such as URLs, or " +"database queries. Only strings should be present on :data:`sys.path`; all " +"other data types are ignored." msgstr "" #: ../../reference/import.rst:717 @@ -1254,39 +1245,39 @@ msgid "" "The :term:`path based finder` is a :term:`meta path finder`, so the import " "machinery begins the :term:`import path` search by calling the path based " "finder's :meth:`~importlib.machinery.PathFinder.find_spec` method as " -"described previously. When the ``path`` argument " -"to :meth:`~importlib.machinery.PathFinder.find_spec` is given, it will be a " -"list of string paths to traverse - typically a package's ``__path__`` " -"attribute for an import within that package. If the ``path`` argument is " -"``None``, this indicates a top level import and :data:`sys.path` is used." +"described previously. When the ``path`` argument to :meth:`~importlib." +"machinery.PathFinder.find_spec` is given, it will be a list of string paths " +"to traverse - typically a package's ``__path__`` attribute for an import " +"within that package. If the ``path`` argument is ``None``, this indicates a " +"top level import and :data:`sys.path` is used." msgstr "" #: ../../reference/import.rst:726 msgid "" "The path based finder iterates over every entry in the search path, and for " -"each of these, looks for an appropriate :term:`path entry finder` " -"(:class:`~importlib.abc.PathEntryFinder`) for the path entry. Because this " -"can be an expensive operation (e.g. there may be ``stat()`` call overheads " -"for this search), the path based finder maintains a cache mapping path " -"entries to path entry finders. This cache is maintained " -"in :data:`sys.path_importer_cache` (despite the name, this cache actually " -"stores finder objects rather than being limited to :term:`importer` " -"objects). In this way, the expensive search for a particular :term:`path " -"entry` location's :term:`path entry finder` need only be done once. User " -"code is free to remove cache entries from :data:`sys.path_importer_cache` " -"forcing the path based finder to perform the path entry search again." +"each of these, looks for an appropriate :term:`path entry finder` (:class:" +"`~importlib.abc.PathEntryFinder`) for the path entry. Because this can be " +"an expensive operation (e.g. there may be ``stat()`` call overheads for this " +"search), the path based finder maintains a cache mapping path entries to " +"path entry finders. This cache is maintained in :data:`sys." +"path_importer_cache` (despite the name, this cache actually stores finder " +"objects rather than being limited to :term:`importer` objects). In this way, " +"the expensive search for a particular :term:`path entry` location's :term:" +"`path entry finder` need only be done once. User code is free to remove " +"cache entries from :data:`sys.path_importer_cache` forcing the path based " +"finder to perform the path entry search again." msgstr "" #: ../../reference/import.rst:739 msgid "" "If the path entry is not present in the cache, the path based finder " -"iterates over every callable in :data:`sys.path_hooks`. Each of " -"the :term:`path entry hooks ` in this list is called with a " -"single argument, the path entry to be searched. This callable may either " -"return a :term:`path entry finder` that can handle the path entry, or it may " -"raise :exc:`ImportError`. An :exc:`ImportError` is used by the path based " -"finder to signal that the hook cannot find a :term:`path entry finder` for " -"that :term:`path entry`. The exception is ignored and :term:`import path` " +"iterates over every callable in :data:`sys.path_hooks`. Each of the :term:" +"`path entry hooks ` in this list is called with a single " +"argument, the path entry to be searched. This callable may either return a :" +"term:`path entry finder` that can handle the path entry, or it may raise :" +"exc:`ImportError`. An :exc:`ImportError` is used by the path based finder " +"to signal that the hook cannot find a :term:`path entry finder` for that :" +"term:`path entry`. The exception is ignored and :term:`import path` " "iteration continues. The hook should expect either a string or bytes " "object; the encoding of bytes objects is up to the hook (e.g. it may be a " "file system encoding, UTF-8, or something else), and if the hook cannot " @@ -1296,11 +1287,11 @@ msgstr "" #: ../../reference/import.rst:753 msgid "" "If :data:`sys.path_hooks` iteration ends with no :term:`path entry finder` " -"being returned, then the path based " -"finder's :meth:`~importlib.machinery.PathFinder.find_spec` method will store " -"``None`` in :data:`sys.path_importer_cache` (to indicate that there is no " -"finder for this path entry) and return ``None``, indicating that " -"this :term:`meta path finder` could not find the module." +"being returned, then the path based finder's :meth:`~importlib.machinery." +"PathFinder.find_spec` method will store ``None`` in :data:`sys." +"path_importer_cache` (to indicate that there is no finder for this path " +"entry) and return ``None``, indicating that this :term:`meta path finder` " +"could not find the module." msgstr "" #: ../../reference/import.rst:760 @@ -1318,9 +1309,9 @@ msgid "" "current working directory cannot be determined or is found not to exist, no " "value is stored in :data:`sys.path_importer_cache`. Second, the value for " "the current working directory is looked up fresh for each module lookup. " -"Third, the path used for :data:`sys.path_importer_cache` and returned " -"by :meth:`importlib.machinery.PathFinder.find_spec` will be the actual " -"current working directory and not the empty string." +"Third, the path used for :data:`sys.path_importer_cache` and returned by :" +"meth:`importlib.machinery.PathFinder.find_spec` will be the actual current " +"working directory and not the empty string." msgstr "" #: ../../reference/import.rst:775 @@ -1344,9 +1335,9 @@ msgstr "" #: ../../reference/import.rst:786 msgid "" -"To indicate to the import machinery that the spec represents a " -"namespace :term:`portion`, the path entry finder sets " -"``submodule_search_locations`` to a list containing the portion." +"To indicate to the import machinery that the spec represents a namespace :" +"term:`portion`, the path entry finder sets ``submodule_search_locations`` to " +"a list containing the portion." msgstr "" #: ../../reference/import.rst:790 @@ -1415,26 +1406,24 @@ msgstr "" msgid "" "If it is acceptable to only alter the behaviour of import statements without " "affecting other APIs that access the import system, then replacing the " -"builtin :func:`__import__` function may be sufficient. This technique may " -"also be employed at the module level to only alter the behaviour of import " -"statements within that module." +"builtin :func:`__import__` function may be sufficient." msgstr "" -#: ../../reference/import.rst:841 +#: ../../reference/import.rst:839 msgid "" "To selectively prevent the import of some modules from a hook early on the " "meta path (rather than disabling the standard import system entirely), it is " -"sufficient to raise :exc:`ModuleNotFoundError` directly " -"from :meth:`~importlib.abc.MetaPathFinder.find_spec` instead of returning " -"``None``. The latter indicates that the meta path search should continue, " -"while raising an exception terminates it immediately." +"sufficient to raise :exc:`ModuleNotFoundError` directly from :meth:" +"`~importlib.abc.MetaPathFinder.find_spec` instead of returning ``None``. The " +"latter indicates that the meta path search should continue, while raising an " +"exception terminates it immediately." msgstr "" -#: ../../reference/import.rst:851 +#: ../../reference/import.rst:849 msgid "Package Relative Imports" msgstr "" -#: ../../reference/import.rst:853 +#: ../../reference/import.rst:851 msgid "" "Relative imports use leading dots. A single leading dot indicates a relative " "import, starting with the current package. Two or more leading dots indicate " @@ -1442,7 +1431,7 @@ msgid "" "after the first. For example, given the following package layout::" msgstr "" -#: ../../reference/import.rst:858 +#: ../../reference/import.rst:856 msgid "" "package/\n" " __init__.py\n" @@ -1466,13 +1455,13 @@ msgstr "" " moduleZ.py\n" " moduleA.py" -#: ../../reference/import.rst:869 +#: ../../reference/import.rst:867 msgid "" "In either ``subpackage1/moduleX.py`` or ``subpackage1/__init__.py``, the " "following are valid relative imports::" msgstr "" -#: ../../reference/import.rst:872 +#: ../../reference/import.rst:870 msgid "" "from .moduleY import spam\n" "from .moduleY import spam as ham\n" @@ -1488,49 +1477,49 @@ msgstr "" "from ..subpackage2.moduleZ import eggs\n" "from ..moduleA import foo" -#: ../../reference/import.rst:879 +#: ../../reference/import.rst:877 msgid "" "Absolute imports may use either the ``import <>`` or ``from <> import <>`` " "syntax, but relative imports may only use the second form; the reason for " "this is that::" msgstr "" -#: ../../reference/import.rst:883 +#: ../../reference/import.rst:881 msgid "import XXX.YYY.ZZZ" msgstr "import XXX.YYY.ZZZ" -#: ../../reference/import.rst:885 +#: ../../reference/import.rst:883 msgid "" "should expose ``XXX.YYY.ZZZ`` as a usable expression, but .moduleY is not a " "valid expression." msgstr "" -#: ../../reference/import.rst:892 +#: ../../reference/import.rst:890 msgid "Special considerations for __main__" msgstr "" -#: ../../reference/import.rst:894 +#: ../../reference/import.rst:892 msgid "" "The :mod:`__main__` module is a special case relative to Python's import " "system. As noted :ref:`elsewhere `, the ``__main__`` module is " -"directly initialized at interpreter startup, much like :mod:`sys` " -"and :mod:`builtins`. However, unlike those two, it doesn't strictly qualify " -"as a built-in module. This is because the manner in which ``__main__`` is " +"directly initialized at interpreter startup, much like :mod:`sys` and :mod:" +"`builtins`. However, unlike those two, it doesn't strictly qualify as a " +"built-in module. This is because the manner in which ``__main__`` is " "initialized depends on the flags and other options with which the " "interpreter is invoked." msgstr "" -#: ../../reference/import.rst:905 +#: ../../reference/import.rst:903 msgid "__main__.__spec__" msgstr "__main__.__spec__" -#: ../../reference/import.rst:907 +#: ../../reference/import.rst:905 msgid "" "Depending on how :mod:`__main__` is initialized, ``__main__.__spec__`` gets " "set appropriately or to ``None``." msgstr "" -#: ../../reference/import.rst:910 +#: ../../reference/import.rst:908 msgid "" "When Python is started with the :option:`-m` option, ``__spec__`` is set to " "the module spec of the corresponding module or package. ``__spec__`` is also " @@ -1538,38 +1527,38 @@ msgid "" "directory, zipfile or other :data:`sys.path` entry." msgstr "" -#: ../../reference/import.rst:915 +#: ../../reference/import.rst:913 msgid "" -"In :ref:`the remaining cases ` " -"``__main__.__spec__`` is set to ``None``, as the code used to populate " -"the :mod:`__main__` does not correspond directly with an importable module:" +"In :ref:`the remaining cases ` ``__main__." +"__spec__`` is set to ``None``, as the code used to populate the :mod:" +"`__main__` does not correspond directly with an importable module:" msgstr "" -#: ../../reference/import.rst:919 +#: ../../reference/import.rst:917 msgid "interactive prompt" msgstr "" -#: ../../reference/import.rst:920 +#: ../../reference/import.rst:918 msgid ":option:`-c` option" msgstr ":option:`-c` 選項" -#: ../../reference/import.rst:921 +#: ../../reference/import.rst:919 msgid "running from stdin" msgstr "" -#: ../../reference/import.rst:922 +#: ../../reference/import.rst:920 msgid "running directly from a source or bytecode file" msgstr "" -#: ../../reference/import.rst:924 +#: ../../reference/import.rst:922 msgid "" "Note that ``__main__.__spec__`` is always ``None`` in the last case, *even " "if* the file could technically be imported directly as a module instead. Use " -"the :option:`-m` switch if valid module metadata is desired " -"in :mod:`__main__`." +"the :option:`-m` switch if valid module metadata is desired in :mod:" +"`__main__`." msgstr "" -#: ../../reference/import.rst:929 +#: ../../reference/import.rst:927 msgid "" "Note also that even when ``__main__`` corresponds with an importable module " "and ``__main__.__spec__`` is set accordingly, they're still considered " @@ -1578,11 +1567,11 @@ msgid "" "populate the ``__main__`` namespace, and not during normal import." msgstr "" -#: ../../reference/import.rst:937 +#: ../../reference/import.rst:935 msgid "References" msgstr "" -#: ../../reference/import.rst:939 +#: ../../reference/import.rst:937 msgid "" "The import machinery has evolved considerably since Python's early days. " "The original `specification for packages ` for " "Python 3.3. :pep:`420` also introduced the :meth:`!find_loader` protocol as " "an alternative to :meth:`!find_module`." msgstr "" -#: ../../reference/import.rst:951 +#: ../../reference/import.rst:949 msgid "" ":pep:`366` describes the addition of the ``__package__`` attribute for " "explicit relative imports in main modules." msgstr "" -#: ../../reference/import.rst:954 +#: ../../reference/import.rst:952 msgid "" ":pep:`328` introduced absolute and explicit relative imports and initially " "proposed ``__name__`` for semantics :pep:`366` would eventually specify for " "``__package__``." msgstr "" -#: ../../reference/import.rst:958 +#: ../../reference/import.rst:956 msgid ":pep:`338` defines executing modules as scripts." msgstr "" -#: ../../reference/import.rst:960 +#: ../../reference/import.rst:958 msgid "" ":pep:`451` adds the encapsulation of per-module import state in spec " "objects. It also off-loads most of the boilerplate responsibilities of " @@ -1629,22 +1618,21 @@ msgid "" "finders and loaders." msgstr "" -#: ../../reference/import.rst:967 +#: ../../reference/import.rst:965 msgid "Footnotes" msgstr "註解" -#: ../../reference/import.rst:968 +#: ../../reference/import.rst:966 msgid "See :class:`types.ModuleType`." msgstr "參閱 :class:`types.ModuleType`。" -#: ../../reference/import.rst:970 +#: ../../reference/import.rst:968 msgid "" "The importlib implementation avoids using the return value directly. " -"Instead, it gets the module object by looking the module name up " -"in :data:`sys.modules`. The indirect effect of this is that an imported " -"module may replace itself in :data:`sys.modules`. This is implementation-" -"specific behavior that is not guaranteed to work in other Python " -"implementations." +"Instead, it gets the module object by looking the module name up in :data:" +"`sys.modules`. The indirect effect of this is that an imported module may " +"replace itself in :data:`sys.modules`. This is implementation-specific " +"behavior that is not guaranteed to work in other Python implementations." msgstr "" #: ../../reference/import.rst:8 diff --git a/tutorial/appendix.po b/tutorial/appendix.po index df5cb68338..af4daa21bb 100644 --- a/tutorial/appendix.po +++ b/tutorial/appendix.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.14\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-08-15 00:17+0000\n" +"POT-Creation-Date: 2026-01-02 00:15+0000\n" "PO-Revision-Date: 2025-07-13 14:05+0800\n" "Last-Translator: Weilin Du <1372449351@qq.com>\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -38,25 +38,26 @@ msgstr "" "限度的行控制能力(line control capabilities)。" #: ../../tutorial/appendix.rst:17 +#, fuzzy msgid "" -"On Windows, or Unix-like systems with :mod:`curses` support, a new " -"interactive shell is used by default since Python 3.13. This one supports " -"color, multiline editing, history browsing, and paste mode. To disable " -"color, see :ref:`using-on-controlling-color` for details. Function keys " -"provide some additional functionality. :kbd:`F1` enters the interactive help " -"browser :mod:`pydoc`. :kbd:`F2` allows for browsing command-line history " -"with neither output nor the :term:`>>>` and :term:`...` prompts. :kbd:`F3` " -"enters \"paste mode\", which makes pasting larger blocks of code easier. " -"Press :kbd:`F3` to return to the regular prompt." +"Since Python 3.13, a new interactive shell is used by default. This one " +"supports color, multiline editing, history browsing, and paste mode. To " +"disable color, see :ref:`using-on-controlling-color` for details. Function " +"keys provide some additional functionality. :kbd:`F1` enters the interactive " +"help browser :mod:`pydoc`. :kbd:`F2` allows for browsing command-line " +"history with neither output nor the :term:`>>>` and :term:`...` prompts. :" +"kbd:`F3` enters \"paste mode\", which makes pasting larger blocks of code " +"easier. Press :kbd:`F3` to return to the regular prompt." msgstr "" -"在 Windows 或支援 :mod:`curses` 的類似 Unix 系統上,自 Python 3.13 起預設會使用新的互動式 " -"shell。這個 shell 支援顏色、多行編輯、歷史瀏覽和貼上模式。要停用顏色,請參" -"閱 :ref:`using-on-controlling-color` 取得詳細資訊。功能鍵提供了一些額外的功" -"能。:kbd:`F1` 進入互動式幫助瀏覽器 :mod:`pydoc`。:kbd:`F2` 允許瀏覽命令列歷" -"史,既沒有輸出,也沒有 :term:`>>>` 和 :term:`...` 的提示。:kbd:`F3` 進入 「貼" -"上模式」,這使得貼上較大的程式碼區塊更容易。按 :kbd:`F3` 可以返回正常提示。" +"在 Windows 或支援 :mod:`curses` 的類似 Unix 系統上,自 Python 3.13 起預設會使" +"用新的互動式 shell。這個 shell 支援顏色、多行編輯、歷史瀏覽和貼上模式。要停用" +"顏色,請參閱 :ref:`using-on-controlling-color` 取得詳細資訊。功能鍵提供了一些" +"額外的功能。:kbd:`F1` 進入互動式幫助瀏覽器 :mod:`pydoc`。:kbd:`F2` 允許瀏覽命" +"令列歷史,既沒有輸出,也沒有 :term:`>>>` 和 :term:`...` 的提示。:kbd:`F3` 進" +"入 「貼上模式」,這使得貼上較大的程式碼區塊更容易。按 :kbd:`F3` 可以返回正常" +"提示。" -#: ../../tutorial/appendix.rst:28 +#: ../../tutorial/appendix.rst:27 msgid "" "When using the new interactive shell, exit the shell by typing :kbd:`exit` " "or :kbd:`quit`. Adding call parentheses after those commands is not required." @@ -64,7 +65,7 @@ msgstr "" "使用新的互動 shell 時, 請輸入 :kbd:`exit` 或 :kbd:`quit` 來離開 shell。不需" "要在這些指令後面加上呼叫括號。" -#: ../../tutorial/appendix.rst:32 +#: ../../tutorial/appendix.rst:31 msgid "" "If the new interactive shell is not desired, it can be disabled via the :" "envvar:`PYTHON_BASIC_REPL` environment variable." @@ -72,11 +73,11 @@ msgstr "" "如果不需要新的互動式 shell, 可以透過 :envvar:`PYTHON_BASIC_REPL` 環境變數來" "停用它。" -#: ../../tutorial/appendix.rst:38 +#: ../../tutorial/appendix.rst:37 msgid "Error Handling" msgstr "錯誤處理" -#: ../../tutorial/appendix.rst:40 +#: ../../tutorial/appendix.rst:39 msgid "" "When an error occurs, the interpreter prints an error message and a stack " "trace. In interactive mode, it then returns to the primary prompt; when " @@ -95,7 +96,7 @@ msgstr "" "內部不一致和一些記憶體耗盡的情況。所有的錯誤訊息都被寫入標準錯誤輸出;被執行" "指令的正常輸出被寫入標準輸出。" -#: ../../tutorial/appendix.rst:50 +#: ../../tutorial/appendix.rst:49 msgid "" "Typing the interrupt character (usually :kbd:`Control-C` or :kbd:`Delete`) " "to the primary or secondary prompt cancels the input and returns to the " @@ -108,11 +109,11 @@ msgstr "" "會引發 :exc:`KeyboardInterrupt` 例外,但可以通過 :keyword:`try` 陳述式來處" "理。" -#: ../../tutorial/appendix.rst:60 +#: ../../tutorial/appendix.rst:59 msgid "Executable Python Scripts" msgstr "可執行的 Python 腳本" -#: ../../tutorial/appendix.rst:62 +#: ../../tutorial/appendix.rst:61 msgid "" "On BSD'ish Unix systems, Python scripts can be made directly executable, " "like shell scripts, by putting the line ::" @@ -120,11 +121,11 @@ msgstr "" "在類 BSD 的 Unix 系統上,Python 腳本可以直接執行,就像 shell 腳本一樣,通過放" "置以下這行: ::" -#: ../../tutorial/appendix.rst:65 +#: ../../tutorial/appendix.rst:64 msgid "#!/usr/bin/env python3" msgstr "#!/usr/bin/env python3" -#: ../../tutorial/appendix.rst:67 +#: ../../tutorial/appendix.rst:66 msgid "" "(assuming that the interpreter is on the user's :envvar:`PATH`) at the " "beginning of the script and giving the file an executable mode. The ``#!`` " @@ -138,17 +139,17 @@ msgstr "" "(``'\\n'``) 結尾,而不是 Windows (``'\\r\\n'``) 換行。請注意,井號 ``'#'`` 用" "於在 Python 中開始註解。" -#: ../../tutorial/appendix.rst:74 +#: ../../tutorial/appendix.rst:73 msgid "" "The script can be given an executable mode, or permission, using the :" "program:`chmod` command." msgstr "可以使用 :program:`chmod` 指令為腳本賦予可執行模式或權限。" -#: ../../tutorial/appendix.rst:77 +#: ../../tutorial/appendix.rst:76 msgid "$ chmod +x myscript.py" msgstr "$ chmod +x myscript.py" -#: ../../tutorial/appendix.rst:81 +#: ../../tutorial/appendix.rst:80 msgid "" "On Windows systems, there is no notion of an \"executable mode\". The " "Python installer automatically associates ``.py`` files with ``python.exe`` " @@ -160,11 +161,11 @@ msgstr "" "檔案與 ``python.exe`` 聯繫起來,這樣雙擊 Python 檔案就會作為腳本運行。副檔名" "也可以是 ``.pyw``,在這種情況下,通常會出現的控制台視窗會被隱藏。" -#: ../../tutorial/appendix.rst:91 +#: ../../tutorial/appendix.rst:90 msgid "The Interactive Startup File" msgstr "互動式啟動檔案" -#: ../../tutorial/appendix.rst:93 +#: ../../tutorial/appendix.rst:92 msgid "" "When you use Python interactively, it is frequently handy to have some " "standard commands executed every time the interpreter is started. You can " @@ -176,7 +177,7 @@ msgstr "" "可以通過設置一個名為 :envvar:`PYTHONSTARTUP` 的環境變數來實現,該變數是一個包" "含啟動指令的檔案名。它的功能類似 Unix shell 的 :file:`.profile` 。" -#: ../../tutorial/appendix.rst:99 +#: ../../tutorial/appendix.rst:98 msgid "" "This file is only read in interactive sessions, not when Python reads " "commands from a script, and not when :file:`/dev/tty` is given as the " @@ -192,7 +193,7 @@ msgstr "" "動模式中不加限定地使用。你也可以在這個檔案中改變 ``sys.ps1`` 和 ``sys.ps2`` " "等提示字元。" -#: ../../tutorial/appendix.rst:107 +#: ../../tutorial/appendix.rst:106 msgid "" "If you want to read an additional start-up file from the current directory, " "you can program this in the global start-up file using code like ``if os." @@ -205,7 +206,7 @@ msgstr "" "式碼設定這個行為。如果你想在一個腳本中使用啟動檔案,你必須在腳本中明確地這樣" "做: ::" -#: ../../tutorial/appendix.rst:113 +#: ../../tutorial/appendix.rst:112 msgid "" "import os\n" "filename = os.environ.get('PYTHONSTARTUP')\n" @@ -221,11 +222,11 @@ msgstr "" " startup_file = fobj.read()\n" " exec(startup_file)" -#: ../../tutorial/appendix.rst:124 +#: ../../tutorial/appendix.rst:123 msgid "The Customization Modules" msgstr "客製化模組" -#: ../../tutorial/appendix.rst:126 +#: ../../tutorial/appendix.rst:125 msgid "" "Python provides two hooks to let you customize it: :index:`sitecustomize` " "and :index:`usercustomize`. To see how it works, you need first to find the " @@ -236,7 +237,7 @@ msgstr "" "index:`usercustomize` 。要看它是如何運作的,你首先需要找到你的 site-packages " "的位置。啟動 Python 並運行這段程式碼: ::" -#: ../../tutorial/appendix.rst:130 +#: ../../tutorial/appendix.rst:129 msgid "" ">>> import site\n" ">>> site.getusersitepackages()\n" @@ -246,7 +247,7 @@ msgstr "" ">>> site.getusersitepackages()\n" "'/home/user/.local/lib/python3.x/site-packages'" -#: ../../tutorial/appendix.rst:134 +#: ../../tutorial/appendix.rst:133 msgid "" "Now you can create a file named :file:`usercustomize.py` in that directory " "and put anything you want in it. It will affect every invocation of Python, " @@ -257,7 +258,7 @@ msgstr "" "要的任何內容放入其中。它會影響 Python 的每次呼叫,除非它以 :option:`-s` 選項" "啟動以禁用自動 import 。" -#: ../../tutorial/appendix.rst:138 +#: ../../tutorial/appendix.rst:137 msgid "" ":index:`sitecustomize` works in the same way, but is typically created by an " "administrator of the computer in the global site-packages directory, and is " @@ -268,10 +269,10 @@ msgstr "" "packages 目錄下建立,並在 :index:`usercustomize` 之前 import 。更多細節請參" "閱 :mod:`site` 模組的文件。" -#: ../../tutorial/appendix.rst:145 +#: ../../tutorial/appendix.rst:144 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/appendix.rst:146 +#: ../../tutorial/appendix.rst:145 msgid "A problem with the GNU Readline package may prevent this." msgstr "GNU Readline 套件的一個問題可能會阻止這一點。" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index a53b130d61..f492b83d45 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -782,6 +782,21 @@ msgid "" " def get_colour(self) -> str:\n" " return \"red\"" msgstr "" +"from typing import override\n" +"\n" +"class Base:\n" +" def get_color(self) -> str:\n" +" return \"blue\"\n" +"\n" +"class GoodChild(Base):\n" +" @override # ok:覆寫 Base.get_color\n" +" def get_color(self) -> str:\n" +" return \"yellow\"\n" +"\n" +"class BadChild(Base):\n" +" @override # 型別檢查錯誤:未覆寫 Base.get_color\n" +" def get_colour(self) -> str:\n" +" return \"red\"" #: ../../whatsnew/3.12.rst:538 msgid "See :pep:`698` for more details." diff --git a/whatsnew/3.14.po b/whatsnew/3.14.po index f460273f04..bc0fab5078 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-11-26 00:14+0000\n" +"POT-Creation-Date: 2025-12-31 00:16+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -34,6 +34,8 @@ msgid "" "Python 3.14 was released on 7 October 2025. For full details, see the :ref:" "`changelog `." msgstr "" +"本文介紹了 Python 3.14 與 3.13 相比多了哪些新功能。Python 3.14 已於 2025 年 " +"10 月 7 日發布。完整詳情請見 :ref:`changelog `。" #: ../../whatsnew/3.14.rst:54 msgid ":pep:`745` -- Python 3.14 release schedule" @@ -41,7 +43,7 @@ msgstr ":pep:`745` - Python 3.14 發佈時程" #: ../../whatsnew/3.14.rst:58 msgid "Summary -- Release highlights" -msgstr "" +msgstr "發布重點摘要" #: ../../whatsnew/3.14.rst:63 msgid "" @@ -53,6 +55,10 @@ msgid "" "`subinterpreters ` in the standard " "library." msgstr "" +"Python 3.14 是 Python 程式語言的最新穩定版本,包含了語言、實作和標準函式庫的各種變更。" +"最大的變更包括\\ :ref:`模板字串字面值 `、" +":ref:`延遲型別註解的求值 `,以及標準函式庫中對\\ " +":ref:`子直譯器 `\\ 的支援。" #: ../../whatsnew/3.14.rst:72 msgid "" @@ -78,7 +84,7 @@ msgstr "" #: ../../whatsnew/3.14.rst:95 msgid "Interpreter improvements:" -msgstr "" +msgstr "直譯器的改進:" #: ../../whatsnew/3.14.rst:97 msgid "" @@ -134,7 +140,7 @@ msgstr "" #: ../../whatsnew/3.14.rst:113 msgid "Significant improvements in the standard library:" -msgstr "" +msgstr "標準函式庫中的顯著改進" #: ../../whatsnew/3.14.rst:115 msgid "" @@ -204,7 +210,7 @@ msgstr "" #: ../../whatsnew/3.14.rst:144 msgid "New features" -msgstr "" +msgstr "新增功能" #: ../../whatsnew/3.14.rst:149 msgid ":pep:`649` & :pep:`749`: Deferred evaluation of annotations" @@ -1139,6 +1145,34 @@ msgid "" "play TaskGroup._aexit -> TaskGroup." "__aexit__ -> album TMBTE 0x7fc93173fa50" msgstr "" +"python -m asyncio ps 12345\n" +"\n" +"tid task id task name coroutine " +"stack awaiter " +"chain awaiter name awaiter id\n" +"------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n" +"1935500 0x7fc930c18050 Task-1 TaskGroup._aexit -> " +"TaskGroup.__aexit__ -> " +"main " +"0x0\n" +"1935500 0x7fc930c18230 Sundowning TaskGroup._aexit -> " +"TaskGroup.__aexit__ -> album TaskGroup._aexit -> TaskGroup.__aexit__ -> " +"main Task-1 0x7fc930c18050\n" +"1935500 0x7fc93173fa50 TMBTE TaskGroup._aexit -> " +"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" +"1935500 0x7fc930d32510 Levitate sleep -> " +"play TaskGroup._aexit -> TaskGroup." +"__aexit__ -> album Sundowning 0x7fc930c18230\n" +"1935500 0x7fc930d32890 DYWTYLM sleep -> " +"play TaskGroup._aexit -> TaskGroup." +"__aexit__ -> album TMBTE 0x7fc93173fa50\n" +"1935500 0x7fc93161ec30 Aqua Regia sleep -> " +"play TaskGroup._aexit -> TaskGroup." +"__aexit__ -> album TMBTE 0x7fc93173fa50" #: ../../whatsnew/3.14.rst:754 msgid "or a tree like this:" @@ -1177,6 +1211,36 @@ msgid "" " └── play example.py:4\n" " └── sleep Lib/asyncio/tasks.py:702" msgstr "" +"python -m asyncio pstree 12345\n" +"\n" +"└── (T) Task-1\n" +" └── main example.py:13\n" +" └── TaskGroup.__aexit__ Lib/asyncio/taskgroups.py:72\n" +" └── 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" +" │ ├── (T) TNDNBTG\n" +" │ │ └── play example.py:4\n" +" │ │ └── sleep Lib/asyncio/tasks.py:702\n" +" │ └── (T) Levitate\n" +" │ └── play example.py:4\n" +" │ └── sleep Lib/asyncio/tasks.py:702\n" +" └── (T) TMBTE\n" +" └── album example.py:8\n" +" └── TaskGroup.__aexit__ Lib/asyncio/taskgroups." +"py:72\n" +" └── TaskGroup._aexit Lib/asyncio/taskgroups." +"py:121\n" +" ├── (T) DYWTYLM\n" +" │ └── play example.py:4\n" +" │ └── sleep Lib/asyncio/tasks.py:702\n" +" └── (T) Aqua Regia\n" +" └── play example.py:4\n" +" └── sleep Lib/asyncio/tasks.py:702" #: ../../whatsnew/3.14.rst:785 msgid "" @@ -1193,6 +1257,11 @@ msgid "" "\n" "cycle: Task-2 → Task-3 → Task-2" msgstr "" +"python -m asyncio pstree 12345\n" +"\n" +"ERROR: await-graph contains cycles - cannot print a tree!\n" +"\n" +"cycle: Task-2 → Task-3 → Task-2" #: ../../whatsnew/3.14.rst:797 msgid "" @@ -1221,7 +1290,7 @@ msgstr "(由 Neil Schemenauer 和 Kumar Aditya 於 :gh:`130010` 貢獻。)" #: ../../whatsnew/3.14.rst:818 msgid "Other language changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/3.14.rst:820 msgid "" @@ -1324,7 +1393,7 @@ msgstr "" #: ../../whatsnew/3.14.rst:888 msgid "Command line and environment" -msgstr "" +msgstr "命令列與環境" #: ../../whatsnew/3.14.rst:890 msgid "" @@ -1374,6 +1443,10 @@ msgid "" "except TimeoutError, ConnectionRefusedError:\n" " print('The network has ceased to be!')" msgstr "" +"try:\n" +" connect_to_server()\n" +"except TimeoutError, ConnectionRefusedError:\n" +" print('The network has ceased to be!')" #: ../../whatsnew/3.14.rst:928 msgid "" @@ -1438,13 +1511,13 @@ msgstr "" msgid "The behavior of :func:`!gc.collect` changes slightly:" msgstr "" -#: ../../whatsnew/3.14.rst:974 ../../whatsnew/3.14.rst:3267 +#: ../../whatsnew/3.14.rst:974 ../../whatsnew/3.14.rst:3276 msgid "" "``gc.collect(1)``: Performs an increment of garbage collection, rather than " "collecting generation 1." msgstr "" -#: ../../whatsnew/3.14.rst:976 ../../whatsnew/3.14.rst:3269 +#: ../../whatsnew/3.14.rst:976 ../../whatsnew/3.14.rst:3278 msgid "Other calls to :func:`!gc.collect` are unchanged." msgstr "" @@ -1490,7 +1563,7 @@ msgstr "" #: ../../whatsnew/3.14.rst:1010 msgid "New modules" -msgstr "" +msgstr "新增模組" #: ../../whatsnew/3.14.rst:1012 msgid "" @@ -1526,9 +1599,9 @@ msgstr "" #: ../../whatsnew/3.14.rst:1038 msgid "Improved modules" -msgstr "" +msgstr "改進的模組" -#: ../../whatsnew/3.14.rst:1041 ../../whatsnew/3.14.rst:2301 +#: ../../whatsnew/3.14.rst:1041 ../../whatsnew/3.14.rst:2310 msgid "argparse" msgstr "argparse" @@ -1556,7 +1629,7 @@ msgid "" "by Hugo van Kemenade in :gh:`130645`.)" msgstr "" -#: ../../whatsnew/3.14.rst:1061 ../../whatsnew/3.14.rst:2320 +#: ../../whatsnew/3.14.rst:1061 ../../whatsnew/3.14.rst:2329 msgid "ast" msgstr "ast" @@ -1600,7 +1673,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.14.rst:1087 ../../whatsnew/3.14.rst:2162 -#: ../../whatsnew/3.14.rst:2351 +#: ../../whatsnew/3.14.rst:2360 msgid "asyncio" msgstr "asyncio" @@ -2527,7 +2600,7 @@ msgid "" msgstr "" #: ../../whatsnew/3.14.rst:1677 ../../whatsnew/3.14.rst:2249 -#: ../../whatsnew/3.14.rst:2501 +#: ../../whatsnew/3.14.rst:2510 msgid "pathlib" msgstr "pathlib" @@ -3115,7 +3188,7 @@ msgstr "" msgid "(Contributed by Serhiy Storchaka in :gh:`71339`.)" msgstr "(由 Serhiy Storchaka 於 :gh:`71339` 貢獻。)" -#: ../../whatsnew/3.14.rst:2064 ../../whatsnew/3.14.rst:2547 +#: ../../whatsnew/3.14.rst:2064 ../../whatsnew/3.14.rst:2556 msgid "urllib" msgstr "urllib" @@ -3187,7 +3260,7 @@ msgstr "" msgid "(Contributed by Barney Gale in :gh:`125866`.)" msgstr "(由 Barney Gale 於 :gh:`125866` 貢獻。)" -#: ../../whatsnew/3.14.rst:2098 ../../whatsnew/3.14.rst:2269 +#: ../../whatsnew/3.14.rst:2098 ../../whatsnew/3.14.rst:2278 msgid "uuid" msgstr "uuid" @@ -3393,24 +3466,36 @@ msgid "" "Tian Gao in :gh:`124533`.)" msgstr "" +#: ../../whatsnew/3.14.rst:2269 +msgid "textwrap" +msgstr "textwrap" + #: ../../whatsnew/3.14.rst:2271 msgid "" +"Optimize the :func:`~textwrap.dedent` function, improving performance by an " +"average of 2.4x, with larger improvements for bigger inputs, and fix a bug " +"with incomplete normalization of blank lines with whitespace characters " +"other than space and tab." +msgstr "" + +#: ../../whatsnew/3.14.rst:2280 +msgid "" ":func:`~uuid.uuid3` and :func:`~uuid.uuid5` are now both roughly 40% faster " "for 16-byte names and 20% faster for 1024-byte names. Performance for longer " "names remains unchanged. (Contributed by Bénédikt Tran in :gh:`128150`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2276 +#: ../../whatsnew/3.14.rst:2285 msgid "" ":func:`~uuid.uuid4` is now c. 30% faster. (Contributed by Bénédikt Tran in :" "gh:`128150`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2281 +#: ../../whatsnew/3.14.rst:2290 msgid "zlib" msgstr "zlib" -#: ../../whatsnew/3.14.rst:2283 +#: ../../whatsnew/3.14.rst:2292 msgid "" "On Windows, `zlib-ng `__ is now used as " "the implementation of the :mod:`zlib` module in the default binaries. There " @@ -3419,29 +3504,29 @@ msgid "" "compression levels." msgstr "" -#: ../../whatsnew/3.14.rst:2290 +#: ../../whatsnew/3.14.rst:2299 msgid "" "It is worth noting that ``zlib.Z_BEST_SPEED`` (``1``) may result in " "significantly less compression than the previous implementation, whilst also " "significantly reducing the time taken to compress." msgstr "" -#: ../../whatsnew/3.14.rst:2294 +#: ../../whatsnew/3.14.rst:2303 msgid "(Contributed by Steve Dower in :gh:`91349`.)" msgstr "(由 Steve Dower 於 :gh:`91349` 貢獻。)" -#: ../../whatsnew/3.14.rst:2298 +#: ../../whatsnew/3.14.rst:2307 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.14.rst:2303 +#: ../../whatsnew/3.14.rst:2312 msgid "" "Remove the *type*, *choices*, and *metavar* parameters of :class:`!" "BooleanOptionalAction`. These have been deprecated since Python 3.12. " "(Contributed by Nikita Sobolev in :gh:`118805`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2308 +#: ../../whatsnew/3.14.rst:2317 msgid "" "Calling :meth:`~argparse.ArgumentParser.add_argument_group` on an argument " "group now raises a :exc:`ValueError`. Similarly, :meth:`~argparse." @@ -3453,34 +3538,34 @@ msgid "" "Savannah Ostrowski in :gh:`127186`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2322 +#: ../../whatsnew/3.14.rst:2331 msgid "" "Remove the following classes, which have been deprecated aliases of :class:" "`~ast.Constant` since Python 3.8 and have emitted deprecation warnings since " "Python 3.12:" msgstr "" -#: ../../whatsnew/3.14.rst:2326 +#: ../../whatsnew/3.14.rst:2335 msgid ":class:`!Bytes`" msgstr ":class:`!Bytes`" -#: ../../whatsnew/3.14.rst:2327 +#: ../../whatsnew/3.14.rst:2336 msgid ":class:`!Ellipsis`" msgstr ":class:`!Ellipsis`" -#: ../../whatsnew/3.14.rst:2328 +#: ../../whatsnew/3.14.rst:2337 msgid ":class:`!NameConstant`" msgstr ":class:`!NameConstant`" -#: ../../whatsnew/3.14.rst:2329 +#: ../../whatsnew/3.14.rst:2338 msgid ":class:`!Num`" msgstr ":class:`!Num`" -#: ../../whatsnew/3.14.rst:2330 +#: ../../whatsnew/3.14.rst:2339 msgid ":class:`!Str`" msgstr ":class:`!Str`" -#: ../../whatsnew/3.14.rst:2332 +#: ../../whatsnew/3.14.rst:2341 msgid "" "As a consequence of these removals, user-defined ``visit_Num``, " "``visit_Str``, ``visit_Bytes``, ``visit_NameConstant`` and " @@ -3489,91 +3574,92 @@ msgid "" "an AST. Define a ``visit_Constant`` method instead." msgstr "" -#: ../../whatsnew/3.14.rst:2338 +#: ../../whatsnew/3.14.rst:2347 msgid "(Contributed by Alex Waygood in :gh:`119562`.)" msgstr "(由 Alex Waygood 於 :gh:`119562` 貢獻。)" -#: ../../whatsnew/3.14.rst:2340 +#: ../../whatsnew/3.14.rst:2349 msgid "" "Remove the following deprecated properties on :class:`ast.Constant`, which " "were present for compatibility with the now-removed AST classes:" msgstr "" -#: ../../whatsnew/3.14.rst:2343 +#: ../../whatsnew/3.14.rst:2352 msgid ":attr:`!Constant.n`" msgstr ":attr:`!Constant.n`" -#: ../../whatsnew/3.14.rst:2344 +#: ../../whatsnew/3.14.rst:2353 msgid ":attr:`!Constant.s`" msgstr ":attr:`!Constant.s`" -#: ../../whatsnew/3.14.rst:2346 +#: ../../whatsnew/3.14.rst:2355 msgid "" "Use :attr:`!Constant.value` instead. (Contributed by Alex Waygood in :gh:" "`119562`.)" msgstr "" +"改用 :attr:`!Constant.value`。(由 Alex Waygood 於 :gh:`119562` 貢獻。)" -#: ../../whatsnew/3.14.rst:2353 +#: ../../whatsnew/3.14.rst:2362 msgid "" "Remove the following classes, methods, and functions, which have been " "deprecated since Python 3.12:" msgstr "" -#: ../../whatsnew/3.14.rst:2356 +#: ../../whatsnew/3.14.rst:2365 msgid ":class:`!AbstractChildWatcher`" msgstr ":class:`!AbstractChildWatcher`" -#: ../../whatsnew/3.14.rst:2357 +#: ../../whatsnew/3.14.rst:2366 msgid ":class:`!FastChildWatcher`" msgstr ":class:`!FastChildWatcher`" -#: ../../whatsnew/3.14.rst:2358 +#: ../../whatsnew/3.14.rst:2367 msgid ":class:`!MultiLoopChildWatcher`" msgstr ":class:`!MultiLoopChildWatcher`" -#: ../../whatsnew/3.14.rst:2359 +#: ../../whatsnew/3.14.rst:2368 msgid ":class:`!PidfdChildWatcher`" msgstr ":class:`!PidfdChildWatcher`" -#: ../../whatsnew/3.14.rst:2360 +#: ../../whatsnew/3.14.rst:2369 msgid ":class:`!SafeChildWatcher`" msgstr ":class:`!SafeChildWatcher`" -#: ../../whatsnew/3.14.rst:2361 +#: ../../whatsnew/3.14.rst:2370 msgid ":class:`!ThreadedChildWatcher`" msgstr ":class:`!ThreadedChildWatcher`" -#: ../../whatsnew/3.14.rst:2362 +#: ../../whatsnew/3.14.rst:2371 msgid ":meth:`!AbstractEventLoopPolicy.get_child_watcher`" msgstr ":meth:`!AbstractEventLoopPolicy.get_child_watcher`" -#: ../../whatsnew/3.14.rst:2363 +#: ../../whatsnew/3.14.rst:2372 msgid ":meth:`!AbstractEventLoopPolicy.set_child_watcher`" msgstr ":meth:`!AbstractEventLoopPolicy.set_child_watcher`" -#: ../../whatsnew/3.14.rst:2364 +#: ../../whatsnew/3.14.rst:2373 msgid ":func:`!get_child_watcher`" msgstr ":func:`!get_child_watcher`" -#: ../../whatsnew/3.14.rst:2365 +#: ../../whatsnew/3.14.rst:2374 msgid ":func:`!set_child_watcher`" msgstr ":func:`!set_child_watcher`" -#: ../../whatsnew/3.14.rst:2367 +#: ../../whatsnew/3.14.rst:2376 msgid "(Contributed by Kumar Aditya in :gh:`120804`.)" msgstr "(由 Kumar Aditya 於 :gh:`120804` 貢獻。)" -#: ../../whatsnew/3.14.rst:2369 +#: ../../whatsnew/3.14.rst:2378 msgid "" ":func:`asyncio.get_event_loop` now raises a :exc:`RuntimeError` if there is " "no current event loop, and no longer implicitly creates an event loop." msgstr "" -#: ../../whatsnew/3.14.rst:2373 +#: ../../whatsnew/3.14.rst:2382 msgid "(Contributed by Kumar Aditya in :gh:`126353`.)" msgstr "(由 Kumar Aditya 於 :gh:`126353` 貢獻。)" -#: ../../whatsnew/3.14.rst:2378 +#: ../../whatsnew/3.14.rst:2387 msgid "" "There's a few patterns that use :func:`asyncio.get_event_loop`, most of them " "can be replaced with :func:`asyncio.run`." @@ -3581,16 +3667,16 @@ msgstr "" "有一些使用 :func:`asyncio.get_event_loop` 的模式,其中大多數可以用 :func:" "`asyncio.run` 取代。" -#: ../../whatsnew/3.14.rst:2381 +#: ../../whatsnew/3.14.rst:2390 msgid "If you're running an async function, simply use :func:`asyncio.run`." msgstr "如果你正在運行非同步函式,只需使用 :func:`asyncio.run`。" -#: ../../whatsnew/3.14.rst:2383 ../../whatsnew/3.14.rst:2410 -#: ../../whatsnew/3.14.rst:2438 +#: ../../whatsnew/3.14.rst:2392 ../../whatsnew/3.14.rst:2419 +#: ../../whatsnew/3.14.rst:2447 msgid "Before:" msgstr "之前是:" -#: ../../whatsnew/3.14.rst:2385 +#: ../../whatsnew/3.14.rst:2394 msgid "" "async def main():\n" " ...\n" @@ -3612,12 +3698,12 @@ msgstr "" "finally:\n" " loop.close()" -#: ../../whatsnew/3.14.rst:2397 ../../whatsnew/3.14.rst:2423 -#: ../../whatsnew/3.14.rst:2454 +#: ../../whatsnew/3.14.rst:2406 ../../whatsnew/3.14.rst:2432 +#: ../../whatsnew/3.14.rst:2463 msgid "After:" msgstr "之後是:" -#: ../../whatsnew/3.14.rst:2399 +#: ../../whatsnew/3.14.rst:2408 msgid "" "async def main():\n" " ...\n" @@ -3629,7 +3715,7 @@ msgstr "" "\n" "asyncio.run(main())" -#: ../../whatsnew/3.14.rst:2406 +#: ../../whatsnew/3.14.rst:2415 msgid "" "If you need to start something, for example, a server listening on a socket " "and then run forever, use :func:`asyncio.run` and an :class:`asyncio.Event`." @@ -3637,7 +3723,7 @@ msgstr "" "如果你需要啟動某些東西然後永遠運行,像是監聽 socket 的伺服器,請使用 :func:" "`asyncio.run` 和 :class:`asyncio.Event`。" -#: ../../whatsnew/3.14.rst:2412 +#: ../../whatsnew/3.14.rst:2421 msgid "" "def start_server(loop): ...\n" "\n" @@ -3657,7 +3743,7 @@ msgstr "" "finally:\n" " loop.close()" -#: ../../whatsnew/3.14.rst:2425 +#: ../../whatsnew/3.14.rst:2434 msgid "" "def start_server(loop): ...\n" "\n" @@ -3675,7 +3761,7 @@ msgstr "" "\n" "asyncio.run(main())" -#: ../../whatsnew/3.14.rst:2435 +#: ../../whatsnew/3.14.rst:2444 msgid "" "If you need to run something in an event loop, then run some blocking code " "around it, use :class:`asyncio.Runner`." @@ -3683,7 +3769,7 @@ msgstr "" "如果你需要在事件迴圈中運行某些東西,然後在其周圍運行一些阻塞程式碼,請使用 :" "class:`asyncio.Runner`。" -#: ../../whatsnew/3.14.rst:2440 +#: ../../whatsnew/3.14.rst:2449 msgid "" "async def operation_one(): ...\n" "def blocking_code(): ...\n" @@ -3709,7 +3795,7 @@ msgstr "" "finally:\n" " loop.close()" -#: ../../whatsnew/3.14.rst:2456 +#: ../../whatsnew/3.14.rst:2465 msgid "" "async def operation_one(): ...\n" "def blocking_code(): ...\n" @@ -3729,65 +3815,70 @@ msgstr "" " blocking_code()\n" " runner.run(operation_two())" -#: ../../whatsnew/3.14.rst:2469 +#: ../../whatsnew/3.14.rst:2478 msgid "email" msgstr "email" -#: ../../whatsnew/3.14.rst:2471 +#: ../../whatsnew/3.14.rst:2480 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:2477 +#: ../../whatsnew/3.14.rst:2486 msgid "importlib.abc" msgstr "importlib.abc" -#: ../../whatsnew/3.14.rst:2479 +#: ../../whatsnew/3.14.rst:2488 msgid "Remove deprecated :mod:`importlib.abc` classes:" msgstr "移除已棄用的 :mod:`importlib.abc` 類別:" -#: ../../whatsnew/3.14.rst:2481 +#: ../../whatsnew/3.14.rst:2490 msgid "" ":class:`!ResourceReader` (use :class:`~importlib.resources.abc." "TraversableResources`)" msgstr "" +":class:`!ResourceReader`\\ (請改用 :class:`~importlib.resources.abc." +"TraversableResources`)" -#: ../../whatsnew/3.14.rst:2483 +#: ../../whatsnew/3.14.rst:2492 msgid "" ":class:`!Traversable` (use :class:`~importlib.resources.abc.Traversable`)" msgstr "" +":class:`!Traversable`\\ (請改用 :class:`~importlib.resources.abc.Traversable`)" -#: ../../whatsnew/3.14.rst:2485 +#: ../../whatsnew/3.14.rst:2494 msgid "" ":class:`!TraversableResources` (use :class:`~importlib.resources.abc." "TraversableResources`)" msgstr "" +":class:`!TraversableResources`\\ (請改用 :class:`~importlib.resources.abc." +"TraversableResources`)" -#: ../../whatsnew/3.14.rst:2488 +#: ../../whatsnew/3.14.rst:2497 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:2492 +#: ../../whatsnew/3.14.rst:2501 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.14.rst:2494 +#: ../../whatsnew/3.14.rst:2503 msgid "" "Remove support for copy, deepcopy, and pickle operations from :mod:" "`itertools` iterators. These have emitted a :exc:`DeprecationWarning` since " "Python 3.12. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2503 +#: ../../whatsnew/3.14.rst:2512 msgid "" "Remove support for passing additional keyword arguments to :class:`~pathlib." "Path`. In previous versions, any such arguments are ignored. (Contributed by " "Barney Gale in :gh:`74033`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2508 +#: ../../whatsnew/3.14.rst:2517 msgid "" "Remove support for passing additional positional arguments to :meth:`." "PurePath.relative_to` and :meth:`~pathlib.PurePath.is_relative_to`. In " @@ -3795,33 +3886,33 @@ msgid "" "by Barney Gale in :gh:`78707`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2515 +#: ../../whatsnew/3.14.rst:2524 msgid "pkgutil" msgstr "pkgutil" -#: ../../whatsnew/3.14.rst:2517 +#: ../../whatsnew/3.14.rst:2526 msgid "" "Remove the :func:`!get_loader` and :func:`!find_loader` functions, which " "have been deprecated since Python 3.12. (Contributed by Bénédikt Tran in :gh:" "`97850`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2523 +#: ../../whatsnew/3.14.rst:2532 msgid "pty" msgstr "pty" -#: ../../whatsnew/3.14.rst:2525 +#: ../../whatsnew/3.14.rst:2534 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:2532 +#: ../../whatsnew/3.14.rst:2541 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.14.rst:2534 +#: ../../whatsnew/3.14.rst:2543 msgid "" "Remove :data:`!version` and :data:`!version_info` from the :mod:`sqlite3` " "module; use :data:`~sqlite3.sqlite_version` and :data:`~sqlite3." @@ -3829,27 +3920,27 @@ msgid "" "library. (Contributed by Hugo van Kemenade in :gh:`118924`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2540 +#: ../../whatsnew/3.14.rst:2549 msgid "" "Using a sequence of parameters with named placeholders now raises a :exc:" "`~sqlite3.ProgrammingError`, having been deprecated since Python 3.12. " "(Contributed by Erlend E. Aasland in :gh:`118928` and :gh:`101693`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2549 +#: ../../whatsnew/3.14.rst:2558 msgid "" "Remove the :class:`!Quoter` class from :mod:`urllib.parse`, which has been " "deprecated since Python 3.11. (Contributed by Nikita Sobolev in :gh:" "`118827`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2553 +#: ../../whatsnew/3.14.rst:2562 msgid "" "Remove the :class:`!URLopener` and :class:`!FancyURLopener` classes from :" "mod:`urllib.request`, which have been deprecated since Python 3.3." msgstr "" -#: ../../whatsnew/3.14.rst:2557 +#: ../../whatsnew/3.14.rst:2566 msgid "" "``myopener.open()`` can be replaced with :func:`~urllib.request.urlopen`. " "``myopener.retrieve()`` can be replaced with :func:`~urllib.request." @@ -3858,15 +3949,15 @@ msgid "" "(Contributed by Barney Gale in :gh:`84850`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2566 +#: ../../whatsnew/3.14.rst:2575 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.14.rst:2569 +#: ../../whatsnew/3.14.rst:2578 msgid "New deprecations" msgstr "" -#: ../../whatsnew/3.14.rst:2571 +#: ../../whatsnew/3.14.rst:2580 msgid "" "Passing a complex number as the *real* or *imag* argument in the :func:" "`complex` constructor is now deprecated; complex numbers should only be " @@ -3877,12 +3968,12 @@ msgstr "" "用;複數應該只作為單個位置引數傳遞。 (由 Serhiy Storchaka 於 :gh:`109218` 貢" "獻。)" -#: ../../whatsnew/3.14.rst:2576 +#: ../../whatsnew/3.14.rst:2585 #: ../../deprecations/pending-removal-in-future.rst:7 msgid ":mod:`argparse`:" msgstr ":mod:`argparse`:" -#: ../../whatsnew/3.14.rst:2578 +#: ../../whatsnew/3.14.rst:2587 msgid "" "Passing the undocumented keyword argument *prefix_chars* to the :meth:" "`~argparse.ArgumentParser.add_argument_group` method is now deprecated. " @@ -3892,19 +3983,19 @@ msgstr "" "ArgumentParser.add_argument_group` 的做法現在已被棄用。(由 Savannah " "Ostrowski 於 :gh:`125563` 貢獻。)" -#: ../../whatsnew/3.14.rst:2582 +#: ../../whatsnew/3.14.rst:2591 msgid "" "Deprecated the :class:`argparse.FileType` type converter. Anything relating " "to resource management should be handled downstream, after the arguments " "have been parsed. (Contributed by Serhiy Storchaka in :gh:`58032`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2587 +#: ../../whatsnew/3.14.rst:2596 #: ../../deprecations/pending-removal-in-3.16.rst:19 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" -#: ../../whatsnew/3.14.rst:2589 +#: ../../whatsnew/3.14.rst:2598 msgid "" "The :func:`!asyncio.iscoroutinefunction` is now deprecated and will be " "removed in Python 3.16; use :func:`inspect.iscoroutinefunction` instead. " @@ -3914,7 +4005,7 @@ msgstr "" "用 :func:`inspect.iscoroutinefunction`。(由 Jiahao Li 和 Kumar Aditya 於 :" "gh:`122875` 貢獻。)" -#: ../../whatsnew/3.14.rst:2594 +#: ../../whatsnew/3.14.rst:2603 msgid "" "The :mod:`asyncio` policy system is deprecated and will be removed in Python " "3.16. In particular, the following classes and functions are deprecated:" @@ -3922,37 +4013,37 @@ msgstr "" ":mod:`asyncio` 策略系統已被棄用並將在 Python 3.16 中移除。特別是以下類別和函" "式已被棄用:" -#: ../../whatsnew/3.14.rst:2598 +#: ../../whatsnew/3.14.rst:2607 #: ../../deprecations/pending-removal-in-3.16.rst:29 msgid ":class:`asyncio.AbstractEventLoopPolicy`" msgstr ":class:`asyncio.AbstractEventLoopPolicy`" -#: ../../whatsnew/3.14.rst:2599 +#: ../../whatsnew/3.14.rst:2608 #: ../../deprecations/pending-removal-in-3.16.rst:30 msgid ":class:`asyncio.DefaultEventLoopPolicy`" msgstr ":class:`asyncio.DefaultEventLoopPolicy`" -#: ../../whatsnew/3.14.rst:2600 +#: ../../whatsnew/3.14.rst:2609 #: ../../deprecations/pending-removal-in-3.16.rst:31 msgid ":class:`asyncio.WindowsSelectorEventLoopPolicy`" msgstr ":class:`asyncio.WindowsSelectorEventLoopPolicy`" -#: ../../whatsnew/3.14.rst:2601 +#: ../../whatsnew/3.14.rst:2610 #: ../../deprecations/pending-removal-in-3.16.rst:32 msgid ":class:`asyncio.WindowsProactorEventLoopPolicy`" msgstr ":class:`asyncio.WindowsProactorEventLoopPolicy`" -#: ../../whatsnew/3.14.rst:2602 +#: ../../whatsnew/3.14.rst:2611 #: ../../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:2603 +#: ../../whatsnew/3.14.rst:2612 #: ../../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:2605 +#: ../../whatsnew/3.14.rst:2614 msgid "" "Users should use :func:`asyncio.run` or :class:`asyncio.Runner` with the " "*loop_factory* argument to use the desired event loop implementation." @@ -3960,11 +4051,11 @@ msgstr "" "使用者應該使用 :func:`asyncio.run` 或 :class:`asyncio.Runner` 搭配 " "*loop_factory* 引數來使用所需的事件迴圈實作。" -#: ../../whatsnew/3.14.rst:2608 +#: ../../whatsnew/3.14.rst:2617 msgid "For example, to use :class:`asyncio.SelectorEventLoop` on Windows:" msgstr "例如在 Windows 上使用 :class:`asyncio.SelectorEventLoop`:" -#: ../../whatsnew/3.14.rst:2610 +#: ../../whatsnew/3.14.rst:2619 #: ../../deprecations/pending-removal-in-3.16.rst:41 msgid "" "import asyncio\n" @@ -3981,12 +4072,12 @@ msgstr "" "\n" "asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)" -#: ../../whatsnew/3.14.rst:2619 +#: ../../whatsnew/3.14.rst:2628 #: ../../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:2621 +#: ../../whatsnew/3.14.rst:2630 msgid "" ":mod:`codecs`: The :func:`codecs.open` function is now deprecated, and will " "be removed in a future version of Python. Use :func:`open` instead. " @@ -3995,13 +4086,13 @@ msgstr "" ":mod:`codecs`: :func:`codecs.open` 函式已被棄用,並將在未來的 Python 版本中移" "除。請改用 :func:`open`。(由 Inada Naoki 於 :gh:`133036` 貢獻。)" -#: ../../whatsnew/3.14.rst:2627 +#: ../../whatsnew/3.14.rst:2636 #: ../../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:2629 +#: ../../whatsnew/3.14.rst:2638 msgid "" "On non-Windows platforms, setting :attr:`.Structure._pack_` to use a MSVC-" "compatible default memory layout is now deprecated in favor of setting :attr:" @@ -4009,7 +4100,7 @@ msgid "" "(Contributed by Petr Viktorin in :gh:`131747`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2634 +#: ../../whatsnew/3.14.rst:2643 msgid "" "Calling :func:`ctypes.POINTER` on a string is now deprecated. Use :ref:" "`incomplete types ` for self-referential " @@ -4018,7 +4109,7 @@ msgid "" "by Sergey Myrianov in :gh:`100926`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2641 +#: ../../whatsnew/3.14.rst:2650 msgid "" ":mod:`functools`: Calling the Python implementation of :func:`functools." "reduce` with *function* or *sequence* as keyword arguments is now " @@ -4029,7 +4120,7 @@ msgstr "" "`functools.reduce` 的 Python 實作已被棄用;這些參數將在 Python 3.16 中變為僅" "限位置引數。(由 Kirill Podoprigora 於 :gh:`121676` 貢獻。)" -#: ../../whatsnew/3.14.rst:2647 +#: ../../whatsnew/3.14.rst:2656 msgid "" ":mod:`logging`: Support for custom logging handlers with the *strm* argument " "is now deprecated and scheduled for removal in Python 3.16. Define handlers " @@ -4040,7 +4131,7 @@ msgstr "" "劃在 Python 3.16 中移除。請改為使用 *stream* 引數來定義處理函式。(由 " "Mariusz Felisiak 於 :gh:`115032` 貢獻。)" -#: ../../whatsnew/3.14.rst:2653 +#: ../../whatsnew/3.14.rst:2662 msgid "" ":mod:`mimetypes`: Valid extensions are either empty or must start with '.' " "for :meth:`mimetypes.MimeTypes.add_type`. Undotted extensions are deprecated " @@ -4051,14 +4142,14 @@ msgstr "" "add_type` 以 '.' 開頭。未加點的副檔名已被棄用,並將在 Python 3.16 中引發 :" "exc:`ValueError`。(由 Hugo van Kemenade 於 :gh:`75223` 貢獻。)" -#: ../../whatsnew/3.14.rst:2660 +#: ../../whatsnew/3.14.rst:2669 msgid "" ":mod:`!nturl2path`: This module is now deprecated. Call :func:`urllib." "request.url2pathname` and :func:`~urllib.request.pathname2url` instead. " "(Contributed by Barney Gale in :gh:`125866`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2665 +#: ../../whatsnew/3.14.rst:2674 msgid "" ":mod:`os`: The :func:`os.popen` and :func:`os.spawn* ` functions " "are now :term:`soft deprecated`. They should no longer be used to write new " @@ -4066,14 +4157,14 @@ msgid "" "Victor Stinner in :gh:`120743`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2672 +#: ../../whatsnew/3.14.rst:2681 msgid "" ":mod:`pathlib`: :meth:`!pathlib.PurePath.as_uri` is now deprecated and " "scheduled for removal in Python 3.19. Use :meth:`pathlib.Path.as_uri` " "instead. (Contributed by Barney Gale in :gh:`123599`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2678 +#: ../../whatsnew/3.14.rst:2687 msgid "" ":mod:`pdb`: The undocumented ``pdb.Pdb.curframe_locals`` attribute is now a " "deprecated read-only property, which will be removed in a future version of " @@ -4084,14 +4175,14 @@ msgid "" "(Contributed by Tian Gao in :gh:`124369` and :gh:`125951`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2687 +#: ../../whatsnew/3.14.rst:2696 msgid "" ":mod:`symtable`: Deprecate :meth:`symtable.Class.get_methods` due to the " "lack of interest, scheduled for removal in Python 3.16. (Contributed by " "Bénédikt Tran in :gh:`119698`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2692 +#: ../../whatsnew/3.14.rst:2701 msgid "" ":mod:`tkinter`: The :class:`!tkinter.Variable` methods :meth:`!" "trace_variable`, :meth:`!trace_vdelete` and :meth:`!trace_vinfo` are now " @@ -4099,7 +4190,7 @@ msgid "" "trace_info` instead. (Contributed by Serhiy Storchaka in :gh:`120220`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2698 +#: ../../whatsnew/3.14.rst:2707 msgid "" ":mod:`urllib.parse`: Accepting objects with false values (like ``0`` and " "``[]``) except empty strings, bytes-like objects and ``None`` in :func:" @@ -5009,18 +5100,18 @@ msgstr "" ":func:`sys._clear_type_cache` 已被棄用:請改用 :func:`sys." "_clear_internal_caches`。" -#: ../../whatsnew/3.14.rst:2718 +#: ../../whatsnew/3.14.rst:2727 msgid "CPython bytecode changes" msgstr "CPython 位元組碼變更" -#: ../../whatsnew/3.14.rst:2720 +#: ../../whatsnew/3.14.rst:2729 msgid "" "Replaced the opcode :opcode:`!BINARY_SUBSCR` by the :opcode:`BINARY_OP` " "opcode with the ``NB_SUBSCR`` oparg. (Contributed by Irit Katriel in :gh:" "`100239`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2724 +#: ../../whatsnew/3.14.rst:2733 msgid "" "Add the :opcode:`BUILD_INTERPOLATION` and :opcode:`BUILD_TEMPLATE` opcodes " "to construct new :class:`~string.templatelib.Interpolation` and :class:" @@ -5029,20 +5120,20 @@ msgid "" "Template strings `)." msgstr "" -#: ../../whatsnew/3.14.rst:2730 +#: ../../whatsnew/3.14.rst:2739 msgid "" "Remove the :opcode:`!BUILD_CONST_KEY_MAP` opcode. Use :opcode:`BUILD_MAP` " "instead. (Contributed by Mark Shannon in :gh:`122160`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2734 +#: ../../whatsnew/3.14.rst:2743 msgid "" "Replace the :opcode:`!LOAD_ASSERTION_ERROR` opcode with :opcode:" "`LOAD_COMMON_CONSTANT` and add support for loading :exc:" "`NotImplementedError`." msgstr "" -#: ../../whatsnew/3.14.rst:2738 +#: ../../whatsnew/3.14.rst:2747 msgid "" "Add the :opcode:`LOAD_FAST_BORROW` and :opcode:" "`LOAD_FAST_BORROW_LOAD_FAST_BORROW` opcodes to reduce reference counting " @@ -5051,14 +5142,14 @@ msgid "" "gh:`130704`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2743 +#: ../../whatsnew/3.14.rst:2752 msgid "" "Add the :opcode:`LOAD_SMALL_INT` opcode, which pushes a small integer equal " "to the ``oparg`` to the stack. The :opcode:`!RETURN_CONST` opcode is removed " "as it is no longer used. (Contributed by Mark Shannon in :gh:`125837`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2748 +#: ../../whatsnew/3.14.rst:2757 msgid "" "Add the new :opcode:`LOAD_SPECIAL` instruction. Generate code for :keyword:" "`with` and :keyword:`async with` statements using the new instruction. " @@ -5066,17 +5157,17 @@ msgid "" "instructions. (Contributed by Mark Shannon in :gh:`120507`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2754 +#: ../../whatsnew/3.14.rst:2763 msgid "" "Add the :opcode:`POP_ITER` opcode to support 'virtual' iterators. " "(Contributed by Mark Shannon in :gh:`132554`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2759 +#: ../../whatsnew/3.14.rst:2768 msgid "Pseudo-instructions" msgstr "" -#: ../../whatsnew/3.14.rst:2761 +#: ../../whatsnew/3.14.rst:2770 msgid "" "Add the :opcode:`!ANNOTATIONS_PLACEHOLDER` pseudo instruction to support " "partially executed module-level annotations with :ref:`deferred evaluation " @@ -5084,14 +5175,14 @@ msgid "" "Zijlstra in :gh:`130907`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2766 +#: ../../whatsnew/3.14.rst:2775 msgid "" "Add the :opcode:`!BINARY_OP_EXTEND` pseudo instruction, which executes a " "pair of functions (guard and specialization functions) accessed from the " "inline cache. (Contributed by Irit Katriel in :gh:`100239`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2771 +#: ../../whatsnew/3.14.rst:2780 msgid "" "Add three specializations for :opcode:`CALL_KW`; :opcode:`!CALL_KW_PY` for " "calls to Python functions, :opcode:`!CALL_KW_BOUND_METHOD` for calls to " @@ -5099,7 +5190,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`118093`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2777 +#: ../../whatsnew/3.14.rst:2786 msgid "" "Add the :opcode:`JUMP_IF_TRUE` and :opcode:`JUMP_IF_FALSE` pseudo " "instructions, conditional jumps which do not impact the stack. Replaced by " @@ -5107,55 +5198,55 @@ msgid "" "(Contributed by Irit Katriel in :gh:`124285`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2782 +#: ../../whatsnew/3.14.rst:2791 msgid "" "Add the :opcode:`!LOAD_CONST_MORTAL` pseudo instruction. (Contributed by " "Mark Shannon in :gh:`128685`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2785 +#: ../../whatsnew/3.14.rst:2794 msgid "" "Add the :opcode:`LOAD_CONST_IMMORTAL` pseudo instruction, which does the " "same as :opcode:`!LOAD_CONST`, but is more efficient for immortal objects. " "(Contributed by Mark Shannon in :gh:`125837`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2790 +#: ../../whatsnew/3.14.rst:2799 msgid "" "Add the :opcode:`NOT_TAKEN` pseudo instruction, used by :mod:`sys." "monitoring` to record branch events (such as :monitoring-event:" "`BRANCH_LEFT`). (Contributed by Mark Shannon in :gh:`122548`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2796 +#: ../../whatsnew/3.14.rst:2805 msgid "C API changes" msgstr "C API 變更" -#: ../../whatsnew/3.14.rst:2801 +#: ../../whatsnew/3.14.rst:2810 msgid "Python configuration C API" -msgstr "" +msgstr "Python 配置 C API" -#: ../../whatsnew/3.14.rst:2803 +#: ../../whatsnew/3.14.rst:2812 msgid "" "Add a :ref:`PyInitConfig C API ` to configure the Python " "initialization without relying on C structures and the ability to make ABI-" "compatible changes in the future." msgstr "" -#: ../../whatsnew/3.14.rst:2807 +#: ../../whatsnew/3.14.rst:2816 msgid "" "Complete the :pep:`587` :ref:`PyConfig C API ` by adding :c:" "func:`PyInitConfig_AddModule` which can be used to add a built-in extension " "module; a feature previously referred to as the \"inittab\"." msgstr "" -#: ../../whatsnew/3.14.rst:2811 +#: ../../whatsnew/3.14.rst:2820 msgid "" "Add :c:func:`PyConfig_Get` and :c:func:`PyConfig_Set` functions to get and " "set the current runtime configuration." msgstr "" -#: ../../whatsnew/3.14.rst:2814 +#: ../../whatsnew/3.14.rst:2823 msgid "" ":pep:`587` 'Python Initialization Configuration' unified all the ways to " "configure Python's initialization. This PEP also unifies the configuration " @@ -5164,7 +5255,7 @@ msgid "" "two 'Python' and 'Isolated' choices (PEP 587), to further simplify the API." msgstr "" -#: ../../whatsnew/3.14.rst:2821 +#: ../../whatsnew/3.14.rst:2830 msgid "" "The lower level PEP 587 PyConfig API remains available for use cases with an " "intentionally higher level of coupling to CPython implementation details " @@ -5172,20 +5263,20 @@ msgid "" "configuration mechanisms)." msgstr "" -#: ../../whatsnew/3.14.rst:2826 ../../whatsnew/3.14.rst:2853 -#: ../../whatsnew/3.14.rst:2873 +#: ../../whatsnew/3.14.rst:2835 ../../whatsnew/3.14.rst:2862 +#: ../../whatsnew/3.14.rst:2882 msgid "(Contributed by Victor Stinner in :gh:`107954`.)" msgstr "(由 Victor Stinner 於 :gh:`107954` 貢獻。)" -#: ../../whatsnew/3.14.rst:2828 +#: ../../whatsnew/3.14.rst:2837 msgid ":pep:`741` and :pep:`587`" msgstr ":pep:`741` 和 :pep:`587`" -#: ../../whatsnew/3.14.rst:2832 +#: ../../whatsnew/3.14.rst:2841 msgid "New features in the C API" msgstr "C API 中的新功能" -#: ../../whatsnew/3.14.rst:2834 +#: ../../whatsnew/3.14.rst:2843 msgid "" "Add :c:func:`Py_PACK_VERSION` and :c:func:`Py_PACK_FULL_VERSION`, two new " "macros for bit-packing Python version numbers. This is useful for " @@ -5193,14 +5284,14 @@ msgid "" "(Contributed by Petr Viktorin in :gh:`128629`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2840 +#: ../../whatsnew/3.14.rst:2849 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:2844 +#: ../../whatsnew/3.14.rst:2853 msgid "" "Add functions to manipulate the configuration of the current runtime Python " "interpreter (:ref:`PEP 741: Python configuration C API `):" -#: ../../whatsnew/3.14.rst:2848 +#: ../../whatsnew/3.14.rst:2857 msgid ":c:func:`PyConfig_Get`" msgstr ":c:func:`PyConfig_Get`" -#: ../../whatsnew/3.14.rst:2849 +#: ../../whatsnew/3.14.rst:2858 msgid ":c:func:`PyConfig_GetInt`" msgstr ":c:func:`PyConfig_GetInt`" -#: ../../whatsnew/3.14.rst:2850 +#: ../../whatsnew/3.14.rst:2859 msgid ":c:func:`PyConfig_Set`" msgstr ":c:func:`PyConfig_Set`" -#: ../../whatsnew/3.14.rst:2851 +#: ../../whatsnew/3.14.rst:2860 msgid ":c:func:`PyConfig_Names`" msgstr ":c:func:`PyConfig_Names`" -#: ../../whatsnew/3.14.rst:2855 +#: ../../whatsnew/3.14.rst:2864 msgid "" "Add functions to configure Python initialization (:ref:`PEP 741: Python " "configuration C API `):" @@ -5233,63 +5324,63 @@ msgstr "" "新增用於配置 Python 初始化的函式(:ref:`PEP 741:Python 配置 C API " "`):" -#: ../../whatsnew/3.14.rst:2858 +#: ../../whatsnew/3.14.rst:2867 msgid ":c:func:`Py_InitializeFromInitConfig`" msgstr ":c:func:`Py_InitializeFromInitConfig`" -#: ../../whatsnew/3.14.rst:2859 +#: ../../whatsnew/3.14.rst:2868 msgid ":c:func:`PyInitConfig_AddModule`" msgstr ":c:func:`PyInitConfig_AddModule`" -#: ../../whatsnew/3.14.rst:2860 +#: ../../whatsnew/3.14.rst:2869 msgid ":c:func:`PyInitConfig_Create`" msgstr ":c:func:`PyInitConfig_Create`" -#: ../../whatsnew/3.14.rst:2861 +#: ../../whatsnew/3.14.rst:2870 msgid ":c:func:`PyInitConfig_Free`" msgstr ":c:func:`PyInitConfig_Free`" -#: ../../whatsnew/3.14.rst:2862 +#: ../../whatsnew/3.14.rst:2871 msgid ":c:func:`PyInitConfig_FreeStrList`" msgstr ":c:func:`PyInitConfig_FreeStrList`" -#: ../../whatsnew/3.14.rst:2863 +#: ../../whatsnew/3.14.rst:2872 msgid ":c:func:`PyInitConfig_GetError`" msgstr ":c:func:`PyInitConfig_GetError`" -#: ../../whatsnew/3.14.rst:2864 +#: ../../whatsnew/3.14.rst:2873 msgid ":c:func:`PyInitConfig_GetExitCode`" msgstr ":c:func:`PyInitConfig_GetExitCode`" -#: ../../whatsnew/3.14.rst:2865 +#: ../../whatsnew/3.14.rst:2874 msgid ":c:func:`PyInitConfig_GetInt`" msgstr ":c:func:`PyInitConfig_GetInt`" -#: ../../whatsnew/3.14.rst:2866 +#: ../../whatsnew/3.14.rst:2875 msgid ":c:func:`PyInitConfig_GetStr`" msgstr ":c:func:`PyInitConfig_GetStr`" -#: ../../whatsnew/3.14.rst:2867 +#: ../../whatsnew/3.14.rst:2876 msgid ":c:func:`PyInitConfig_GetStrList`" msgstr ":c:func:`PyInitConfig_GetStrList`" -#: ../../whatsnew/3.14.rst:2868 +#: ../../whatsnew/3.14.rst:2877 msgid ":c:func:`PyInitConfig_HasOption`" msgstr ":c:func:`PyInitConfig_HasOption`" -#: ../../whatsnew/3.14.rst:2869 +#: ../../whatsnew/3.14.rst:2878 msgid ":c:func:`PyInitConfig_SetInt`" msgstr ":c:func:`PyInitConfig_SetInt`" -#: ../../whatsnew/3.14.rst:2870 +#: ../../whatsnew/3.14.rst:2879 msgid ":c:func:`PyInitConfig_SetStr`" msgstr ":c:func:`PyInitConfig_SetStr`" -#: ../../whatsnew/3.14.rst:2871 +#: ../../whatsnew/3.14.rst:2880 msgid ":c:func:`PyInitConfig_SetStrList`" msgstr ":c:func:`PyInitConfig_SetStrList`" -#: ../../whatsnew/3.14.rst:2875 +#: ../../whatsnew/3.14.rst:2884 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 " @@ -5298,13 +5389,13 @@ msgid "" "(Contributed by Victor Stinner in :gh:`127350`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2883 +#: ../../whatsnew/3.14.rst:2892 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:2886 +#: ../../whatsnew/3.14.rst:2895 msgid "" "Add :c:func:`PyImport_ImportModuleAttr` and :c:func:" "`PyImport_ImportModuleAttrString` helper functions to import a module and " @@ -5312,20 +5403,20 @@ msgid "" "`128911`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2891 +#: ../../whatsnew/3.14.rst:2900 msgid "" "Add :c:func:`PyIter_NextItem` to replace :c:func:`PyIter_Next`, which has an " "ambiguous return value. (Contributed by Irit Katriel and Erlend Aasland in :" "gh:`105201`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2895 +#: ../../whatsnew/3.14.rst:2904 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:2898 +#: ../../whatsnew/3.14.rst:2907 msgid "" "Add :c:func:`PyLong_IsPositive`, :c:func:`PyLong_IsNegative` and :c:func:" "`PyLong_IsZero` for checking if :c:type:`PyLongObject` is positive, " @@ -5333,82 +5424,82 @@ msgid "" "Kirpichev in :gh:`126061`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2903 +#: ../../whatsnew/3.14.rst:2912 msgid "" "Add new functions to convert C ```` numbers to/from Python :class:" "`int` objects:" msgstr "" -#: ../../whatsnew/3.14.rst:2906 +#: ../../whatsnew/3.14.rst:2915 msgid ":c:func:`PyLong_AsInt32`" msgstr ":c:func:`PyLong_AsInt32`" -#: ../../whatsnew/3.14.rst:2907 +#: ../../whatsnew/3.14.rst:2916 msgid ":c:func:`PyLong_AsInt64`" msgstr ":c:func:`PyLong_AsInt64`" -#: ../../whatsnew/3.14.rst:2908 +#: ../../whatsnew/3.14.rst:2917 msgid ":c:func:`PyLong_AsUInt32`" msgstr ":c:func:`PyLong_AsUInt32`" -#: ../../whatsnew/3.14.rst:2909 +#: ../../whatsnew/3.14.rst:2918 msgid ":c:func:`PyLong_AsUInt64`" msgstr ":c:func:`PyLong_AsUInt64`" -#: ../../whatsnew/3.14.rst:2910 +#: ../../whatsnew/3.14.rst:2919 msgid ":c:func:`PyLong_FromInt32`" msgstr ":c:func:`PyLong_FromInt32`" -#: ../../whatsnew/3.14.rst:2911 +#: ../../whatsnew/3.14.rst:2920 msgid ":c:func:`PyLong_FromInt64`" msgstr ":c:func:`PyLong_FromInt64`" -#: ../../whatsnew/3.14.rst:2912 +#: ../../whatsnew/3.14.rst:2921 msgid ":c:func:`PyLong_FromUInt32`" msgstr ":c:func:`PyLong_FromUInt32`" -#: ../../whatsnew/3.14.rst:2913 +#: ../../whatsnew/3.14.rst:2922 msgid ":c:func:`PyLong_FromUInt64`" msgstr ":c:func:`PyLong_FromUInt64`" -#: ../../whatsnew/3.14.rst:2915 +#: ../../whatsnew/3.14.rst:2924 msgid "(Contributed by Victor Stinner in :gh:`120389`.)" msgstr "(由 Victor Stinner 於 :gh:`120389` 貢獻。)" -#: ../../whatsnew/3.14.rst:2917 +#: ../../whatsnew/3.14.rst:2926 msgid "" "Add a new import and export API for Python :class:`int` objects (:pep:`757`):" msgstr "" -#: ../../whatsnew/3.14.rst:2920 +#: ../../whatsnew/3.14.rst:2929 msgid ":c:func:`PyLong_GetNativeLayout`" msgstr ":c:func:`PyLong_GetNativeLayout`" -#: ../../whatsnew/3.14.rst:2921 +#: ../../whatsnew/3.14.rst:2930 msgid ":c:func:`PyLong_Export`" msgstr ":c:func:`PyLong_Export`" -#: ../../whatsnew/3.14.rst:2922 +#: ../../whatsnew/3.14.rst:2931 msgid ":c:func:`PyLong_FreeExport`" msgstr ":c:func:`PyLong_FreeExport`" -#: ../../whatsnew/3.14.rst:2923 +#: ../../whatsnew/3.14.rst:2932 msgid ":c:func:`PyLongWriter_Create`" msgstr ":c:func:`PyLongWriter_Create`" -#: ../../whatsnew/3.14.rst:2924 +#: ../../whatsnew/3.14.rst:2933 msgid ":c:func:`PyLongWriter_Finish`" msgstr ":c:func:`PyLongWriter_Finish`" -#: ../../whatsnew/3.14.rst:2925 +#: ../../whatsnew/3.14.rst:2934 msgid ":c:func:`PyLongWriter_Discard`" msgstr ":c:func:`PyLongWriter_Discard`" -#: ../../whatsnew/3.14.rst:2927 +#: ../../whatsnew/3.14.rst:2936 msgid "(Contributed by Sergey B Kirpichev and Victor Stinner in :gh:`102471`.)" msgstr "(由 Sergey B Kirpichev 和 Victor Stinner 於 :gh:`102471` 貢獻。)" -#: ../../whatsnew/3.14.rst:2929 +#: ../../whatsnew/3.14.rst:2938 msgid "" "Add :c:func:`PyMonitoring_FireBranchLeftEvent` and :c:func:" "`PyMonitoring_FireBranchRightEvent` for generating :monitoring-event:" @@ -5416,13 +5507,13 @@ msgid "" "(Contributed by Mark Shannon in :gh:`122548`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2935 +#: ../../whatsnew/3.14.rst:2944 msgid "" "Add :c:func:`PyType_Freeze` function to make a type immutable. (Contributed " "by Victor Stinner in :gh:`121654`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2938 +#: ../../whatsnew/3.14.rst:2947 msgid "" "Add :c:func:`PyType_GetBaseByToken` and :c:data:`Py_tp_token` slot for " "easier superclass identification, which attempts to resolve the type " @@ -5430,110 +5521,110 @@ msgid "" "in :gh:`124153`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2943 +#: ../../whatsnew/3.14.rst:2952 msgid "" "Add a new :c:func:`PyUnicode_Equal` function to test if two strings are " "equal. The function is also added to the Limited C API. (Contributed by " "Victor Stinner in :gh:`124502`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2948 +#: ../../whatsnew/3.14.rst:2957 msgid "" "Add a new :c:type:`PyUnicodeWriter` API to create a Python :class:`str` " "object, with the following functions:" msgstr "" -#: ../../whatsnew/3.14.rst:2951 +#: ../../whatsnew/3.14.rst:2960 msgid ":c:func:`PyUnicodeWriter_Create`" msgstr ":c:func:`PyUnicodeWriter_Create`" -#: ../../whatsnew/3.14.rst:2952 +#: ../../whatsnew/3.14.rst:2961 msgid ":c:func:`PyUnicodeWriter_DecodeUTF8Stateful`" msgstr ":c:func:`PyUnicodeWriter_DecodeUTF8Stateful`" -#: ../../whatsnew/3.14.rst:2953 +#: ../../whatsnew/3.14.rst:2962 msgid ":c:func:`PyUnicodeWriter_Discard`" msgstr ":c:func:`PyUnicodeWriter_Discard`" -#: ../../whatsnew/3.14.rst:2954 +#: ../../whatsnew/3.14.rst:2963 msgid ":c:func:`PyUnicodeWriter_Finish`" msgstr ":c:func:`PyUnicodeWriter_Finish`" -#: ../../whatsnew/3.14.rst:2955 +#: ../../whatsnew/3.14.rst:2964 msgid ":c:func:`PyUnicodeWriter_Format`" msgstr ":c:func:`PyUnicodeWriter_Format`" -#: ../../whatsnew/3.14.rst:2956 +#: ../../whatsnew/3.14.rst:2965 msgid ":c:func:`PyUnicodeWriter_WriteASCII`" msgstr ":c:func:`PyUnicodeWriter_WriteASCII`" -#: ../../whatsnew/3.14.rst:2957 +#: ../../whatsnew/3.14.rst:2966 msgid ":c:func:`PyUnicodeWriter_WriteChar`" msgstr ":c:func:`PyUnicodeWriter_WriteChar`" -#: ../../whatsnew/3.14.rst:2958 +#: ../../whatsnew/3.14.rst:2967 msgid ":c:func:`PyUnicodeWriter_WriteRepr`" msgstr ":c:func:`PyUnicodeWriter_WriteRepr`" -#: ../../whatsnew/3.14.rst:2959 +#: ../../whatsnew/3.14.rst:2968 msgid ":c:func:`PyUnicodeWriter_WriteStr`" msgstr ":c:func:`PyUnicodeWriter_WriteStr`" -#: ../../whatsnew/3.14.rst:2960 +#: ../../whatsnew/3.14.rst:2969 msgid ":c:func:`PyUnicodeWriter_WriteSubstring`" msgstr ":c:func:`PyUnicodeWriter_WriteSubstring`" -#: ../../whatsnew/3.14.rst:2961 +#: ../../whatsnew/3.14.rst:2970 msgid ":c:func:`PyUnicodeWriter_WriteUCS4`" msgstr ":c:func:`PyUnicodeWriter_WriteUCS4`" -#: ../../whatsnew/3.14.rst:2962 +#: ../../whatsnew/3.14.rst:2971 msgid ":c:func:`PyUnicodeWriter_WriteUTF8`" msgstr ":c:func:`PyUnicodeWriter_WriteUTF8`" -#: ../../whatsnew/3.14.rst:2963 +#: ../../whatsnew/3.14.rst:2972 msgid ":c:func:`PyUnicodeWriter_WriteWideChar`" msgstr ":c:func:`PyUnicodeWriter_WriteWideChar`" -#: ../../whatsnew/3.14.rst:2965 +#: ../../whatsnew/3.14.rst:2974 msgid "(Contributed by Victor Stinner in :gh:`119182`.)" msgstr "(由 Victor Stinner 於 :gh:`119182` 貢獻。)" -#: ../../whatsnew/3.14.rst:2967 +#: ../../whatsnew/3.14.rst:2976 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:2972 +#: ../../whatsnew/3.14.rst:2981 msgid "" "Add support for a new ``p`` format unit in :c:func:`Py_BuildValue` that " "produces a Python :class:`bool` object from a C integer. (Contributed by " "Pablo Galindo in :issue:`45325`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2976 +#: ../../whatsnew/3.14.rst:2985 msgid "" "Add :c:func:`PyUnstable_IsImmortal` for determining if an object is :term:" "`immortal`, for debugging purposes. (Contributed by Peter Bierma in :gh:" "`128509`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2980 +#: ../../whatsnew/3.14.rst:2989 msgid "" "Add :c:func:`PyUnstable_Object_EnableDeferredRefcount` for enabling deferred " "reference counting, as outlined in :pep:`703`." msgstr "" -#: ../../whatsnew/3.14.rst:2983 +#: ../../whatsnew/3.14.rst:2992 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:2988 +#: ../../whatsnew/3.14.rst:2997 msgid "" "Add :c:func:`PyUnstable_Object_IsUniqueReferencedTemporary` to determine if " "an object is a unique temporary object on the interpreter's operand stack. " @@ -5542,11 +5633,11 @@ msgid "" "functions. (Contributed by Sam Gross in :gh:`133164`.)" msgstr "" -#: ../../whatsnew/3.14.rst:2998 +#: ../../whatsnew/3.14.rst:3007 msgid "Limited C API changes" msgstr "" -#: ../../whatsnew/3.14.rst:3000 +#: ../../whatsnew/3.14.rst:3009 msgid "" "In the limited C API version 3.14 and newer, :c:func:`Py_TYPE` and :c:func:" "`Py_REFCNT` are now implemented as an opaque function call to hide " @@ -5554,7 +5645,7 @@ msgid "" "gh:`124127`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3005 +#: ../../whatsnew/3.14.rst:3014 msgid "" "Remove the :c:macro:`PySequence_Fast_GET_SIZE`, :c:macro:" "`PySequence_Fast_GET_ITEM`, and :c:macro:`PySequence_Fast_ITEMS` macros from " @@ -5562,32 +5653,32 @@ msgid "" "(Contributed by Victor Stinner in :gh:`91417`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3016 +#: ../../whatsnew/3.14.rst:3025 msgid "Removed C APIs" msgstr "被移除的 C API" -#: ../../whatsnew/3.14.rst:3018 +#: ../../whatsnew/3.14.rst:3027 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases was deprecated in Python 3.12, and now raises a :exc:`TypeError`. " "(Contributed by Nikita Sobolev in :gh:`119775`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3023 +#: ../../whatsnew/3.14.rst:3032 msgid "" "Remove ``PyDictObject.ma_version_tag`` member, which was deprecated in " "Python 3.12. Use the :c:func:`PyDict_AddWatcher` API instead. (Contributed " "by Sam Gross in :gh:`124296`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3028 +#: ../../whatsnew/3.14.rst:3037 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:3032 +#: ../../whatsnew/3.14.rst:3041 msgid "" "Remove the undocumented APIs :c:macro:`!Py_C_RECURSION_LIMIT` and :c:member:" "`!PyThreadState.c_recursion_remaining`. These were added in 3.13 and have " @@ -5596,18 +5687,18 @@ msgid "" "`133079`, see also :gh:`130396`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3043 +#: ../../whatsnew/3.14.rst:3052 msgid "Deprecated C APIs" msgstr "已棄用的 C API" -#: ../../whatsnew/3.14.rst:3045 +#: ../../whatsnew/3.14.rst:3054 msgid "" "The :c:macro:`!Py_HUGE_VAL` macro is now :term:`soft deprecated`. Use :c:" "macro:`!Py_INFINITY` instead. (Contributed by Sergey B Kirpichev in :gh:" "`120026`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3049 +#: ../../whatsnew/3.14.rst:3058 msgid "" "The :c:macro:`!Py_IS_NAN`, :c:macro:`!Py_IS_INFINITY`, and :c:macro:`!" "Py_IS_FINITE` macros are now :term:`soft deprecated`. Use :c:macro:`!" @@ -5615,7 +5706,7 @@ msgid "" "file:`math.h` since C99. (Contributed by Sergey B Kirpichev in :gh:`119613`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3055 +#: ../../whatsnew/3.14.rst:3064 msgid "" "Non-tuple sequences are now deprecated as argument for the ``(items)`` " "format unit in :c:func:`PyArg_ParseTuple` and other :ref:`argument parsing " @@ -5624,14 +5715,14 @@ msgid "" "(Contributed by Serhiy Storchaka in :gh:`50333`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3062 +#: ../../whatsnew/3.14.rst:3071 msgid "" "The ``_PyMonitoring_FireBranchEvent`` function is now deprecated and should " "be replaced with calls to :c:func:`PyMonitoring_FireBranchLeftEvent` and :c:" "func:`PyMonitoring_FireBranchRightEvent`." msgstr "" -#: ../../whatsnew/3.14.rst:3067 +#: ../../whatsnew/3.14.rst:3076 msgid "" "The previously undocumented function :c:func:`PySequence_In` is now :term:" "`soft deprecated`. Use :c:func:`PySequence_Contains` instead. (Contributed " @@ -6259,11 +6350,11 @@ msgstr "" msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要。" -#: ../../whatsnew/3.14.rst:3086 +#: ../../whatsnew/3.14.rst:3095 msgid "Build changes" msgstr "建置變更" -#: ../../whatsnew/3.14.rst:3088 +#: ../../whatsnew/3.14.rst:3097 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 " @@ -6273,31 +6364,31 @@ msgid "" "Chatham in :gh:`127146`, :gh:`127683`, and :gh:`136931`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3098 +#: ../../whatsnew/3.14.rst:3107 msgid "Official Android binary releases are now provided on python.org__." msgstr "" -#: ../../whatsnew/3.14.rst:3102 +#: ../../whatsnew/3.14.rst:3111 msgid "" "GNU Autoconf 2.72 is now required to generate :file:`configure`. " "(Contributed by Erlend Aasland in :gh:`115765`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3105 +#: ../../whatsnew/3.14.rst:3114 msgid "" "``wasm32-unknown-emscripten`` is now a :pep:`11` tier 3 platform. " "(Contributed by R. Hood Chatham in :gh:`127146`, :gh:`127683`, and :gh:" "`136931`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3108 +#: ../../whatsnew/3.14.rst:3117 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:3112 +#: ../../whatsnew/3.14.rst:3121 msgid "" "CPython now enables a set of recommended compiler options by default for " "improved security. Use the :option:`--disable-safety` :file:`configure` " @@ -6305,45 +6396,45 @@ msgid "" "larger set of compiler options, albeit with a performance cost." msgstr "" -#: ../../whatsnew/3.14.rst:3118 +#: ../../whatsnew/3.14.rst:3127 msgid "" "The ``WITH_FREELISTS`` macro and ``--without-freelists`` :file:`configure` " "option have been removed." msgstr "" -#: ../../whatsnew/3.14.rst:3121 +#: ../../whatsnew/3.14.rst:3130 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-interpreter` for further details." msgstr "" -#: ../../whatsnew/3.14.rst:3125 +#: ../../whatsnew/3.14.rst:3134 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:3129 +#: ../../whatsnew/3.14.rst:3138 msgid "" "iOS and macOS apps can now be configured to redirect ``stdout`` and " "``stderr`` content to the system log. (Contributed by Russell Keith-Magee " "in :gh:`127592`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3133 +#: ../../whatsnew/3.14.rst:3142 msgid "" "The iOS testbed is now able to stream test output while the test is running. " "The testbed can also be used to run the test suite of projects other than " "CPython itself. (Contributed by Russell Keith-Magee in :gh:`127592`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3142 +#: ../../whatsnew/3.14.rst:3151 msgid ":file:`build-details.json`" msgstr ":file:`build-details.json`" -#: ../../whatsnew/3.14.rst:3144 +#: ../../whatsnew/3.14.rst:3153 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 " @@ -6351,7 +6442,7 @@ msgid "" "cases such as Python launchers, cross-compilation, and so on." msgstr "" -#: ../../whatsnew/3.14.rst:3150 +#: ../../whatsnew/3.14.rst:3159 msgid "" ":file:`build-details.json` must be installed in the platform-independent " "standard library directory. This corresponds to the :ref:`'stdlib' " @@ -6359,17 +6450,17 @@ msgid "" "by running ``sysconfig.get_path('stdlib')``." msgstr "" -#: ../../whatsnew/3.14.rst:3156 +#: ../../whatsnew/3.14.rst:3165 msgid "" ":pep:`739` -- ``build-details.json`` 1.0 -- a static description file for " "Python build details" msgstr "" -#: ../../whatsnew/3.14.rst:3163 +#: ../../whatsnew/3.14.rst:3172 msgid "Discontinuation of PGP signatures" msgstr "" -#: ../../whatsnew/3.14.rst:3165 +#: ../../whatsnew/3.14.rst:3174 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 " @@ -6377,15 +6468,15 @@ msgid "" "sigstore/>`__. Releases have been signed using Sigstore_ since Python 3.11." msgstr "" -#: ../../whatsnew/3.14.rst:3171 +#: ../../whatsnew/3.14.rst:3180 msgid "This change in release process was specified in :pep:`761`." msgstr "" -#: ../../whatsnew/3.14.rst:3179 +#: ../../whatsnew/3.14.rst:3188 msgid "Free-threaded Python is officially supported" msgstr "" -#: ../../whatsnew/3.14.rst:3181 +#: ../../whatsnew/3.14.rst:3190 msgid "" "The free-threaded build of Python is now supported and no longer " "experimental. This is the start of `phase II `__, with free-threading as the default or sole build of Python is " @@ -6416,19 +6507,19 @@ msgid "" "and the community. This decision is for the future." msgstr "" -#: ../../whatsnew/3.14.rst:3201 +#: ../../whatsnew/3.14.rst:3210 msgid ":pep:`779`" msgstr ":pep:`779`" -#: ../../whatsnew/3.14.rst:3203 +#: ../../whatsnew/3.14.rst:3212 msgid "`PEP 779's acceptance `__" msgstr "`PEP 779 的接受 `__" -#: ../../whatsnew/3.14.rst:3209 +#: ../../whatsnew/3.14.rst:3218 msgid "Binary releases for the experimental just-in-time compiler" msgstr "" -#: ../../whatsnew/3.14.rst:3211 +#: ../../whatsnew/3.14.rst:3220 msgid "" "The official macOS and Windows release binaries now include an " "*experimental* just-in-time (JIT) compiler. Although it is **not** " @@ -6438,7 +6529,7 @@ msgid "" "off` configuration option for similar behavior." msgstr "" -#: ../../whatsnew/3.14.rst:3218 +#: ../../whatsnew/3.14.rst:3227 msgid "" "The JIT is at an early stage and still in active development. As such, the " "typical performance impact of enabling it can range from 10% slower to 20% " @@ -6450,7 +6541,7 @@ msgid "" "current process." msgstr "" -#: ../../whatsnew/3.14.rst:3226 +#: ../../whatsnew/3.14.rst:3235 msgid "" "Currently, the most significant missing functionality is that native " "debuggers and profilers like ``gdb`` and ``perf`` are unable to unwind " @@ -6459,83 +6550,83 @@ msgid "" "not support JIT compilation." msgstr "" -#: ../../whatsnew/3.14.rst:3231 +#: ../../whatsnew/3.14.rst:3240 msgid "" "Please report any bugs or major performance regressions that you encounter!" msgstr "" -#: ../../whatsnew/3.14.rst:3233 +#: ../../whatsnew/3.14.rst:3242 msgid ":pep:`744`" msgstr ":pep:`744`" -#: ../../whatsnew/3.14.rst:3237 +#: ../../whatsnew/3.14.rst:3246 msgid "Porting to Python 3.14" msgstr "移植至 Python 3.14" -#: ../../whatsnew/3.14.rst:3239 +#: ../../whatsnew/3.14.rst:3248 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "本節列出了前面描述的更改以及可能需要更改程式碼的其他錯誤修復。" -#: ../../whatsnew/3.14.rst:3244 +#: ../../whatsnew/3.14.rst:3253 msgid "Changes in the Python API" msgstr "Python API 的變更" -#: ../../whatsnew/3.14.rst:3246 +#: ../../whatsnew/3.14.rst:3255 msgid "" "On Unix platforms other than macOS, *forkserver* is now the default :ref:" "`start method ` for :mod:`multiprocessing` " "and :class:`~concurrent.futures.ProcessPoolExecutor`, instead of *fork*." msgstr "" -#: ../../whatsnew/3.14.rst:3250 +#: ../../whatsnew/3.14.rst:3259 msgid "" "See :ref:`(1) ` and :ref:`(2) " "` for details." msgstr "" -#: ../../whatsnew/3.14.rst:3253 +#: ../../whatsnew/3.14.rst:3262 msgid "" "If you encounter :exc:`NameError`\\s or pickling errors coming out of :mod:" "`multiprocessing` or :mod:`concurrent.futures`, see the :ref:`forkserver " "restrictions `." msgstr "" -#: ../../whatsnew/3.14.rst:3257 +#: ../../whatsnew/3.14.rst:3266 msgid "" "This change does not affect Windows or macOS, where :ref:`'spawn' " "` remains the default start method." msgstr "" -#: ../../whatsnew/3.14.rst:3260 +#: ../../whatsnew/3.14.rst:3269 msgid "" ":class:`functools.partial` is now a method descriptor. Wrap it in :func:" "`staticmethod` if you want to preserve the old behavior. (Contributed by " "Serhiy Storchaka and Dominykas Grigonis in :gh:`121027`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3264 +#: ../../whatsnew/3.14.rst:3273 msgid "" "The :ref:`garbage collector is now incremental `, which means that the behavior of :func:`gc.collect` changes slightly:" msgstr "" -#: ../../whatsnew/3.14.rst:3271 +#: ../../whatsnew/3.14.rst:3280 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:3276 +#: ../../whatsnew/3.14.rst:3285 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:3281 +#: ../../whatsnew/3.14.rst:3290 msgid "" "The runtime behavior of annotations has changed in various ways; see :ref:" "`above ` for details. While most code that " @@ -6543,29 +6634,29 @@ msgid "" "details may behave differently." msgstr "" -#: ../../whatsnew/3.14.rst:3286 +#: ../../whatsnew/3.14.rst:3295 msgid "" "As part of making the :mod:`mimetypes` CLI public, it now exits with ``1`` " "on failure instead of ``0`` and ``2`` on incorrect command-line parameters " "instead of ``1``. Error messages are now printed to stderr." msgstr "" -#: ../../whatsnew/3.14.rst:3291 +#: ../../whatsnew/3.14.rst:3300 msgid "" "The ``\\B`` pattern in regular expression now matches the empty string when " "given as the entire pattern, which may cause behavioural changes." msgstr "" -#: ../../whatsnew/3.14.rst:3294 +#: ../../whatsnew/3.14.rst:3303 msgid "" "On FreeBSD, :data:`sys.platform` no longer contains the major version number." msgstr "" -#: ../../whatsnew/3.14.rst:3300 +#: ../../whatsnew/3.14.rst:3309 msgid "Changes in annotations (:pep:`649` and :pep:`749`)" msgstr "" -#: ../../whatsnew/3.14.rst:3302 +#: ../../whatsnew/3.14.rst:3311 msgid "" "This section contains guidance on changes that may be needed to annotations " "or Python code that interacts with or introspects annotations, due to the " @@ -6573,24 +6664,24 @@ msgid "" "deferred-annotations>`." msgstr "" -#: ../../whatsnew/3.14.rst:3307 +#: ../../whatsnew/3.14.rst:3316 msgid "" "In the majority of cases, working code from older versions of Python will " "not require any changes." msgstr "" -#: ../../whatsnew/3.14.rst:3312 +#: ../../whatsnew/3.14.rst:3321 msgid "Implications for annotated code" msgstr "" -#: ../../whatsnew/3.14.rst:3314 +#: ../../whatsnew/3.14.rst:3323 msgid "" "If you define annotations in your code (for example, for use with a static " "type checker), then this change probably does not affect you: you can keep " "writing annotations the same way you did with previous versions of Python." msgstr "" -#: ../../whatsnew/3.14.rst:3318 +#: ../../whatsnew/3.14.rst:3327 msgid "" "You will likely be able to remove quoted strings in annotations, which are " "frequently used for forward references. Similarly, if you use ``from " @@ -6601,11 +6692,11 @@ msgid "" "annotations before they work as expected." msgstr "" -#: ../../whatsnew/3.14.rst:3328 +#: ../../whatsnew/3.14.rst:3337 msgid "Implications for readers of ``__annotations__``" msgstr "" -#: ../../whatsnew/3.14.rst:3330 +#: ../../whatsnew/3.14.rst:3339 msgid "" "If your code reads the :attr:`~object.__annotations__` attribute on objects, " "you may want to make changes in order to support code that relies on " @@ -6614,7 +6705,7 @@ msgid "" "FORWARDREF` format, as the :mod:`dataclasses` module now does." msgstr "" -#: ../../whatsnew/3.14.rst:3337 +#: ../../whatsnew/3.14.rst:3346 msgid "" "The external :pypi:`typing_extensions` package provides partial backports of " "some of the functionality of the :mod:`annotationlib` module, such as the :" @@ -6623,11 +6714,11 @@ msgid "" "that takes advantage of the new behavior in Python 3.14." msgstr "" -#: ../../whatsnew/3.14.rst:3346 +#: ../../whatsnew/3.14.rst:3355 msgid "Related changes" msgstr "" -#: ../../whatsnew/3.14.rst:3348 +#: ../../whatsnew/3.14.rst:3357 msgid "" "The changes in Python 3.14 are designed to rework how :attr:`!" "__annotations__` works at runtime while minimizing breakage to code that " @@ -6639,7 +6730,7 @@ msgid "" "the :mod:`annotationlib` module." msgstr "" -#: ../../whatsnew/3.14.rst:3357 +#: ../../whatsnew/3.14.rst:3366 msgid "" "In particular, do not read annotations directly from the namespace " "dictionary attribute of type objects. Use :func:`annotationlib." @@ -6647,25 +6738,25 @@ msgid "" "`annotationlib.get_annotations` afterwards." msgstr "" -#: ../../whatsnew/3.14.rst:3362 +#: ../../whatsnew/3.14.rst:3371 msgid "" "In previous releases, it was sometimes possible to access class annotations " "from an instance of an annotated class. This behavior was undocumented and " "accidental, and will no longer work in Python 3.14." msgstr "" -#: ../../whatsnew/3.14.rst:3368 +#: ../../whatsnew/3.14.rst:3377 msgid "``from __future__ import annotations``" msgstr "``from __future__ import annotations``" -#: ../../whatsnew/3.14.rst:3370 +#: ../../whatsnew/3.14.rst:3379 msgid "" "In Python 3.7, :pep:`563` introduced the ``from __future__ import " "annotations`` :ref:`future statement `, which turns all annotations " "into strings." msgstr "" -#: ../../whatsnew/3.14.rst:3373 +#: ../../whatsnew/3.14.rst:3382 msgid "" "However, this statement is now deprecated and it is expected to be removed " "in a future version of Python. This removal will not happen until after " @@ -6673,17 +6764,17 @@ msgid "" "Python without support for deferred evaluation of annotations." msgstr "" -#: ../../whatsnew/3.14.rst:3379 +#: ../../whatsnew/3.14.rst:3388 msgid "" "In Python 3.14, the behavior of code using ``from __future__ import " "annotations`` is unchanged." msgstr "" -#: ../../whatsnew/3.14.rst:3384 +#: ../../whatsnew/3.14.rst:3393 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.14.rst:3386 +#: ../../whatsnew/3.14.rst:3395 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 " @@ -6696,14 +6787,14 @@ msgid "" "`113601`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3396 +#: ../../whatsnew/3.14.rst:3405 msgid "" "The :ref:`Unicode Exception Objects ` C API now raises a :" "exc:`TypeError` if its exception argument is not a :exc:`UnicodeError` " "object. (Contributed by Bénédikt Tran in :gh:`127691`.)" msgstr "" -#: ../../whatsnew/3.14.rst:3403 +#: ../../whatsnew/3.14.rst:3412 msgid "" "The interpreter internally avoids some reference count modifications when " "loading objects onto the operands stack by :term:`borrowing