From 29472912af9c7210be543cc8c75a68e55fa89121 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Mon, 31 Jul 2023 08:39:07 +0800 Subject: [PATCH] wip --- whatsnew/3.12.po | 1286 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 1166 insertions(+), 120 deletions(-) diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 733d5754b4..1f78d37c6c 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -1,17 +1,17 @@ -# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2023, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # -#, fuzzy +# Translators: +# Matt Wang , 2023 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-24 00:03+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"POT-Creation-Date: 2023-07-26 16:45+0800\n" +"PO-Revision-Date: 2023-07-31 08:10+0800\n" +"Last-Translator: Matt Wang \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -52,6 +52,8 @@ msgid "" "form. It will be updated substantially as Python 3.12 moves towards release, " "so it's worth checking back even after reading earlier versions." msgstr "" +"預發行版使用者應該知道該文件目前處於草稿形式。隨著 Python 3.12 即將發布,它將" +"進行大幅更新,因此即使在閱讀了早期版本後也值得回顧一下。" #: ../../whatsnew/3.12.rst:61 msgid "Summary -- Release highlights" @@ -63,7 +65,7 @@ msgstr "新增語法特性:" #: ../../whatsnew/3.12.rst:71 msgid ":pep:`701`: Syntactic formalization of f-strings" -msgstr "" +msgstr ":pep:`701`:f 字串的語法形式化" #: ../../whatsnew/3.12.rst:73 msgid "New typing features:" @@ -71,7 +73,7 @@ msgstr "新增型別特性:" #: ../../whatsnew/3.12.rst:75 msgid ":pep:`688`: Making the buffer protocol accessible in Python" -msgstr "" +msgstr ":pep:`688`:使緩衝區協議可在 Python 中被存取" #: ../../whatsnew/3.12.rst:77 msgid ":ref:`whatsnew312-pep692`" @@ -83,15 +85,15 @@ msgstr ":ref:`whatsnew312-pep695`" #: ../../whatsnew/3.12.rst:81 msgid ":pep:`698`: Override Decorator for Static Typing" -msgstr "" +msgstr ":pep:`698`:覆蓋靜態型別的裝飾器" #: ../../whatsnew/3.12.rst:83 msgid "Important deprecations, removals or restrictions:" -msgstr "" +msgstr "重要的棄用、刪除或限制:" #: ../../whatsnew/3.12.rst:85 msgid ":pep:`623`: Remove wstr from Unicode" -msgstr "" +msgstr ":pep:`623`: 從 Unicode 中刪除 wstr" #: ../../whatsnew/3.12.rst:87 msgid "" @@ -99,19 +101,25 @@ msgid "" "`_ for advice on its " "replacement." msgstr "" +":pep:`632`: 刪除 ``distutils`` 套件。有關其替換的建議,請參閱\\ `遷移指南 " +"`_。" #: ../../whatsnew/3.12.rst:92 msgid "Improved Error Messages" -msgstr "" +msgstr "改進的錯誤訊息" #: ../../whatsnew/3.12.rst:94 +#, fuzzy msgid "" "Modules from the standard library are now potentially suggested as part of " "the error messages displayed by the interpreter when a :exc:`NameError` is " "raised to the top level. Contributed by Pablo Galindo in :gh:`98254`." msgstr "" +"當 :exc:`NameError` 提升到頂層時,標準庫中的模組現在可能會被建議作為直譯器顯" +"示的錯誤訊息的一部分。由 Pablo Galindo 在 :gh:`98254` 中貢獻。" #: ../../whatsnew/3.12.rst:103 +#, fuzzy msgid "" "Improve the error suggestion for :exc:`NameError` exceptions for instances. " "Now if a :exc:`NameError` is raised in a method and the instance has an " @@ -119,6 +127,9 @@ msgid "" "will include ``self.`` instead of the closest match in the method " "scope. Contributed by Pablo Galindo in :gh:`99139`." msgstr "" +"改進實例的 NameError 例外的錯誤建議。現在,如果在方法中引發 NameError 並且實" +"例具有與例外中的名稱完全相同的屬性,則建議將包含 ``self.`` 而不是方法範" +"圍。由 Pablo Galindo 在 :gh:`99139` 中貢獻。" #: ../../whatsnew/3.12.rst:124 msgid "" @@ -126,6 +137,8 @@ msgid "" "from y`` instead of ``from y import x``. Contributed by Pablo Galindo in :gh:" "`98931`." msgstr "" +"改進當使用者鍵入 ``import x from y`` 而不是 ``from y import x`` 時出現的 :" +"exc:`SyntaxError` 錯誤訊息。由 Pablo Galindo 在 :gh:`98931` 中貢獻。" #: ../../whatsnew/3.12.rst:134 msgid "" @@ -134,6 +147,9 @@ msgid "" "based on the available names in ````. Contributed by Pablo Galindo " "in :gh:`91058`." msgstr "" +"``from import `` 陳述式引發的 :exc:`ImportError` 例外現在包含" +"基於 ```` 中可用名稱的 ```` 值的建議。由 Pablo Galindo 在 :gh:" +"`91058` 中貢獻。" #: ../../whatsnew/3.12.rst:145 ../../whatsnew/3.12.rst:1594 msgid "New Features" @@ -141,9 +157,10 @@ msgstr "新增特性" #: ../../whatsnew/3.12.rst:150 msgid "PEP 701: Syntactic formalization of f-strings" -msgstr "" +msgstr "PEP 701:f 字串的語法形式化" #: ../../whatsnew/3.12.rst:152 +#, fuzzy msgid "" ":pep:`701` lifts some restrictions on the usage of f-strings. Expression " "components inside f-strings can now be any valid Python expression including " @@ -151,30 +168,45 @@ msgid "" "strings reusing the same quote as the containing f-string. Let's cover these " "in detail:" msgstr "" +":pep:`701` 取消了對 f 字串使用的一些限制。 f 字串內的表達式組件現在可以是任何" +"有效的 Python 表達式,包括反斜杠、unicode 轉義序列、多行表達式、註釋和重複使" +"用與包含 f 字串相同的引號的字串。讓我們詳細介紹一下這些內容:" #: ../../whatsnew/3.12.rst:157 +#, fuzzy msgid "" "Quote reuse: in Python 3.11, reusing the same quotes as the containing f-" "string raises a :exc:`SyntaxError`, forcing the user to either use other " "available quotes (like using double quotes or triple quotes if the f-string " "uses single quotes). In Python 3.12, you can now do things like this:" msgstr "" +"引號重用:在 Python 3.11 中,重用與包含 f 字串相同的引號會引發 SyntaxError," +"強制使用者使用其他可用引號(例如,如果 f 字串使用單引號,則使用雙引號或三引" +"號)引號)。在 Python 3.12 中,你現在可以執行以下操作:" #: ../../whatsnew/3.12.rst:166 +#, fuzzy msgid "" "Note that before this change there was no explicit limit in how f-strings " "can be nested, but the fact that string quotes cannot be reused inside the " "expression component of f-strings made it impossible to nest f-strings " "arbitrarily. In fact, this is the most nested f-string that could be written:" msgstr "" +"請注意,在此更改之前,對於如何嵌套 f 字串沒有明確的限制,但事實上字串引號不能" +"在 f 字串的表達式組件內重複使用,因此無法任意嵌套 f 字串。事實上,這是可以編" +"寫的最嵌套的 f 字串:" #: ../../whatsnew/3.12.rst:174 +#, fuzzy msgid "" "As now f-strings can contain any valid Python expression inside expression " "components, it is now possible to nest f-strings arbitrarily:" msgstr "" +"由於現在 f 字串可以在表達式組件內包含任何有效的 Python 表達式,因此現在可以任" +"意嵌套 f 字串:" #: ../../whatsnew/3.12.rst:180 +#, fuzzy msgid "" "Multi-line expressions and comments: In Python 3.11, f-strings expressions " "must be defined in a single line even if outside f-strings expressions could " @@ -182,8 +214,12 @@ msgid "" "making them harder to read. In Python 3.12 you can now define expressions " "spanning multiple lines and include comments on them:" msgstr "" +"多行表達式和註釋:在 Python 3.11 中,f 字串表達式必須在單行中定義,即使外部 " +"f 字串表達式可以跨越多行(如在多行上定義的文字串列),從而使它們更難以閱讀。" +"在 Python 3.12 中,你現在可以定義跨多行的表達式並在其中包含註釋:" #: ../../whatsnew/3.12.rst:193 +#, fuzzy msgid "" "Backslashes and unicode characters: before Python 3.12 f-string expressions " "couldn't contain any ``\\`` character. This also affected unicode escaped " @@ -191,12 +227,17 @@ msgid "" "previously could not be part of expression components of f-strings. Now, you " "can define expressions like this:" msgstr "" +"反斜杠和 unicode 字元:在 Python 3.12 之前,f 字串表達式不能包含任何 ``\\`` " +"字元。這也影響了 unicode 轉義序列(例如 ``\\N{snowman}``),因為這些序列包含 " +"``\\N``部分,而該部分以前不能是 f 字串的表達式組件的一部分。現在,你可以像這" +"樣定義表達式:" #: ../../whatsnew/3.12.rst:206 msgid "See :pep:`701` for more details." msgstr "詳情請見 :pep:`701`。" #: ../../whatsnew/3.12.rst:208 +#, fuzzy msgid "" "As a positive side-effect of how this feature has been implemented (by " "parsing f-strings with the PEG parser (see :pep:`617`), now error messages " @@ -204,25 +245,36 @@ msgid "" "For example, in Python 3.11, the following f-string raises a :exc:" "`SyntaxError`:" msgstr "" +"作為如何實作此功能的積極副作用(通過使用 PEG 剖析器剖析 f 字串(請參閱:pep:" +"`617`),現在 f 字串的錯誤訊息更加精確,並且包括錯誤。例如,在 Python 3.11 " +"中,以下 f 字串會引發 SyntaxError:" #: ../../whatsnew/3.12.rst:221 +#, fuzzy msgid "" "but the error message doesn't include the exact location of the error within " "the line and also has the expression artificially surrounded by parentheses. " "In Python 3.12, as f-strings are parsed with the PEG parser, error messages " "can be more precise and show the entire line:" msgstr "" +"但錯誤訊息不包括行內錯誤的確切位置,並且還人為地將表達式用括號括起來。在 " +"Python 3.12 中,由於使用 PEG 剖析器剖析 f 字串,因此錯誤訊息可以更精確並顯示" +"整行:" #: ../../whatsnew/3.12.rst:233 +#, fuzzy msgid "" "(Contributed by Pablo Galindo, Batuhan Taskaya, Lysandros Nikolaou, Cristián " "Maureira-Fredes and Marta Gómez in :gh:`102856`. PEP written by Pablo " "Galindo, Batuhan Taskaya, Lysandros Nikolaou and Marta Gómez)." msgstr "" +"(由 Pablo Galindo、Batuhan Taskaya、Lysandros Nikolaou、Cristián Maureira-" +"Fredes 和 Marta Gómez 在 :gh:`102856` 中貢獻。PEP 由 Pablo Galindo、Batuhan " +"Taskaya、Lysandros Nikolaou 和 Marta Gómez 編寫)。" #: ../../whatsnew/3.12.rst:240 msgid "PEP 709: Comprehension inlining" -msgstr "" +msgstr "PEP 709:綜合運算的內聯" #: ../../whatsnew/3.12.rst:242 msgid "" @@ -230,33 +282,45 @@ msgid "" "creating a new single-use function object for each execution of the " "comprehension. This speeds up execution of a comprehension by up to 2x." msgstr "" +"字典、串列和集合綜合運算現在是內聯的,而不是為綜合運算的每次執行建立一個新的" +"一次性函式物件。這將綜合運算的執行速度提高了 2 倍。" #: ../../whatsnew/3.12.rst:246 +#, fuzzy msgid "" "Comprehension iteration variables remain isolated; they don't overwrite a " "variable of the same name in the outer scope, nor are they visible after the " "comprehension. This isolation is now maintained via stack/locals " "manipulation, not via separate function scope." msgstr "" +"理解疊代變數保持孤立;它們不會覆蓋外部作用域中的同名變數,並且在理解後也不可" +"見。現在,這種隔離是通過堆疊/局部變數操作來維護的,而不是通過單獨的函式作用" +"域。" #: ../../whatsnew/3.12.rst:251 msgid "Inlining does result in a few visible behavior changes:" -msgstr "" +msgstr "內聯確實會導致一些明顯的行為變更:" #: ../../whatsnew/3.12.rst:253 +#, fuzzy msgid "" "There is no longer a separate frame for the comprehension in tracebacks, and " "tracing/profiling no longer shows the comprehension as a function call." msgstr "" +"回溯中不再有用於理解的單獨框架,並且跟踪/分析不再將理解顯示為函式呼叫。" #: ../../whatsnew/3.12.rst:255 +#, fuzzy msgid "" "Calling :func:`locals` inside a comprehension now includes variables from " "outside the comprehension, and no longer includes the synthetic ``.0`` " "variable for the comprehension \"argument\"." msgstr "" +"現在,在綜合運算內呼叫 :func:`locals` 包含來自綜合運算外部的變數,並且不再包" +"含用於綜合運算 ``參數``的合成 ``.0`` 變數。" #: ../../whatsnew/3.12.rst:258 +#, fuzzy msgid "" "A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " "locals()]``) may see \"RuntimeError: dictionary changed size during " @@ -265,70 +329,89 @@ msgid "" "error, first create a list of keys to iterate over: ``keys = list(locals()); " "[k for k in keys]``." msgstr "" +"當在跟踪下運行時(例如程式碼覆蓋率測量),直接疊代 ``locals()``(例如 ``[k " +"for k in locals()]``)的理解可能會看到 ``運行時錯誤:疊代期間字典改變了大小" +"``。這與在例如中已經看到的行為相同。 ``for k in locals():``.為了避免錯誤,首" +"先建立一個要疊代的鍵串列:``keys = list(locals()); [k 代表鍵中的 k]``。" #: ../../whatsnew/3.12.rst:265 msgid "Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`." -msgstr "" +msgstr "由 Carl Meyer 和 Vladimir Matveev 在 :pep:`709` 中貢獻。" #: ../../whatsnew/3.12.rst:268 msgid "PEP 688: Making the buffer protocol accessible in Python" -msgstr "" +msgstr "PEP 688:使緩衝區協議可在 Python 中存取" #: ../../whatsnew/3.12.rst:270 +#, fuzzy msgid "" ":pep:`688` introduces a way to use the :ref:`buffer protocol " "` from Python code. Classes that implement the :meth:`~object." "__buffer__` method are now usable as buffer types." msgstr "" +":pep:`688` 引入了一種從 Python 程式碼使用 :ref:`緩衝區協議 ` " +"的方法。實作 :meth:`~object.__buffer__` 方法的類現在可用作緩衝區型別。" #: ../../whatsnew/3.12.rst:274 +#, fuzzy msgid "" "The new :class:`collections.abc.Buffer` ABC provides a standard way to " "represent buffer objects, for example in type annotations. The new :class:" "`inspect.BufferFlags` enum represents the flags that can be used to " "customize buffer creation. (Contributed by Jelle Zijlstra in :gh:`102500`.)" msgstr "" +"新的collections.abc.Buffer ABC提供了一種表示緩衝區物件的標準方法,例如在型別" +"註釋中。新的 inspect.BufferFlags 列舉表示可用於自定義緩衝區建立的旗標。 (由 " +"Jelle Zijlstra 在 :gh:`102500` 中貢獻。)" #: ../../whatsnew/3.12.rst:281 msgid "New Features Related to Type Hints" -msgstr "" +msgstr "與型別提示相關的新功能" #: ../../whatsnew/3.12.rst:283 msgid "" "This section covers major changes affecting :pep:`484` type hints and the :" "mod:`typing` module." -msgstr "" +msgstr "本節介紹影響 :pep:`484` 型別提示和 :mod:`typing` 模組的主要變更。" #: ../../whatsnew/3.12.rst:289 msgid "PEP 692: Using ``TypedDict`` for more precise ``**kwargs`` typing" -msgstr "" +msgstr "PEP 692:使用 ``TypedDict`` 進行更精確的 ``**kwargs`` 型別註釋" #: ../../whatsnew/3.12.rst:291 +#, fuzzy msgid "" "Typing ``**kwargs`` in a function signature as introduced by :pep:`484` " "allowed for valid annotations only in cases where all of the ``**kwargs`` " "were of the same type." msgstr "" +"在 :pep:`484` 引入的函式簽名中鍵入 ``**kwargs``僅在所有 ``**kwargs``屬於同一" +"型別的情況下才允許有效註釋。" #: ../../whatsnew/3.12.rst:295 +#, fuzzy msgid "" "This PEP specifies a more precise way of typing ``**kwargs`` by relying on " "typed dictionaries::" msgstr "" +"此 PEP 指定了一種更精確的方式,通過依賴型別化字典來輸入 ``**kwargs``:\n" +"\n" +"::" #: ../../whatsnew/3.12.rst:306 msgid "See :pep:`692` for more details." -msgstr "" +msgstr "有關更多詳細資訊,請參閱 :pep:`692`。" #: ../../whatsnew/3.12.rst:308 msgid "(Contributed by Franek Magiera in :gh:`103629`.)" -msgstr "" +msgstr "(由 Franek Magiera 在 :gh:`103629` 中貢獻。)" #: ../../whatsnew/3.12.rst:311 msgid "PEP 698: Override Decorator for Static Typing" -msgstr "" +msgstr "PEP 698:覆蓋靜態型別的裝飾器" #: ../../whatsnew/3.12.rst:313 +#, fuzzy msgid "" "A new decorator :func:`typing.override` has been added to the :mod:`typing` " "module. It indicates to type checkers that the method is intended to " @@ -336,60 +419,91 @@ msgid "" "mistakes where a method that is intended to override something in a base " "class does not in fact do so." msgstr "" +"一個新的裝飾器 :func:`typing.override` 已新增到 :mod:`typing` 模組中。它向型" +"別檢查器指示該方法旨在重寫超類中的方法。這允許型別檢查器捕獲錯誤,其中旨在重" +"寫基底類別中某些內容的方法實際上並未這樣做。" #: ../../whatsnew/3.12.rst:319 msgid "Example::" msgstr "" +"例子:\n" +"\n" +"::" #: ../../whatsnew/3.12.rst:337 msgid "(Contributed by Steven Troxler in :gh:`101561`.)" -msgstr "" +msgstr "(由 Steven Troxler 在 :gh:`101561` 中貢獻。)" #: ../../whatsnew/3.12.rst:342 msgid "PEP 695: Type Parameter Syntax" -msgstr "" +msgstr "PEP 695:型別參數語法" #: ../../whatsnew/3.12.rst:344 +#, fuzzy msgid "" "Generic classes and functions under :pep:`484` were declared using a verbose " "syntax that left the scope of type parameters unclear and required explicit " "declarations of variance." msgstr "" +"484 下的泛型類和函式是使用冗長的語法聲明的,這使得型別參數的範圍不明確,並且" +"需要顯式的方差聲明。" #: ../../whatsnew/3.12.rst:348 +#, fuzzy msgid "" ":pep:`695` introduces a new, more compact and explicit way to create :ref:" "`generic classes ` and :ref:`functions `::" msgstr "" +":pep:`695` 引入了一種新的、更緊湊和顯式的方法來建立 :ref:`泛型類 ` 和 :ref:`函式 `:\n" +"\n" +"::" #: ../../whatsnew/3.12.rst:361 +#, fuzzy msgid "" "In addition, the PEP introduces a new way to declare :ref:`type aliases " "` using the :keyword:`type` statement, which creates an " "instance of :class:`~typing.TypeAliasType`::" msgstr "" +"此外,PEP 引入了一種使用 type 語句聲明型別別名 ` 的新方法,該方" +"法建立:class:`~typing.TypeAliasType`:\n" +"\n" +"::" #: ../../whatsnew/3.12.rst:367 msgid "Type aliases can also be :ref:`generic `::" msgstr "" +"型別別名也可以是\\ :ref:`泛型 `:\n" +"\n" +"::" #: ../../whatsnew/3.12.rst:371 +#, fuzzy msgid "" "The new syntax allows declaring :class:`~typing.TypeVarTuple` and :class:" "`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " "parameters with bounds or constraints::" msgstr "" +"新語法允許聲明 :class:`~typing.TypeVarTuple` 和 :class:`~typing.ParamSpec` 參" +"數,以及帶有邊界或約束的 :class:`~typing.TypeVar` 參數:\n" +"\n" +"::" #: ../../whatsnew/3.12.rst:380 +#, fuzzy msgid "" "The value of type aliases and the bound and constraints of type variables " "created through this syntax are evaluated only on demand (see :ref:`lazy-" "evaluation`). This means type aliases are able to refer to other types " "defined later in the file." msgstr "" +"型別別名的值以及通過此語法建立的型別變數的綁定和約束僅根據需要進行評估(請參" +"閱惰性評估)。這意味著型別別名可以引用文件中稍後定義的其他型別。" #: ../../whatsnew/3.12.rst:385 +#, fuzzy msgid "" "Type parameters declared through a type parameter list are visible within " "the scope of the declaration and any nested scopes, but not in the outer " @@ -398,8 +512,13 @@ msgid "" "module scope after the class is defined. See :ref:`type-params` for a " "detailed description of the runtime semantics of type parameters." msgstr "" +"通過型別參數串列聲明的型別參數在聲明範圍和任何嵌套範圍內可見,但在外部範圍內" +"不可見。例如,它們可以用在泛型類方法的型別註釋中或類主體中。但是,在定義類" +"後,它們不能在模組範圍內使用。有關型別參數的運行時語義的詳細描述,請參閱 " +"type-params。" #: ../../whatsnew/3.12.rst:392 +#, fuzzy msgid "" "In order to support these scoping semantics, a new kind of scope is " "introduced, the :ref:`annotation scope `. Annotation " @@ -407,6 +526,10 @@ msgid "" "differently with enclosing class scopes. In Python 3.13, :term:`annotations " "` will also be evaluated in annotation scopes." msgstr "" +"為了支援這些作用域語義,引入了一種新的作用域,即 :ref:`註釋作用域 " +"`。註釋作用域的行為在很大程度上類似於函式作用域,但與封閉" +"類作用域的交互方式不同。在 Python 3.13 中,註釋 ` 也將在註釋範圍" +"內進行評估。" #: ../../whatsnew/3.12.rst:398 msgid "See :pep:`695` for more details." @@ -417,12 +540,15 @@ msgid "" "(PEP written by Eric Traut. Implementation by Jelle Zijlstra, Eric Traut, " "and others in :gh:`103764`.)" msgstr "" +"(PEP 由 Eric Traut 編寫。由 Jelle Zijlstra、Eric Traut 等人在 :gh:`103764` " +"中實作。)" #: ../../whatsnew/3.12.rst:404 msgid "Other Language Changes" msgstr "其他語言更動" #: ../../whatsnew/3.12.rst:406 +#, fuzzy msgid "" "Add :ref:`perf_profiling` through the new environment variable :envvar:" "`PYTHONPERFSUPPORT`, the new command-line option :option:`-X perf <-X>`, as " @@ -432,8 +558,15 @@ msgid "" "Heimes with contributions from Gregory P. Smith [Google] and Mark Shannon " "in :gh:`96123`.)" msgstr "" +"通過新的環境變數:envvar:`PYTHONPERFSUPPORT`、新的命令列選項:option:`-X perf " +"<-X>`以及新的:func:`sys.activate_stack_trampoline 新增:ref:`perf_profiling` " +"`、:func:`sys.deactivate_stack_trampoline` 和 :func:`sys." +"is_stack_trampoline_active` API。 (由 Pablo Galindo 設計。由 Pablo Galindo " +"和 Christian Heimes 貢獻,Gregory P. Smith [Google] 和 Mark Shannon 在 :gh:" +"`96123` 中也有貢獻。)" #: ../../whatsnew/3.12.rst:416 +#, fuzzy msgid "" "The extraction methods in :mod:`tarfile`, and :func:`shutil.unpack_archive`, " "have a new a *filter* argument that allows limiting tar features than may be " @@ -442,33 +575,50 @@ msgid "" "the default will switch to ``'data'``. (Contributed by Petr Viktorin in :pep:" "`706`.)" msgstr "" +"tarfile 和 shutdown.unpack_archive 中的提取方法有一個新的 *filter* 參數,該參" +"數允許限制可能令人驚訝或危險的 tar 功能,例如在目標目錄之外建立文件。有關詳細" +"資訊,請參閱:ref:`tarfile-extraction-filter`。在Python 3.14中,預設將切換為" +"``'data'``。 (由 Petr Viktorin 在 :pep:`706` 中貢獻。)" #: ../../whatsnew/3.12.rst:424 +#, fuzzy msgid "" ":class:`types.MappingProxyType` instances are now hashable if the underlying " "mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" msgstr "" +"如果底層映射是可散列的,則 types.MappingProxyType` 實例現在是可散列的。 (由 " +"Serhiy Storchaka 在 :gh:`87995` 中貢獻。)" #: ../../whatsnew/3.12.rst:428 +#, fuzzy msgid "" ":class:`memoryview` now supports the half-float type (the \"e\" format " "code). (Contributed by Dong-hee Na and Antoine Pitrou in :gh:`90751`.)" msgstr "" +"memoryview 現在支援半浮點型別(\"e\" 格式程式碼)。 (由 Dong-hee Na 和 " +"Antoine Pitrou 在 :gh:`90751` 中貢獻。)" #: ../../whatsnew/3.12.rst:431 +#, fuzzy msgid "" "The parser now raises :exc:`SyntaxError` when parsing source code containing " "null bytes. (Contributed by Pablo Galindo in :gh:`96670`.)" msgstr "" +"現在,剖析器在剖析包含空位元組的源程式碼時會引發 SyntaxError。 (由 Pablo " +"Galindo 在 :gh:`96670` 中貢獻。)" #: ../../whatsnew/3.12.rst:434 +#, fuzzy msgid "" ":func:`ast.parse` now raises :exc:`SyntaxError` instead of :exc:`ValueError` " "when parsing source code containing null bytes. (Contributed by Pablo " "Galindo in :gh:`96670`.)" msgstr "" +"現在,在剖析包含空位元組的源程式碼時,ast.parse 會引發 SyntaxError,而不是 " +"ValueError。 (由 Pablo Galindo 在 :gh:`96670` 中貢獻。)" #: ../../whatsnew/3.12.rst:438 +#, fuzzy msgid "" "The Garbage Collector now runs only on the eval breaker mechanism of the " "Python bytecode evaluation loop instead of object allocations. The GC can " @@ -477,8 +627,13 @@ msgid "" "chance to execute the GC periodically. (Contributed by Pablo Galindo in :gh:" "`97922`.)" msgstr "" +"垃圾收集器現在僅在 Python 位元組碼評估循環的 eval 斷路器機制上運行,而不是在" +"物件分配上運行。 GC 也可以在呼叫 PyErr_CheckSignals 時運行,因此需要長時間運" +"行而不執行任何 Python 程式碼的 C 擴充也有機會定期執行 GC。 (由 Pablo " +"Galindo 在 :gh:`97922` 中貢獻。)" #: ../../whatsnew/3.12.rst:445 +#, fuzzy msgid "" "A backslash-character pair that is not a valid escape sequence now generates " "a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " @@ -488,14 +643,25 @@ msgid "" "exc:`SyntaxError` will eventually be raised, instead of :exc:" "`SyntaxWarning`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" +"不是有效轉義序列的反斜杠字元對現在會生成 SyntaxWarning,而不是 " +"DeprecationWarning。例如,``re.compile(\"\\d+\\.\\d+\")`` 現在發出一個 :exc:" +"`SyntaxWarning` (``\"\\d\"`` 是無效的轉義序列),使用原始字串進行常規表達" +"式:``re.compile(r\"\\d+\\.\\d+\")``。在未來的 Python 版本中,最終將引發 " +"SyntaxError,而不是 SyntaxWarning。 (由 Victor Stinner 在 :gh:`98401` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:454 +#, fuzzy msgid "" "Octal escapes with value larger than ``0o377`` (ex: ``\"\\477\"``), " "deprecated in Python 3.11, now produce a :exc:`SyntaxWarning`, instead of :" "exc:`DeprecationWarning`. In a future Python version they will be eventually " "a :exc:`SyntaxError`. (Contributed by Victor Stinner in :gh:`98401`.)" msgstr "" +"值大於 ``0o377`` 的八進位轉義符(例如:``\"\\477\"``)在 Python 3.11 中已棄" +"用,現在會生成:exc:`SyntaxWarning`,而不是:exc:`DeprecationWarning`。在未來" +"的 Python 版本中,它們最終將成為 SyntaxError。 (由 Victor Stinner 在 :gh:" +"`98401` 中貢獻。)" #: ../../whatsnew/3.12.rst:460 msgid "" @@ -503,8 +669,11 @@ msgid "" "arguments of any type instead of just :class:`bool` and :class:`int`. " "(Contributed by Serhiy Storchaka in :gh:`60203`.)" msgstr "" +"所有需要布林參數的內建和擴充可呼叫物件現在接受任何型別的參數,而不僅僅是 :" +"class:`bool` 和 :class:`int`。(由 Serhiy Storchaka 在 :gh:`60203` 中貢獻。)" #: ../../whatsnew/3.12.rst:464 +#, fuzzy msgid "" "Variables used in the target part of comprehensions that are not stored to " "can now be used in assignment expressions (``:=``). For example, in ``[(b := " @@ -513,6 +682,10 @@ msgid "" "comprehensions (like ``a``) is still disallowed, as per :pep:`572`. " "(Contributed by Nikita Sobolev in :gh:`100581`.)" msgstr "" +"綜合運算目標部分中使用的未存儲的變數現在可以在賦值表達式中使用 (``:=``)。例" +"如,在``[(b := 1) for a, b.prop in some_iter]``中,現在允許對``b``進行賦值。" +"請注意,根據 :pep:`572` ,仍然不允許對存儲在綜合運算目標部分中的變數進行賦值" +"(如 ``a``)。 (由 Nikita Sobolev 在 :gh:`100581` 中貢獻。)" #: ../../whatsnew/3.12.rst:471 msgid "" @@ -520,50 +693,66 @@ msgid "" "keys and set items. (Contributed by Will Bradshaw, Furkan Onder, and Raymond " "Hettinger in :gh:`101264`.)" msgstr "" +":class:`slice` 物件現在是可雜湊的,允許它們作為字典的鍵和集合的項。(由 Will " +"Bradshaw、Furkan Onder 和 Raymond Hettinger 在 :gh:`101264` 中貢獻。)" #: ../../whatsnew/3.12.rst:474 +#, fuzzy msgid "" ":func:`sum` now uses Neumaier summation to improve accuracy when summing " "floats or mixed ints and floats. (Contributed by Raymond Hettinger in :gh:" "`100425`.)" msgstr "" +":func:`sum` 現在使用 Neumaier 求和來提高對浮點數或混合整數和浮點數求和時的準" +"確性。 (由 Raymond Hettinger 在 :gh:`100425` 中貢獻。)" #: ../../whatsnew/3.12.rst:478 +#, fuzzy msgid "" "Exceptions raised in a typeobject's ``__set_name__`` method are no longer " "wrapped by a :exc:`RuntimeError`. Context information is added to the " "exception as a :pep:`678` note. (Contributed by Irit Katriel in :gh:`77757`.)" msgstr "" +"在型別物件的 __set_name__ 方法中引發的例外不再由 :exc:`RuntimeError` 包裝。情" +"境資訊作為 :pep:`678` 註釋新增到例外中。 (由 Irit Katriel 在 :gh:`77757` 中" +"貢獻。)" #: ../../whatsnew/3.12.rst:482 +#, fuzzy msgid "" "When a ``try-except*`` construct handles the entire :exc:`ExceptionGroup` " "and raises one other exception, that exception is no longer wrapped in an :" "exc:`ExceptionGroup`. Also changed in version 3.11.4. (Contributed by Irit " "Katriel in :gh:`103590`.)" msgstr "" +"當 ``try- except*`` 構造處理整個 :exc:`ExceptionGroup` 並引發另一個例外時,該" +"例外不再包裝在 :exc:`ExceptionGroup` 中。在 3.11.4 版本中也進行了更改。 (由 " +"Irit Katriel 在 :gh:`103590` 中貢獻。)" #: ../../whatsnew/3.12.rst:489 msgid "New Modules" -msgstr "" +msgstr "新模組" #: ../../whatsnew/3.12.rst:491 msgid "None." -msgstr "" +msgstr "還沒有任何新模組。" #: ../../whatsnew/3.12.rst:495 msgid "Improved Modules" -msgstr "" +msgstr "模組的改進" #: ../../whatsnew/3.12.rst:498 msgid "array" msgstr "array" #: ../../whatsnew/3.12.rst:500 +#, fuzzy msgid "" "The :class:`array.array` class now supports subscripting, making it a :term:" "`generic type`. (Contributed by Jelle Zijlstra in :gh:`98658`.)" msgstr "" +":class:`array.array` 類別現在支援下標,使其成為通用型別。 (由 Jelle " +"Zijlstra 在 :gh:`98658` 中貢獻。)" #: ../../whatsnew/3.12.rst:504 msgid "asyncio" @@ -576,6 +765,9 @@ msgid "" "writing to sockets and uses :meth:`~socket.socket.sendmsg` if the platform " "supports it. (Contributed by Kumar Aditya in :gh:`91166`.)" msgstr "" +"asyncio 中寫入 socket 的性能得到了顯著提高。``asyncio`` 現在可以避免在寫入 " +"socket 時進行不必要的複製,並在平台支援的情況下使用 :meth:`~socket.socket." +"sendmsg`。(由 Kumar Aditya 在 :gh:`91166` 中貢獻。)" #: ../../whatsnew/3.12.rst:511 msgid "" @@ -584,6 +776,10 @@ msgid "" "eager task execution, making some use-cases 2x to 5x faster. (Contributed by " "Jacob Bower & Itamar O in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" msgstr "" +"新增了 :func:`asyncio.eager_task_factory` 和 :func:`asyncio." +"create_eager_task_factory` 函式,以允許選擇事件循環 (event loop) 來執行急切任" +"務,使某些用例中速度提高 2 到 5 倍。(由 Jacob Bower 和 Itamar O 在 :gh:" +"`102853`、:gh:`104140` 和 :gh:`104138` 中貢獻)" #: ../../whatsnew/3.12.rst:516 msgid "" @@ -592,8 +788,12 @@ msgid "" "`~asyncio.ThreadedChildWatcher`. (Contributed by Kumar Aditya in :gh:" "`98024`.)" msgstr "" +"在 Linux 上,如果 :func:`os.pidfd_open` 可用且運作正常,則 :mod:`asyncio` 預" +"設使用 :class:`~asyncio.PidfdChildWatcher` 而不是 :class:`~asyncio." +"ThreadedChildWatcher`。(由 Kumar Aditya 在 :gh:`98024` 中貢獻。)" #: ../../whatsnew/3.12.rst:521 +#, fuzzy msgid "" "The child watcher classes :class:`~asyncio.MultiLoopChildWatcher`, :class:" "`~asyncio.FastChildWatcher`, :class:`~asyncio.AbstractChildWatcher` and :" @@ -604,39 +804,59 @@ msgid "" "ThreadedChildWatcher` otherwise). (Contributed by Kumar Aditya in :gh:" "`94597`.)" msgstr "" +"子觀察器類 :class:`~asyncio.MultiLoopChildWatcher`、:class:`~asyncio." +"FastChildWatcher`、:class:`~asyncio.AbstractChildWatcher` 和 :class:" +"`~asyncio.SafeChildWatcher` 已棄用,並將在Python 3.14。建議不要手動配置子觀察" +"程序,因為事件循環現在使用每個平台的最佳可用子觀察程序(如果支援,則為:" +"class:`~asyncio.PidfdChildWatcher`,否則為:class:`~asyncio." +"ThreadedChildWatcher`)。 (由 Kumar Aditya 在 :gh:`94597` 中貢獻。)" #: ../../whatsnew/3.12.rst:530 +#, fuzzy msgid "" ":func:`asyncio.set_child_watcher`, :func:`asyncio.get_child_watcher`, :meth:" "`asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`asyncio." "AbstractEventLoopPolicy.get_child_watcher` are deprecated and will be " "removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" +":func:`asyncio.set_child_watcher`、:func:`asyncio.get_child_watcher`、:meth:" +"`asyncio.AbstractEventLoopPolicy.set_child_watcher` 和:meth:`asyncio." +"AbstractEventLoopPolicy.get_child_watcher` 已棄用,並將在 Python 3.14 中刪" +"除。 (由 Kumar Aditya 在 :gh:`94597` 中貢獻。)" #: ../../whatsnew/3.12.rst:536 msgid "" "Add *loop_factory* parameter to :func:`asyncio.run` to allow specifying a " "custom event loop factory. (Contributed by Kumar Aditya in :gh:`99388`.)" msgstr "" +":func:`asyncio.run` 新增 *loop_factory* 參數以允許指定自定義事件循環工廠函" +"式。(由 Kumar Aditya 在 :gh:`99388` 中貢獻。)" #: ../../whatsnew/3.12.rst:540 msgid "" "Add C implementation of :func:`asyncio.current_task` for 4x-6x speedup. " "(Contributed by Itamar Ostricher and Pranav Thulasiram Bhat in :gh:`100344`.)" msgstr "" +"新增 :func:`asyncio.current_task` 的 C 實作並得到了 4-6 倍的加速。(由 " +"Itamar Ostrcher 和 Pranav Thulasiram Bhat 在 :gh:`100344` 中貢獻。)" #: ../../whatsnew/3.12.rst:543 +#, fuzzy msgid "" ":func:`asyncio.iscoroutine` now returns ``False`` for generators as :mod:" "`asyncio` does not support legacy generator-based coroutines. (Contributed " "by Kumar Aditya in :gh:`102748`.)" msgstr "" +":func:`asyncio.iscoroutine` 現在為產生器回傳 ``False`` ,因為 :mod:`asyncio` " +"不支援傳統的基於產生器的協程。 (由 Kumar Aditya 在 :gh:`102748` 中貢獻。)" #: ../../whatsnew/3.12.rst:547 msgid "" ":func:`asyncio.wait` and :func:`asyncio.as_completed` now accepts generators " "yielding tasks. (Contributed by Kumar Aditya in :gh:`78530`.)" msgstr "" +":func:`asyncio.wait` 和 :func:`asyncio.as_completed` 現在接受使用產生器來生成" +"任務。(由 Kumar Aditya 在 :gh:`78530` 中貢獻。)" #: ../../whatsnew/3.12.rst:552 msgid "calendar" @@ -647,6 +867,8 @@ msgid "" "Add enums :data:`~calendar.Month` and :data:`~calendar.Day`. (Contributed by " "Prince Roshan in :gh:`103636`.)" msgstr "" +"新增列舉 :data:`~calendar.Month` 和 :data:`~calendar.Day`。(由 Prince " +"Roshan 在 :gh:`103636` 中貢獻。)" #: ../../whatsnew/3.12.rst:558 msgid "csv" @@ -658,12 +880,15 @@ msgid "" "provide finer grained control of ``None`` and empty strings by :class:`~csv." "writer` objects." msgstr "" +"新增 :data:`~csv.QUOTE_NOTNULL` 和 :data:`~csv.QUOTE_STRINGS` 旗標,以通過 :" +"class:`~csv.writer` 物件提供對 ``None`` 和空字串更細粒度的控制。" #: ../../whatsnew/3.12.rst:565 msgid "dis" msgstr "dis" #: ../../whatsnew/3.12.rst:567 +#, fuzzy msgid "" "Pseudo instruction opcodes (which are used by the compiler but do not appear " "in executable bytecode) are now exposed in the :mod:`dis` module. :opcode:" @@ -671,16 +896,22 @@ msgid "" "pseudo instructions. Use the new :data:`~dis.hasarg` collection instead. " "(Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" +"偽指令操作碼(由編譯器使用,但不會出現在可執行位元組碼中)現在在 dis 模組中公" +"開。 :opcode:`HAVE_ARGUMENT` 仍然與真實操作碼相關,但對於偽指令沒有用處。請改" +"用新的:data:`~dis.hasarg` 集合。 (由 Irit Katriel 在 :gh:`94216` 中貢獻。)" #: ../../whatsnew/3.12.rst:576 msgid "fractions" msgstr "fractions" #: ../../whatsnew/3.12.rst:578 +#, fuzzy msgid "" "Objects of type :class:`fractions.Fraction` now support float-style " "formatting. (Contributed by Mark Dickinson in :gh:`100161`.)" msgstr "" +":class:`fractions.Fraction` 型別的物件現在支援浮點樣式格式。(由 Mark " +"Dickinson 在 :gh:`100161` 中貢獻。)" #: ../../whatsnew/3.12.rst:582 msgid "inspect" @@ -692,6 +923,9 @@ msgid "" "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed Carlton Gibson in :gh:`99247`.)" msgstr "" +"新增 :func:`inspect.markcoroutinefunction` 來標記回傳 :term:`coroutine` 的同" +"步函式,以便與 :func:`inspect.iscoroutinefunction` 一起使用。(Carlton " +"Gibson 在 :gh:`99247` 中貢獻。)" #: ../../whatsnew/3.12.rst:588 msgid "" @@ -699,6 +933,9 @@ msgid "" "for determining the current state of asynchronous generators. (Contributed " "by Thomas Krennwallner in :issue:`35759`.)" msgstr "" +"新增 :func:`inspect.getasyncgenstate` 和 :func:`inspect.getasyncgenlocals` 用" +"於確定非同步產生器的當前狀態。(由 Thomas Krennwallner 在 :issue:`35759` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:592 msgid "" @@ -707,17 +944,23 @@ msgid "" "were in Python 3.11, and some may be 6x faster or more. (Contributed by Alex " "Waygood in :gh:`103193`.)" msgstr "" +":func:`inspect.getattr_static` 的性能得到了顯著提昇。大多數對該函式的呼叫應該" +"比 Python 3.11 中的呼叫快至少 2 倍,有些可能快 6 倍或更多。(由 Alex Waygood " +"在 :gh:`103193` 中貢獻。)" #: ../../whatsnew/3.12.rst:598 msgid "itertools" msgstr "itertools" #: ../../whatsnew/3.12.rst:600 +#, fuzzy msgid "" "Added :class:`itertools.batched()` for collecting into even-sized tuples " "where the last batch may be shorter than the rest. (Contributed by Raymond " "Hettinger in :gh:`98363`.)" msgstr "" +"新增了 :class:`itertools.batched()` 用於收集到大小均勻的元組,其中最後一批可" +"能比其餘批次短。(由 Raymond Hettinger 在 :gh:`98363` 中貢獻。)" #: ../../whatsnew/3.12.rst:605 msgid "math" @@ -728,6 +971,8 @@ msgid "" "Added :func:`math.sumprod` for computing a sum of products. (Contributed by " "Raymond Hettinger in :gh:`100485`.)" msgstr "" +"新增 :func:`math.sumprod`,用於計算乘積之和。(由 Raymond Hettinger 在 :gh:" +"`100485` 中貢獻。)" #: ../../whatsnew/3.12.rst:610 msgid "" @@ -735,33 +980,47 @@ msgid "" "or down multiple steps at a time. (By Matthias Goergens, Mark Dickinson, and " "Raymond Hettinger in :gh:`94906`.)" msgstr "" +"擴充 :func:`math.nextafter` 包含一個 *steps* 引數,用於一次向上或向下移動多個" +"步驟。(由 Matthias Goergens、Mark Dickinson 和 Raymond Hettinger 於 :gh:" +"`94906` 中貢獻。)" #: ../../whatsnew/3.12.rst:615 msgid "os" msgstr "os" #: ../../whatsnew/3.12.rst:617 +#, fuzzy msgid "" "Add :const:`os.PIDFD_NONBLOCK` to open a file descriptor for a process with :" "func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar Aditya in :" "gh:`93312`.)" msgstr "" +"新增 :data:`os.PIDFD_NONBLOCK` 以便在非阻塞模式下使用 :func:`os.pidfd_open` " +"為行程打開檔案描述器。 (由 Kumar Aditya 在 :gh:`93312` 中貢獻。)" #: ../../whatsnew/3.12.rst:621 +#, fuzzy msgid "" ":class:`os.DirEntry` now includes an :meth:`os.DirEntry.is_junction` method " "to check if the entry is a junction. (Contributed by Charles Machalow in :gh:" "`99547`.)" msgstr "" +":class:`os.DirEntry` 現在包含一個 :meth:`os.DirEntry.is_junction` 方法來檢查" +"條目是否為結點。 (由 Charles Machalow 在 :gh:`99547` 中貢獻。)" #: ../../whatsnew/3.12.rst:625 +#, fuzzy msgid "" "Add :func:`os.listdrives`, :func:`os.listvolumes` and :func:`os.listmounts` " "functions on Windows for enumerating drives, volumes and mount points. " "(Contributed by Steve Dower in :gh:`102519`.)" msgstr "" +"在 Windows 上新增 :func:`os.listdrives`、:func:`os.listvolumes` 和 :func:`os." +"listmounts` 函式,用於列舉磁碟機 (drives)、磁碟區 (volumes) 和掛載點 (mount " +"points)。(由 Steve Dower 在 :gh:`102519` 中貢獻。)" #: ../../whatsnew/3.12.rst:629 +#, fuzzy msgid "" ":func:`os.stat` and :func:`os.lstat` are now more accurate on Windows. The " "``st_birthtime`` field will now be filled with the creation time of the " @@ -773,74 +1032,105 @@ msgid "" "faster on newer releases of Windows. (Contributed by Steve Dower in :gh:" "`99726`.)" msgstr "" +":func:`os.stat` 和 :func:`os.lstat` 現在在 Windows 上更加準確。 " +"``st_birthtime`` 欄位現在將填充文件的建立時間,``st_ctime`` 已棄用,但仍包含" +"建立時間(但將來將回傳最後一次元資料更改,以與其他平台保持一致) )。根據你的" +"文件系統,``st_dev`` 可能高達 64 位,``st_ino`` 高達 128 位,並且``st_rdev`` " +"始終設定為零而不是錯誤的值。在較新版本的 Windows 上,這兩個功能可能會明顯更" +"快。 (由 Steve Dower 在 :gh:`99726` 中貢獻。)" #: ../../whatsnew/3.12.rst:640 msgid "os.path" msgstr "os.path" #: ../../whatsnew/3.12.rst:642 +#, fuzzy msgid "" "Add :func:`os.path.isjunction` to check if a given path is a junction. " "(Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" +"新增 :func:`os.path.isjunction` 來檢查給定路徑是否是連接點。(由 Charles " +"Machalow 在 :gh:`99547` 中貢獻。)" #: ../../whatsnew/3.12.rst:645 msgid "" "Add :func:`os.path.splitroot` to split a path into a triad ``(drive, root, " "tail)``. (Contributed by Barney Gale in :gh:`101000`.)" msgstr "" +"新增 :func:`os.path.splitroot` 將路徑拆分為三元組 ``(drive, root, tail)``。" +"(由 Barney Gale 在 :gh:`101000` 中貢獻。)" #: ../../whatsnew/3.12.rst:649 msgid "pathlib" msgstr "pathlib" #: ../../whatsnew/3.12.rst:651 +#, fuzzy msgid "" "Add support for subclassing :class:`pathlib.PurePath` and :class:`~pathlib." "Path`, plus their Posix- and Windows-specific variants. Subclasses may " "override the :meth:`~pathlib.PurePath.with_segments` method to pass " "information between path instances." msgstr "" +"新增對 :class:`pathlib.PurePath` 和 :class:`~pathlib.Path` 子類別化的支援,以" +"及它們的 Posix 和 Windows 特定變體。子類別可以重寫:meth:`~pathlib.PurePath." +"with_segments` 方法以在路徑實例之間傳遞資訊。" #: ../../whatsnew/3.12.rst:656 +#, fuzzy msgid "" "Add :meth:`~pathlib.Path.walk` for walking the directory trees and " "generating all file or directory names within them, similar to :func:`os." "walk`. (Contributed by Stanislav Zmiev in :gh:`90385`.)" msgstr "" +"新增 :meth:`~pathlib.Path.walk` 用於遍歷目錄樹並生成其中的所有檔案或目錄名" +"稱,類似於 :func:`os.walk`。 (由 Stanislav Zmiev 在 :gh:`90385` 中貢獻。)" #: ../../whatsnew/3.12.rst:660 +#, fuzzy msgid "" "Add *walk_up* optional parameter to :meth:`pathlib.PurePath.relative_to` to " "allow the insertion of ``..`` entries in the result; this behavior is more " "consistent with :func:`os.path.relpath`. (Contributed by Domenico Ragusa in :" "issue:`40358`.)" msgstr "" +"將 *walk_up* 可選參數新增到 :meth:`pathlib.PurePath.relative_to` 以允許在結果" +"中插入 ``..`` 條目;此行為與 :func:`os.path.relpath` 更加一致。(由 Domenico " +"Ragusa 在 :issue:`40358` 中貢獻。)" #: ../../whatsnew/3.12.rst:665 msgid "" "Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." "isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" +"新增 :meth:`pathlib.Path.is_junction` 作為 :func:`os.path.isjunction` 的代" +"理。(由 Charles Machalow 在 :gh:`99547` 中貢獻。)" #: ../../whatsnew/3.12.rst:668 +#, fuzzy msgid "" "Add *case_sensitive* optional parameter to :meth:`pathlib.Path.glob`, :meth:" "`pathlib.Path.rglob` and :meth:`pathlib.PurePath.match` for matching the " "path's case sensitivity, allowing for more precise control over the matching " "process." msgstr "" +"向 :meth:`pathlib.Path.glob`、:meth:`pathlib.Path.rglob` 和 :meth:`pathlib." +"PurePath.match` 新增 *case_sensitive* 可選參數,以匹配路徑的大小寫敏感度,從" +"而更精確控制匹配過程。" #: ../../whatsnew/3.12.rst:673 msgid "pdb" msgstr "pdb" #: ../../whatsnew/3.12.rst:675 +#, fuzzy msgid "" "Add convenience variables to hold values temporarily for debug session and " "provide quick access to values like the current frame or the return value. " "(Contributed by Tian Gao in :gh:`103693`.)" msgstr "" +"新增方便的變數來臨時保存除錯會話的值,並提供對當前幀或回傳值等值的快速存取。 " +"(由 Tian Gao 貢獻 :gh:`103693`。)" #: ../../whatsnew/3.12.rst:681 msgid "random" @@ -851,54 +1141,79 @@ msgid "" "Added :func:`random.binomialvariate`. (Contributed by Raymond Hettinger in :" "gh:`81620`.)" msgstr "" +"新增 :func:`random.binomialvariate`。(由 Raymond Hettinger 在 :gh:`81620` 中" +"貢獻。)" #: ../../whatsnew/3.12.rst:686 msgid "" "Added a default of ``lamb=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" +"為 :func:`random.expovariate` 新增了預設值 ``lamb=1.0``。(由 Raymond " +"Hettinger 在 :gh:`100234` 中貢獻。)" #: ../../whatsnew/3.12.rst:690 msgid "shutil" msgstr "shutil" #: ../../whatsnew/3.12.rst:692 +#, fuzzy msgid "" ":func:`shutil.make_archive` now passes the *root_dir* argument to custom " "archivers which support it. In this case it no longer temporarily changes " "the current working directory of the process to *root_dir* to perform " "archiving. (Contributed by Serhiy Storchaka in :gh:`74696`.)" msgstr "" +":func:`shutil.make_archive` 現在將 *root_dir* 參數傳遞給支援它的自定義歸檔" +"器。在這種情況下,它不再臨時將行程的當前工作目錄更改為 *root_dir* 來執行歸" +"檔。 (由 Serhiy Storchaka 在 :gh:`74696` 中貢獻。)" #: ../../whatsnew/3.12.rst:698 +#, fuzzy msgid "" ":func:`shutil.rmtree` now accepts a new argument *onexc* which is an error " "handler like *onerror* but which expects an exception instance rather than a " "*(typ, val, tb)* triplet. *onerror* is deprecated and will be removed in " "Python 3.14. (Contributed by Irit Katriel in :gh:`102828`.)" msgstr "" +":func:`shutil.rmtree` 現在接受一個新引數 *onexc*,它是一個類似於 *onerror* 的" +"錯誤處理程式,但它需要一個例外實例而不是 *(typ, val, tb)* 三元組。 *onerror* " +"已棄用,並將在 Python 3.14 中刪除。 (由 Irit Katriel 在 :gh:`102828` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:704 +#, fuzzy msgid "" ":func:`shutil.which` now consults the *PATHEXT* environment variable to find " "matches within *PATH* on Windows even when the given *cmd* includes a " "directory component. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" +":func:`shuutil.which` 現在會查閱 *PATHEXT* 環境變數來查找 Windows 上 *PATH* " +"內的匹配項,即使給定的 *cmd* 包含目錄組件也是如此。 (由 Charles Machalow " +"在 :gh:`103179` 中貢獻。)" #: ../../whatsnew/3.12.rst:709 +#, fuzzy msgid "" ":func:`shutil.which` will call ``NeedCurrentDirectoryForExePathW`` when " "querying for executables on Windows to determine if the current working " "directory should be prepended to the search path. (Contributed by Charles " "Machalow in :gh:`103179`.)" msgstr "" +"在 Windows 上查詢可執行文件時,shutil.which 將呼叫 " +"``NeedCurrentDirectoryForExePathW``以確定是否應將當前工作目錄新增到搜索路徑前" +"面。 (由 Charles Machalow 在 :gh:`103179` 中貢獻。)" #: ../../whatsnew/3.12.rst:714 +#, fuzzy msgid "" ":func:`shutil.which` will return a path matching the *cmd* with a component " "from ``PATHEXT`` prior to a direct match elsewhere in the search path on " "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" +":func:`shuutil.which` 將回傳一個與 *cmd* 與 ``PATHEXT`` 中的組件相匹配的路" +"徑,然後再直接匹配 Windows 上搜索路徑中的其他位置。 (由 Charles Machalow " +"在 :gh:`103179` 中貢獻。)" #: ../../whatsnew/3.12.rst:720 msgid "sqlite3" @@ -909,21 +1224,32 @@ msgid "" "Add a :ref:`command-line interface `. (Contributed by Erlend E. " "Aasland in :gh:`77617`.)" msgstr "" +"新增一個\\ :ref:`命令列界面 `。(由 Erlend E. Aasland 在 :gh:" +"`77617` 中貢獻。)" #: ../../whatsnew/3.12.rst:725 +#, fuzzy msgid "" "Add the :attr:`~sqlite3.Connection.autocommit` attribute to :class:`~sqlite3." "Connection` and the *autocommit* parameter to :func:`~sqlite3.connect` to " "control :pep:`249`-compliant :ref:`transaction handling `. (Contributed by Erlend E. Aasland in :gh:`83638`.)" msgstr "" +"將 :attr:`~sqlite3.Connection.autocommit` 屬性新增到 :class:`~sqlite3." +"Connection` 並將 *autocommit* 參數新增到 :func:`~sqlite3.connect` 以控制 :" +"pep:`249` 相容:ref:`事務處理 `。 " +"(由 Erlend E. Aasland 在 :gh:`83638` 中貢獻。)" #: ../../whatsnew/3.12.rst:732 +#, fuzzy msgid "" "Add *entrypoint* keyword-only parameter to :meth:`~sqlite3.Connection." "load_extension`, for overriding the SQLite extension entry point. " "(Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" +"將 *entrypoint* 僅關鍵字參數新增到:meth:`~sqlite3.Connection." +"load_extension`,以覆蓋 SQLite 擴充入口點。 (由 Erlend E. Aasland 在 :gh:" +"`103015` 中貢獻。)" #: ../../whatsnew/3.12.rst:737 msgid "" @@ -931,6 +1257,9 @@ msgid "" "setconfig` to :class:`~sqlite3.Connection` to make configuration changes to " "a database connection. (Contributed by Erlend E. Aasland in :gh:`103489`.)" msgstr "" +"將 :meth:`~sqlite3.Connection.getconfig` 和 :meth:`~sqlite3.Connection." +"setconfig` 新增到 :class:`~sqlite3.Connection` 以對資料庫連接進行設定的更" +"改。 (由 Erlend E. Aasland 在 :gh:`103489` 中貢獻。)" #: ../../whatsnew/3.12.rst:743 msgid "statistics" @@ -942,12 +1271,15 @@ msgid "" "for computing the Spearman correlation of ranked data. (Contributed by " "Raymond Hettinger in :gh:`95861`.)" msgstr "" +"擴充 :func:`statistics.correlation`,作為計算排名資料的 Spearman 相關性的 " +"``ranked`` 方法。 (由 Raymond Hettinger 在 :gh:`95861` 中貢獻。)" #: ../../whatsnew/3.12.rst:750 msgid "sys" msgstr "sys" #: ../../whatsnew/3.12.rst:752 +#, fuzzy msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -956,8 +1288,14 @@ msgid "" "Christian Heimes with contributions from Gregory P. Smith [Google] and Mark " "Shannon in :gh:`96123`.)" msgstr "" +"新增 :func:`sys.activate_stack_trampoline` 和 :func:`sys." +"deactivate_stack_trampoline` 用於激活和停用堆疊分析器蹦床,以及 :func:`sys." +"is_stack_trampoline_active` 用於查詢堆疊分析器蹦床是否處於活動狀態。 (由 " +"Pablo Galindo 和 Christian Heimes 貢獻,Gregory P. Smith [Google] 和 Mark " +"Shannon 在 :gh:`96123` 中貢獻。)" #: ../../whatsnew/3.12.rst:761 +#, fuzzy msgid "" "Add :data:`sys.last_exc` which holds the last unhandled exception that was " "raised (for post-mortem debugging use cases). Deprecate the three fields " @@ -965,13 +1303,20 @@ msgid "" "data:`sys.last_value` and :data:`sys.last_traceback`. (Contributed by Irit " "Katriel in :gh:`102778`.)" msgstr "" +"新增 :data:`sys.last_exc`,它保存最後一個引發的未處理的例外(用於事後除錯用" +"例)。棄用舊格式中具有相同資訊的三個欄位::data:`sys.last_type`、:data:`sys." +"last_value` 和 :data:`sys.last_traceback`。 (由 Irit Katriel 在 :gh:" +"`102778` 中貢獻。)" #: ../../whatsnew/3.12.rst:767 ../../whatsnew/3.12.rst:1504 +#, fuzzy msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " "by Irit Katriel in :gh:`103176`.)" msgstr "" +":func:`sys._current_exceptions` 現在回傳從執行緒 id 到例外實例的映射,而不是 " +"``(typ, exc, tb)`` 元組。(由 Irit Katriel 在 :gh:`103176` 中貢獻。)" #: ../../whatsnew/3.12.rst:772 msgid "tempfile" @@ -982,30 +1327,40 @@ msgid "" "The :class:`tempfile.NamedTemporaryFile` function has a new optional " "parameter *delete_on_close* (Contributed by Evgeny Zorin in :gh:`58451`.)" msgstr "" +":class:`tempfile.NamedTemporaryFile` 函式有一個新的可選參數 " +"*delete_on_close*\\ (由 Evgeny Zorin 在 :gh:`58451` 中貢獻。)" #: ../../whatsnew/3.12.rst:776 +#, fuzzy msgid "" ":func:`tempfile.mkdtemp` now always returns an absolute path, even if the " "argument provided to the *dir* parameter is a relative path." msgstr "" +":func:`tempfile.mkdtemp` 現在始終回傳絕對路徑,即使提供給 *dir* 引數的參數是" +"相對路徑。" #: ../../whatsnew/3.12.rst:782 msgid "threading" msgstr "threading" #: ../../whatsnew/3.12.rst:784 +#, fuzzy msgid "" "Add :func:`threading.settrace_all_threads` and :func:`threading." "setprofile_all_threads` that allow to set tracing and profiling functions in " "all running threads in addition to the calling one. (Contributed by Pablo " "Galindo in :gh:`93503`.)" msgstr "" +"新增 :func:`threading.settrace_all_threads` 和 :func:`threading." +"setprofile_all_threads`,允許在除呼叫執行緒之外的所有正在運行的執行緒中設定跟" +"踪和分析函式。(由 Pablo Galindo 在 :gh:`93503` 中貢獻。)" #: ../../whatsnew/3.12.rst:790 msgid "tkinter" msgstr "tkinter" #: ../../whatsnew/3.12.rst:792 +#, fuzzy msgid "" "``tkinter.Canvas.coords()`` now flattens its arguments. It now accepts not " "only coordinates as separate arguments (``x1, y1, x2, y2, ...``) and a " @@ -1014,6 +1369,11 @@ msgid "" "y2), ...]``), like ``create_*()`` methods. (Contributed by Serhiy Storchaka " "in :gh:`94473`.)" msgstr "" +"``tkinter.Canvas.coords()`` 現在將其參數展平。它現在不僅接受坐標作為單獨的參" +"數(``x1,y1,x2,y2,...``)和一系列坐標(``[x1,y1,x2,y2,...]``) ,而且" +"還有成對分組的坐標 (``(x1, y1), (x2, y2), ...`` 和``[(x1, y1), (x2, " +"y2), ...]``) ,如 ``create_*()``方法。 (由 Serhiy Storchaka 在 :gh:`94473` " +"中貢獻。)" #: ../../whatsnew/3.12.rst:801 msgid "tokenize" @@ -1026,6 +1386,9 @@ msgid "" "ref:`whatsnew312-porting-to-python312` for more information on the changes " "to the :mod:`tokenize` module." msgstr "" +":mod:`tokenize` 模組包含 :pep:`701` 中引入的更改。(由 Marta Gómez Macías 和 " +"Pablo Galindo 在 :gh:`102856` 中貢獻。)有關 :mod:`tokenize` 模組變更的更多資" +"訊,請參閱 :ref:`whatsnew312-porting-to-python312`。" #: ../../whatsnew/3.12.rst:809 msgid "types" @@ -1037,12 +1400,16 @@ msgid "" "ref:`user-defined-generics` when subclassed. (Contributed by James Hilton-" "Balfe and Alex Waygood in :gh:`101827`.)" msgstr "" +"新增 :func:`types.get_original_bases` 以允許在子類別化時進一步內省 " +"(introspect) :ref:`使用者定義的泛型 `。 (由 James " +"Hilton-Balfe 和 Alex Waygood 在 :gh:`101827` 中貢獻。)" #: ../../whatsnew/3.12.rst:816 msgid "typing" msgstr "typing" #: ../../whatsnew/3.12.rst:818 +#, fuzzy msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1054,22 +1421,36 @@ msgid "" "protocol on Python 3.12+, and vice versa. Most users are unlikely to be " "affected by this change. (Contributed by Alex Waygood in :gh:`102433`.)" msgstr "" +"isinstance 針對運行時可檢查協議 檢查,現在使用 " +"inspect.getattr_static 而不是 hasattr 來查找屬性是否存在。這意味著在針對運行" +"時可檢查協議的 ``isinstance()``檢查期間,描述器和:meth:`~object.__getattr__`" +"方法不再意外地被評估。然而,這也可能意味著一些曾經被視為運行時可檢查協議實例" +"的物件在 Python 3.12+ 上可能不再被視為該協議的實例,反之亦然。大多數使用者不" +"太可能受到此更改的影響。 (由 Alex Waygood 在 :gh:`102433` 中貢獻。)" #: ../../whatsnew/3.12.rst:829 +#, fuzzy msgid "" "The members of a runtime-checkable protocol are now considered \"frozen\" at " "runtime as soon as the class has been created. Monkey-patching attributes " "onto a runtime-checkable protocol will still work, but will have no impact " "on :func:`isinstance` checks comparing objects to the protocol. For example::" msgstr "" +"現在,一旦建立了類,運行時可檢查協議的成員就會在運行時被視為 ``凍結``。將屬性" +"猴子修補到可運行時檢查的協議上仍然有效,但不會影響將物件與協議進行比較的 " +"isinstance 檢查。例如:\n" +"\n" +"::" #: ../../whatsnew/3.12.rst:851 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." msgstr "" +"進行此更改是為了加快針對 runtime 之可檢查協議的 ``isinstance()`` 檢查。" #: ../../whatsnew/3.12.rst:854 +#, fuzzy msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1079,19 +1460,30 @@ msgid "" "more members may be slower than in Python 3.11. (Contributed by Alex Waygood " "in :gh:`74690` and :gh:`103193`.)" msgstr "" +"isinstance 針對運行時可檢查協議 進行檢查的性能配置" +"文件已發生顯著變更。大多數 ``isinstance()``針對只有少數成員的協議的檢查應該" +"比 3.11 中至少快 2 倍,有些可能快 20 倍或更多。然而, ``isinstance()``對具有 " +"14 個或更多成員的協議進行檢查可能比 Python 3.11 慢。 (由 Alex Waygood 在 :" +"gh:`74690` 和 :gh:`103193` 中貢獻。)" #: ../../whatsnew/3.12.rst:862 +#, fuzzy msgid "" "All :data:`typing.TypedDict` and :data:`typing.NamedTuple` classes now have " "the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " "in :gh:`103699`.)" msgstr "" +"所有typing.TypedDict 和typing.NamedTuple 類現在都具有__orig_bases__ 屬性。 " +"(由 Adrian Garcia Badaracco 在 :gh:`103699` 中貢獻。)" #: ../../whatsnew/3.12.rst:866 +#, fuzzy msgid "" "Add ``frozen_default`` parameter to :func:`typing.dataclass_transform`. " "(Contributed by Erik De Bonte in :gh:`99957`.)" msgstr "" +"將``frozen_default`` 參數新增到:func:`typing.dataclass_transform`。 (由 " +"Erik De Bonte 在 :gh:`99957` 中貢獻。)" #: ../../whatsnew/3.12.rst:870 msgid "unicodedata" @@ -1102,19 +1494,25 @@ msgid "" "The Unicode database has been updated to version 15.0.0. (Contributed by " "Benjamin Peterson in :gh:`96734`)." msgstr "" +"Unicode 資料庫已更新至版本 15.0.0。(由 Benjamin Peterson 在 :gh:`96734` 中貢" +"獻)。" #: ../../whatsnew/3.12.rst:876 msgid "unittest" msgstr "unittest" #: ../../whatsnew/3.12.rst:878 +#, fuzzy msgid "" "Added ``--durations`` command line option, showing the N slowest test cases::" msgstr "" +"新增了 ``--durations`` 命令列選項,顯示 N 個最慢的測試用例:\n" +"\n" +"::" #: ../../whatsnew/3.12.rst:894 msgid "(Contributed by Giampaolo Rodola in :issue:`4080`)" -msgstr "" +msgstr "(由 Giampaolo Rodola 在 :issue:`4080` 中貢獻)" #: ../../whatsnew/3.12.rst:897 msgid "uuid" @@ -1125,65 +1523,93 @@ msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" +"新增\\ :ref:`命令列界面 `。(由 Adam Chhina 在 :gh:`88597` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:904 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.12.rst:906 +#, fuzzy msgid "" "Removed ``wstr`` and ``wstr_length`` members from Unicode objects. It " "reduces object size by 8 or 16 bytes on 64bit platform. (:pep:`623`) " "(Contributed by Inada Naoki in :gh:`92536`.)" msgstr "" +"從 Unicode 物件中刪除了 ``wstr`` 和 ``wstr_length`` 成員。它在 64 位平台上將" +"物件大小減少了 8 或 16 位元組。 (:pep:`623`)(由 Inada Naoki 在 :gh:`92536` " +"中貢獻。)" #: ../../whatsnew/3.12.rst:910 +#, fuzzy msgid "" "Added experimental support for using the BOLT binary optimizer in the build " "process, which improves performance by 1-5%. (Contributed by Kevin " "Modzelewski in :gh:`90536` and tuned by Dong-hee Na in :gh:`101525`)" msgstr "" +"新增了對在構建過程中使用 BOLT 二進位最佳化器的實驗性支援,這將性能提高了 " +"1-5%。 (由 Kevin Modzelewski 在 :gh:`90536` 中貢獻,由 Dong-hee Na 在 :gh:" +"`101525` 中調整)" #: ../../whatsnew/3.12.rst:914 +#, fuzzy msgid "" "Speed up the regular expression substitution (functions :func:`re.sub` and :" "func:`re.subn` and corresponding :class:`!re.Pattern` methods) for " "replacement strings containing group references by 2--3 times. (Contributed " "by Serhiy Storchaka in :gh:`91524`.)" msgstr "" +"將包含組引用的替換字串的正則表達式替換(函式 :func:`re.sub` 和 :func:`re." +"subn` 以及相應的 :class:`!re.Pattern` 方法)速度提高 2--3 倍。 (由 Serhiy " +"Storchaka 在 :gh:`91524` 中貢獻。)" #: ../../whatsnew/3.12.rst:919 +#, fuzzy msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " "formatting. (Contributed by Itamar O in :gh:`103793`.)" msgstr "" +"通過推遲昂貴的字串格式來加快 asyncio.Task 的建立速度。 (由 Itamar O 在 :gh:" +"`103793` 中貢獻。)" #: ../../whatsnew/3.12.rst:922 +#, fuzzy msgid "" "The :func:`tokenize.tokenize` and :func:`tokenize.generate_tokens` functions " "are up to 64% faster as a side effect of the changes required to cover :pep:" "`701` in the :mod:`tokenize` module. (Contributed by Marta Gómez Macías and " "Pablo Galindo in :gh:`102856`.)" msgstr "" +"作為覆蓋 :mod:`tokenize` 模組中的 :pep:`701` 所需更改的副作用,tokenize." +"tokenize 和 tokenize.generate_tokens 函式速度提高了 64% 。 (由 Marta Gómez " +"Macías 和 Pablo Galindo 在 :gh:`102856` 中貢獻。)" #: ../../whatsnew/3.12.rst:927 +#, fuzzy msgid "" "Speed up :func:`super` method calls and attribute loads via the new :opcode:" "`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " "Matveev in :gh:`103497`.)" msgstr "" +"通過新的 LOAD_SUPER_ATTR 指令加速 super 方法呼叫和屬性加載。 (由 Carl Meyer " +"和 Vladimir Matveev 在 :gh:`103497` 中貢獻。)" #: ../../whatsnew/3.12.rst:933 msgid "CPython bytecode changes" -msgstr "" +msgstr "CPython 位元組碼變更" #: ../../whatsnew/3.12.rst:935 +#, fuzzy msgid "" "Remove the :opcode:`LOAD_METHOD` instruction. It has been merged into :" "opcode:`LOAD_ATTR`. :opcode:`LOAD_ATTR` will now behave like the old :opcode:" "`LOAD_METHOD` instruction if the low bit of its oparg is set. (Contributed " "by Ken Jin in :gh:`93429`.)" msgstr "" +"刪除 :opcode:`LOAD_METHOD` 指令。它已合併到 :opcode:`LOAD_ATTR` 中。如果設定" +"了 oparg 的低位,則 :opcode:`LOAD_ATTR` 現在將像舊的 :opcode:`LOAD_METHOD` 指" +"令一樣運行。 (由 Ken Jin 在 :gh:`93429` 中貢獻。)" #: ../../whatsnew/3.12.rst:940 msgid "" @@ -1191,14 +1617,20 @@ msgid "" "JUMP_IF_TRUE_OR_POP` instructions. (Contributed by Irit Katriel in :gh:" "`102859`.)" msgstr "" +"刪除 :opcode:`!JUMP_IF_FALSE_OR_POP` 和 :opcode:`!JUMP_IF_TRUE_OR_POP` 指示。" +"(由 Irit Katriel 在 :gh:`102859` 中貢獻。)" #: ../../whatsnew/3.12.rst:943 +#, fuzzy msgid "" "Add the :opcode:`LOAD_FAST_AND_CLEAR` instruction as part of the " "implementation of :pep:`709`. (Contributed by Carl Meyer in :gh:`101441`.)" msgstr "" +"新增 LOAD_FAST_AND_CLEAR 指令作為 709 實作的一部分。 (由 Carl Meyer 在 :gh:" +"`101441` 中貢獻。)" #: ../../whatsnew/3.12.rst:946 +#, fuzzy msgid "" "Add the :opcode:`LOAD_FROM_DICT_OR_DEREF`, :opcode:" "`LOAD_FROM_DICT_OR_GLOBALS`, and :opcode:`LOAD_LOCALS` opcodes as part of " @@ -1206,51 +1638,77 @@ msgid "" "opcode, which can be replaced with :opcode:`LOAD_LOCALS` plus :opcode:" "`LOAD_FROM_DICT_OR_DEREF`. (Contributed by Jelle Zijlstra in :gh:`103764`.)" msgstr "" +"新增 LOAD_FROM_DICT_OR_DEREF`、LOAD_FROM_DICT_OR_GLOBALS` 和 LOAD_LOCALS` 操" +"作碼作為 695` 實作的一部分。刪除 :opcode:`!LOAD_CLASSDEREF` 操作碼,可以用 :" +"opcode:`LOAD_LOCALS` 加上 :opcode:`LOAD_FROM_DICT_OR_DEREF` 替換。 (由 " +"Jelle Zijlstra 在 :gh:`103764` 中貢獻。)" #: ../../whatsnew/3.12.rst:952 +#, fuzzy msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" +"新增 LOAD_SUPER_ATTR 指令。 (由 Carl Meyer 和 Vladimir Matveev 在 :gh:" +"`103497` 中貢獻。)" #: ../../whatsnew/3.12.rst:956 +#, fuzzy msgid "Demos and Tools" -msgstr "" +msgstr "演示和工具" #: ../../whatsnew/3.12.rst:958 +#, fuzzy msgid "" "Remove the ``Tools/demo/`` directory which contained old demo scripts. A " "copy can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97681`.)" msgstr "" +"刪除包含舊演示腳本的 ``Tools/demo/`` 目錄。可以在 `old-demos 項目 `_ 中找到副本。(由 Victor Stinner 在 :gh:" +"`97681` 中貢獻。)" #: ../../whatsnew/3.12.rst:963 +#, fuzzy msgid "" "Remove outdated example scripts of the ``Tools/scripts/`` directory. A copy " "can be found in the `old-demos project `_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" +"刪除 ``Tools/scripts/`` 目錄中過時的示例腳本。可以在 `old-demos 項目 " +"`_ 中找到副本。 (由 Victor Stinner " +"在 :gh:`97669` 中貢獻。)" #: ../../whatsnew/3.12.rst:970 ../../whatsnew/3.12.rst:1869 msgid "Deprecated" -msgstr "" +msgstr "已棄用" #: ../../whatsnew/3.12.rst:972 +#, fuzzy msgid "" ":mod:`asyncio`: The :meth:`~asyncio.get_event_loop` method of the default " "event loop policy now emits a :exc:`DeprecationWarning` if there is no " "current event loop set and it decides to create one. (Contributed by Serhiy " "Storchaka and Guido van Rossum in :gh:`100160`.)" msgstr "" +":mod:`asyncio`:如果沒有當前事件循環集並且決定建立一個,預設事件循環策略的 :" +"meth:`~asyncio.get_event_loop` 方法現在會發出一個 :exc:" +"`DeprecationWarning` 。 (由 Serhiy Storchaka 和 Guido van Rossum 在 :gh:" +"`100160` 中貢獻。)" #: ../../whatsnew/3.12.rst:977 +#, fuzzy msgid "" ":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " "are deprecated and replaced by :data:`calendar.Month.JANUARY` and :data:" "`calendar.Month.FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" +":mod:`calendar`:``calendar.January`` 和 ``calendar.February`` 常數已棄用,並" +"替換為:data:`calendar.Month.JANUARY` 和:data:`calendar.Month.FEBRUARY`。 " +"(由 Roshan 王子在 :gh:`103636` 中貢獻。)" #: ../../whatsnew/3.12.rst:981 +#, fuzzy msgid "" ":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." "utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " @@ -1259,8 +1717,15 @@ msgid "" "now` and :meth:`~datetime.datetime.fromtimestamp` with the *tz* parameter " "set to :const:`datetime.UTC`. (Contributed by Paul Ganssle in :gh:`103857`.)" msgstr "" +":mod:`datetime`: :class:`datetime.datetime` 的 :meth:`~datetime.datetime." +"utcnow` 和 :meth:`~datetime.datetime.utcfromtimestamp` 已棄用,並將在未來版本" +"中刪除。相反,使用時區感知物件來表示 UTC 中的日期時間:分別呼叫 :meth:" +"`~datetime.datetime.now` 和 :meth:`~datetime.datetime.fromtimestamp` 並將 " +"*tz* 參數設定為 :const: `日期時間.UTC`。 (由 Paul Ganssle 在 :gh:`103857` " +"中貢獻。)" #: ../../whatsnew/3.12.rst:989 +#, fuzzy msgid "" ":mod:`os`: The ``st_ctime`` fields return by :func:`os.stat` and :func:`os." "lstat` on Windows are deprecated. In a future release, they will contain the " @@ -1268,6 +1733,10 @@ msgid "" "still contain the creation time, which is also available in the new " "``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" +":mod:`os`:Windows 上 :func:`os.stat` 和 :func:`os.lstat` 回傳的 " +"``st_ctime`` 欄位已被棄用。在未來的版本中,它們將包含最後一次元資料更改時間," +"與其他平台一致。目前,它們仍然包含建立時間,這也可以在新的 ``st_birthtime`` " +"欄位中找到。 (由 Steve Dower 在 :gh:`99726` 中貢獻。)" #: ../../whatsnew/3.12.rst:995 msgid "" @@ -1275,19 +1744,27 @@ msgid "" "as will be removed in Python 3.14. Use *onexc* instead. (Contributed by Irit " "Katriel in :gh:`102828`.)" msgstr "" +":mod:`shutil`::func:`shutil.rmtree` 的 *onerror* 引數已被棄用,並將在 " +"Python 3.14 中刪除。請改用 *onexc*。(由 Irit Katriel 在 :gh:`102828` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1010 msgid ":mod:`sqlite3`:" -msgstr "" +msgstr ":mod:`sqlite3`:" #: ../../whatsnew/3.12.rst:999 +#, fuzzy msgid "" ":ref:`default adapters and converters ` are now " "deprecated. Instead, use the :ref:`sqlite3-adapter-converter-recipes` and " "tailor them to your needs. (Contributed by Erlend E. Aasland in :gh:`90016`.)" msgstr "" +":ref:`預設適配器和轉換器 ` 現已棄用。相反,請使" +"用 sqlite3-adapter-converter-recipes 並根據你的需求進行定制。 (由 Erlend E. " +"Aasland 在 :gh:`90016` 中貢獻。)" #: ../../whatsnew/3.12.rst:1005 +#, fuzzy msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1296,6 +1773,11 @@ msgid "" "as a sequence will raise a :exc:`~sqlite3.ProgrammingError`. (Contributed by " "Erlend E. Aasland in :gh:`101698`.)" msgstr "" +"在 :meth:`~sqlite3.Cursor.execute` 中,當 :ref:`命名佔位符 ` 與作為 :term:`sequence` 提供的參數一起使用時,現在會發出 " +"DeprecationWarning`作為 :class:`dict` 。從 Python 3.14 開始,使用命名佔位符以" +"及作為序列提供的參數將引發:exc:`~sqlite3.ProgrammingError`。 (由 Erlend E. " +"Aasland 在 :gh:`101698` 中貢獻。)" #: ../../whatsnew/3.12.rst:1012 msgid "" @@ -1303,13 +1785,20 @@ msgid "" "last_traceback` fields are deprecated. Use :data:`sys.last_exc` instead. " "(Contributed by Irit Katriel in :gh:`102778`.)" msgstr "" +":mod:`sys`::data:`sys.last_type`、:data:`sys.last_value` 和 :data:`sys." +"last_traceback` 欄位已被棄用。請改用 :data:`sys.last_exc`。(由 Irit Katriel " +"在 :gh:`102778` 中貢獻。)" #: ../../whatsnew/3.12.rst:1016 +#, fuzzy msgid "" ":mod:`tarfile`: Extracting tar archives without specifying *filter* is " "deprecated until Python 3.14, when ``'data'`` filter will become the " "default. See :ref:`tarfile-extraction-filter` for details." msgstr "" +":mod:`tarfile`:不推薦在不指定 *filter* 的情況下提取 tar 檔案,直到 Python " +"3.14 為止,此時“'data'`` 過濾器將成為預設過濾器。有關詳細資訊,請參閱:ref:" +"`tarfile-extraction-filter`。" #: ../../whatsnew/3.12.rst:1020 msgid "" @@ -1317,22 +1806,33 @@ msgid "" "for :class:`collections.abc.Hashable` and :class:`collections.abc.Sized`. (:" "gh:`94309`.)" msgstr "" +":mod:`typing`::class:`typing.Hashable` 和:class:`typing.Sized` 是 :class:" +"`collections.abc.Hashable` 和 :class:`collections.abc.Sized` 的別名。(:gh:" +"`94309`)" #: ../../whatsnew/3.12.rst:1023 +#, fuzzy msgid "" ":mod:`xml.etree.ElementTree`: The module now emits :exc:`DeprecationWarning` " "when testing the truth value of an :class:`xml.etree.ElementTree.Element`. " "Before, the Python implementation emitted :exc:`FutureWarning`, and the C " "implementation emitted nothing." msgstr "" +":mod:`xml.etree.ElementTree`:該模組現在在測試 :class:`xml.etree.ElementTree." +"Element` 的真值時會發出 :exc:`DeprecationWarning`。之前,Python 實作發出了 :" +"exc:`FutureWarning`,而 C 實作什麼也沒發出。" #: ../../whatsnew/3.12.rst:1028 +#, fuzzy msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`~coroutine.throw`, :" "meth:`~generator.throw` and :meth:`~agen.athrow` are deprecated and may be " "removed in a future version of Python. Use the single-arg versions of these " "functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" +":meth:`~coroutine.throw`、:meth:`~generator.throw` 和 :meth:`~agen.athrow` " +"的 3-arg 簽名(型別、值、回溯)已被棄用,可能會在Python 的未來版本。請改用這" +"些函式的單參數版本。 (由 Ofey Chan 在 :gh:`89874` 中貢獻。)" #: ../../whatsnew/3.12.rst:1033 msgid "" @@ -1340,8 +1840,12 @@ msgid "" "differs from ``__spec__.parent`` (previously it was :exc:`ImportWarning`). " "(Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" +"現在,當模組上的 ``__package__`` 與 ``__spec__.parent`` 不同時,會引發 :exc:" +"`DeprecationWarning`\\ (以前是 :exc:`ImportWarning`\\ )。 (由 Brett " +"Cannon 在 :gh:`65961` 中貢獻。)" #: ../../whatsnew/3.12.rst:1038 +#, fuzzy msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -1349,8 +1853,13 @@ msgid "" "in Python 3.14. (Contributed by Ramvikrams and Kumar Aditya in :gh:`101193`. " "PEP by Ken Jin.)" msgstr "" +"根據:pep:`699`,:c:type:`PyDictObject` 中的 ``ma_version_tag`` 欄位對於擴充模" +"組已被棄用。存取該欄位將在編譯時生成編譯器警告。該欄位將在 Python 3.14 中刪" +"除。 (由 Ramvikrams 和 Kumar Aditya 在 :gh:`101193` 中貢獻。Ken Jin 的 " +"PEP。)" #: ../../whatsnew/3.12.rst:1043 +#, fuzzy msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.14. Use ``not`` for logical negation of bools instead. " @@ -1358,20 +1867,25 @@ msgid "" "underlying ``int``, convert to int explicitly with ``~int(x)``. (Contributed " "by Tim Hoffmann in :gh:`103487`.)" msgstr "" +"bool 上的按位反轉運算符 (``~``) 已棄用。在 Python 3.14 中它將拋出錯誤。使用 " +"``not`` 來代替布林值的邏輯否定。在極少數情況下,你確實需要對底層 ``int`` 進行" +"按位反轉,請使用 ``~int(x)`` 顯式轉換為 int。 (由 Tim Hoffmann 在 :gh:" +"`103487` 中貢獻。)" #: ../../whatsnew/3.12.rst:1050 msgid "Pending Removal in Python 3.13" -msgstr "" +msgstr "Python 3.13 中的待刪除項目" #: ../../whatsnew/3.12.rst:1052 msgid "" "The following modules and APIs have been deprecated in earlier Python " "releases, and will be removed in Python 3.13." msgstr "" +"以下模組和 API 在早期的 Python 版本中已被棄用,並將在 Python 3.13 中刪除。" #: ../../whatsnew/3.12.rst:1055 msgid "Modules (see :pep:`594`):" -msgstr "" +msgstr "模組(參見:pep:`594`):" #: ../../whatsnew/3.12.rst:1057 msgid ":mod:`aifc`" @@ -1451,7 +1965,7 @@ msgstr ":mod:`xdrlib`" #: ../../whatsnew/3.12.rst:1077 msgid "APIs:" -msgstr "" +msgstr "API:" #: ../../whatsnew/3.12.rst:1079 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" @@ -1487,26 +2001,34 @@ msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" #: ../../whatsnew/3.12.rst:1087 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" -msgstr "" +msgstr ":class:`classmethod` 描述器鏈接 (:gh:`89519`)" #: ../../whatsnew/3.12.rst:1090 msgid "Pending Removal in Python 3.14" -msgstr "" +msgstr "Python 3.14 中的待刪除項目" #: ../../whatsnew/3.12.rst:1092 +#, fuzzy msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`92248`.)" msgstr "" +":mod:`argparse`::class:`!argparse.BooleanOptionalAction` 的 *type*、" +"*choices* 和 *metavar* 參數已棄用,並將在 3.14 中刪除。 (由 Nikita Sobolev " +"在 :gh:`92248` 中貢獻。)" #: ../../whatsnew/3.12.rst:1097 +#, fuzzy msgid "" ":mod:`ast`: The following :mod:`ast` features have been deprecated in " "documentation since Python 3.8, now cause a :exc:`DeprecationWarning` to be " "emitted at runtime when they are accessed or used, and will be removed in " "Python 3.14:" msgstr "" +":mod:`ast`:自 Python 3.8 起,以下 :mod:`ast` 功能已在文檔中棄用,現在會導致" +"在存取或使用它們時在運行時發出 :exc:`DeprecationWarning` ,並將被刪除在 " +"Python 3.14 中:" #: ../../whatsnew/3.12.rst:1101 msgid ":class:`!ast.Num`" @@ -1533,26 +2055,34 @@ msgid "" "Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" "`90953`.)" msgstr "" +"請改用 :class:`ast.Constant`。(由 Serhiy Storchaka 在 :gh:`90953` 中貢獻。)" #: ../../whatsnew/3.12.rst:1110 +#, fuzzy msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " "typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." "abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" msgstr "" +":mod:`collections.abc`:棄用 :class:`collections.abc.ByteString`。現在會推薦" +"使用 :class:`Sequence` 或 :class:`collections.abc.Buffer`。為了在打字中使用," +"更喜歡使用聯合,例如``bytes | bytearray`,或:class:`collections.abc." +"Buffer`。 (由 Shantanu Jain 在 :gh:`91896` 中貢獻。)" #: ../../whatsnew/3.12.rst:1115 msgid "" ":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." "localtime`. (Contributed by Alan Williams in :gh:`72346`.)" msgstr "" +":mod:`email`:棄用了 :func:`email.utils.localtime` 中的 *isdst* 參數。 (由 " +"Alan Williams 在 :gh:`72346` 中貢獻。)" #: ../../whatsnew/3.12.rst:1118 msgid "" ":mod:`importlib.abc`: Deprecated the following classes, scheduled for " "removal in Python 3.14:" -msgstr "" +msgstr ":mod:`importlib.abc`:已棄用以下類別,計劃在 Python 3.14 中刪除:" #: ../../whatsnew/3.12.rst:1121 msgid ":class:`!importlib.abc.ResourceReader`" @@ -1567,8 +2097,9 @@ msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" #: ../../whatsnew/3.12.rst:1125 +#, fuzzy msgid "Use :mod:`importlib.resources.abc` classes instead:" -msgstr "" +msgstr "使用 importlib.resources.abc 類代替:" #: ../../whatsnew/3.12.rst:1127 msgid ":class:`importlib.resources.abc.Traversable`" @@ -1580,7 +2111,7 @@ msgstr ":class:`importlib.resources.abc.TraversableResources`" #: ../../whatsnew/3.12.rst:1130 msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" -msgstr "" +msgstr "(由 Jason R. Coombs 和 Hugo van Kemenade 在 :gh:`93963` 中貢獻。)" #: ../../whatsnew/3.12.rst:1132 msgid "" @@ -1589,8 +2120,12 @@ msgid "" "This will be removed in 3.14 for a significant reduction in code volume and " "maintenance burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" msgstr "" +"itertools:該模組對一般複製、深度複製 (deepcopy) 和 pickle 操作的支援不一致," +"且沒有文件記錄、效率低下、過去常發生錯誤。這將在 3.14 中刪除,以顯著減少程式" +"碼的量和維護負擔。 (由 Raymond Hettinger 在 :gh:`101588` 中貢獻。)" #: ../../whatsnew/3.12.rst:1138 +#, fuzzy msgid "" ":mod:`multiprocessing`: The default :mod:`multiprocessing` start method will " "change to a safer one on Linux, BSDs, and other non-macOS POSIX platforms " @@ -1600,13 +2135,23 @@ msgid "" "`~multiprocessing.set_start_method` APIs to explicitly specify when your " "code *requires* ``'fork'``. See :ref:`multiprocessing-start-methods`." msgstr "" +":mod:`multiprocessing`:預設的 :mod:`multiprocessing` 啟動方法將在 Linux、" +"BSD 和其他非 macOS POSIX 平台上更改為更安全的方法,其中 ``'fork'`` 當前是預設" +"值 (:gh:`84559`)。新增關於此的運行時警告被認為太具有破壞性,因為大多數程式碼" +"預計不會關心。使用 :func:`~multiprocessing.get_context` 或 :func:" +"`~multiprocessing.set_start_method` API 顯式指定你的程式碼何時*需要* " +"``'fork'``。請參閱:ref:`多處理啟動方法`。" #: ../../whatsnew/3.12.rst:1146 +#, fuzzy msgid "" ":mod:`pkgutil`: :func:`pkgutil.find_loader` and :func:`pkgutil.get_loader` " "now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " "instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" +":mod:`pkgutil`: :func:`pkgutil.find_loader` 和:func:`pkgutil.get_loader` 現在" +"引發:exc:`DeprecationWarning`;使用 importlib.util.find_spec 代替。 (由 " +"Nikita Sobolev 在 :gh:`97850` 中貢獻。)" #: ../../whatsnew/3.12.rst:1151 msgid "" @@ -1614,18 +2159,25 @@ msgid "" "``slave_open()`` functions that have been deprecated since Python 2 but only " "gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14." msgstr "" +"pty:該模組有兩個未以文件記錄的 ``master_open()`` 和 ``slave_open()`` 函式," +"自 Python 2 以來已被棄用,但僅在 3.12 中以 :exc:`DeprecationWarning` 處理。將" +"在 3.14 中刪除它們。" #: ../../whatsnew/3.12.rst:1155 msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is deprecated " "in 3.12, and will be removed in 3.14." msgstr "" +":mod:`shutil`::func:`shutil.rmtree` 的 *onerror* 引數在 3.12 中已棄用,並將" +"在 3.14 中刪除。" #: ../../whatsnew/3.12.rst:1158 msgid "" ":mod:`typing`: :class:`typing.ByteString`, deprecated since Python 3.9, now " "causes a :exc:`DeprecationWarning` to be emitted when it is used." msgstr "" +":mod:`typing`: :class:`typing.ByteString` 自 Python 3.9 起已棄用,現在會在使" +"用時發出 :exc:`DeprecationWarning` 。" #: ../../whatsnew/3.12.rst:1161 msgid "" @@ -1633,42 +2185,54 @@ msgid "" "etree.ElementTree.Element` is deprecated and will raise an exception in " "Python 3.14." msgstr "" +":mod:`xml.etree.ElementTree`: :class:`xml.etree.ElementTree.Element` 的真值" +"測試已被棄用,並且會在 Python 3.14 中引發例外。" #: ../../whatsnew/3.12.rst:1164 msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases using the C API." msgstr "" +"使用 C API 建立具有可變基底的不可變型別 (:c:macro:" +"`Py_TPFLAGS_IMMUTABLETYPE`)。" #: ../../whatsnew/3.12.rst:1167 msgid "" "``__package__`` and ``__cached__`` will cease to be set or taken into " "consideration by the import system (:gh:`97879`)." msgstr "" +"引入系統將不再設定或考慮 ``__package__`` 和 ``__cached__`` (:gh:`97879`)。" #: ../../whatsnew/3.12.rst:1170 +#, fuzzy msgid "" "Accessing ``co_lnotab`` was deprecated in :pep:`626` since 3.10 and was " "planned to be removed in 3.12 but it only got a proper :exc:" "`DeprecationWarning` in 3.12. May be removed in 3.14. (Contributed by Nikita " "Sobolev in :gh:`101866`.)" msgstr "" +"自 3.10 起,存取 ``co_lnotab`` 已在 626 中被棄用,併計劃在 3.12 中刪除,但在 " +"3.12 中只得到了適當的 DeprecationWarning。可能會在 3.14 中刪除。 (由 Nikita " +"Sobolev 在 :gh:`101866` 中貢獻。)" #: ../../whatsnew/3.12.rst:1177 msgid "Pending Removal in Future Versions" -msgstr "" +msgstr "未來版本中待刪除項目" #: ../../whatsnew/3.12.rst:1179 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" +"以下 API 在早期 Python 版本中已棄用,並將被刪除,但目前還沒有計劃刪除它們的日" +"期。" #: ../../whatsnew/3.12.rst:1182 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" #: ../../whatsnew/3.12.rst:1184 +#, fuzzy msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -1679,10 +2243,16 @@ msgid "" "keyword:`is` and :keyword:`or`. In a future release it will be changed to a " "syntax error. (:gh:`87999`)" msgstr "" +"目前,Python 接受緊跟關鍵字的數字文字,例如 ``0in x``、 ``1or x``、 ``0if " +"1else 2``。它允許令人困惑和不明確的表達式,例如 ``[0x1for x in y]``(可以解釋" +"為 ``[0x1 for x in y]``或 ``[0x1f or x in y]``)。如果數字文字後緊跟以下關鍵" +"字之一,則會引發語法警告::keyword:`and`、:keyword:`else`、:keyword:`for`、:" +"keyword:`if`、:keyword:`in` ,:關鍵字:`是`和:關鍵字:`或`。在未來的版本" +"中,它將更改為語法錯誤。 (:gh:`87999`)" #: ../../whatsnew/3.12.rst:1195 ../../whatsnew/3.12.rst:1951 msgid "Removed" -msgstr "" +msgstr "已刪除" #: ../../whatsnew/3.12.rst:1197 msgid "" @@ -1690,32 +2260,44 @@ msgid "" "to the schedule in :pep:`594`, having been deprecated in Python 3.6. Use :" "mod:`asyncio` instead. (Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" +"``asynchat`` 和 ``asyncore``:這兩個模組已根據 :pep:`594` 中的計劃刪除,在 " +"Python 3.6 中已棄用。請改用 :mod:`asyncio`。(由 Nikita Sobolev 在 :gh:" +"`96580` 中貢獻。)" #: ../../whatsnew/3.12.rst:1203 msgid "" ":mod:`configparser`: Several names deprecated in the :mod:`configparser` way " "back in 3.2 have been removed per :gh:`89336`:" msgstr "" +":mod:`configparser`:3.2 中 :mod:`configparser` 中不推薦使用的幾個名稱已在 :" +"gh:`89336` 刪除:" #: ../../whatsnew/3.12.rst:1206 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" +":class:`configparser.ParsingError` 不再具有 ``filename`` 屬性或引數。請改用 " +"``source`` 屬性和引數。" #: ../../whatsnew/3.12.rst:1208 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" +":mod:`configparser` 不再有 ``SafeConfigParser`` 類別。請改用較短的 :class:" +"`~configparser.ConfigParser` 名稱。" #: ../../whatsnew/3.12.rst:1210 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" +":class:`configparser.ConfigParser` 不再有 ``readfp`` 方法。請改用 :meth:" +"`~configparser.ConfigParser.read_file`。" #: ../../whatsnew/3.12.rst:1213 +#, fuzzy msgid "" "``distutils``: Remove the ``distutils`` package. It was deprecated in Python " "3.10 by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -1723,22 +2305,33 @@ msgid "" "project can be installed: it still provides ``distutils``. (Contributed by " "Victor Stinner in :gh:`92584`.)" msgstr "" +"``distutils``:刪除 ``distutils`` 套件。它在 Python 3.10 中被 :pep:`632` 「棄" +"用 distutils 模組」棄用。對於仍然使用 ``distutils`` 且無法更新為其他內容的項" +"目,可以安裝 ``setuptools`` 項目:它仍然提供 ``distutils``。 (由 Victor " +"Stinner 在 :gh:`92584` 中貢獻。)" #: ../../whatsnew/3.12.rst:1219 msgid "" ":mod:`ensurepip`: Remove the bundled setuptools wheel from :mod:`ensurepip`, " "and stop installing setuptools in environments created by :mod:`venv`." msgstr "" +":mod:`ensurepip`:從 :mod:`ensurepip` 中刪除綁定的 setuptools wheek,並停止" +"在 :mod:`venv` 建立的環境中安裝 setuptools。" #: ../../whatsnew/3.12.rst:1222 +#, fuzzy msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " "still be used with ``pip install``, since pip will provide ``setuptools`` in " "the build environment it uses for building a package." msgstr "" +"``pip (>= 22.1)`` 不需要在環境中安裝 setuptools。基於 ``setuptools``(和基於 " +"``distutils``)的套件仍然可以與 ``pip install``一起使用,因為 pip 將在用於構" +"建套件的建構環境中提供 ``setuptools``。" #: ../../whatsnew/3.12.rst:1228 +#, fuzzy msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -1747,16 +2340,22 @@ msgid "" "project should be declared as a dependency and installed separately " "(typically, using pip)." msgstr "" +"在使用 venv 建立或使用 ensurepip 引導的環境中,預設情況下不再提供 " +"easy_install、pkg_resources、setuptools 和 distutils,因為它們 ``setuptools``" +"包的一部分。對於在運行時依賴這些的項目,應將 ``setuptools``項目聲明為依賴項並" +"單獨安裝(通常使用 pip)。" #: ../../whatsnew/3.12.rst:1235 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" -msgstr "" +msgstr "(由 Pradyun Gedam 在 :gh:`95299` 中貢獻。)" #: ../../whatsnew/3.12.rst:1237 msgid "" ":mod:`ftplib`: Remove the ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" +":mod:`ftplib`:刪除 ``FTP_TLS.ssl_version`` 類別屬性:請改用 *context* 參數。" +"(由 Victor Stinner 在 :gh:`94172` 中貢獻。)" #: ../../whatsnew/3.12.rst:1241 msgid "" @@ -1766,8 +2365,13 @@ msgid "" "extension if it was not present. (Contributed by Victor Stinner in :gh:" "`94196`.)" msgstr "" +"gzip:刪除(自 Python 2.6 起已棄用的):class:`gzip.GzipFile` 的 ``filename`` " +"屬性,請改用 :attr:`~gzip.GzipFile.name` 屬性。在寫入模式下,``filename`` 屬" +"性會新增 ``'.gz'`` 檔案擴充名稱(如果原本不存在)。(由 Victor Stinner 在 :" +"gh:`94196` 中貢獻。)" #: ../../whatsnew/3.12.rst:1247 +#, fuzzy msgid "" ":mod:`hashlib`: Remove the pure Python implementation of :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -1775,46 +2379,59 @@ msgid "" "of :func:`~hashlib.pbkdf2_hmac()` which is faster. (Contributed by Victor " "Stinner in :gh:`94199`.)" msgstr "" +":mod:`hashlib`:刪除 :func:`hashlib.pbkdf2_hmac()` 的純 Python 實作,該實作" +"在 Python 3.10 中已棄用。 Python 3.10 及更新版本需要 OpenSSL 1.1.1 (:pep:" +"`644`):此 OpenSSL 版本提供了更快的 :func:`~hashlib.pbkdf2_hmac()` 的 C 實" +"作。 (由 Victor Stinner 在 :gh:`94199` 中貢獻。)" #: ../../whatsnew/3.12.rst:1253 msgid "" ":mod:`importlib`: Many previously deprecated cleanups in :mod:`importlib` " "have now been completed:" msgstr "" +":mod:`importlib`:許多以前在 :mod:`importlib` 中棄用的清理現在已經完成:" #: ../../whatsnew/3.12.rst:1256 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" +"對 :meth:`!module_repr()` 的參照和支援已被刪除。(由 Barry Warsaw 在 :gh:" +"`97850` 中貢獻。)" #: ../../whatsnew/3.12.rst:1259 msgid "" "``importlib.util.set_package`` has been removed. (Contributed by Brett " "Cannon in :gh:`65961`.)" msgstr "" +"``importlib.util.set_package`` 已被刪除。(由 Brett Cannon 在 :gh:`65961` 中" +"貢獻。)" #: ../../whatsnew/3.12.rst:1262 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" +"對 ``find_loader()`` 和 ``find_module()`` API 的支援已被刪除。(由 Barry " +"Warsaw 在 :gh:`98040` 中貢獻。)" #: ../../whatsnew/3.12.rst:1265 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" +"``importlib.abc.Finder``、``pkgutil.ImpImporter`` 和 ``pkgutil.ImpLoader`` 已" +"被刪除。(由 Barry Warsaw 在 :gh:`98040` 中貢獻。)" #: ../../whatsnew/3.12.rst:1268 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" -msgstr "" +msgstr ":mod:`!imp` 模組已被刪除。(由 Barry Warsaw 在 :gh:`98040` 中貢獻。)" #: ../../whatsnew/3.12.rst:1271 msgid "Replace removed :mod:`!imp` functions with :mod:`importlib` functions:" -msgstr "" +msgstr "將已刪除的 :mod:`!imp` 函式替換為 :mod:`importlib` 函式:" #: ../../whatsnew/3.12.rst:1274 msgid "imp" @@ -1830,7 +2447,7 @@ msgstr "``imp.NullImporter``" #: ../../whatsnew/3.12.rst:1276 msgid "Insert ``None`` into ``sys.path_importer_cache``" -msgstr "" +msgstr "將 ``None`` 插入 ``sys.path_importer_cache``" #: ../../whatsnew/3.12.rst:1277 msgid "``imp.cache_from_source()``" @@ -1865,6 +2482,8 @@ msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" +":attr:`importlib.machinery.SOURCE_SUFFIXES`、:attr:`importlib.machinery." +"EXTENSION_SUFFIXES` 和 :attr:`importlib.machinery.BYTECODE_SUFFIXES`" #: ../../whatsnew/3.12.rst:1281 msgid "``imp.get_tag()``" @@ -1909,14 +2528,17 @@ msgstr ":func:`importlib.util.source_from_cache`" #: ../../whatsnew/3.12.rst:1288 msgid "Replace ``imp.load_source()`` with::" msgstr "" +"將 ``imp.load_source()`` 替換為:\n" +"\n" +"::" #: ../../whatsnew/3.12.rst:1303 msgid "Removed :mod:`!imp` functions and attributes with no replacements:" -msgstr "" +msgstr "刪除了 :mod:`!imp` 函式和屬性,沒有其他替代品:" #: ../../whatsnew/3.12.rst:1305 msgid "undocumented functions:" -msgstr "" +msgstr "未於文件記錄的函式:" #: ../../whatsnew/3.12.rst:1307 msgid "``imp.init_builtin()``" @@ -1935,10 +2557,13 @@ msgid "``imp.load_package()``" msgstr "``imp.load_package()``" #: ../../whatsnew/3.12.rst:1312 +#, fuzzy msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" +"``imp.lock_held()``、``imp.acquire_lock()``、``imp.release_lock()``:鎖定 " +"scheme 在 Python 3.3 中已改為模組鎖 (per-module locks)。" #: ../../whatsnew/3.12.rst:1314 msgid "" @@ -1946,6 +2571,9 @@ msgid "" "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" +"``imp.find_module()`` 常數:``SEARCH_ERROR``、``PY_SOURCE``、" +"``PY_COMPILED``、``C_EXTENSION``、``PY_RESOURCE``、``PKG_DIRECTORY``、" +"``C_BUILTIN ``、``PY_FROZEN``、``PY_CODERESOURCE``、``IMP_HOOK``。" #: ../../whatsnew/3.12.rst:1318 msgid "" @@ -1955,6 +2583,10 @@ msgid "" "open` is also a static method. (Contributed by Victor Stinner in :gh:" "`94169`.)" msgstr "" +":mod:`io`:刪除在 Python 3.10 中已棄用的 ``io.OpenWrapper`` 和 ``_pyio." +"OpenWrapper``,請改用 :func:`open`。:func:`open` (:func:`io.open`) 函式是一個" +"內建函式。從 Python 3.10 開始,:func:`!_pyio.open` 也是一個靜態方法。 (由 " +"Victor Stinner 在 :gh:`94169` 中貢獻。)" #: ../../whatsnew/3.12.rst:1324 msgid "" @@ -1962,20 +2594,29 @@ msgid "" "Python 3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" +":mod:`locale`:刪除在 Python 3.7 中已棄用的 :func:`!locale.format` 函式,請改" +"用 :func:`locale.format_string`。(由 Victor Stinner 在 :gh:`94226` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1328 +#, fuzzy msgid "" "``smtpd``: The module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " "module or any other :mod:`asyncio`-based server instead. (Contributed by " "Oleg Iarygin in :gh:`93243`.)" msgstr "" +"``smtpd``:該模組已根據 :pep:`594` 中的計劃刪除,已在 Python 3.4.7 和 3.5.4 " +"中棄用。請改用 aiosmtpd_ PyPI 模組或任何其他基於 asyncio 的服務器。 (由 " +"Oleg Iarygin 在 :gh:`93243` 中貢獻。)" #: ../../whatsnew/3.12.rst:1336 msgid "" ":mod:`sqlite3`: The following undocumented :mod:`sqlite3` features, " "deprecated in Python 3.10, are now removed:" msgstr "" +":mod:`sqlite3`:以下未記錄於文件的 :mod:`sqlite3` 功能在 Python 3.10 中已棄" +"用、且現已被刪除:" #: ../../whatsnew/3.12.rst:1339 msgid "``sqlite3.enable_shared_cache()``" @@ -1990,39 +2631,57 @@ msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" +"xml.etree.ElementTree:刪除純 Python 實作的 ElementTree.Element.copy() 方法" +"(在 Python 3.10 中已棄用),改用 copy.copy 函式。 xml.etree.ElementTree 的 " +"C 實作沒有 ``copy()`` 方法,只有 ``__copy__()`` 方法。 (由 Victor Stinner " +"在 :gh:`94383` 中貢獻。)" #: ../../whatsnew/3.12.rst:1345 +#, fuzzy msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " "``OptimizedUnicode`` can either use ``str`` explicitly, or rely on the " "default value which is also ``str``." msgstr "" +"自 Python 3.3 起,``sqlite3.OptimizedUnicode`` 文本工廠一直是 str 的別名。之" +"前將文本工廠設定為 ``OptimizedUnicode`` 的程式碼可以顯式使用 ``str``,或者依" +"賴預設值 ``str``。" #: ../../whatsnew/3.12.rst:1350 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" -msgstr "" +msgstr "(由 Erlend E. Aasland 在 :gh:`92548` 中貢獻。)" #: ../../whatsnew/3.12.rst:1352 +#, fuzzy msgid ":mod:`ssl`:" -msgstr "" +msgstr ":mod:`ssl`:" #: ../../whatsnew/3.12.rst:1354 +#, fuzzy msgid "" "Remove the :func:`!ssl.RAND_pseudo_bytes` function, deprecated in Python " "3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. (Contributed " "by Victor Stinner in :gh:`94199`.)" msgstr "" +"刪除 :func:`!ssl.RAND_pseudo_bytes` 函式(在 Python 3.6 中已棄用):使用 :" +"func:`os.urandom` 或 :func:`ssl.RAND_bytes` 代替。 (由 Victor Stinner 在 :" +"gh:`94199` 中貢獻。)" #: ../../whatsnew/3.12.rst:1358 +#, fuzzy msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " "uses the :func:`!ssl.match_hostname` function. (Contributed by Victor " "Stinner in :gh:`94199`.)" msgstr "" +"刪除 :func:`!ssl.match_hostname` 函式。它在 Python 3.7 中已被棄用。 OpenSSL " +"從 Python 3.7 開始執行主機名匹配,Python 不再使用 :func:`!ssl." +"match_hostname` 函式。 (由 Victor Stinner 在 :gh:`94199` 中貢獻。)" #: ../../whatsnew/3.12.rst:1364 +#, fuzzy msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2032,26 +2691,33 @@ msgid "" "`_: Improper Certificate " "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" +"刪除 :func:`!ssl.wrap_socket` 函式(在 Python 3.7 中已棄用):而是建立一個 :" +"class:`ssl.SSLContext` 物件並呼叫其 :class:`ssl.SSLContext.wrap_socket` 方" +"法。任何仍然使用 :func:`!ssl.wrap_socket` 的包都是損壞且不安全的。該函式既不" +"發送 SNI TLS 擴充,也不驗證服務器主機名。程式碼受 ``CWE-295 ``約束:不正確的證書驗證。 (由 Victor " +"Stinner 在 :gh:`94199` 中貢獻。)" #: ../../whatsnew/3.12.rst:1373 +#, fuzzy msgid ":mod:`unittest`: Removed many old deprecated :mod:`unittest` features:" -msgstr "" +msgstr ":mod:`unittest`:刪除了許多舊的已棄用的 :mod:`unittest` 功能:" #: ../../whatsnew/3.12.rst:1375 msgid "A number of :class:`~unittest.TestCase` method aliases:" -msgstr "" +msgstr "許多 :class:`~unittest.TestCase` 方法別名:" #: ../../whatsnew/3.12.rst:1378 msgid "Deprecated alias" -msgstr "" +msgstr "已棄用的別名" #: ../../whatsnew/3.12.rst:1378 msgid "Method Name" -msgstr "" +msgstr "方法名稱" #: ../../whatsnew/3.12.rst:1378 msgid "Deprecated in" -msgstr "" +msgstr "已棄用於" #: ../../whatsnew/3.12.rst:1380 msgid "``failUnless``" @@ -2176,39 +2842,55 @@ msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" +"你可以使用 https://github.com/isidentical/teyit 自動現代化 (modernise) 你的單" +"元測試。" #: ../../whatsnew/3.12.rst:1400 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" +"未記錄且損壞的 :class:`~unittest.TestCase` 方法 ``assertDictContainsSubset`` " +"(在 Python 3.2 中已棄用)。" #: ../../whatsnew/3.12.rst:1403 +#, fuzzy msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" +"未記錄的 TestLoader.loadTestsFromModule 參數 *use_load_tests* (自 Python 3.2 起已棄用並被忽" +"略)。" #: ../../whatsnew/3.12.rst:1407 +#, fuzzy msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" +":class:`~unittest.TextTestResult` 類的別名:``_TextTestResult`` (在 Python " +"3.2 中已棄用)。" #: ../../whatsnew/3.12.rst:1410 msgid "(Contributed by Serhiy Storchaka in :issue:`45162`.)" -msgstr "" +msgstr "(由 Serhiy Storchaka 在 :issue:`45162` 中貢獻。)" #: ../../whatsnew/3.12.rst:1412 +#, fuzzy msgid "" ":mod:`webbrowser`: Remove support for obsolete browsers from :mod:" "`webbrowser`. Removed browsers include: Grail, Mosaic, Netscape, Galeon, " "Skipstone, Iceape, Firebird, and Firefox versions 35 and below (:gh:" "`102871`)." msgstr "" +":mod:`webbrowser`:從 :mod:`webbrowser` 中刪除對過時瀏覽器的支援。刪除的瀏覽" +"器包括:Grail、Mosaic、Netscape、Galeon、Skipstone、Iceape、Firebird 和 " +"Firefox 版本 35 及以下 (:gh:`102871`)。" #: ../../whatsnew/3.12.rst:1416 +#, fuzzy msgid "" ":mod:`xml.etree.ElementTree`: Remove the ``ElementTree.Element.copy()`` " "method of the pure Python implementation, deprecated in Python 3.10, use " @@ -2216,6 +2898,10 @@ msgid "" "etree.ElementTree` has no ``copy()`` method, only a ``__copy__()`` method. " "(Contributed by Victor Stinner in :gh:`94383`.)" msgstr "" +"xml.etree.ElementTree:刪除純 Python 實作的 ElementTree.Element.copy() 方法" +"(在 Python 3.10 中已棄用),改用 copy.copy 函式。 xml.etree.ElementTree 的 " +"C 實作沒有 ``copy()`` 方法,只有 ``__copy__()`` 方法。 (由 Victor Stinner " +"在 :gh:`94383` 中貢獻。)" #: ../../whatsnew/3.12.rst:1422 msgid "" @@ -2223,6 +2909,9 @@ msgid "" "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" +":mod:`zipimport`:刪除 ``find_loader()`` 和 ``find_module()`` 方法,在 " +"Python 3.10 中已棄用:請改用 ``find_spec()`` 方法。基本原理請參考 :pep:" +"`451`。 (由 Victor Stinner 在 :gh:`94379` 中貢獻。)" #: ../../whatsnew/3.12.rst:1427 msgid "" @@ -2230,8 +2919,12 @@ msgid "" "``Doc/tools/rstlint.py``, both in favor of `sphinx-lint `_. (Contributed by Julien Palard in :gh:`98179`.)" msgstr "" +"從說明文件的 Makefile 中刪除了 ``suspicious`` 規則與 ``Doc/tools/rstlint." +"py``,因 `sphinx-lint `_ 都支" +"援兩者的功能。(由 Julien Palard 在 :gh:`98179` 中貢獻。)" #: ../../whatsnew/3.12.rst:1432 +#, fuzzy msgid "" "Remove the *keyfile* and *certfile* parameters from the :mod:`ftplib`, :mod:" "`imaplib`, :mod:`poplib` and :mod:`smtplib` modules, and the *key_file*, " @@ -2240,22 +2933,29 @@ msgid "" "(*ssl_context* in :mod:`imaplib`) instead. (Contributed by Victor Stinner " "in :gh:`94172`.)" msgstr "" +"從 :mod:`ftplib`、:mod:`imaplib`、:mod:`poplib` 和 :mod:`smtplib` 模組中刪除 " +"*keyfile* 和 *certfile* 參數,以及 *key_file*、*cert_file*和 http.client 模組" +"中的 *check_hostname* 參數,自 Python 3.6 起均已棄用。請使用 *context* 參數" +"(imaplib 中的 *ssl_context*)。 (由 Victor Stinner 在 :gh:`94172` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1443 ../../whatsnew/3.12.rst:1747 msgid "Porting to Python 3.12" -msgstr "" +msgstr "移植到 Python 3.12" #: ../../whatsnew/3.12.rst:1445 +#, fuzzy msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." -msgstr "" +msgstr "本節列出了前面描述的變更以及可能需要更改程式碼的其他錯誤修復。" #: ../../whatsnew/3.12.rst:1449 msgid "Changes in the Python API" -msgstr "" +msgstr "Python API 的變更" #: ../../whatsnew/3.12.rst:1451 +#, fuzzy msgid "" "More strict rules are now applied for numerical group references and group " "names in regular expressions. Only sequence of ASCII digits is now accepted " @@ -2263,8 +2963,12 @@ msgid "" "strings can now only contain ASCII letters and digits and underscore. " "(Contributed by Serhiy Storchaka in :gh:`91760`.)" msgstr "" +"現在,正則表達式中的數字組引用和組名稱應用了更嚴格的規則。現在僅接受 ASCII 數" +"字序列作為數字參考。位元組模式和替換字串中的組名稱現在只能包含 ASCII 字母、數" +"字和下劃線。 (由 Serhiy Storchaka 在 :gh:`91760` 中貢獻。)" #: ../../whatsnew/3.12.rst:1458 +#, fuzzy msgid "" "Removed ``randrange()`` functionality deprecated since Python 3.10. " "Formerly, ``randrange(10.0)`` losslessly converted to ``randrange(10)``. " @@ -2275,8 +2979,15 @@ msgid "" "``randrange(10**25)``. (Originally suggested by Serhiy Storchaka :gh:" "`86388`.)" msgstr "" +"刪除了自 Python 3.10 以來已棄用的 ``randrange()``功能。以前, " +"``randrange(10.0)``無損轉換為 ``randrange(10)``。現在,它會引發 TypeError。此" +"外,針對非整數值(例如 ``randrange(10.5)``或 ``randrange('10')``)引發的例外" +"已從 ValueError 更改為 TypeError。這還可以防止 ``randrange(1e25)``默默地從比 " +"``randrange(10**25)``更大的範圍中進行選擇的錯誤。 (最初由 Serhiy Storchaka " +"建議:gh:`86388`。)" #: ../../whatsnew/3.12.rst:1466 +#, fuzzy msgid "" ":class:`argparse.ArgumentParser` changed encoding and error handler for " "reading arguments from file (e.g. ``fromfile_prefix_chars`` option) from " @@ -2285,6 +2996,11 @@ msgid "" "handler`. Argument files should be encoded in UTF-8 instead of ANSI Codepage " "on Windows." msgstr "" +":class:`argparse.ArgumentParser` 更改了編碼和錯誤處理程序,用於從預設文本編碼" +"(例如 :func:`locale.getpreferredencoding(False) `)中讀取文件參數(例如 ``fromfile_prefix_chars`` 選項)" +"到:term:`文件系統編碼和錯誤處理程序`。在 Windows 上,參數文件應使用 UTF-8 編" +"碼,而不是 ANSI 程式碼頁。" #: ../../whatsnew/3.12.rst:1472 msgid "" @@ -2292,23 +3008,33 @@ msgid "" "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based aiosmtpd_ " "PyPI module." msgstr "" +"刪除了在 Python 3.4.7 和 3.5.4 中已棄用、基於 ``asyncore`` 的 ``smtpd`` 模" +"組。推薦的替代品是基於 :mod:`asyncio` 的 aiosmtpd_ PyPI 模組。" #: ../../whatsnew/3.12.rst:1476 +#, fuzzy msgid "" ":func:`shlex.split`: Passing ``None`` for *s* argument now raises an " "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" +"shlex.split:為 *s* 參數傳遞 None 現在會引發例外,而不是讀取 sys.stdin。該功" +"能在 Python 3.9 中已被棄用。 (由 Victor Stinner 在 :gh:`94352` 中貢獻。)" #: ../../whatsnew/3.12.rst:1481 +#, fuzzy msgid "" "The :mod:`os` module no longer accepts bytes-like paths, like :class:" "`bytearray` and :class:`memoryview` types: only the exact :class:`bytes` " "type is accepted for bytes strings. (Contributed by Victor Stinner in :gh:" "`98393`.)" msgstr "" +":mod:`os` 模組不再接受類似位元組的路徑,例如 bytearray 和 memoryview 型別:對" +"於位元組字串,僅接受確切的 bytes 型別。 (由 Victor Stinner 在 :gh:`98393` 中" +"貢獻。)" #: ../../whatsnew/3.12.rst:1486 +#, fuzzy msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -2319,8 +3045,14 @@ msgid "" "process-global resources, which are best managed from the main interpreter. " "(Contributed by Dong-hee Na in :gh:`99127`.)" msgstr "" +"如果在子直譯器中使用,syslog.openlog 和 syslog.closelog 現在會失敗。 syslog." +"syslog 仍可在子直譯器中使用,但現在僅當 syslog.openlog 已在主直譯器中呼叫時。" +"這些新限制不適用於主直譯器,因此只有極少數使用者可能會受到影響。此更改有助於" +"口譯員隔離。此外,syslog 是行程全局資源的包裝器,最好通過主直譯器進行管理。 " +"(由 Dong-hee Na 在 :gh:`99127` 中貢獻。)" #: ../../whatsnew/3.12.rst:1495 +#, fuzzy msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -2331,15 +3063,25 @@ msgid "" "fine. If synchronization is needed, implement locking within the cached " "property getter function or around multi-threaded access points." msgstr "" +"未記錄的 :func:`~functools.cached_property` 鎖定行為已被刪除,因為它鎖定了類" +"的所有實例,從而導致高鎖定爭用。這意味著,如果兩個執行緒競爭,快取的屬性 " +"getter 函式現在可以為單個實例運行多次。對於大多數簡單的快取屬性(例如,那些冪" +"等屬性並且簡單地根據實例的其他屬性計算值),這將沒問題。如果需要同步,請在快" +"取的屬性 getter 函式內或多執行緒存取點周圍實作鎖定。" #: ../../whatsnew/3.12.rst:1508 +#, fuzzy msgid "" "When extracting tar files using :mod:`tarfile` or :func:`shutil." "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" +"使用 tarfile 或 shutdown.unpack_archive 提取 tar 文件時,請傳遞 *filter* 參數" +"以限制可能令人驚訝或危險的功能。有關詳細資訊,請參閱:ref:`tarfile-extraction-" +"filter`。" #: ../../whatsnew/3.12.rst:1513 +#, fuzzy msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" @@ -2350,46 +3092,69 @@ msgid "" "tokenization in the expression components. For example for the f-string " "``f\"start {1+1} end\"`` the old version of the tokenizer emitted::" msgstr "" +"由於 701 中引入的更改,tokenize.tokenize 和 tokenize.generate_tokens 函式的輸" +"出現已更改。這意味著不再為 f 字串發出 ``STRING`` 令牌,並且現在會生成 :pep:" +"`701` 中描述的令牌:``FSTRING_START``、``FSRING_MIDDLE`` 和 ``FSTRING_END`除" +"了表達式組件中用於標記化的適當標記之外,現在還會針對 f 字串 ``字串``部分發出" +"`。例如,對於 f 字串 ``f\"start {1+1} end\"`` 舊版本的標記產生器發出:\n" +"\n" +"::" #: ../../whatsnew/3.12.rst:1524 msgid "while the new version emits::" msgstr "" +"而新版本會發出:\n" +"\n" +"::" #: ../../whatsnew/3.12.rst:1536 +#, fuzzy msgid "" "Additionally, there may be some minor behavioral changes as a consecuence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" +"此外,由於支援 :pep:`701` 所需的更改,可能會出現一些細微的行為變更。其中一些" +"變更包括:" #: ../../whatsnew/3.12.rst:1539 +#, fuzzy msgid "" "The ``type`` attribute of the tokens emitted when tokenizing some invalid " "Python characters such as ``!`` has changed from ``ERRORTOKEN`` to ``OP``." msgstr "" +"對某些無效 Python 字元(例如 ``!``)進行標記時發出的標記的 ``type``屬性已從 " +"``ERRORTOKEN``更改為 ``OP``。" #: ../../whatsnew/3.12.rst:1542 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" +"不完整的單列字串現在也會像不完整的多列字串一樣引發 :exc:`tokenize." +"TokenError`。" #: ../../whatsnew/3.12.rst:1545 +#, fuzzy msgid "" "Some incomplete or invalid Python code now raises :exc:`tokenize.TokenError` " "instead of returning arbitrary ``ERRORTOKEN`` tokens when tokenizing it." msgstr "" +"一些不完整或無效的 Python 程式碼現在會引發 :exc:`tokenize.TokenError`,而不是" +"在 tokenize 時回傳任意 ``ERRORTOKEN`` 標記。" #: ../../whatsnew/3.12.rst:1548 +#, fuzzy msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." -msgstr "" +msgstr "不再支援在同一文件中混合製表符和空格作為縮進,並且會引發 TabError。" #: ../../whatsnew/3.12.rst:1552 msgid "Build Changes" -msgstr "" +msgstr "建置變更" #: ../../whatsnew/3.12.rst:1554 +#, fuzzy msgid "" "Python no longer uses ``setup.py`` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " @@ -2397,13 +3162,20 @@ msgid "" "config`` and fall back to manual detection. (Contributed by Christian Heimes " "in :gh:`93939`.)" msgstr "" +"Python 不再使用 setup.py 來構建共享 C 擴充模組。在 ``configure``腳本中檢測到" +"標頭檔和庫等構建參數。擴充由``Makefile`` 構建。大多數擴充使用 ``pkg-config``" +"並回退到手動檢測。 (由 Christian Heimes 在 :gh:`93939` 中貢獻。)" #: ../../whatsnew/3.12.rst:1560 +#, fuzzy msgid "" "``va_start()`` with two parameters, like ``va_start(args, format),`` is now " "required to build Python. ``va_start()`` is no longer called with a single " "parameter. (Contributed by Kumar Aditya in :gh:`93207`.)" msgstr "" +"現在構建 Python 需要帶有兩個參數的 va_start() ,例如 va_start(args, " +"format) 。不再使用單個參數呼叫 ``va_start()``。 (由 Kumar Aditya 在 :gh:" +"`93207` 中貢獻。)" #: ../../whatsnew/3.12.rst:1565 msgid "" @@ -2411,8 +3183,11 @@ msgid "" "policy if the Clang compiler accepts the flag. (Contributed by Dong-hee Na " "in :gh:`89536`.)" msgstr "" +"如果 Clang 編譯器接受該旗標,CPython 現在使用 ThinLTO 選項作為預設鏈接時間最" +"佳化策略。(由 Dong-hee Na 在 :gh:`89536` 中貢獻。)" #: ../../whatsnew/3.12.rst:1569 +#, fuzzy msgid "" "Add ``COMPILEALL_OPTS`` variable in Makefile to override :mod:`compileall` " "options (default: ``-j0``) in ``make install``. Also merged the 3 " @@ -2420,10 +3195,14 @@ msgid "" "optimization levels (0, 1, 2) at once. (Contributed by Victor Stinner in :gh:" "`99289`.)" msgstr "" +"在 Makefile 中新增 ``COMPILEALL_OPTS`` 變數以覆蓋 ``make install`` 中的:mod:" +"`compileall` 選項(預設值:``-j0``)。還將 3 個 ``compileall``命令合併為一個" +"命令,以一次性為所有最佳化級別(0、1、2)構建 .pyc 文件。 (由 Victor " +"Stinner 在 :gh:`99289` 中貢獻。)" #: ../../whatsnew/3.12.rst:1575 msgid "Add platform triplets for 64-bit LoongArch:" -msgstr "" +msgstr "為 64 位元 LoongArch 新增平台三元組:" #: ../../whatsnew/3.12.rst:1577 msgid "loongarch64-linux-gnusf" @@ -2439,124 +3218,160 @@ msgstr "loongarch64-linux-gnu" #: ../../whatsnew/3.12.rst:1581 msgid "(Contributed by Zhang Na in :gh:`90656`.)" -msgstr "" +msgstr "(由 Zhang Na 於 :gh:`90656` 貢獻。)" #: ../../whatsnew/3.12.rst:1583 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." -msgstr "" +msgstr "``PYTHON_FOR_REGEN`` 現在需要 Python 3.10 或更高版本。" #: ../../whatsnew/3.12.rst:1585 msgid "" "Autoconf 2.71 and aclocal 1.16.4 is now required to regenerate :file:`!" "configure`. (Contributed by Christian Heimes in :gh:`89886`.)" msgstr "" +"現在需要 Autoconf 2.71 和 aclocal 1.16.4 來重新生成 :file:`!configure`。(由 " +"Christian Heimes 在 :gh:`89886` 中貢獻。)" #: ../../whatsnew/3.12.rst:1591 msgid "C API Changes" -msgstr "" +msgstr "C API 變更" #: ../../whatsnew/3.12.rst:1597 +#, fuzzy msgid "" ":pep:`697`: Introduced the :ref:`Unstable C API tier `, " "intended for low-level tools like debuggers and JIT compilers. This API may " "change in each minor release of CPython without deprecation warnings. Its " "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" +":pep:`697`:引入了\\ :ref:`不穩定 C API 層 `,旨在用於除錯器" +"和 JIT 編譯器等低級工具。此 API 可能會在 CPython 的每個次要版本中發生更改,而" +"不會出現棄用警告。其內容由名稱中的 ``PyUnstable_``前綴標記。" #: ../../whatsnew/3.12.rst:1603 msgid "Code object constructors:" -msgstr "" +msgstr "程式碼物件建構函式:" #: ../../whatsnew/3.12.rst:1605 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" -msgstr "" +msgstr "``PyUnstable_Code_New()`` (從 ``PyCode_New`` 重命名)" #: ../../whatsnew/3.12.rst:1606 +#, fuzzy msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" +" ``PyUnstable_Code_NewWithPosOnlyArgs()``(從 ``PyCode_NewWithPosOnlyArgs``重" +"命名)" #: ../../whatsnew/3.12.rst:1608 +#, fuzzy msgid "Extra storage for code objects (:pep:`523`):" -msgstr "" +msgstr "程式碼物件的額外存儲 (:pep:`523`):" #: ../../whatsnew/3.12.rst:1610 +#, fuzzy msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" +" ``PyUnstable_Eval_RequestCodeExtraIndex()``(從 " +"``_PyEval_RequestCodeExtraIndex``重命名)" #: ../../whatsnew/3.12.rst:1611 +#, fuzzy msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" -msgstr "" +msgstr " ``PyUnstable_Code_GetExtra()``(從 ``_PyCode_GetExtra``重命名)" #: ../../whatsnew/3.12.rst:1612 +#, fuzzy msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" -msgstr "" +msgstr " ``PyUnstable_Code_SetExtra()``(從 ``_PyCode_SetExtra``重命名)" #: ../../whatsnew/3.12.rst:1614 +#, fuzzy msgid "" "The original names will continue to be available until the respective API " "changes." -msgstr "" +msgstr "原始名稱將繼續可用,直到相應的 API 發生更改。" #: ../../whatsnew/3.12.rst:1617 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" -msgstr "" +msgstr "(由 Petr Viktorin 在 :gh:`101101` 中貢獻。)" #: ../../whatsnew/3.12.rst:1619 +#, fuzzy msgid "" ":pep:`697`: Added API for extending types whose instance memory layout is " "opaque:" -msgstr "" +msgstr ":pep:`697`:新增了用於擴充實例記憶體佈局不透明的型別的 API:" #: ../../whatsnew/3.12.rst:1622 +#, fuzzy msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" +":c:member:`PyType_Spec.basicsize` 可以為零或負數來指定繼承或擴充基底類別大" +"小。" #: ../../whatsnew/3.12.rst:1624 +#, fuzzy msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" +"新增了 PyObject_GetTypeData 和 PyType_GetTypeDataSize 以允許存取特定於子類別" +"的實例資料。" #: ../../whatsnew/3.12.rst:1626 +#, fuzzy msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" +"新增了:const:`Py_TPFLAGS_ITEMS_AT_END` 和:c:func:`PyObject_GetItemData` 以允" +"許安全地擴充某些可變大小的型別,包括:c:var:`PyType_Type`。" #: ../../whatsnew/3.12.rst:1629 +#, fuzzy msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" +"新增了 Py_RELATIVE_OFFSET 以允許根據子類別特定的結構定義成員 。" #: ../../whatsnew/3.12.rst:1632 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" -msgstr "" +msgstr "(由 Petr Viktorin 在 :gh:`103509` 中貢獻。)" #: ../../whatsnew/3.12.rst:1634 +#, fuzzy msgid "" "Added the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" "`PyType_FromModuleAndSpec` using an additional metaclass argument. " "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" +"新增了新的 :ref:`limited C API ` 函式 :c:func:" +"`PyType_FromMetaclass`,它使用附加元類參數概括了現有的:c:func:" +"`PyType_FromModuleAndSpec`。 (由 Wenzel Jakob 在 :gh:`93012` 中貢獻。)" #: ../../whatsnew/3.12.rst:1639 +#, fuzzy msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" +"用於建立可使用矢量呼叫協議 ` 進行呼叫的物件的 API 已新增到:ref:`" +"有限 API ` 中:" #: ../../whatsnew/3.12.rst:1643 +#, fuzzy msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" -msgstr "" +msgstr ":c:巨集:`Py_TPFLAGS_HAVE_VECTORCALL`" #: ../../whatsnew/3.12.rst:1644 msgid ":c:func:`PyVectorcall_NARGS`" @@ -2571,6 +3386,7 @@ msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" #: ../../whatsnew/3.12.rst:1648 +#, fuzzy msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -2580,20 +3396,33 @@ msgid "" "``Py_TPFLAGS_HAVE_VECTORCALL`` flag. (Contributed by Petr Viktorin in :gh:" "`93274`.)" msgstr "" +"現在,當重新分配類的 :py:meth:`~object.__call__` 方法時," +"Py_TPFLAGS_HAVE_VECTORCALL` 旗標將從類中刪除。這使得 vectorcall 可以安全地與" +"可變型別一起使用(即沒有不可變旗標的堆型別,:const:" +"`Py_TPFLAGS_IMMUTABLETYPE`)。不覆蓋 :c:member:`~PyTypeObject.tp_call` 的可變" +"型別現在繼承 ``Py_TPFLAGS_HAVE_VECTORCALL``旗標。 (由 Petr Viktorin 在 :gh:" +"`93274` 中貢獻。)" #: ../../whatsnew/3.12.rst:1656 +#, fuzzy msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " "classes to support object ``__dict__`` and weakrefs with less bookkeeping, " "using less memory and with faster access." msgstr "" +"新增了 Py_TPFLAGS_MANAGED_DICT 和 Py_TPFLAGS_MANAGED_WEAKREF 旗標。這允許擴充" +"類以更少的簿記、使用更少的記憶體和更快的存取來支援物件 ``__dict__``和" +"weakrefs。" #: ../../whatsnew/3.12.rst:1661 +#, fuzzy msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" +"使用向量呼叫協議 ` 執行呼叫的 API 已新增到 :ref:`有限 API " +"` 中:" #: ../../whatsnew/3.12.rst:1665 msgid ":c:func:`PyObject_Vectorcall`" @@ -2604,32 +3433,44 @@ msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" #: ../../whatsnew/3.12.rst:1667 +#, fuzzy msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -msgstr "" +msgstr ":c:巨集:`PY_VECTORCALL_ARGUMENTS_OFFSET`" #: ../../whatsnew/3.12.rst:1669 +#, fuzzy msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" +"這意味著矢量呼叫協議的傳入和傳出端現在都可以在 :ref:`Limited API ` 中" +"使用。 (由 Wenzel Jakob 在 :gh:`98586` 中貢獻。)" #: ../../whatsnew/3.12.rst:1673 +#, fuzzy msgid "" "Added two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " "functions in all running threads in addition to the calling one. " "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" +"新增了兩個新的公開函式:PyEval_SetProfileAllThreads 和 " +"PyEval_SetTraceAllThreads,它們允許在除呼叫執行緒之外的所有正在運行的執行緒中" +"設定跟踪和分析函式。 (由 Pablo Galindo 在 :gh:`93503` 中貢獻。)" #: ../../whatsnew/3.12.rst:1679 +#, fuzzy msgid "" "Added new function :c:func:`PyFunction_SetVectorcall` to the C API which " "sets the vectorcall field of a given :c:type:`PyFunctionObject`. " "(Contributed by Andrew Frost in :gh:`92257`.)" msgstr "" +"向 C API 新增了新函式 PyFunction_SetVectorcall ,用於設定給定 " +"PyFunctionObject 的向量呼叫欄位。 (由 Andrew Frost 在 :gh:`92257` 中貢獻。)" #: ../../whatsnew/3.12.rst:1683 +#, fuzzy msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -2637,29 +3478,42 @@ msgid "" "interpreters, JIT compilers, or debuggers. (Contributed by Carl Meyer in :gh:" "`91052`.)" msgstr "" +"C API 現在允許通過:c:func:`PyDict_AddWatcher`、:c:func:`PyDict_Watch` 註冊回" +"呼以及每當修改字典時呼叫的相關 API。它旨在供最佳化直譯器、JIT 編譯器或除錯器" +"使用。 (由 Carl Meyer 在 :gh:`91052` 中貢獻。)" #: ../../whatsnew/3.12.rst:1689 +#, fuzzy msgid "" "Added :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" +"新增了 PyType_AddWatcher 和 PyType_Watch API 來註冊回呼以接收有關型別更改的通" +"知。 (由 Carl Meyer 在 :gh:`91051` 中貢獻。)" #: ../../whatsnew/3.12.rst:1693 +#, fuzzy msgid "" "Added :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Ostricher in :gh:`91054`.)" msgstr "" +"新增了 PyCode_AddWatcher 和 PyCode_ClearWatcher API 來註冊回呼以接收有關建立" +"和銷毀程式碼物件的通知。 (由 Itamar Ostrcher 在 :gh:`91054` 中貢獻。)" #: ../../whatsnew/3.12.rst:1698 +#, fuzzy msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" +"新增:c:func:`PyFrame_GetVar` 和:c:func:`PyFrame_GetVarString` 函式以通過名稱" +"獲取框架變數。 (由 Victor Stinner 在 :gh:`91248` 中貢獻。)" #: ../../whatsnew/3.12.rst:1702 +#, fuzzy msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -2668,107 +3522,148 @@ msgid "" "`PyErr_Restore`. This is less error prone and a bit more efficient. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" +"新增 PyErr_GetRaishedException 和 PyErr_SetRaishedException 用於保存和恢復當" +"前例外。這些函式回傳並接受單個例外物件,而不是現已棄用的 PyErr_Fetch 和 " +"PyErr_Restore 的三重參數。這不容易出錯並且效率更高一些。 (由 Mark Shannon " +"在 :gh:`101578` 中貢獻。)" #: ../../whatsnew/3.12.rst:1710 +#, fuzzy msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" +"新增 ``_PyErr_ChainExceptions1``(它採用例外實例)來替換舊版 API " +"``_PyErr_ChainExceptions``(現已棄用)。 (由 Mark Shannon 在 :gh:`101578` 中" +"貢獻。)" #: ../../whatsnew/3.12.rst:1714 +#, fuzzy msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." "args` passed to the exception's constructor. (Contributed by Mark Shannon " "in :gh:`101578`.)" msgstr "" +"新增:c:func:`PyException_GetArgs` 和:c:func:`PyException_SetArgs` 作為檢索和" +"修改傳遞給例外構造函式的:attr:`~BaseException.args` 的便捷函式。 (由 Mark " +"Shannon 在 :gh:`101578` 中貢獻。)" #: ../../whatsnew/3.12.rst:1719 +#, fuzzy msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" +"新增 :c:func:`PyErr_DisplayException`(它採用例外實例)來替換舊版 api :c:" +"func:`!PyErr_Display`。 (由 Irit Katriel 在 :gh:`102755` 中貢獻)。" #: ../../whatsnew/3.12.rst:1723 +#, fuzzy msgid "" ":pep:`683`: Introduced Immortal Objects to Python which allows objects to " "bypass reference counts and introduced changes to the C-API:" msgstr "" +":pep:`683`:向 Python 引入了 Immortal Objects,它允許物件繞過引用計數並對 C-" +"API 進行了更改:" #: ../../whatsnew/3.12.rst:1726 +#, fuzzy msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" -msgstr "" +msgstr "``_Py_IMMORTAL_REFCNT``:定義物件的引用計數" #: ../../whatsnew/3.12.rst:1727 +#, fuzzy msgid "as immortal." -msgstr "" +msgstr "作為不朽的。" #: ../../whatsnew/3.12.rst:1728 +#, fuzzy msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." -msgstr "" +msgstr "``_Py_IsImmortal`` 檢查物件是否具有不朽引用計數。" #: ../../whatsnew/3.12.rst:1729 +#, fuzzy msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" -msgstr "" +msgstr "``PyObject_HEAD_INIT`` 這現在將初始化引用計數" #: ../../whatsnew/3.12.rst:1730 +#, fuzzy msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." -msgstr "" +msgstr "與 ``Py_BUILD_CORE``一起使用時 ``_Py_IMMORTAL_REFCNT``。" #: ../../whatsnew/3.12.rst:1731 +#, fuzzy msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" -msgstr "" +msgstr "``SSTATE_INTERNED_IMMORTAL`` 內部 unicode 物件的標識符" #: ../../whatsnew/3.12.rst:1732 +#, fuzzy msgid "that are immortal." -msgstr "" +msgstr "那是不朽的。" #: ../../whatsnew/3.12.rst:1733 +#, fuzzy msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" -msgstr "" +msgstr "``SSSTATE_INTERNED_IMMORTAL_STATIC`` 內部 unicode 的標識符" #: ../../whatsnew/3.12.rst:1734 +#, fuzzy msgid "objects that are immortal and static" -msgstr "" +msgstr "不朽且靜態的物體" #: ../../whatsnew/3.12.rst:1737 +#, fuzzy msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" -msgstr "" +msgstr "``sys.getunicodeinternedsize`` 這回傳 unicode 的總數" #: ../../whatsnew/3.12.rst:1736 +#, fuzzy msgid "" "objects that have been interned. This is now needed for refleak.py to " "correctly track reference counts and allocated blocks" -msgstr "" +msgstr "已被拘留的物件。現在 refleak.py 需要它來正確跟踪引用計數和分配的塊" #: ../../whatsnew/3.12.rst:1739 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" -msgstr "" +msgstr "(由 Eddie Elizondo 在 :gh:`84436` 中貢獻。)" #: ../../whatsnew/3.12.rst:1741 +#, fuzzy msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" +"在有限的 C API 版本 3.12 中,:c:func:`Py_INCREF` 和:c:func:`Py_DECREF` 函式現" +"在實作為不透明函式呼叫,以隱藏實作細節。 (由 Victor Stinner 在 :gh:`105387` " +"中貢獻。)" #: ../../whatsnew/3.12.rst:1749 +#, fuzzy msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" +"基於 ``Py_UNICODE*``表示的舊版 Unicode API 已被刪除。請遷移到基於 UTF-8 或 " +"``wchar_t*``的 API。" #: ../../whatsnew/3.12.rst:1752 +#, fuzzy msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" +"像 :c:func:`PyArg_ParseTuple` 這樣的參數剖析函式不再支援基於 ``Py_UNICODE*`` " +"的格式(例如 ``u``, ``Z``)。請遷移到其他 Unicode 格式,例如 ``s``、 ``z``、 " +"``es``和 ``U``。" #: ../../whatsnew/3.12.rst:1756 +#, fuzzy msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -2776,22 +3671,34 @@ msgid "" "breakage, consider using the existing public C-API instead, or, if " "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" +"所有靜態內建型別的 ``tp_weaklist``始終為 ``NULL``。這是 ``PyTypeObject``上的" +"一個僅限內部的欄位,但我們指出了這一變更,以防有人碰巧直接存取該欄位。為了避" +"免損壞,請考慮使用現有的公開 C-API,或者,如有必要,使用(僅限內部)" +"``_PyObject_GET_WEAKREFS_LISTPTR()`` 巨集。" #: ../../whatsnew/3.12.rst:1763 +#, fuzzy msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " "this. We mention this in case someone happens to be accessing the internal-" "only field directly." msgstr "" +"這個僅限內部的:c:member:`PyTypeObject.tp_subclasses` 現在可能不是有效的物件指" +"標。它的型別已更改為 :c:expr:`void *` 以反映這一點。我們提到這一點是為了防止" +"有人碰巧直接存取僅限內部的欄位。" #: ../../whatsnew/3.12.rst:1768 +#, fuzzy msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" +"要獲取子類別串列,請呼叫 Python 方法:py:meth:`~class.__subclasses__`(例如," +"使用:c:func:`PyObject_CallMethod`)。" #: ../../whatsnew/3.12.rst:1772 +#, fuzzy msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -2799,8 +3706,13 @@ msgid "" "and :c:func:`PyUnicode_FromFormatV`. (Contributed by Serhiy Storchaka in :gh:" "`98836`.)" msgstr "" +"在 :c:func:`PyUnicode_FromFormat` 中新增對更多格式化選項的支援(左對齊、八進" +"制、大寫十六進位、intmax_t、ptrdiff_t、wchar_t C 字串、可變寬度和精度)和:c:" +"func:`PyUnicode_FromFormatV`。 (由 Serhiy Storchaka 在 :gh:`98836` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1778 +#, fuzzy msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -2808,14 +3720,21 @@ msgid "" "the result string, and any extra arguments discarded. (Contributed by Serhiy " "Storchaka in :gh:`95781`.)" msgstr "" +"PyUnicode_FromFormat 和 PyUnicode_FromFormatV 中無法識別的格式字元現在會設定 " +"SystemError。在以前的版本中,它導致格式字串的所有其餘部分按原樣複製到結果字" +"串,並丟棄任何額外的參數。 (由 Serhiy Storchaka 在 :gh:`95781` 中貢獻。)" #: ../../whatsnew/3.12.rst:1784 +#, fuzzy msgid "" "Fixed wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" +"修復了 PyUnicode_FromFormat 和 PyUnicode_FromFormatV 中錯誤的符號位置。 (由 " +"Philip Georgi 在 :gh:`95504` 中貢獻。)" #: ../../whatsnew/3.12.rst:1788 +#, fuzzy msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -2828,44 +3747,67 @@ msgid "" "traverse and clear their instance's dictionaries. To clear weakrefs, call :c:" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" +"想要新增 __dict__ 或弱引用槽的擴充類應該分別使用 Py_TPFLAGS_MANAGED_DICT 和 " +"Py_TPFLAGS_MANAGED_WEAKREF 而不是 tp_dictoffset 和 tp_weaklistoffset 。仍然支" +"援使用 tp_dictoffset 和 tp_weaklistoffset ,但不完全支援多重繼承(:gh:" +"`95589`),並且性能可能會更差。聲明 Py_TPFLAGS_MANAGED_DICT 的類應呼叫 :c:" +"func:`!_PyObject_VisitManagedDict` 和 :c:func:`!_PyObject_ClearManagedDict` " +"來遍歷並清除其實例的字典。要清除弱引用,請像以前一樣呼叫:c:func:" +"`PyObject_ClearWeakRefs`。" #: ../../whatsnew/3.12.rst:1800 +#, fuzzy msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " "exact :class:`bytes` type is accepted for bytes strings. (Contributed by " "Victor Stinner in :gh:`98393`.)" msgstr "" +"PyUnicode_FSDecoder 函式不再接受類似位元組的路徑,例如 bytearray 和 " +"memoryview 型別:對於位元組字串,僅接受確切的 bytes 型別。 (由 Victor " +"Stinner 在 :gh:`98393` 中貢獻。)" #: ../../whatsnew/3.12.rst:1805 +#, fuzzy msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " "effects, these side effects are no longer duplicated. (Contributed by Victor " "Stinner in :gh:`98724`.)" msgstr "" +"Py_CLEAR、Py_SETREF 和 Py_XSETREF 巨集現在僅計算其參數一次。如果參數有副作" +"用,這些副作用將不再重複。 (由 Victor Stinner 在 :gh:`98724` 中貢獻。)" #: ../../whatsnew/3.12.rst:1810 +#, fuzzy msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " "that set the error indicator now normalize the exception before storing it. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" +"直譯器的錯誤指示器現在總是標準化的。這意味著 PyErr_SetObject、" +"PyErr_SetString 和其他設定錯誤指示器的函式現在會在存儲例外之前對其進行規範" +"化。 (由 Mark Shannon 在 :gh:`101578` 中貢獻。)" #: ../../whatsnew/3.12.rst:1815 +#, fuzzy msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " "debug builds. If you happen to be using it then you'll need to start using " "``_Py_GetGlobalRefTotal()``." msgstr "" +"``_Py_RefTotal`` 不再具有權威性,只是為了 ABI 相容性而保留。請注意,它是內部" +"全局的,僅在除錯版本中可用。如果你碰巧正在使用它,那麼你需要開始使用 " +"``_Py_GetGlobalRefTotal()``。" #: ../../whatsnew/3.12.rst:1820 +#, fuzzy msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" -msgstr "" +msgstr "現在,以下函式為新建立的型別選擇適當的元類:" #: ../../whatsnew/3.12.rst:1823 msgid ":c:func:`PyType_FromSpec`" @@ -2880,21 +3822,29 @@ msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" #: ../../whatsnew/3.12.rst:1827 +#, fuzzy msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " "functions ignore ``tp_new`` of the metaclass, possibly allowing incomplete " "initialization." msgstr "" +"建立元類覆蓋 :c:member:`~PyTypeObject.tp_new` 的類已被棄用,並且在 Python " +"3.14+ 中將被禁止。請注意,這些函式忽略元類的 ``tp_new``,可能允許不完整的初始" +"化。" #: ../../whatsnew/3.12.rst:1832 +#, fuzzy msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" +"請注意, :c:func:`PyType_FromMetaclass` (在 Python 3.12 中新增)已經不允許建" +"立其元類覆蓋 ``tp_new`` (Python 中的:meth:`~object.__new__` )的類。" #: ../../whatsnew/3.12.rst:1836 +#, fuzzy msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -2902,278 +3852,376 @@ msgid "" "since (meta)classes assume that ``tp_new`` was called. There is no simple " "general workaround. One of the following may work for you:" msgstr "" +"由於 tp_new 幾乎覆蓋了 PyType_From* 函式所做的一切,因此兩者彼此不相容。現有" +"的行為——在型別建立的幾個步驟中忽略元類——通常是不安全的,因為(元)類假設呼叫" +"了 ``tp_new``。沒有簡單的通用解決方法。以下其中一項可能適合你:" #: ../../whatsnew/3.12.rst:1843 +#, fuzzy msgid "If you control the metaclass, avoid using ``tp_new`` in it:" -msgstr "" +msgstr "如果你控制元類,請避免在其中使用 ``tp_new``:" #: ../../whatsnew/3.12.rst:1845 +#, fuzzy msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" +"如果可以跳過初始化,則可以在 :c:member:`~PyTypeObject.tp_init` 中完成。" #: ../../whatsnew/3.12.rst:1847 +#, fuzzy msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" "`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag. This makes it acceptable for " "``PyType_From*`` functions." msgstr "" +"如果元類不需要從 Python 實例化,請使用 Py_TPFLAGS_DISALLOW_INSTANTIATION 旗標" +"將其 tp_new 設定為 NULL 。這使得 ``PyType_From*``函式可以接受。" #: ../../whatsnew/3.12.rst:1852 +#, fuzzy msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" +"避免使用 ``PyType_From*``函式:如果你不需要特定於 C 的功能(插槽或設定實例大" +"小),請通過呼叫元類來建立型別。" #: ../../whatsnew/3.12.rst:1856 +#, fuzzy msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" +"如果你 ``知道``可以安全地跳過 ``tp_new``,請使用 Python 中的:func:`warnings." +"catch_warnings` 過濾掉棄用警告。" #: ../../whatsnew/3.12.rst:1859 +#, fuzzy msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " "because clients generally rely on process-wide global state (since these " "callbacks have no way of recovering extension module state)." msgstr "" +":c:var:`PyOS_InputHook` 和 :c:var:`PyOS_ReadlineFunctionPointer` 不再在 " +"subinterpreters ` 中呼叫。這是因為客戶端通常依賴於行" +"程範圍的全局狀態(因為這些回呼無法恢復擴充模組狀態)。" #: ../../whatsnew/3.12.rst:1864 +#, fuzzy msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" +"這也避免了擴充可能發現自己在它們不支援(或尚未加載)的子直譯器中運行的情況。" +"請參閱 :gh:`104668` 了解更多資訊。" #: ../../whatsnew/3.12.rst:1871 +#, fuzzy msgid "Deprecate global configuration variable:" -msgstr "" +msgstr "棄用全局配置變數:" #: ../../whatsnew/3.12.rst:1873 +#, fuzzy msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" -msgstr "" +msgstr ":c:var:`Py_DebugFlag`:使用 :c:member:`PyConfig.parser_debug`" #: ../../whatsnew/3.12.rst:1874 +#, fuzzy msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" -msgstr "" +msgstr ":c:var:`Py_VerboseFlag`:使用 :c:member:`PyConfig.verbose`" #: ../../whatsnew/3.12.rst:1875 +#, fuzzy msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" -msgstr "" +msgstr ":c:var:`Py_QuietFlag`:使用 :c:member:`PyConfig.quiet`" #: ../../whatsnew/3.12.rst:1876 +#, fuzzy msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" -msgstr "" +msgstr ":c:var:`Py_InteractiveFlag`:使用 :c:member:`PyConfig.interactive`" #: ../../whatsnew/3.12.rst:1877 +#, fuzzy msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" -msgstr "" +msgstr ":c:var:`Py_InspectFlag`:使用 :c:member:`PyConfig.inspect`" #: ../../whatsnew/3.12.rst:1878 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" -msgstr "" +msgstr ":c:var:`Py_OptimizeFlag`:使用 :c:member:`PyConfig.optimization_level`" #: ../../whatsnew/3.12.rst:1879 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" -msgstr "" +msgstr ":c:var:`Py_NoSiteFlag`:使用 :c:member:`PyConfig.site_import`" #: ../../whatsnew/3.12.rst:1880 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" -msgstr "" +msgstr ":c:var:`Py_BytesWarningFlag`:使用 :c:member:`PyConfig.bytes_warning`" #: ../../whatsnew/3.12.rst:1881 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" -msgstr "" +msgstr ":c:var:`Py_FrozenFlag`:使用 :c:member:`PyConfig.pathconfig_warnings`" #: ../../whatsnew/3.12.rst:1882 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" +":c:var:`Py_IgnoreEnvironmentFlag`:使用 :c:member:`PyConfig.use_environment`" #: ../../whatsnew/3.12.rst:1883 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" +":c:var:`Py_DontWriteBytecodeFlag`:使用 :c:member:`PyConfig.write_bytecode`" #: ../../whatsnew/3.12.rst:1884 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" +":c:var:`Py_NoUserSiteDirectory`:使用 :c:member:`PyConfig." +"user_site_directory`" #: ../../whatsnew/3.12.rst:1885 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" +":c:var:`Py_UnbufferedStdioFlag`:使用 :c:member:`PyConfig.buffered_stdio`" #: ../../whatsnew/3.12.rst:1886 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" msgstr "" +":c:var:`Py_HashRandomizationFlag`:使用 :c:member:`PyConfig.use_hash_seed` " +"和 :c:member:`PyConfig.hash_seed`" #: ../../whatsnew/3.12.rst:1888 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" -msgstr "" +msgstr ":c:var:`Py_IsolatedFlag`:使用 :c:member:`PyConfig.isolated`" #: ../../whatsnew/3.12.rst:1889 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" +":c:var:`Py_LegacyWindowsFSEncodingFlag`:使用 :c:member:`PyPreConfig." +"legacy_windows_fs_encoding`" #: ../../whatsnew/3.12.rst:1890 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" +":c:var:`Py_LegacyWindowsStdioFlag`:使用 :c:member:`PyConfig." +"legacy_windows_stdio`" #: ../../whatsnew/3.12.rst:1891 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" +":c:var:`!Py_FileSystemDefaultEncoding`:使用 :c:member:`PyConfig." +"filesystem_encoding`" #: ../../whatsnew/3.12.rst:1892 +#, fuzzy msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" +":c:var:`!Py_HasFileSystemDefaultEncoding`:使用 :c:member:`PyConfig." +"filesystem_encoding`" #: ../../whatsnew/3.12.rst:1893 +#, fuzzy msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" +":c:var:`!Py_FileSystemDefaultEncodeErrors`:使用 :c:member:`PyConfig." +"filesystem_errors`" #: ../../whatsnew/3.12.rst:1894 +#, fuzzy msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" msgstr "" +":c:var:`!Py_UTF8Mode`:使用 :c:member:`PyPreConfig.utf8_mode` (參見 :c:func:" +"`Py_PreInitialize`)" #: ../../whatsnew/3.12.rst:1896 +#, fuzzy msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" msgstr "" +":c:func:`Py_InitializeFromConfig` API 應與 :c:type:`PyConfig` 一起使用。 " +"(由 Victor Stinner 在 :gh:`77782` 中貢獻。)" #: ../../whatsnew/3.12.rst:1900 +#, fuzzy msgid "" "Creating immutable types (:c:macro:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable " "bases is deprecated and will be disabled in Python 3.14." msgstr "" +"使用可變基數建立不可變型別 (:const:`Py_TPFLAGS_IMMUTABLETYPE`) 已被棄用,並將" +"在 Python 3.14 中禁用。" #: ../../whatsnew/3.12.rst:1903 +#, fuzzy msgid "" "The ``structmember.h`` header is deprecated, though it continues to be " "available and there are no plans to remove it." -msgstr "" +msgstr "``structmember.h`` 標頭已被棄用,但它仍然可用並且沒有計劃刪除它。" #: ../../whatsnew/3.12.rst:1906 +#, fuzzy msgid "" "Its contents are now available just by including ``Python.h``, with a ``Py`` " "prefix added if it was missing:" -msgstr "" +msgstr "現在只需包含 ``Python.h``即可使用其內容,如果缺少,則新增 ``Py``前綴:" #: ../../whatsnew/3.12.rst:1909 +#, fuzzy msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" msgstr "" +":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" +"`PyMember_SetOne`" #: ../../whatsnew/3.12.rst:1911 +#, fuzzy msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" +"輸入巨集,如 :c:macro:`Py_T_INT`、:c:macro:`Py_T_DOUBLE` 等(以前為 " +"``T_INT``、 ``T_DOUBLE`` 等)" #: ../../whatsnew/3.12.rst:1913 +#, fuzzy msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" msgstr "" +"旗標 :c:macro:`Py_READONLY` (以前是 ``READONLY``)和 :c:macro:" +"`Py_AUDIT_READ` (以前都是大寫)" #: ../../whatsnew/3.12.rst:1916 +#, fuzzy msgid "Several items are not exposed from ``Python.h``:" -msgstr "" +msgstr "``Python.h`` 中沒有公開一些項目:" #: ../../whatsnew/3.12.rst:1918 +#, fuzzy msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" -msgstr "" +msgstr ":c:macro:`T_OBJECT` (使用 :c:macro:`Py_T_OBJECT_EX`)" #: ../../whatsnew/3.12.rst:1919 +#, fuzzy msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" -msgstr "" +msgstr ":c:macro:`T_NONE` (以前沒有記錄,而且非常古怪)" #: ../../whatsnew/3.12.rst:1920 +#, fuzzy msgid "The macro ``WRITE_RESTRICTED`` which does nothing." -msgstr "" +msgstr "巨集 ``WRITE_RESTRICTED``不執行任何操作。" #: ../../whatsnew/3.12.rst:1921 +#, fuzzy msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." msgstr "" +"巨集 ``RESTRICTED``和 ``READ_RESTRICTED``,相當於:c:macro:`Py_AUDIT_READ`。" #: ../../whatsnew/3.12.rst:1923 +#, fuzzy msgid "" "In some configurations, ```` is not included from ``Python.h``. It " "should be included manually when using ``offsetof()``." msgstr "" +"在某些配置中, ``Python.h``中不包含 ````。使用 ``offsetof()``時應手" +"動包含它。" #: ../../whatsnew/3.12.rst:1926 +#, fuzzy msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" +"已棄用的標頭繼續以原始名稱提供其原始內容。你的舊程式碼可以保持不變,除非額外" +"的包含巨集和非命名空間巨集對你造成很大困擾。" #: ../../whatsnew/3.12.rst:1931 +#, fuzzy msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" +"(由 Petr Viktorin 在 :gh:`47146` 中貢獻,基於 Alexander Belopolsky 和 " +"Matthias Braun 的早期工作。)" #: ../../whatsnew/3.12.rst:1934 +#, fuzzy msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" +":c:func:`PyErr_Fetch` 和 :c:func:`PyErr_Restore` 已棄用。請改用 " +"PyErr_GetRaishedException 和 PyErr_SetRaishedException 。 (由 Mark Shannon " +"在 :gh:`101578` 中貢獻。)" #: ../../whatsnew/3.12.rst:1939 +#, fuzzy msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." msgstr "" +":c:func:`!PyErr_Display` 已棄用。請改用:c:func:`PyErr_DisplayException`。 " +"(由 Irit Katriel 在 :gh:`102755` 中貢獻)。" #: ../../whatsnew/3.12.rst:1942 +#, fuzzy msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" msgstr "" +"``_PyErr_ChainExceptions`` 已棄用。使用``_PyErr_ChainExceptions1`` 代替。 " +"(由 Irit Katriel 在 :gh:`102192` 中貢獻。)" #: ../../whatsnew/3.12.rst:1945 +#, fuzzy msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" +"不推薦使用 PyType_FromSpec、PyType_FromSpecWithBases 或 " +"PyType_FromModuleAndSpec 建立元類重寫的類。而是呼叫元類。" #: ../../whatsnew/3.12.rst:1953 +#, fuzzy msgid "" "Remove the ``token.h`` header file. There was never any public tokenizer C " "API. The ``token.h`` header file was only designed to be used by Python " "internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" +"刪除 ``token.h`` 標頭檔。從來沒有任何公開分詞器 C API。 ``token.h``標頭檔僅" +"供 Python 內部使用。 (由 Victor Stinner 在 :gh:`92651` 中貢獻。)" #: ../../whatsnew/3.12.rst:1958 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." -msgstr "" +msgstr "舊版 Unicode API 已被刪除。有關詳細資訊,請參閱 :pep:`623`。" #: ../../whatsnew/3.12.rst:1960 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" @@ -3216,24 +4264,22 @@ msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" msgstr "" +"刪除 ``PyUnicode_InternImmortal()`` 函式巨集。(由 Victor Stinner 在 :gh:" +"`85858` 中貢獻。)" #: ../../whatsnew/3.12.rst:1973 +#, fuzzy msgid "" "Remove ``Jython`` compatibility hacks from several stdlib modules and tests. " "(Contributed by Nikita Sobolev in :gh:`99482`.)" msgstr "" +"從多個標組函式庫的模組和測試中刪除 ``Jython`` 相容性相關的 hacks。(由 " +"Nikita Sobolev 在 :gh:`99482` 中貢獻。)" #: ../../whatsnew/3.12.rst:1976 msgid "" "Remove ``_use_broken_old_ctypes_structure_semantics_`` flag from :mod:" "`ctypes` module. (Contributed by Nikita Sobolev in :gh:`99285`.)" msgstr "" - -#~ msgid ":const:`Py_TPFLAGS_HAVE_VECTORCALL`" -#~ msgstr ":const:`Py_TPFLAGS_HAVE_VECTORCALL`" - -#~ msgid ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#~ msgstr ":const:`PY_VECTORCALL_ARGUMENTS_OFFSET`" - -#~ msgid "email" -#~ msgstr "email" +"從 :mod:`ctypes` 模組中刪除 ``_use_broken_old_ctypes_structural_semantics_`` " +"旗標。(由 Nikita Sobolev 在 :gh:`99285` 中貢獻。)"