From 12f0de705245881a3768289ec8dc40e28c28c8f8 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Sun, 28 Apr 2024 12:43:40 +0800 Subject: [PATCH] wip --- whatsnew/3.12.po | 1257 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 1137 insertions(+), 120 deletions(-) diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index dd0af11a99..a996dcf61a 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -1,16 +1,17 @@ -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2024, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. # -#, fuzzy +# Translators: +# Matt Wang , 2023-2024 msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-04-25 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: 2024-04-26 16:28+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" @@ -34,10 +35,12 @@ msgid "" "Python 3.12 was released on October 2, 2023. For full details, see the :ref:" "`changelog `." msgstr "" +"本文介紹了 Python 3.12 與 3.11 相比的新功能。 Python 3.12 於 2023 年 10 月 2 " +"日發布。完整細節請見 :ref:`changelog `。" #: ../../whatsnew/3.12.rst:54 msgid ":pep:`693` -- Python 3.12 Release Schedule" -msgstr ":pep:`693` -- Python 3.12 發佈時程" +msgstr ":pep:`693` -- Python 3.12 發布時程" #: ../../whatsnew/3.12.rst:57 msgid "Summary -- Release highlights" @@ -52,6 +55,10 @@ msgid "" "library. Filesystem support in :mod:`os` and :mod:`pathlib` has seen a " "number of improvements, and several modules have better performance." msgstr "" +"Python 3.12 是 Python 程式語言的最新穩定版本,對語言和標準函式庫進行了一些更" +"改。函式庫更改的重點是清理已棄用的 API、可用性和正確性。值得注意的是,:mod:`!" +"distutils` 套件已從標準函式庫中刪除。:mod:`os` 和 :mod:`pathlib` 中的檔案系統" +"支援已得到許多改進,並且多個模組具有更好的效能。" #: ../../whatsnew/3.12.rst:69 msgid "" @@ -62,6 +69,11 @@ msgid "" "`generic types ` and :term:`type aliases ` with " "static type checkers." msgstr "" +"語言變化側重於可用性,因為 :term:`f 字串 (f-strings) ` 已經消除了許" +"多限制,並且「你的意思是… (Did you mean ...)」建議不斷改進。新的\\ :ref:`型別" +"參數語法 `\\ 和 :keyword:`type` 陳述式改進了使用\\ :term:" +"`通用型別 (generic types) `\\ 和\\ :term:`型別別名 (type " +"aliases) `\\ 在使用靜態型別檢查器時的易用性。" #: ../../whatsnew/3.12.rst:76 msgid "" @@ -73,6 +85,10 @@ msgid "" "change, refer to the PEP for a particular new feature; but note that PEPs " "usually are not kept up-to-date once a feature has been fully implemented." msgstr "" +"本文並非試圖提供所有新功能的完整規範,而是提供一個方便的概述。有關完整詳細資" +"訊,你應該參閱文件,例如\\ :ref:`函式庫參考手冊 `\\ 和\\ :ref:" +"`語言參考手冊 `。如果你想了解變更的完整實作和設計原理,請參" +"閱特定新功能的 PEP;但請注意,一旦功能完全實作,PEP 通常不會保持最新狀態。" #: ../../whatsnew/3.12.rst:90 msgid "New syntax features:" @@ -83,16 +99,18 @@ msgid "" ":ref:`PEP 695 `, type parameter syntax and the :keyword:" "`type` statement" msgstr "" +":ref:`PEP 695 `,型別參數語法和 :keyword:`type` 陳述式" #: ../../whatsnew/3.12.rst:94 msgid "New grammar features:" -msgstr "新增語法特性:" +msgstr "新增文法特性:" #: ../../whatsnew/3.12.rst:96 msgid "" ":ref:`PEP 701 `, :term:`f-strings ` in the " "grammar" msgstr "" +"文法中的 :ref:`PEP 701 `、:term:`f-strings `" #: ../../whatsnew/3.12.rst:98 msgid "Interpreter improvements:" @@ -103,30 +121,36 @@ msgid "" ":ref:`PEP 684 `, a unique per-interpreter :term:`GIL " "`" msgstr "" +":ref:`PEP 684 `,一個獨特的直譯器獨立 (per-interpreter) :" +"term:`GIL `" #: ../../whatsnew/3.12.rst:102 msgid ":ref:`PEP 669 `, low impact monitoring" -msgstr "" +msgstr ":ref:`PEP 669 `,低影響監控" #: ../../whatsnew/3.12.rst:103 msgid "" "`Improved 'Did you mean ...' suggestions `_ for :" "exc:`NameError`, :exc:`ImportError`, and :exc:`SyntaxError` exceptions" msgstr "" +"改進了 :exc:`NameError`、:exc:`ImportError` 和 :exc:`SyntaxError` 例外的\\ `" +"「你的意思是... (Did you mean ...)」建議 `_" #: ../../whatsnew/3.12.rst:106 msgid "Python data model improvements:" -msgstr "" +msgstr "Python 資料模型改進:" #: ../../whatsnew/3.12.rst:108 msgid "" ":ref:`PEP 688 `, using the :ref:`buffer protocol " "` from Python" msgstr "" +":ref:`PEP 688 `,使用 Python 的 :ref:`緩衝協定 " +"`" #: ../../whatsnew/3.12.rst:111 msgid "Significant improvements in the standard library:" -msgstr "" +msgstr "標準函式庫的重大改進:" #: ../../whatsnew/3.12.rst:113 msgid "The :class:`pathlib.Path` class now supports subclassing" @@ -134,37 +158,42 @@ msgstr ":class:`pathlib.Path` 類別現在支援子類別化" #: ../../whatsnew/3.12.rst:114 msgid "The :mod:`os` module received several improvements for Windows support" -msgstr "" +msgstr ":mod:`os` 模組對 Windows 支援進行了多項改進" #: ../../whatsnew/3.12.rst:115 msgid "" "A :ref:`command-line interface ` has been added to the :mod:" "`sqlite3` module" -msgstr "" +msgstr ":ref:`命令列介面 `\\ 已加入 :mod:`sqlite3` 模組中" #: ../../whatsnew/3.12.rst:117 msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` enjoy a speed up of between two and 20 times" msgstr "" +":func:`isinstance` 對 :func:`可 runtime 檢查協定 (runtime-checkable " +"protocols) ` 檢查,速度可提高 2 到 20 倍" #: ../../whatsnew/3.12.rst:119 msgid "" "The :mod:`asyncio` package has had a number of performance improvements, " "with some benchmarks showing a 75% speed up." msgstr "" +":mod:`asyncio` 套件進行了許多效能改進,一些基準測試顯示速度提高了 75%。" #: ../../whatsnew/3.12.rst:121 msgid "" "A :ref:`command-line interface ` has been added to the :mod:`uuid` " "module" -msgstr "" +msgstr ":ref:`命令列介面 `\\ 已被加入 :mod:`uuid` 模組中" #: ../../whatsnew/3.12.rst:123 msgid "" "Due to the changes in :ref:`PEP 701 `, producing tokens " "via the :mod:`tokenize` module is up to 64% faster." msgstr "" +"由於 :ref:`PEP 701 ` 中的更改,透過 :mod:`tokenize` 模組" +"產生 token 的速度提高了 64%。" #: ../../whatsnew/3.12.rst:126 msgid "Security improvements:" @@ -177,6 +206,9 @@ msgid "" "github.com/hacl-star/hacl-star/>`__ project. These builtin implementations " "remain as fallbacks that are only used when OpenSSL does not provide them." msgstr "" +"將於 :mod:`hashlib` 中 SHA1、SHA3、SHA2-384、SHA2-512 和 MD5 內建實作替換為來" +"自 `HACL* `__ 項目的實作。這些內建實" +"作仍然作為回退方案 (fallback),僅在 OpenSSL 不提供它們時使用。" #: ../../whatsnew/3.12.rst:134 msgid "C API improvements:" @@ -184,27 +216,29 @@ msgstr "C API 改進:" #: ../../whatsnew/3.12.rst:136 msgid ":ref:`PEP 697 `, unstable C API tier" -msgstr "" +msgstr ":ref:`PEP 697 `,不穩定的 C API 層" #: ../../whatsnew/3.12.rst:137 +#, fuzzy msgid ":ref:`PEP 683 `, immortal objects" -msgstr "" +msgstr ":ref:`PEP 683 `,不朽的物體" #: ../../whatsnew/3.12.rst:139 msgid "CPython implementation improvements:" -msgstr "" +msgstr "CPython 實作改進:" #: ../../whatsnew/3.12.rst:141 msgid ":ref:`PEP 709 `, comprehension inlining" msgstr "" +":ref:`PEP 709 `,行內綜合運算 (comprehension inlining)" #: ../../whatsnew/3.12.rst:142 msgid ":ref:`CPython support ` for the Linux ``perf`` profiler" -msgstr "" +msgstr "對 Linux ``perf`` 分析器的 :ref:`CPython 支援 `" #: ../../whatsnew/3.12.rst:143 msgid "Implement stack overflow protection on supported platforms" -msgstr "" +msgstr "在支援的平台上實作堆疊溢位保護" #: ../../whatsnew/3.12.rst:145 msgid "New typing features:" @@ -215,7 +249,7 @@ msgid "" ":ref:`PEP 692 `, using :class:`~typing.TypedDict` to " "annotate :term:`**kwargs `" msgstr "" -":ref:`PEP 692 `、使用 :class:`~typing.TypedDict` 來標註 :" +":ref:`PEP 692 `,使用 :class:`~typing.TypedDict` 來註釋 :" "term:`**kwargs `" #: ../../whatsnew/3.12.rst:149 @@ -224,13 +258,15 @@ msgstr ":ref:`PEP 698 `、:func:`typing.override` 裝飾器" #: ../../whatsnew/3.12.rst:151 msgid "Important deprecations, removals or restrictions:" -msgstr "" +msgstr "重要的棄用、刪除或限制:" #: ../../whatsnew/3.12.rst:153 msgid "" ":pep:`623`: Remove ``wstr`` from Unicode objects in Python's C API, reducing " "the size of every :class:`str` object by at least 8 bytes." msgstr "" +":pep:`623`:從 Python C API 中的 Unicode 物件中刪除 ``wstr``,將每個 :class:" +"`str` 物件的大小減少至少 8 個位元組。" #: ../../whatsnew/3.12.rst:156 msgid "" @@ -240,6 +276,11 @@ msgid "" "io/en/latest/deprecated/distutils-legacy.html>`__ package continues to " "provide :mod:`!distutils`, if you still require it in Python 3.12 and beyond." msgstr "" +":pep:`632`:刪除 :mod:`!distutils` 套件。請參閱\\ `遷移指南 `_\\ 以獲得替換原有 API 的建議。如果你" +"在 Python 3.12 及後續版本中仍然需要它們,第三方套件 `Setuptools `__ 會繼續提" +"供 :mod:`!distutils`。" #: ../../whatsnew/3.12.rst:163 msgid "" @@ -249,6 +290,10 @@ msgid "" "to access these run ``pip install setuptools`` in the :ref:`activated ` virtual environment." msgstr "" +":gh:`95299`:不要在使用 :mod:`venv` 建立的虛擬環境中預先安裝 ``setuptools``。" +"這意味著 ``distutils``、``setuptools``、``pkg_resources`` 和 " +"``easy_install`` 預設不再可用;若要存取它們,請在\\ :ref:`啟動的 ` 虛擬環境中執行 ``pip install setuptools``。" #: ../../whatsnew/3.12.rst:170 msgid "" @@ -256,6 +301,9 @@ msgid "" "removed, along with several :class:`unittest.TestCase` `method aliases " "`_." msgstr "" +"已刪除 :mod:`!asynchat`、:mod:`!asyncore` 和 :mod:`!imp` 模組,以及幾個 :" +"class:`unittest.TestCase` 的\\ `方法別名 `_。" #: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1962 msgid "New Features" @@ -263,7 +311,7 @@ msgstr "新增特性" #: ../../whatsnew/3.12.rst:181 msgid "PEP 695: Type Parameter Syntax" -msgstr "" +msgstr "PEP 695:型別參數語法" #: ../../whatsnew/3.12.rst:183 msgid "" @@ -271,6 +319,8 @@ msgid "" "syntax that left the scope of type parameters unclear and required explicit " "declarations of variance." msgstr "" +":pep:`484` 下的泛型類別和函式是使用較冗長語法來宣告,這使得型別參數的作用域不" +"明確,並且需要顯式地宣告差異。" #: ../../whatsnew/3.12.rst:187 msgid "" @@ -278,6 +328,8 @@ msgid "" "`generic classes ` and :ref:`functions `::" msgstr "" +":pep:`695` 引入了一種新的、更簡潔和顯式的方法來建立\\ :ref:`泛型類別 " +"`\\ 和\\ :ref:`函式 `: ::" #: ../../whatsnew/3.12.rst:200 msgid "" @@ -285,10 +337,13 @@ msgid "" "` using the :keyword:`type` statement, which creates an " "instance of :class:`~typing.TypeAliasType`::" msgstr "" +"此外,PEP 引入了一種使用\\ :keyword:`型別 `\\ 陳述式來宣告\\ :ref:`型別" +"別名 `\\ 的新方法,該方法會建立一個 :class:`~typing." +"TypeAliasType` 的實例: ::" #: ../../whatsnew/3.12.rst:206 msgid "Type aliases can also be :ref:`generic `::" -msgstr "" +msgstr "型別別名也可以是\\ :ref:`泛型 `: ::" #: ../../whatsnew/3.12.rst:210 msgid "" @@ -296,6 +351,9 @@ msgid "" "`~typing.ParamSpec` parameters, as well as :class:`~typing.TypeVar` " "parameters with bounds or constraints::" msgstr "" +"新的語法允許宣告 :class:`~typing.TypeVarTuple` 和 :class:`~typing.ParamSpec` " +"參數,以及帶有邊界 (bounds) 或限制 (constraints) 的 :class:`~typing.TypeVar` " +"參數: ::" #: ../../whatsnew/3.12.rst:219 msgid "" @@ -304,8 +362,12 @@ msgid "" "evaluation `). This means type aliases are able to refer to " "other types defined later in the file." msgstr "" +"透過此語法建立之型別別名的值和型別變數的邊界和限制,僅會根據需求來被求值(請" +"參閱\\ :ref:`延遲求值 (lazy evaluation) `)。這意味著型別別" +"名可以參照在檔案中後續定義的其他型別。" #: ../../whatsnew/3.12.rst:224 +#, 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 " @@ -314,6 +376,10 @@ msgid "" "module scope after the class is defined. See :ref:`type-params` for a " "detailed description of the runtime semantics of type parameters." msgstr "" +"透過型別參數串列宣告的型別參數在宣告作用域及任何巢狀作用域內皆為可見,但在外" +"部作用域內不可見。例如,它們可以用在泛型類方法的型別註釋中或類主體中。但是," +"在定義類後,它們不能在模組作用域內使用。有關型別參數的 runtime 語義的詳細描" +"述,請參閱 type-params。" #: ../../whatsnew/3.12.rst:231 msgid "" @@ -323,6 +389,10 @@ msgid "" "differently with enclosing class scopes. In Python 3.13, :term:`annotations " "` will also be evaluated in annotation scopes." msgstr "" +"為了支援這些作用域語義而引入了一種新的作用域,即\\ :ref:`註釋作用域 " +"(annotation scope) `。註釋作用域的行為在很大程度上類似於函" +"式作用域,但與封閉類別作用域的交互方式不同。在 Python 3.13 中,:term:`註釋 " +"`\\ 也將在註釋作用域內進行求值。" #: ../../whatsnew/3.12.rst:237 msgid "See :pep:`695` for more details." @@ -333,12 +403,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:245 msgid "PEP 701: Syntactic formalization of f-strings" -msgstr "" +msgstr "PEP 701:f 字串的語法形式化" #: ../../whatsnew/3.12.rst:247 +#, fuzzy msgid "" ":pep:`701` lifts some restrictions on the usage of :term:`f-strings `. Expression components inside f-strings can now be any valid Python " @@ -346,30 +419,46 @@ msgid "" "string, multi-line expressions, comments, backslashes, and unicode escape " "sequences. Let's cover these in detail:" msgstr "" +":pep:`701` 解除了 :term:`f 字串 `\\ 在使用上的一些限制。f 字串內的" +"運算式元件現在可以是任何有效的 Python 運算式,包括重複使用與包含 f 字串相同的" +"引號的字串、多行運算式、註解、反斜線和 unicode 轉義序列。讓我們詳細介紹一下這" +"些內容:" #: ../../whatsnew/3.12.rst:253 +#, fuzzy msgid "" "Quote reuse: in Python 3.11, reusing the same quotes as the enclosing 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:262 +#, 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:270 +#, 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:276 +#, fuzzy msgid "" "Multi-line expressions and comments: In Python 3.11, f-string expressions " "must be defined in a single line, even if the expression within the f-string " @@ -377,8 +466,12 @@ msgid "" "multiple lines), making them harder to read. In Python 3.12 you can now " "define f-strings spanning multiple lines, and add inline comments:" msgstr "" +"多行運算式和註解:在Python 3.11 中,f 字串運算式必須在單行中定義,即使f 字串" +"中的運算式通常可以跨越多行(就像在多行上定義的文字列表一樣),從而使它們更難" +"閱讀。在 Python 3.12 中,你現在可以定義跨越多行的 f 字串,並新增內嵌註解:" #: ../../whatsnew/3.12.rst:290 +#, fuzzy msgid "" "Backslashes and unicode characters: before Python 3.12 f-string expressions " "couldn't contain any ``\\`` character. This also affected unicode :ref:" @@ -386,39 +479,57 @@ msgid "" "contain the ``\\N`` part that 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 :ref:`轉義序列` (例如" +"``\\N{snowman}``),因為它們包含``\\N`` 部分,該部分以前不能是運算式元件的一" +"部分f 弦。現在,你可以像這樣定義運算式:" #: ../../whatsnew/3.12.rst:303 msgid "See :pep:`701` for more details." msgstr "詳情請見 :pep:`701`。" #: ../../whatsnew/3.12.rst:305 +#, fuzzy msgid "" "As a positive side-effect of how this feature has been implemented (by " "parsing f-strings with :pep:`the PEG parser <617>`), now error messages for " "f-strings are more precise and include the exact location of the error. For " "example, in Python 3.11, the following f-string raises a :exc:`SyntaxError`:" msgstr "" +"作為此功能實作方式的積極副作用(透過使用 PEG 解析器 <617> 解析 f 字串),現" +"在 f 字串的錯誤訊息更加精確,並且包括錯誤。例如,在 Python 3.11 中,以下 f 字" +"串會引發 SyntaxError:" #: ../../whatsnew/3.12.rst:318 +#, 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:330 +#, 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:337 +#, fuzzy msgid "PEP 684: A Per-Interpreter GIL" -msgstr "" +msgstr "PEP 684:每個直譯器的 GIL" #: ../../whatsnew/3.12.rst:339 +#, fuzzy msgid "" ":pep:`684` introduces a per-interpreter :term:`GIL `, so that sub-interpreters may now be created with a unique GIL per " @@ -426,28 +537,39 @@ msgid "" "CPU cores. This is currently only available through the C-API, though a " "Python API is :pep:`anticipated for 3.13 <554>`." msgstr "" +":pep:`684` 引入了每個直譯器 :term:`GIL <全域直譯器鎖定>`,因此現在可以使用每" +"個直譯器唯一的 GIL 建立子直譯器。這使得Python程式能夠充分利用多個CPU核心。目" +"前只能透過 C-API 獲得此功能,儘管 Python API 預計在 3.13 <554> 中提供。" #: ../../whatsnew/3.12.rst:345 +#, fuzzy msgid "" "Use the new :c:func:`Py_NewInterpreterFromConfig` function to create an " "interpreter with its own GIL:" msgstr "" +"使用新的 Py_NewInterpreterFromConfig 函式建立一個具有自己的 GIL 的直譯器:" #: ../../whatsnew/3.12.rst:361 +#, fuzzy msgid "" "For further examples how to use the C-API for sub-interpreters with a per-" "interpreter GIL, see :source:`Modules/_xxsubinterpretersmodule.c`." msgstr "" +"有關如何使用帶有每個直譯器 GIL 的子直譯器的 C-API 的更多範例,請參閱:source:" +"`Modules/_xxsubinterpretersmodule.c`。" #: ../../whatsnew/3.12.rst:364 +#, fuzzy msgid "(Contributed by Eric Snow in :gh:`104210`, etc.)" -msgstr "(由 Eric Snow 於 :gh:`104210` 等貢獻。)" +msgstr "(由 Eric Snow 在 :gh:`104210` 等貢獻)" #: ../../whatsnew/3.12.rst:369 +#, fuzzy msgid "PEP 669: Low impact monitoring for CPython" -msgstr "" +msgstr "PEP 669:CPython 的低影響監控" #: ../../whatsnew/3.12.rst:371 +#, fuzzy msgid "" ":pep:`669` defines a new :mod:`API ` for profilers, " "debuggers, and other tools to monitor events in CPython. It covers a wide " @@ -456,70 +578,98 @@ msgid "" "near-zero overhead debuggers and coverage tools. See :mod:`sys.monitoring` " "for details." msgstr "" +":pep:`669` 定義了一個新的 :mod:`API ` ,用於分析器、偵錯器和" +"其他工具來監視 CPython 中的事件。它涵蓋了廣泛的事件,包括呼叫、回傳、線路、例" +"外、跳躍等等。這意味著你只需為使用的內容付費,為接近零開銷的除錯器和覆蓋工具" +"提供支援。有關詳細資訊,請參閱 sys.monitoring。" #: ../../whatsnew/3.12.rst:379 +#, fuzzy msgid "(Contributed by Mark Shannon in :gh:`103082`.)" -msgstr "(由 Mark Shannon 於 :gh:`103082` 中貢獻。)" +msgstr "(由 Mark Shannon 在 :gh:`103082` 中貢獻。)" #: ../../whatsnew/3.12.rst:384 msgid "PEP 688: Making the buffer protocol accessible in Python" -msgstr "" +msgstr "PEP 688:使緩衝區協定可在 Python 中存取" #: ../../whatsnew/3.12.rst:386 +#, 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:390 +#, 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:399 msgid "PEP 709: Comprehension inlining" -msgstr "" +msgstr "PEP 709:綜合運算的內聯" #: ../../whatsnew/3.12.rst:401 +#, fuzzy msgid "" "Dictionary, list, and set comprehensions are now inlined, rather than " "creating a new single-use function object for each execution of the " "comprehension. This speeds up execution of a comprehension by up to two " "times. See :pep:`709` for further details." msgstr "" +"字典、列表和集合推導式現在是內聯的,而不是為推導式的每次執行建立一個新的一次" +"性函式物件。這可以將理解的執行速度提高兩倍。請參閱:pep:`709` 以了解更多詳細資" +"訊。" #: ../../whatsnew/3.12.rst:406 +#, fuzzy msgid "" "Comprehension iteration variables remain isolated and don't overwrite a " "variable of the same name in the outer scope, nor are they visible after the " "comprehension. Inlining does result in a few visible behavior changes:" msgstr "" +"推導疊代變數保持隔離,不會覆蓋外部作用域中的同名變數,推導後它們也不可見。內" +"聯確實會導致一些明顯的行為改變:" #: ../../whatsnew/3.12.rst:410 +#, 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:412 +#, fuzzy msgid "" "The :mod:`symtable` module will no longer produce child symbol tables for " "each comprehension; instead, the comprehension's locals will be included in " "the parent function's symbol table." msgstr "" +"symtable 模組將不再為每個推導式產生子符號表;相反,推導式的局部變數將包含在父" +"函式的符號表中。" #: ../../whatsnew/3.12.rst:415 +#, 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:418 +#, fuzzy msgid "" "A comprehension iterating directly over ``locals()`` (e.g. ``[k for k in " "locals()]``) may see \"RuntimeError: dictionary changed size during " @@ -528,6 +678,11 @@ 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()]``)的理解可能會看到 \"RuntimeError: dictionary changed size " +"during iteration\"。這與在例如中已經看到的行為相同。 ``for k in locals():``." +"為了避免錯誤,首先建立一個要疊代的鍵串列:``keys = list(locals()); [k 代表鍵" +"中的 k]``。" #: ../../whatsnew/3.12.rst:425 msgid "(Contributed by Carl Meyer and Vladimir Matveev in :pep:`709`.)" @@ -535,16 +690,20 @@ msgstr "(由 Carl Meyer 和 Vladimir Matveev 於 :pep:`709` 中貢獻。)" #: ../../whatsnew/3.12.rst:428 msgid "Improved Error Messages" -msgstr "" +msgstr "改進的錯誤訊息" #: ../../whatsnew/3.12.rst:430 +#, 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 "" +"當 NameError 提升到頂層時,標準庫中的模組現在可能會被建議作為直譯器顯示的錯誤" +"訊息的一部分。(由 Pablo Galindo 在 :gh:`98254` 中貢獻。)" #: ../../whatsnew/3.12.rst:439 +#, 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 " @@ -552,6 +711,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:459 msgid "" @@ -559,6 +721,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:469 msgid "" @@ -567,33 +731,42 @@ 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:480 msgid "New Features Related to Type Hints" -msgstr "" +msgstr "與型別提示相關的新功能" #: ../../whatsnew/3.12.rst:482 +#, fuzzy msgid "" "This section covers major changes affecting :pep:`type hints <484>` and the :" "mod:`typing` module." -msgstr "" +msgstr "本節涵蓋影響:pep:`型別提示 <484>` 和:mod:`typing` 模組的主要變更。" #: ../../whatsnew/3.12.rst:488 msgid "PEP 692: Using ``TypedDict`` for more precise ``**kwargs`` typing" -msgstr "" +msgstr "PEP 692:使用 ``TypedDict`` 進行更精確的 ``**kwargs`` 型別註釋" #: ../../whatsnew/3.12.rst:490 +#, 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:494 +#, fuzzy msgid "" ":pep:`692` specifies a more precise way of typing ``**kwargs`` by relying on " "typed dictionaries::" msgstr "" +":pep:`692` 指定了一種更精確的方式,透過依賴型別化字典來輸入 ``**kwargs`` :" #: ../../whatsnew/3.12.rst:505 msgid "See :pep:`692` for more details." @@ -605,9 +778,10 @@ msgstr "(由 Franek Magiera 於 :gh:`103629` 中貢獻。)" #: ../../whatsnew/3.12.rst:512 msgid "PEP 698: Override Decorator for Static Typing" -msgstr "" +msgstr "PEP 698:覆蓋靜態型別的裝飾器" #: ../../whatsnew/3.12.rst:514 +#, 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 " @@ -615,6 +789,9 @@ 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:520 msgid "Example::" @@ -626,19 +803,23 @@ msgstr "詳情請見 :pep:`698`。" #: ../../whatsnew/3.12.rst:540 msgid "(Contributed by Steven Troxler in :gh:`101561`.)" -msgstr "(由 Steven Troxler 於 :gh:`101561` 中貢獻。)" +msgstr "(由 Steven Troxler 在 :gh:`101561` 中貢獻。)" #: ../../whatsnew/3.12.rst:543 msgid "Other Language Changes" msgstr "其他語言更動" #: ../../whatsnew/3.12.rst:545 +#, 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:548 +#, fuzzy msgid "" "A backslash-character pair that is not a valid escape sequence now generates " "a :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. For example, " @@ -648,16 +829,28 @@ 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:557 +#, 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:563 +#, 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 := " @@ -666,23 +859,35 @@ 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:570 +#, fuzzy msgid "" "Exceptions raised in a class or type'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__`` 方法中引發的例外不再由 RuntimeError 包裝。上下文" +"資訊會以 :pep:`678` 註解加入例外。(由 Irit Katriel 在 :gh:`77757` 中貢獻。)" #: ../../whatsnew/3.12.rst:574 +#, 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:579 +#, 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 " @@ -691,6 +896,10 @@ 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:586 msgid "" @@ -698,12 +907,16 @@ 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:590 msgid "" ":class:`memoryview` now supports the half-float type (the \"e\" format " "code). (Contributed by Donghee Na and Antoine Pitrou in :gh:`90751`.)" msgstr "" +":class:`memoryview` 現在支援半浮點型別(\"e\" 格式碼)。(由 Donghee Na 和 " +"Antoine Pitrou 在 :gh:`90751` 中貢獻。)" #: ../../whatsnew/3.12.rst:593 msgid "" @@ -711,22 +924,31 @@ 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:596 +#, fuzzy msgid "" ":func:`sum` now uses Neumaier summation to improve accuracy and " "commutativity when summing floats or mixed ints and floats. (Contributed by " "Raymond Hettinger in :gh:`100425`.)" msgstr "" +"sum 現在使用 Neumaier 求和來提高對浮點數或混合整數和浮點數求和時的準確性和交" +"換性。(由 Raymond Hettinger 在 :gh:`100425` 中貢獻。)" #: ../../whatsnew/3.12.rst:600 +#, 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:604 +#, 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 " @@ -735,12 +957,18 @@ msgid "" "for details. In Python 3.14, the default will switch to ``'data'``. " "(Contributed by Petr Viktorin in :pep:`706`.)" msgstr "" +"tarfile 和 shutdown.unpack_archive 中的提取方法有一個新的 *filter* 參數,該參" +"數允許限制可能令人驚訝或危險的 tar 功能,例如在目標目錄之外建立檔案。有關詳細" +"資訊,請參閱 tarfile 提取過濾器 `。在Python 3.14" +"中,預設將切換為``'data'``。(由 Petr Viktorin 在 :pep:`706` 中貢獻。)" #: ../../whatsnew/3.12.rst:612 msgid "" ":class:`types.MappingProxyType` instances are now hashable if the underlying " "mapping is hashable. (Contributed by Serhiy Storchaka in :gh:`87995`.)" msgstr "" +"如果底層映射是可雜湊的,則 :class:`types.MappingProxyType` 實例現在是可雜湊" +"的。(由 Serhiy Storchaka 在 :gh:`87995` 中貢獻。)" #: ../../whatsnew/3.12.rst:616 msgid "" @@ -752,6 +980,12 @@ msgid "" "Contributed by Pablo Galindo and Christian Heimes with contributions from " "Gregory P. Smith [Google] and Mark Shannon in :gh:`96123`.)" msgstr "" +"透過新的環境變數 :envvar:`PYTHONPERFSUPPORT` 和命令列選項 :option:`-X perf <-" +"X>` 以及新的 :func:`sys.activate_stack_trampoline`、:func:`sys." +"deactivate_stack_trampoline` 和 :func:`sys.is_stack_trampoline_active` 函式," +"新增對\\ :ref:`效能分析器的支援 `。(由 Pablo Galindo 設計。" +"由 Pablo Galindo 和 Christian Heimes 貢獻,Gregory P. Smith [Google] 和 Mark " +"Shannon 在 :gh:`96123` 中也有貢獻。)" #: ../../whatsnew/3.12.rst:628 msgid "New Modules" @@ -759,7 +993,7 @@ msgstr "新增模組" #: ../../whatsnew/3.12.rst:630 msgid "None." -msgstr "" +msgstr "還沒有任何新模組。" #: ../../whatsnew/3.12.rst:634 msgid "Improved Modules" @@ -774,6 +1008,8 @@ 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` 類別現在支援下標,使其成為\\ :term:`通用型別 `。(由 Jelle Zijlstra 在 :gh:`98658` 中貢獻。)" #: ../../whatsnew/3.12.rst:643 msgid "asyncio" @@ -786,14 +1022,22 @@ 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 的性能得到了顯著提高。:mod:`asyncio` 現在可以避免在寫" +"入 socket 時進行不必要的複製,並在平台支援的情況下使用 :meth:`~socket.socket." +"sendmsg`。(由 Kumar Aditya 在 :gh:`91166` 中貢獻。)" #: ../../whatsnew/3.12.rst:650 +#, fuzzy msgid "" "Add :func:`asyncio.eager_task_factory` and :func:`asyncio." "create_eager_task_factory` functions to allow opting an event loop in to " "eager task execution, making some use-cases 2x to 5x faster. (Contributed by " "Jacob Bower & Itamar Oren in :gh:`102853`, :gh:`104140`, and :gh:`104138`)" msgstr "" +"新增 :func:`asyncio.eager_task_factory` 和 :func:`asyncio." +"create_eager_task_factory` 函式以允許選擇事件迴圈來執行急切任務,使某些用例速" +"度提高 2 到 5 倍。(由 Jacob Bower 和 Itamar Oren 在 :gh:`102853`、:gh:" +"`104140` 和 :gh:`104138` 中貢獻)" #: ../../whatsnew/3.12.rst:655 msgid "" @@ -801,6 +1045,9 @@ msgid "" "if :func:`os.pidfd_open` is available and functional instead of :class:" "`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:660 msgid "" @@ -809,18 +1056,26 @@ msgid "" "ThreadedChildWatcher` otherwise), so manually configuring a child watcher is " "not recommended. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" +"事件迴圈現在使用每個平台上的最佳可用子觀察器(如果有支援,則使用 :class:" +"`asyncio.PidfdChildWatcher`,否則使用 :class:`asyncio." +"ThreadedChildWatcher`),因此不建議手動配置子觀察器。(由 Kumar Aditya 在 :" +"gh:`94597` 中貢獻。)" #: ../../whatsnew/3.12.rst:666 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:670 msgid "" "Add C implementation of :func:`asyncio.current_task` for 4x-6x speedup. " "(Contributed by Itamar Oren and Pranav Thulasiram Bhat in :gh:`100344`.)" msgstr "" +"新增 :func:`asyncio.current_task`k 的 C 實作,加速了 4-6 倍。(由 Itamar " +"Oren 和 Pranav Thulasiram Bhat 在 :gh:`100344` 中貢獻。)" #: ../../whatsnew/3.12.rst:673 msgid "" @@ -828,12 +1083,16 @@ msgid "" "`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:677 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:682 msgid "calendar" @@ -845,6 +1104,8 @@ msgid "" "the year and days of the week. (Contributed by Prince Roshan in :gh:" "`103636`.)" msgstr "" +"新增列舉 :data:`calendar.Month` 和 :data:`calendar.Day` 來定義一年中的月份和" +"一週的日期。(由 Prince Roshan 在 :gh:`103636` 中貢獻。)" #: ../../whatsnew/3.12.rst:689 msgid "csv" @@ -856,12 +1117,15 @@ msgid "" "provide finer grained control of ``None`` and empty strings by :class:`csv." "writer` objects." msgstr "" +"新增 :const:`csv.QUOTE_NOTNULL` 和 :const:`csv.QUOTE_STRINGS` 旗標,以透過 :" +"class:`csv.writer` 物件提供對 ``None`` 和空字串的更細粒度的控制。" #: ../../whatsnew/3.12.rst:696 msgid "dis" msgstr "dis" #: ../../whatsnew/3.12.rst:698 +#, 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:" @@ -869,12 +1133,19 @@ msgid "" "pseudo instructions. Use the new :data:`dis.hasarg` collection instead. " "(Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" +"偽指令操作碼(由編譯器使用,但不會出現在可執行位元組碼中)現在在 :mod:`dis` " +"模組中公開。:opcode:`HAVE_ARGUMENT` 仍然與真實操作碼相關,但對於偽指令沒有用" +"處。請改用新的 :data:`dis.hasarg` 集合。(由 Irit Katriel 在 :gh:`94216` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:706 +#, fuzzy msgid "" "Add the :data:`dis.hasexc` collection to signify instructions that set an " "exception handler. (Contributed by Irit Katriel in :gh:`94216`.)" msgstr "" +"新增 :data:`dis.hasexc` 集合來表示設定例外處理程序的指令。(由 Irit Katriel " +"在 :gh:`94216` 中貢獻。)" #: ../../whatsnew/3.12.rst:710 msgid "fractions" @@ -885,6 +1156,8 @@ 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:716 msgid "importlib.resources" @@ -895,12 +1168,16 @@ msgid "" ":func:`importlib.resources.as_file` now supports resource directories. " "(Contributed by Jason R. Coombs in :gh:`97930`.)" msgstr "" +":func:`importlib.resources.as_file` 現在支援資源目錄。(由 Jason R. Coombs " +"在 :gh:`97930` 中貢獻。)" #: ../../whatsnew/3.12.rst:721 msgid "" "Rename first parameter of :func:`importlib.resources.files` to *anchor*. " "(Contributed by Jason R. Coombs in :gh:`100598`.)" msgstr "" +"將 :func:`importlib.resources.files` 的第一個參數重新命名為 *anchor*。(由 " +"Jason R. Coombs 在 :gh:`100598` 中貢獻。)" #: ../../whatsnew/3.12.rst:725 msgid "inspect" @@ -912,6 +1189,9 @@ msgid "" "a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`. " "(Contributed by Carlton Gibson in :gh:`99247`.)" msgstr "" +"新增 :func:`inspect.markcoroutinefunction` 來標記會回傳\\ :term:`協程 " +"`\\ 的同步函式,以便與 :func:`inspect.iscoroutinefunction` 一起使" +"用。(由 Carlton Gibson 在 :gh:`99247` 中貢獻。)" #: ../../whatsnew/3.12.rst:731 msgid "" @@ -919,6 +1199,9 @@ msgid "" "for determining the current state of asynchronous generators. (Contributed " "by Thomas Krennwallner in :gh:`79940`.)" msgstr "" +"新增 :func:`inspect.getasyncgenstate` 和 :func:`inspect.getasyncgenlocals` 用" +"於確定非同步產生器的目前狀態。(由 Thomas Krennwallner 在 :gh:`79940` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:735 msgid "" @@ -926,6 +1209,9 @@ msgid "" "improved. Most calls to the function should be at least 2x faster than they " "were in Python 3.11. (Contributed by Alex Waygood in :gh:`103193`.)" msgstr "" +":func:`inspect.getattr_static` 的效能得到了顯著提升。大多數對該函式的呼叫應該" +"比 Python 3.11 中的呼叫至少快 2 倍。(由 Alex Waygood 在 :gh:`103193` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:740 msgid "itertools" @@ -937,6 +1223,8 @@ msgid "" "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:747 msgid "math" @@ -956,6 +1244,9 @@ msgid "" "down multiple steps at a time. (Contributed 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:757 msgid "os" @@ -967,6 +1258,8 @@ msgid "" "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:763 msgid "" @@ -974,6 +1267,8 @@ msgid "" "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:767 msgid "" @@ -981,8 +1276,12 @@ msgid "" "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:771 +#, 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 " @@ -994,6 +1293,12 @@ 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:782 msgid "os.path" @@ -1004,31 +1309,42 @@ 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` 來檢查給定路徑是否是聯接點 (junction)。(由 " +"Charles Machalow 在 :gh:`99547` 中貢獻。)" #: ../../whatsnew/3.12.rst:787 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:791 msgid "pathlib" msgstr "pathlib" #: ../../whatsnew/3.12.rst:793 +#, 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:798 +#, 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:802 msgid "" @@ -1037,12 +1353,17 @@ msgid "" "consistent with :func:`os.path.relpath`. (Contributed by Domenico Ragusa in :" "gh:`84538`.)" msgstr "" +"將可選參數 *walk_up* 新增至 :meth:`pathlib.PurePath.relative_to` 以允許在結果" +"中插入 ``..`` 條目;此行為與 :func:`os.path.relpath` 更加一致。(由 Domenico " +"Ragusa 在 :gh:`84538` 中貢獻。)" #: ../../whatsnew/3.12.rst:807 msgid "" "Add :meth:`pathlib.Path.is_junction` as a proxy to :func:`os.path." "isjunction`. (Contributed by Charles Machalow in :gh:`99547`.)" msgstr "" +"新增 :meth:`pathlib.Path.is_junction` 作為 :func:`os.path.isjunction` 的代" +"理。(由 Charles Machalow 在 :gh:`99547` 中貢獻。)" #: ../../whatsnew/3.12.rst:810 msgid "" @@ -1051,17 +1372,23 @@ msgid "" "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:815 msgid "pdb" msgstr "pdb" #: ../../whatsnew/3.12.rst:817 +#, 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:823 msgid "random" @@ -1080,6 +1407,8 @@ msgid "" "Add a default of ``lambd=1.0`` to :func:`random.expovariate`. (Contributed " "by Raymond Hettinger in :gh:`100234`.)" msgstr "" +"將預設值 ``lambd=1.0`` 加入 :func:`random.expovariate` 中。(由 Raymond " +"Hettinger 在 :gh:`100234` 中貢獻。)" #: ../../whatsnew/3.12.rst:832 msgid "shutil" @@ -1092,6 +1421,9 @@ msgid "" "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:840 msgid "" @@ -1100,6 +1432,9 @@ msgid "" "*(typ, val, tb)* triplet. *onerror* is deprecated. (Contributed by Irit " "Katriel in :gh:`102828`.)" msgstr "" +":func:`shutil.rmtree` 現在接受一個新引數 *onexc*,它是一個類似於 *onerror* 的" +"錯誤處理程序,但它需要一個例外實例而不是 *(typ, val, tb)* 三元組。*onerror* " +"已棄用。(由 Irit Katriel 在 :gh:`102828` 中貢獻。)" #: ../../whatsnew/3.12.rst:845 msgid "" @@ -1107,6 +1442,9 @@ msgid "" "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:850 msgid "" @@ -1115,13 +1453,20 @@ msgid "" "directory should be prepended to the search path. (Contributed by Charles " "Machalow in :gh:`103179`.)" msgstr "" +"在 Windows 上查詢可執行文件時,:func:`shutil.which` 將呼叫 " +"``NeedCurrentDirectoryForExePathW`` 以確定是否應將當前工作目錄新增到搜索路徑" +"前面。(由 Charles Machalow 在 :gh:`103179` 中貢獻。)" #: ../../whatsnew/3.12.rst:855 +#, 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:861 ../../whatsnew/3.12.rst:1666 msgid "sqlite3" @@ -1142,6 +1487,10 @@ msgid "" "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:873 msgid "" @@ -1149,6 +1498,9 @@ msgid "" "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:878 msgid "" @@ -1156,6 +1508,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:884 msgid "statistics" @@ -1167,6 +1522,8 @@ msgid "" "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:891 msgid "sys" @@ -1178,8 +1535,11 @@ msgid "" "` monitoring API. (Contributed by Mark Shannon in :gh:" "`103082`.)" msgstr "" +"新增 :mod:`sys.monitoring` 命名空間以公開新的 :ref:`PEP 669 ` 監控 API。(由 Mark Shannon 在 :gh:`103082` 中貢獻。)" #: ../../whatsnew/3.12.rst:897 +#, fuzzy msgid "" "Add :func:`sys.activate_stack_trampoline` and :func:`sys." "deactivate_stack_trampoline` for activating and deactivating stack profiler " @@ -1188,6 +1548,11 @@ 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` 用於啟用和停用堆疊分析器 trampolines,以及 :" +"func:`sys.is_stack_trampoline_active` 用於查詢堆疊分析器 trampolines 是否處於" +"活躍狀態。(由 Pablo Galindo 、 Christian Heimes、Gregory P. Smith [Google] " +"和 Mark Shannon 在 :gh:`96123` 中貢獻。)" #: ../../whatsnew/3.12.rst:906 msgid "" @@ -1197,13 +1562,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:912 ../../whatsnew/3.12.rst:1861 +#, 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:916 msgid "" @@ -1212,6 +1584,9 @@ msgid "" "use the recursion limit, but are protected by a different mechanism that " "prevents recursion from causing a virtual machine crash." msgstr "" +":func:`sys.setrecursionlimit` 和 :func:`sys.getrecursionlimit`。遞迴限制現在" +"僅適用於 Python 程式碼。內建函式不使用遞迴限制,但受到不同機制的保護,以防止" +"遞迴導致虛擬機器崩潰。" #: ../../whatsnew/3.12.rst:922 msgid "tempfile" @@ -1222,12 +1597,16 @@ 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:926 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:930 msgid "threading" @@ -1240,6 +1619,10 @@ msgid "" "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`,允許在除呼叫執行緒之外的所有正在運行的執行緒中設定追" +"蹤 (tracing) 和分析 (profiling) 函式。(由 Pablo Galindo 在 :gh:`93503` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:938 msgid "tkinter" @@ -1254,6 +1637,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:949 msgid "tokenize" @@ -1266,6 +1654,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:957 msgid "types" @@ -1277,12 +1668,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:966 msgid "typing" msgstr "typing" #: ../../whatsnew/3.12.rst:968 +#, fuzzy msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols ` now use :func:`inspect.getattr_static` rather than :func:" @@ -1294,22 +1689,34 @@ 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 "" +":func:`isinstance` 針對\\ :func:`可 runtime 檢查協定 `\\ 檢查,現在使用 :func:`inspect.getattr_static` 而不是 :" +"func:`hasattr` 來查找屬性是否存在。這意味著在針對 可 runtime 檢查協定的 " +"``isinstance()`` 檢查期間,描述器和 :meth:`~object.__getattr__` 方法不再意外" +"地被求值。然而,這也可能意味著一些曾經被視為 runtime 可檢查協定實例的物件在 " +"Python 3.12+ 上可能不再被視為該協定的實例,反之亦然。大多數使用者不太可能受到" +"此更改的影響。(由 Alex Waygood 在 :gh:`102433` 中貢獻。)" #: ../../whatsnew/3.12.rst:979 +#, 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 "" +"現在,一旦建立了類別,可 runtime 檢查協定的成員就會在 runtime 被視為「凍" +"結」。將屬性 monkey-patch 到 可 runtime 檢查的協定上仍然有效,但不會影響將物" +"件與協定進行比較的 isinstance 檢查。例如: ::" #: ../../whatsnew/3.12.rst:1001 msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." -msgstr "" +msgstr "進行此更改是為了加快針對可 runtime 檢查協定的 ``isinstance()`` 檢查。" #: ../../whatsnew/3.12.rst:1004 +#, fuzzy msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1319,6 +1726,12 @@ msgid "" "may be slower than in Python 3.11. (Contributed by Alex Waygood in :gh:" "`74690` and :gh:`103193`.)" msgstr "" +":func:`isinstance` 針對\\ :func:`可 runtime 檢查協定 進行檢查的效能設定檔已發生顯著變化。大多數 " +"``isinstance()`` 針對只有少數成員的協定的檢查應該比 3.11 中至少快 2 倍,有些" +"可能快 20 倍或更多。然而,``isinstance()`` 對具有許多成員的協定進行檢查可能" +"比 Python 3.11 慢。(由 Alex Waygood 在 :gh:`74690` 和 :gh:`103193` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1012 msgid "" @@ -1326,12 +1739,17 @@ msgid "" "the ``__orig_bases__`` attribute. (Contributed by Adrian Garcia Badaracco " "in :gh:`103699`.)" msgstr "" +"所有 :data:`typing.TypedDict` 和 :data:`typing.NamedTuple` 類別現在都具有 " +"``__orig_bases__`` 屬性。 (由 Adrian Garcia Badaracco 在 :gh:`103699` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1016 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:1020 msgid "unicodedata" @@ -1342,6 +1760,8 @@ 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:1026 ../../whatsnew/3.12.rst:1706 msgid "unittest" @@ -1350,11 +1770,11 @@ msgstr "unittest" #: ../../whatsnew/3.12.rst:1028 msgid "" "Add a ``--durations`` command line option, showing the N slowest test cases::" -msgstr "" +msgstr "新增一個 ``--durations`` 命令列選項,顯示 N 個最慢的測試案例: ::" #: ../../whatsnew/3.12.rst:1044 msgid "(Contributed by Giampaolo Rodola in :gh:`48330`)" -msgstr "" +msgstr "(由 Giampaolo Rodola 在 :gh:`48330` 中貢獻)" #: ../../whatsnew/3.12.rst:1047 msgid "uuid" @@ -1365,6 +1785,8 @@ msgid "" "Add a :ref:`command-line interface `. (Contributed by Adam Chhina " "in :gh:`88597`.)" msgstr "" +"新增\\ :ref:`命令列界面 `。(由 Adam Chhina 在 :gh:`88597` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1054 msgid "Optimizations" @@ -1376,6 +1798,9 @@ msgid "" "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:1060 msgid "" @@ -1383,28 +1808,41 @@ msgid "" "process, which improves performance by 1-5%. (Contributed by Kevin " "Modzelewski in :gh:`90536` and tuned by Donghee Na in :gh:`101525`)" msgstr "" +"增加在建置過程中使用 BOLT 二進位最佳化器的實驗支援,這可將效能提高 1-5%。" +"(由 Kevin Modzelewski 在 :gh:`90536` 中貢獻、由 Donghee Na 在 :gh:`101525` " +"中調整)" #: ../../whatsnew/3.12.rst:1064 +#, 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:1069 msgid "" "Speed up :class:`asyncio.Task` creation by deferring expensive string " "formatting. (Contributed by Itamar Oren in :gh:`103793`.)" msgstr "" +"透過推遲運算繁重的字串格式來加快 :class:`asyncio.Task` 的建立速度。(由 " +"Itamar Oren 在 :gh:`103793` 中貢獻。)" #: ../../whatsnew/3.12.rst:1072 +#, 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` 所需更改的副作用,:func:" +"`tokenize.tokenize` 和 :func:`tokenize.generate_tokens` 函式速度提高了 64%。" +"(由 Marta Gómez Macías 和 Pablo Galindo 在 :gh:`102856` 中貢獻。)" #: ../../whatsnew/3.12.rst:1077 msgid "" @@ -1412,6 +1850,8 @@ msgid "" "`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer and Vladimir " "Matveev in :gh:`103497`.)" msgstr "" +"透過新的 :opcode:`LOAD_SUPER_ATTR` 指令加速 :func:`super` 方法呼叫和屬性載" +"入。(由 Carl Meyer 和 Vladimir Matveev 在 :gh:`103497` 中貢獻。)" #: ../../whatsnew/3.12.rst:1083 msgid "CPython bytecode changes" @@ -1424,6 +1864,9 @@ msgid "" "`!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:1090 msgid "" @@ -1431,54 +1874,70 @@ 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:1093 msgid "" "Remove the :opcode:`!PRECALL` instruction. (Contributed by Mark Shannon in :" "gh:`92925`.)" msgstr "" +"刪除 :opcode:`!PRECALL` 指令。(由 Mark Shannon 在 :gh:`92925` 中貢獻。)" #: ../../whatsnew/3.12.rst:1096 msgid "" "Add the :opcode:`BINARY_SLICE` and :opcode:`STORE_SLICE` instructions. " "(Contributed by Mark Shannon in :gh:`94163`.)" msgstr "" +"新增 :opcode:`BINARY_SLICE` 和 :opcode:`STORE_SLICE` 指令。(由 Mark Shannon " +"在 :gh:`94163` 中貢獻。)" #: ../../whatsnew/3.12.rst:1099 msgid "" "Add the :opcode:`CALL_INTRINSIC_1` instructions. (Contributed by Mark " "Shannon in :gh:`99005`.)" msgstr "" +"新增 :opcode:`CALL_INTRINSIC_1` 指令。(由 Mark Shannon 在 :gh:`99005` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1102 msgid "" "Add the :opcode:`CALL_INTRINSIC_2` instruction. (Contributed by Irit Katriel " "in :gh:`101799`.)" msgstr "" +"新增 :opcode:`CALL_INTRINSIC_2` 指令。(由 Irit Katriel 在 :gh:`101799` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1105 msgid "" "Add the :opcode:`CLEANUP_THROW` instruction. (Contributed by Brandt Bucher " "in :gh:`90997`.)" msgstr "" +"新增 :opcode:`CLEANUP_THROW` 指令。(由 Brandt Bucher 在 :gh:`90997` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1108 msgid "" "Add the :opcode:`!END_SEND` instruction. (Contributed by Mark Shannon in :gh:" "`103082`.)" msgstr "" +"新增 :opcode:`!END_SEND` 指令。(由 Mark Shannon 在 :gh:`103082` 中貢獻。)" #: ../../whatsnew/3.12.rst:1111 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 "" +"作為 :pep:`709` 實作的一部分,新增 :opcode:`LOAD_FAST_AND_CLEAR` 指令。(由 " +"Carl Meyer 在 :gh:`101441` 中貢獻。)" #: ../../whatsnew/3.12.rst:1114 msgid "" "Add the :opcode:`LOAD_FAST_CHECK` instruction. (Contributed by Dennis " "Sweeney in :gh:`93143`.)" msgstr "" +"新增 :opcode:`LOAD_FAST_CHECK` 指令。(由 Dennis Sweeney 在 :gh:`93143` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1117 msgid "" @@ -1488,22 +1947,31 @@ 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 "" +"新增 :opcode:`LOAD_FROM_DICT_OR_DEREF`、:opcode:`LOAD_FROM_DICT_OR_GLOBALS` " +"和 :opcode:`LOAD_LOCALS` 操作碼作為 :pep:`695` 實作的一部分。刪除 :opcode:`!" +"LOAD_CLASSDEREF` 操作碼,可以用 :opcode:`LOAD_LOCALS` 加上 :opcode:" +"`LOAD_FROM_DICT_OR_DEREF` 替換。(由 Jelle Zijlstra 在 :gh:`103764` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1123 msgid "" "Add the :opcode:`LOAD_SUPER_ATTR` instruction. (Contributed by Carl Meyer " "and Vladimir Matveev in :gh:`103497`.)" msgstr "" +"新增 :opcode:`LOAD_SUPER_ATTR` 指令。(由 Carl Meyer 和 Vladimir Matveev 在 :" +"gh:`103497` 中貢獻。)" #: ../../whatsnew/3.12.rst:1126 msgid "" "Add the :opcode:`RETURN_CONST` instruction. (Contributed by Wenyang Wang in :" "gh:`101632`.)" msgstr "" +"新增 :opcode:`RETURN_CONST` 指令。(由 Wenyang Wang 在 :gh:`101632` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1129 msgid "Demos and Tools" -msgstr "" +msgstr "演示和工具" #: ../../whatsnew/3.12.rst:1131 msgid "" @@ -1511,6 +1979,9 @@ msgid "" "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:1136 msgid "" @@ -1518,6 +1989,9 @@ msgid "" "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:1143 ../../whatsnew/3.12.rst:2264 msgid "Deprecated" @@ -1529,6 +2003,9 @@ msgid "" "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:1150 msgid "" @@ -1537,6 +2014,9 @@ msgid "" "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` 功能已在文件中棄用,現在會導致" +"在存取或使用它們時在 runtime 發出 :exc:`DeprecationWarning`,並將在 Python " +"3.14 中被刪除:" #: ../../whatsnew/3.12.rst:1154 ../../whatsnew/3.12.rst:1400 msgid ":class:`!ast.Num`" @@ -1563,6 +2043,7 @@ 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:1163 ../../whatsnew/3.12.rst:1406 msgid ":mod:`asyncio`:" @@ -1575,6 +2056,10 @@ msgid "" "`asyncio.SafeChildWatcher` are deprecated and will be removed in Python " "3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" msgstr "" +"子觀察器類別 :class:`asyncio.MultiLoopChildWatcher`、:class:`asyncio." +"FastChildWatcher`、:class:`asyncio.AbstractChildWatcher` 和 :class:`asyncio." +"SafeChildWatcher` 已棄用並將在 Python 3.14 中刪除。(由 Kumar Aditya 在 :gh:" +"`94597` 中貢獻。)" #: ../../whatsnew/3.12.rst:1171 msgid "" @@ -1583,6 +2068,10 @@ msgid "" "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:1177 msgid "" @@ -1591,6 +2080,9 @@ msgid "" "and it decides to create one. (Contributed by Serhiy Storchaka and Guido van " "Rossum in :gh:`100160`.)" msgstr "" +"如果沒有當前事件迴圈集且決定要建立一個,預設事件迴圈策略的 :meth:`~asyncio." +"get_event_loop` 方法現在會發出 :exc:`DeprecationWarning`。(由 Serhiy " +"Storchaka 和 Guido van Rossum 在 :gh:`100160` 中貢獻。)" #: ../../whatsnew/3.12.rst:1182 msgid "" @@ -1598,16 +2090,25 @@ msgid "" "are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." "FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" msgstr "" +":mod:`calendar`:``calendar.January`` 和 ``calendar.February`` 常數已棄用,並" +"替換為 :data:`calendar.JANUARY` 和 :data:`calendar.FEBRUARY`。(由 Prince " +"Roshan 在 :gh:`103636` 中貢獻。)" #: ../../whatsnew/3.12.rst:1186 +#, 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`。為了在 typing 中使" +"用,使用聯集會更合適,例如 ``bytes | bytearray`` 或 :class:`collections.abc." +"Buffer`。(由 Shantanu Jain 在 :gh:`91896` 中貢獻。)" #: ../../whatsnew/3.12.rst:1191 +#, fuzzy msgid "" ":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime." "utcnow` and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and " @@ -1616,6 +2117,12 @@ 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` 已棄用,並將在未來版本" +"中刪除。請改用時區感知 (timezone-aware) 物件來表示 UTC 中的日期時間:分別呼" +"叫 :meth:`~datetime.datetime.now` 和 :meth:`~datetime.datetime." +"fromtimestamp` 並將 *tz* 參數設定為 :const:`datetime.UTC`。(由 Paul Ganssle " +"在 :gh:`103857` 中貢獻。)" #: ../../whatsnew/3.12.rst:1199 msgid "" @@ -1667,6 +2174,9 @@ msgid "" "code volume and maintenance burden. (Contributed by Raymond Hettinger in :gh:" "`101588`.)" msgstr "" +":mod:`itertools`:棄用對複製、深度複製和 pickle 操作的支援,這些操作沒有文件" +"記錄、效率低下、過去常有錯誤且不一致。這將在 3.14 中刪除,以顯著地減少程式碼" +"總量和維護負擔。(由 Raymond Hettinger 在 :gh:`101588` 中貢獻。)" #: ../../whatsnew/3.12.rst:1222 msgid "" @@ -1679,6 +2189,13 @@ msgid "" "specify when your code *requires* ``'fork'``. See :ref:`contexts and start " "methods `." msgstr "" +":mod:`multiprocessing`:在 Python 3.14 中,預設的 :mod:`multiprocessing` 啟動" +"方法將更改為 Linux、BSD 和其他非 macOS POSIX 平台上更安全的方法,其中 " +"``'fork'`` 目前是預設值 (:gh:`84559`)。新增關於此的 runtime 警告被認為太具有" +"破壞性,因為大多數程式碼預計不會關心它們。使用 :func:`~multiprocessing." +"get_context` 或 :func:`~multiprocessing.set_start_method` API 明確指定你的程" +"式碼何時\\ *需要* ``'fork'``。請參閱\\ :ref:`情境和啟動方法 `。" #: ../../whatsnew/3.12.rst:1232 msgid "" @@ -1686,6 +2203,9 @@ msgid "" "are deprecated and will be removed in Python 3.14; use :func:`importlib.util." "find_spec` instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" msgstr "" +":mod:`pkgutil`::func:`pkgutil.find_loader` 和 :func:`pkgutil.get_loader` 已" +"棄用,並將在 Python 3.14 中刪除;請改用 :func:`importlib.util.find_spec`。" +"(由 Nikita Sobolev 在 :gh:`97850` 中貢獻。)" #: ../../whatsnew/3.12.rst:1237 msgid "" @@ -1694,6 +2214,10 @@ msgid "" "gained a proper :exc:`DeprecationWarning` in 3.12. Remove them in 3.14. " "(Contributed by Soumendra Ganguly and Gregory P. Smith in :gh:`85984`.)" msgstr "" +":mod:`pty`:這個模組有兩個未記錄於文件中的函式 ``master_open()`` 和 " +"``slave_open()``,自Python 2 以來已被棄用,但僅在 3.12 中會適時發出 :exc:" +"`DeprecationWarning`。將會在 3.14 中刪除它們。(由 Soumendra Ganguly 和 " +"Gregory P. Smith 在 :gh:`85984` 中貢獻。)" #: ../../whatsnew/3.12.rst:1242 msgid ":mod:`os`:" @@ -1707,8 +2231,13 @@ msgid "" "contain the creation time, which is also available in the new " "``st_birthtime`` field. (Contributed by Steve Dower in :gh:`99726`.)" msgstr "" +"Windows 上 :func:`os.stat` 和 :func:`os.lstat` 回傳的 ``st_ctime`` 欄位已被棄" +"用。在未來的版本中,它們將包含最近一次的元資料變更時間,與其他平台一致。目前" +"它們仍然包含建立時間,這也可以在新的 ``st_birthtime`` 欄位中找到。(由 Steve " +"Dower 在 :gh:`99726` 中貢獻。)" #: ../../whatsnew/3.12.rst:1250 +#, fuzzy msgid "" "On POSIX platforms, :func:`os.fork` can now raise a :exc:" "`DeprecationWarning` when it can detect being called from a multithreaded " @@ -1720,13 +2249,24 @@ msgid "" "`_ for *why* we're now surfacing this " "longstanding platform compatibility problem to developers." msgstr "" +"在 POSIX 平台上,當 :func:`os.fork` 偵測到從多執行緒行程呼叫時,它現在可以引" +"發 DeprecationWarning。這樣做時始終存在與 POSIX 平台根本不相容的問題。即使這" +"樣的程式碼\\ *看起來*\\ 可以運作。我們新增了警告以提高認識,因為執行此操作的" +"程式碼遇到的問題變得越來越頻繁。請參閱 :func:`os.fork` 文件以獲取更多詳細資" +"訊,以及\\ `關於fork 與執行緒不相容的討論`_\\ 了解\\ *為什麼*\\ 我們現在向開發人員展示這個長期存在的平台相容性" +"問題。" #: ../../whatsnew/3.12.rst:1260 +#, fuzzy msgid "" "When this warning appears due to usage of :mod:`multiprocessing` or :mod:" "`concurrent.futures` the fix is to use a different :mod:`multiprocessing` " "start method such as ``\"spawn\"`` or ``\"forkserver\"``." msgstr "" +"當由於使用 :mod:`multiprocessing` 或 :mod:`concurrent.futures` 出現此警告時," +"修復方法是使用不同的 :mod:`multiprocessing` 啟動方法,例如 ``\"spawn\"`` 或 " +"``\"forkserver\"``。" #: ../../whatsnew/3.12.rst:1264 msgid "" @@ -1742,13 +2282,18 @@ msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" #: ../../whatsnew/3.12.rst:1269 +#, 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:`預設適配器和轉換器 `\\ 現已棄用。請改為使" +"用 :ref:`sqlite3-adapter-converter-recipes` 並根據你的需求進行細部調整。(由 " +"Erlend E. Aasland 在 :gh:`90016` 中貢獻。)" #: ../../whatsnew/3.12.rst:1275 +#, fuzzy msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -1757,6 +2302,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:`附名佔位符 (named " +"placeholder) ` 與作為 :term:`sequence` 提供的參數一起使" +"用時,現在會發出 :exc:`DeprecationWarning` 作為 :class:`dict`。從 Python " +"3.14 開始,使用附名佔位符以及作為序列提供的參數將引發 :exc:`~sqlite3." +"ProgrammingError`。(由 Erlend E. Aasland 在 :gh:`101698` 中貢獻。)" #: ../../whatsnew/3.12.rst:1282 msgid "" @@ -1764,13 +2314,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:1286 +#, 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:1290 msgid ":mod:`typing`:" @@ -1782,6 +2339,9 @@ msgid "" "`collections.abc.Hashable` and :class:`collections.abc.Sized` respectively, " "are deprecated. (:gh:`94309`.)" msgstr "" +":class:`typing.Hashable` 和 :class:`typing.Sized` 分別是 :class:`collections." +"abc.Hashable` 和 :class:`collections.abc.Sized` 的別名,已被棄用。(:gh:" +"`94309`)" #: ../../whatsnew/3.12.rst:1296 msgid "" @@ -1789,16 +2349,24 @@ msgid "" "`DeprecationWarning` to be emitted when it is used. (Contributed by Alex " "Waygood in :gh:`91896`.)" msgstr "" +":class:`typing.ByteString` 自 Python 3.9 起已棄用,現在會導致在使用時發出 :" +"exc:`DeprecationWarning`。(由 Alex Waygood 在 :gh:`91896` 中貢獻。)" #: ../../whatsnew/3.12.rst:1300 +#, 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. (Contributed by Jacob Walls in :gh:`83122`.)" msgstr "" +":mod:`xml.etree.ElementTree`:這個模組現在在測試 :class:`xml.etree." +"ElementTree.Element` 的真值時發出 :exc:`DeprecationWarning`。之前,Python 實" +"作發出了 :exc:`FutureWarning`,而 C 實作什麼也沒發出。(由 Jacob Walls 在 :" +"gh:`83122` 中貢獻。)" #: ../../whatsnew/3.12.rst:1306 +#, fuzzy msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`coroutine throw() " "`, :meth:`generator throw() ` and :meth:" @@ -1806,6 +2374,10 @@ msgid "" "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:`async generator throw ` 的三引數簽" +"名 (type, value, traceback) 已棄用,並且可能會在 Python 的未來版本中刪除。請" +"改用這些函式的單引數版本。(由 Ofey Chan 在 :gh:`89874` 中貢獻。)" #: ../../whatsnew/3.12.rst:1312 msgid "" @@ -1813,15 +2385,22 @@ 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:1317 +#, fuzzy msgid "" "Setting ``__package__`` or ``__cached__`` on a module is deprecated, and " "will cease to be set or taken into consideration by the import system in " "Python 3.14. (Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" +"在模組上設定 ``__package__`` 或 ``__cached__`` 已被棄用,並且 Python 3.14 中" +"的引入系統將不再設定或考慮該設定。(由 Brett Cannon 在 :gh:`65961` 中貢獻。)" #: ../../whatsnew/3.12.rst:1321 +#, 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. " @@ -1829,28 +2408,38 @@ msgid "" "underlying ``int``, convert to int explicitly: ``~int(x)``. (Contributed by " "Tim Hoffmann in :gh:`103487`.)" msgstr "" +"bool 上的位元反轉運算子 (``~``) 已棄用。在 Python 3.14 中它將拋出錯誤。使用 " +"``not`` 來代替布林值的邏輯否定。在極少數情況下,你確實需要對底層 ``int`` 進行" +"位元反轉,請明確轉換為 int:``~int(x)``。(由 Tim Hoffmann 在 :gh:`103487` 中" +"貢獻。)" #: ../../whatsnew/3.12.rst:1327 +#, fuzzy msgid "" "Accessing :attr:`~codeobject.co_lnotab` on code objects was deprecated in " "Python 3.10 via :pep:`626`, but it only got a proper :exc:" "`DeprecationWarning` in 3.12, therefore it will be removed in 3.14. " "(Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" +"在 Python 3.10 中,不建議透過 :pep:`626` 存取程式碼物件上的 :attr:" +"`~codeobject.co_lnotab`,但它在 3.12 中只會適時發出 :exc:" +"`DeprecationWarning`,因此它將在 3.14 中刪除。(由 Nikita Sobolev 在 :gh:" +"`101866` 中貢獻。)" #: ../../whatsnew/3.12.rst:1334 msgid "Pending Removal in Python 3.13" -msgstr "Python 3.13 中待決議的移除項目" +msgstr "Python 3.13 中的待刪除項目" #: ../../whatsnew/3.12.rst:1336 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:1339 msgid "Modules (see :pep:`594`):" -msgstr "" +msgstr "模組(參見:pep:`594`):" #: ../../whatsnew/3.12.rst:1341 msgid ":mod:`aifc`" @@ -2009,15 +2598,19 @@ msgid "``read_text()``" msgstr "``read_text()``" #: ../../whatsnew/3.12.rst:1386 +#, fuzzy msgid "" "Use :func:`importlib.resources.files()` instead. Refer to `importlib-" "resources: Migrating from Legacy `_ (:gh:`106531`)" msgstr "" +"使用 importlib.resources.files() 取代。請參閱 `importlib-resources:從舊版遷" +"移 `_ (:gh:`106531`)" #: ../../whatsnew/3.12.rst:1390 ../../whatsnew/3.12.rst:2351 msgid "Pending Removal in Python 3.14" -msgstr "Python 3.14 中待決議的移除項目" +msgstr "Python 3.14 中的待刪除項目" #: ../../whatsnew/3.12.rst:1392 msgid "" @@ -2029,6 +2622,8 @@ msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction`" msgstr "" +":mod:`argparse`::class:`!argparse.BooleanOptionalAction` 的 *type*、" +"*choices* 和 *metavar* 參數" #: ../../whatsnew/3.12.rst:1398 msgid ":mod:`ast`:" @@ -2068,11 +2663,11 @@ msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" #: ../../whatsnew/3.12.rst:1417 msgid ":mod:`collections.abc`: :class:`!collections.abc.ByteString`." -msgstr ":mod:`collections.abc`: :class:`!collections.abc.ByteString`。" +msgstr ":mod:`collections.abc`::class:`!collections.abc.ByteString`。" #: ../../whatsnew/3.12.rst:1419 msgid ":mod:`email`: the *isdst* parameter in :func:`email.utils.localtime`." -msgstr "" +msgstr ":mod:`email`::func:`email.utils.localtime` 中的 *isdst* 參數。" #: ../../whatsnew/3.12.rst:1421 msgid ":mod:`importlib.abc`:" @@ -2080,7 +2675,7 @@ msgstr ":mod:`importlib.abc`:" #: ../../whatsnew/3.12.rst:1427 msgid ":mod:`itertools`: Support for copy, deepcopy, and pickle operations." -msgstr "" +msgstr ":mod:`itertools`:支援複製、深度複製和 pickle 操作。" #: ../../whatsnew/3.12.rst:1429 msgid ":mod:`pkgutil`:" @@ -2119,23 +2714,25 @@ msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." "etree.ElementTree.Element`." msgstr "" +":mod:`xml.etree.ElementTree`:測試 :class:`xml.etree.ElementTree.Element` 的" +"真值。" #: ../../whatsnew/3.12.rst:1445 msgid "The ``__package__`` and ``__cached__`` attributes on module objects." -msgstr "" +msgstr "模組物件上的 ``__package__`` 和 ``__cached__`` 屬性。" #: ../../whatsnew/3.12.rst:1447 msgid "The :attr:`~codeobject.co_lnotab` attribute of code objects." -msgstr "" +msgstr "程式碼物件的 :attr:`~codeobject.co_lnotab` 屬性。" #: ../../whatsnew/3.12.rst:1450 ../../whatsnew/3.12.rst:2388 msgid "Pending Removal in Python 3.15" -msgstr "Python 3.15 中待決議的移除項目" +msgstr "Python 3.15 中的待刪除項目" #: ../../whatsnew/3.12.rst:1452 msgid "" "The following APIs have been deprecated and will be removed in Python 3.15." -msgstr "" +msgstr "以下 API 已被棄用,並將在 Python 3.15 中刪除。" #: ../../whatsnew/3.12.rst:1457 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" @@ -2143,23 +2740,26 @@ msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" #: ../../whatsnew/3.12.rst:1461 ../../whatsnew/3.12.rst:2406 msgid "Pending Removal in Future Versions" -msgstr "未來版本中待決議的移除項目" +msgstr "未來版本中待刪除項目" #: ../../whatsnew/3.12.rst:1463 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:1466 msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" -msgstr "" +msgstr ":mod:`array` 的 ``'u'`` 格式碼 (:gh:`57281`)" #: ../../whatsnew/3.12.rst:1468 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" #: ../../whatsnew/3.12.rst:1470 +#, fuzzy msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -2170,6 +2770,12 @@ 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`、:keyword:`is` 和 :keyword:`or`。在未來的" +"版本中,它將被更改為語法錯誤。(:gh:`87999`)" #: ../../whatsnew/3.12.rst:1481 ../../whatsnew/3.12.rst:2438 msgid "Removed" @@ -2185,6 +2791,8 @@ msgid "" "having been deprecated in Python 3.6. Use :mod:`asyncio` instead. " "(Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" +"這兩個模組已根據 :pep:`594` 的計畫時間刪除,並已在 Python 3.6 中棄用。請改" +"用 :mod:`asyncio`。(由 Nikita Sobolev 在 :gh:`96580` 中貢獻。)" #: ../../whatsnew/3.12.rst:1493 msgid "configparser" @@ -2194,25 +2802,31 @@ msgstr "configparser" msgid "" "Several names deprecated in the :mod:`configparser` way back in 3.2 have " "been removed per :gh:`89336`:" -msgstr "" +msgstr ":mod:`configparser` 的幾個於 3.2 中棄用的名稱已在 :gh:`89336` 刪除:" #: ../../whatsnew/3.12.rst:1498 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:1500 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:1502 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:1506 msgid "distutils" @@ -2226,6 +2840,10 @@ msgid "" "project can be installed: it still provides ``distutils``. (Contributed by " "Victor Stinner in :gh:`92584`.)" msgstr "" +"刪除 :py:mod:`!distutils` 套件。它在 Python 3.10 中被 :pep:`632` 「棄用 " +"distutils 模組」棄用。對於仍然使用 ``distutils`` 且無法更新為其他內容的項目," +"可以安裝 ``setuptools`` 項目:它仍然提供 ``distutils``。(由 Victor Stinner " +"在 :gh:`92584` 中貢獻。)" #: ../../whatsnew/3.12.rst:1515 msgid "ensurepip" @@ -2236,16 +2854,23 @@ msgid "" "Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " "installing setuptools in environments created by :mod:`venv`." msgstr "" +"從 :mod:`ensurepip` 中刪除綁定的 setuptools wheel,並停止在 :mod:`venv` 建立" +"的環境中安裝 setuptools。" #: ../../whatsnew/3.12.rst:1520 +#, 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:1526 +#, fuzzy msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -2254,6 +2879,10 @@ msgid "" "project should be declared as a dependency and installed separately " "(typically, using pip)." msgstr "" +"在使用 ``venv`` 建立或使用 ensurepip 引導的環境中,預設情況下不再提供 " +"``easy_install``、``pkg_resources``、``setuptools`` 和 ``distutils``,因為它" +"們 ``setuptools``包的一部分。對於在 runtime 依賴這些的項目,應將 " +"``setuptools`` 項目宣告為依賴項並單獨安裝(通常使用 pip)。" #: ../../whatsnew/3.12.rst:1533 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" @@ -2264,10 +2893,13 @@ msgid "enum" msgstr "enum" #: ../../whatsnew/3.12.rst:1538 +#, fuzzy msgid "" "Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" +"刪除 :mod:`enum` 的 ``EnumMeta.__getattr__``,列舉屬性存取不再需要它。(由 " +"Ethan Furman 在 :gh:`95083` 中貢獻。)" #: ../../whatsnew/3.12.rst:1543 msgid "ftplib" @@ -2286,6 +2918,7 @@ msgid "gzip" msgstr "gzip" #: ../../whatsnew/3.12.rst:1552 +#, fuzzy msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -2293,12 +2926,16 @@ msgid "" "extension if it was not present. (Contributed by Victor Stinner in :gh:" "`94196`.)" msgstr "" +"刪除 gzip 的 gzip.GzipFile 的 filename 屬性(自 Python 2.6 起已棄用),改用 " +"~gzip.GzipFile.name 屬性。在寫入模式下,``filename`` 屬性會新增``'.gz'`` 檔案" +"副檔名(如果不存在)。(由 Victor Stinner 在 :gh:`94196` 中貢獻。)" #: ../../whatsnew/3.12.rst:1559 msgid "hashlib" msgstr "hashlib" #: ../../whatsnew/3.12.rst:1561 +#, fuzzy msgid "" "Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -2306,22 +2943,29 @@ msgid "" "of :func:`~hashlib.pbkdf2_hmac()` which is faster. (Contributed by Victor " "Stinner in :gh:`94199`.)" msgstr "" +"刪除 hashlib 的 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:1568 ../../whatsnew/3.12.rst:1595 msgid "importlib" msgstr "importlib" #: ../../whatsnew/3.12.rst:1570 +#, fuzzy msgid "" "Many previously deprecated cleanups in :mod:`importlib` have now been " "completed:" -msgstr "" +msgstr "importlib 中許多先前棄用的清理現已完成:" #: ../../whatsnew/3.12.rst:1573 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:1576 msgid "" @@ -2329,18 +2973,25 @@ msgid "" "``importlib.util.module_for_loader`` have all been removed. (Contributed by " "Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" +"``importlib.util.set_package``、``importlib.util.set_loader`` 和 ``importlib." +"util.module_for_loader`` 已全部刪除。(由 Brett Cannon 和 Nikita Sobolev 在 :" +"gh:`65961` 和 :gh:`97850` 貢獻。)" #: ../../whatsnew/3.12.rst:1580 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:1583 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:1587 ../../whatsnew/3.12.rst:1595 msgid "imp" @@ -2350,11 +3001,12 @@ msgstr "imp" 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:1592 +#, fuzzy msgid "To migrate, consult the following correspondence table:" -msgstr "" +msgstr "如需遷移,請查閱以下對應表:" #: ../../whatsnew/3.12.rst:1597 msgid "``imp.NullImporter``" @@ -2397,6 +3049,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:1602 msgid "``imp.get_tag()``" @@ -2444,15 +3098,15 @@ msgstr "``imp.load_source()``" #: ../../whatsnew/3.12.rst:1607 msgid "*See below*" -msgstr "" +msgstr "*見下文*" #: ../../whatsnew/3.12.rst:1610 msgid "Replace ``imp.load_source()`` with::" -msgstr "" +msgstr "將 ``imp.load_source()`` 替換為: ::" #: ../../whatsnew/3.12.rst:1625 msgid "Remove :mod:`!imp` functions and attributes with no replacements:" -msgstr "" +msgstr "刪除 :mod:`!imp` 函式和屬性,不提供替換方案:" #: ../../whatsnew/3.12.rst:1627 msgid "Undocumented functions:" @@ -2475,10 +3129,13 @@ msgid "``imp.load_package()``" msgstr "``imp.load_package()``" #: ../../whatsnew/3.12.rst:1634 +#, 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:1636 msgid "" @@ -2502,6 +3159,10 @@ msgid "" "open` is also a static method. (Contributed by Victor Stinner in :gh:" "`94169`.)" msgstr "" +"刪除 :mod:`io` 的 ``io.OpenWrapper`` 和 ``_pyio.OpenWrapper``,在 Python " +"3.10 中已棄用:改用 :func:`open` 即可。:func:`open` (:func:`io.open`) 函式是" +"一個內建函式。從 Python 3.10 開始 :func:`!_pyio.open` 也是一個靜態方法。(由 " +"Victor Stinner 在 :gh:`94169` 中貢獻。)" #: ../../whatsnew/3.12.rst:1650 msgid "locale" @@ -2513,6 +3174,9 @@ msgid "" "3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" +"刪除 :mod:`locale` 的 :func:`!locale.format` 函式(在 Python 3.7 中已棄用):" +"請改用 :func:`locale.format_string`。(由 Victor Stinner 在 :gh:`94226` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:1657 msgid "smtpd" @@ -2525,12 +3189,16 @@ msgid "" "`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 中棄" +"用。請改用 :pypi:`aiosmtpd` PyPI 模組或任何其他基於 :mod:`asyncio` 的伺服器。" +"(由 Oleg Iarygin 在 :gh:`93243` 中貢獻。)" #: ../../whatsnew/3.12.rst:1668 msgid "" "The following undocumented :mod:`sqlite3` features, deprecated in Python " "3.10, are now removed:" msgstr "" +"以下未記錄於文件的 :mod:`sqlite3` 功能已在 Python 3.10 中棄用,現已刪除:" #: ../../whatsnew/3.12.rst:1671 msgid "``sqlite3.enable_shared_cache()``" @@ -2545,14 +3213,22 @@ 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:1677 +#, 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`` 文本工廠一直是 :class:`str` 的" +"別名。之前將文本工廠設定為 ``OptimizedUnicode`` 的程式碼可以顯式使用 " +"``str``,或者依賴預設值 ``str``。" #: ../../whatsnew/3.12.rst:1682 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" @@ -2568,6 +3244,9 @@ msgid "" "Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. " "(Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" +"刪除 :mod:`ssl` 的 :func:`!ssl.RAND_pseudo_bytes` 函式(在 Python 3.6 中已棄" +"用):請改用 :func:`os.urandom` 或 :func:`ssl.RAND_bytes`。(由 Victor " +"Stinner 在 :gh:`94199` 中貢獻。)" #: ../../whatsnew/3.12.rst:1691 msgid "" @@ -2576,6 +3255,9 @@ msgid "" "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:1697 msgid "" @@ -2587,6 +3269,11 @@ 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:1708 msgid "Remove many long-deprecated :mod:`unittest` features:" @@ -2594,7 +3281,7 @@ msgstr "移除許多 :mod:`unittest` 中被棄用已久的功能:" #: ../../whatsnew/3.12.rst:1712 msgid "A number of :class:`~unittest.TestCase` method aliases:" -msgstr "" +msgstr "許多 :class:`~unittest.TestCase` 方法別名:" #: ../../whatsnew/3.12.rst:1715 msgid "Deprecated alias" @@ -2606,7 +3293,7 @@ msgstr "方法名稱" #: ../../whatsnew/3.12.rst:1715 msgid "Deprecated in" -msgstr "" +msgstr "已棄用於" #: ../../whatsnew/3.12.rst:1717 msgid "``failUnless``" @@ -2731,12 +3418,16 @@ 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:1737 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:1740 msgid "" @@ -2744,12 +3435,17 @@ msgid "" "loadTestsFromModule>` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" +"未以文件記錄的 :meth:`TestLoader.loadTestsFromModule ` 的參數 *use_load_tests*\\ (自 Python 3.2 起已棄用並被" +"忽略)。" #: ../../whatsnew/3.12.rst:1744 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:1747 msgid "(Contributed by Serhiy Storchaka in :gh:`89325`.)" @@ -2765,6 +3461,9 @@ msgid "" "browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " "Firebird, and Firefox versions 35 and below (:gh:`102871`)." msgstr "" +"從 :mod:`webbrowser` 中刪除對過時瀏覽器的支援。刪除的瀏覽器包括:Grail、" +"Mosaic、Netscape、Galeon、Skipstone、Iceape、Firebird 和 Firefox 版本 35 及以" +"下 (:gh:`102871`)。" #: ../../whatsnew/3.12.rst:1757 msgid "xml.etree.ElementTree" @@ -2778,6 +3477,10 @@ msgid "" "no ``copy()`` method, only a ``__copy__()`` method. (Contributed by Victor " "Stinner in :gh:`94383`.)" msgstr "" +"刪除純 Python 實作的 ``ElementTree.Element.copy()`` 方法(在 Python 3.10 中已" +"棄用),改用 :func:`copy.copy` 函式。:mod:`xml.etree.ElementTree` 的 C 實作沒" +"有 ``copy()`` 方法,只有 ``__copy__()`` 方法。(由 Victor Stinner 在 :gh:" +"`94383` 中貢獻。)" #: ../../whatsnew/3.12.rst:1766 msgid "zipimport" @@ -2789,6 +3492,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:1774 msgid "Others" @@ -2801,6 +3507,9 @@ msgid "" "com/sphinx-contrib/sphinx-lint>`_. (Contributed by Julien Palard in :gh:" "`98179`.)" msgstr "" +"從文件 :file:`Makefile` 和 :file:`Doc/tools/rstlint.py` 中刪除 " +"``suspicious`` 規則,兩者現在都已被 `sphinx-lint `_ 所支援。(由 Julien Palard 在 :gh:`98179` 中貢獻。)" #: ../../whatsnew/3.12.rst:1781 msgid "" @@ -2811,6 +3520,11 @@ 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* 參數,並刪除 :mod:`http.client` 模組中的 *key_file*、" +"*cert_file* 和 *check_hostname* 參數,它們自 Python 3.6 起均已棄用。請使用 " +"*context* 參數(:mod:`imaplib` 中的 *ssl_context*)。(由 Victor Stinner 在 :" +"gh:`94172` 中貢獻。)" #: ../../whatsnew/3.12.rst:1789 msgid "" @@ -2830,19 +3544,20 @@ msgstr "" #: ../../whatsnew/3.12.rst:1800 ../../whatsnew/3.12.rst:2124 msgid "Porting to Python 3.12" -msgstr "" +msgstr "移植到 Python 3.12" #: ../../whatsnew/3.12.rst:1802 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." -msgstr "" +msgstr "本節列出了前面描述的變更以及可能需要你更改程式碼的其他錯誤修復。" #: ../../whatsnew/3.12.rst:1806 msgid "Changes in the Python API" -msgstr "" +msgstr "Python API 的變更" #: ../../whatsnew/3.12.rst:1808 +#, 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 " @@ -2850,6 +3565,9 @@ 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:1815 msgid "" @@ -2862,6 +3580,13 @@ msgid "" "``randrange(10**25)``. (Originally suggested by Serhiy Storchaka :gh:" "`86388`.)" msgstr "" +"刪除自 Python 3.10 以來已棄用的 ``randrange()`` 功能。以前 " +"``randrange(10.0)`` 無損轉換為 ``randrange(10)``。現在它會引發 :exc:" +"`TypeError`。此外,針對非整數值(例如 ``randrange(10.5)`` 或 " +"``randrange('10')``)引發的例外已從 :exc:`ValueError` 變更為 :exc:" +"`TypeError`。這也可以防止 ``randrange(1e25)`` 默默地從比 " +"``randrange(10**25)`` 更大的作用域中進行選擇的錯誤。(最初由 Serhiy " +"Storchaka 建議 :gh:`86388`。)" #: ../../whatsnew/3.12.rst:1823 msgid "" @@ -2872,6 +3597,11 @@ msgid "" "handler`. Argument files should be encoded in UTF-8 instead of ANSI Codepage " "on Windows." msgstr "" +":class:`argparse.ArgumentParser` 更改了編碼和錯誤處理程式,用於從檔案(例如 " +"``fromfile_prefix_chars`` 選項)用預設文本編碼(例如 :func:`locale." +"getpreferredencoding(False) `)中讀取引數到\\ :" +"term:`檔案系統編碼和錯誤處理程式 `。" +"在 Windows 上,引數檔案應使用 UTF-8 編碼,而不是 Windows 的 ANSI Codepage。" #: ../../whatsnew/3.12.rst:1829 msgid "" @@ -2879,6 +3609,8 @@ msgid "" "and 3.5.4. A recommended replacement is the :mod:`asyncio`-based :pypi:" "`aiosmtpd` PyPI module." msgstr "" +"刪除 Python 3.4.7 和 3.5.4 中已棄用的基於 ``asyncore`` 的 ``smtpd`` 模組。推" +"薦的替代品是基於 :mod:`asyncio` 的 :pypi:`aiosmtpd` PyPI 模組。" #: ../../whatsnew/3.12.rst:1833 msgid "" @@ -2886,6 +3618,9 @@ msgid "" "exception, rather than reading :data:`sys.stdin`. The feature was deprecated " "in Python 3.9. (Contributed by Victor Stinner in :gh:`94352`.)" msgstr "" +":func:`shlex.split`:以 ``None`` 做為 *s* 引數傳遞現在會引發例外,而不是讀" +"取 :data:`sys.stdin`。該功能在 Python 3.9 中已被棄用。(由 Victor Stinner " +"在 :gh:`94352` 中貢獻。)" #: ../../whatsnew/3.12.rst:1838 msgid "" @@ -2894,8 +3629,12 @@ msgid "" "type is accepted for bytes strings. (Contributed by Victor Stinner in :gh:" "`98393`.)" msgstr "" +":mod:`os` 模組不再接受類位元組的路徑,例如 :class:`bytearray` 和 :class:" +"`memoryview` 型別:對於位元組字串,僅接受確切的 :class:`bytes` 型別。(由 " +"Victor Stinner 在 :gh:`98393` 中貢獻。)" #: ../../whatsnew/3.12.rst:1843 +#, fuzzy msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -2906,8 +3645,14 @@ msgid "" "process-global resources, which are best managed from the main interpreter. " "(Contributed by Donghee Na in :gh:`99127`.)" msgstr "" +"如果在子直譯器中使用,:func:`syslog.openlog` 和 :func:`syslog.closelog` 現在" +"會失敗。:func:`syslog.syslog` 仍可在子直譯器中使用,但現在僅當 :func:`syslog." +"openlog` 已在主直譯器中呼叫。這些新限制不適用於主直譯器,因此只有極少數使用者" +"可能會受到影響。此更改有助於口譯員隔離。此外,:mod:`syslog` 是行程全域資源的" +"包裝器,最好透過主直譯器進行管理。 (由 Donghee Na 在 :gh:`99127` 中貢獻。)" #: ../../whatsnew/3.12.rst:1852 +#, fuzzy msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -2918,6 +3663,12 @@ 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` 鎖定行為已被刪除,因為它鎖" +"定了類別的所有實例,從而導致高鎖定爭用 (high lock contention)。這意味著,如果" +"兩個執行緒競爭,快取的屬性 getter 函式現在可以為單個實例運行多次。對於大多數" +"簡單的快取屬性(例如,那些冪等屬性並且簡單地根據實例的其他屬性計算值),這將" +"沒問題。如果需要同步,請在快取的屬性 getter 函式內或多執行緒存取點周圍實作鎖" +"定。" #: ../../whatsnew/3.12.rst:1865 msgid "" @@ -2925,8 +3676,12 @@ msgid "" "unpack_archive`, pass the *filter* argument to limit features that may be " "surprising or dangerous. See :ref:`tarfile-extraction-filter` for details." msgstr "" +"使用 :mod:`tarfile` 或 :func:`shutil.unpack_archive` 提取 tar 檔案時,請傳遞 " +"*filter* 引數以限制可能不預期或甚至危險的功能。詳細資訊請參閱 :ref:`tarfile-" +"extraction-filter`。" #: ../../whatsnew/3.12.rst:1870 +#, fuzzy msgid "" "The output of the :func:`tokenize.tokenize` and :func:`tokenize." "generate_tokens` functions is now changed due to the changes introduced in :" @@ -2937,40 +3692,57 @@ 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 "" +"由於 :pep:`701` 中引入的更改,:func:`tokenize.tokenize` 和 :func:`tokenize." +"generate_tokens` 函式的輸出現已更改。這意味著不再為 f 字串發出 ``STRING`` 標" +"記,並且現在產生 :pep:`701` 中描述的標記:``FSTRING_START``、" +"``FSTRING_MIDDLE`` 和 ``FSTRING_END`` 除了運算式元件中用於標記化的適當標記之" +"外,現在還會針對 f 字串 \"string\" 部分發出。例如,對於 f 字串 ``f\"start " +"{1+1} end\"`` 舊版的標記產生器發出: ::" #: ../../whatsnew/3.12.rst:1881 msgid "while the new version emits::" -msgstr "" +msgstr "而新版本會發出: ::" #: ../../whatsnew/3.12.rst:1893 msgid "" "Additionally, there may be some minor behavioral changes as a consequence of " "the changes required to support :pep:`701`. Some of these changes include:" msgstr "" +"此外,由於支援 :pep:`701` 所做的更改,可能會出現一些細微的行為變化。其中的變" +"化包括:" #: ../../whatsnew/3.12.rst:1896 +#, 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:1899 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" +"不完整的單列字串現在也會像不完整的多列字串一樣引發 :exc:`tokenize." +"TokenError`。" #: ../../whatsnew/3.12.rst:1902 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:1905 +#, fuzzy msgid "" "Mixing tabs and spaces as indentation in the same file is not supported " "anymore and will raise a :exc:`TabError`." msgstr "" +"不再支援在同一文件中混合製表符和空格作為縮進,並且會引發 :exc:`TabError`。" #: ../../whatsnew/3.12.rst:1908 msgid "" @@ -2978,18 +3750,24 @@ msgid "" "an ``_is_main_interpreter`` attribute. It is a function with no arguments " "that returns ``True`` if the current interpreter is the main interpreter." msgstr "" +":mod:`threading` 模組現在期望 :mod:`!_thread` 模組具有 " +"``_is_main_interpreter`` 屬性。它是一個沒有引數的函式,如果目前直譯器是主直譯" +"器,則回傳 ``True``。" #: ../../whatsnew/3.12.rst:1913 msgid "" "Any library or application that provides a custom ``_thread`` module should " "provide ``_is_main_interpreter()``. (See :gh:`112826`.)" msgstr "" +"任何提供自訂 ``_thread`` 模組的函式庫或應用程式都應該提供 " +"``_is_main_interpreter()``。(參閱 :gh:`112826`。)" #: ../../whatsnew/3.12.rst:1918 msgid "Build Changes" -msgstr "" +msgstr "建置變更" #: ../../whatsnew/3.12.rst:1920 +#, fuzzy msgid "" "Python no longer uses :file:`setup.py` to build shared C extension modules. " "Build parameters like headers and libraries are detected in ``configure`` " @@ -2997,6 +3775,10 @@ msgid "" "config`` and fall back to manual detection. (Contributed by Christian Heimes " "in :gh:`93939`.)" msgstr "" +"Python 不再使用 :file:`setup.py` 來建立共享 C 擴充模組。在 ``configure`` 腳本" +"中偵測到頭檔和函式庫等建置參數。擴充功能由 :file:`Makefile` 建置。大多數擴充" +"功能使用 ``pkg-config`` 並回退到手動檢測。(由 Christian Heimes 在 :gh:" +"`93939` 中貢獻。)" #: ../../whatsnew/3.12.rst:1926 msgid "" @@ -3004,6 +3786,9 @@ msgid "" "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:1931 msgid "" @@ -3011,6 +3796,8 @@ msgid "" "policy if the Clang compiler accepts the flag. (Contributed by Donghee Na " "in :gh:`89536`.)" msgstr "" +"CPython 現在會使用 ThinLTO 選項作為預設連結時間最佳化策略(如果 Clang 編譯器" +"接受該旗標)。(由 Donghee Na 在 :gh:`89536` 中貢獻。)" #: ../../whatsnew/3.12.rst:1935 msgid "" @@ -3020,10 +3807,14 @@ msgid "" "optimization levels (0, 1, 2) at once. (Contributed by Victor Stinner in :gh:" "`99289`.)" msgstr "" +"在 :file:`Makefile` 中新增 ``COMPILEALL_OPTS`` 變數以覆蓋 ``make install`` 中" +"的 :mod:`compileall` 選項(預設值:``-j0``)。也將 3 個 ``compileall`` 指令合" +"併為一個指令,來一次性為所有最佳化等級(0、1、2)建置 .pyc 檔案。(由 Victor " +"Stinner 在 :gh:`99289` 中貢獻。)" #: ../../whatsnew/3.12.rst:1941 msgid "Add platform triplets for 64-bit LoongArch:" -msgstr "" +msgstr "為 64 位元 LoongArch 新增平台三元組:" #: ../../whatsnew/3.12.rst:1943 msgid "loongarch64-linux-gnusf" @@ -3043,90 +3834,105 @@ msgstr "(由 Zhang Na 於 :gh:`90656` 中貢獻。)" #: ../../whatsnew/3.12.rst:1949 msgid "``PYTHON_FOR_REGEN`` now require Python 3.10 or newer." -msgstr "" +msgstr "``PYTHON_FOR_REGEN`` 現在需要 Python 3.10 或更高版本。" #: ../../whatsnew/3.12.rst:1951 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:1955 msgid "" "Windows builds and macOS installers from python.org now use OpenSSL 3.0." -msgstr "" +msgstr "來自 python.org 的 Windows 建置和 macOS 安裝程式現在使用 OpenSSL 3.0。" #: ../../whatsnew/3.12.rst:1959 msgid "C API Changes" msgstr "C API 變更" #: ../../whatsnew/3.12.rst:1966 +#, fuzzy msgid "" ":pep:`697`: Introduce 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:1972 msgid "Code object constructors:" -msgstr "" +msgstr "程式碼物件建構函式:" #: ../../whatsnew/3.12.rst:1974 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" -msgstr "" +msgstr "``PyUnstable_Code_New()``\\ (自 ``PyCode_New`` 改名)" #: ../../whatsnew/3.12.rst:1975 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" +"``PyUnstable_Code_NewWithPosOnlyArgs()``\\ (自 " +"``PyCode_NewWithPosOnlyArgs`` 改名)" #: ../../whatsnew/3.12.rst:1977 msgid "Extra storage for code objects (:pep:`523`):" -msgstr "" +msgstr "程式碼物件的額外儲存空間 (:pep:`523`):" #: ../../whatsnew/3.12.rst:1979 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" +"``PyUnstable_Eval_RequestCodeExtraIndex()``\\ (自 " +"``_PyEval_RequestCodeExtraIndex`` 改名)" #: ../../whatsnew/3.12.rst:1980 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" -msgstr "" +msgstr "``PyUnstable_Code_GetExtra()``\\ (自 ``_PyCode_GetExtra`` 改名)" #: ../../whatsnew/3.12.rst:1981 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" -msgstr "" +msgstr "``PyUnstable_Code_SetExtra()``\\ (自 ``_PyCode_SetExtra`` 改名)" #: ../../whatsnew/3.12.rst:1983 msgid "" "The original names will continue to be available until the respective API " "changes." -msgstr "" +msgstr "原始名稱將繼續可用,直到相應的 API 發生更改。" #: ../../whatsnew/3.12.rst:1986 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" #: ../../whatsnew/3.12.rst:1988 +#, fuzzy msgid "" ":pep:`697`: Add an API for extending types whose instance memory layout is " "opaque:" -msgstr "" +msgstr ":pep:`697`:新增一個 API 用來擴充實例記憶體佈局不透明的型別:" #: ../../whatsnew/3.12.rst:1991 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:1993 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" +"新增了 :c:func:`PyObject_GetTypeData` 和 :c:func:`PyType_GetTypeDataSize` 以" +"允許存取特定於子類別的實例資料。" #: ../../whatsnew/3.12.rst:1995 msgid "" @@ -3134,30 +3940,42 @@ msgid "" "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:1998 +#, fuzzy msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" +"新增了 :c:macro:`Py_RELATIVE_OFFSET` 以允許根據子類別特定的結構定義\\ :c:" +"type:`成員 。" #: ../../whatsnew/3.12.rst:2001 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" #: ../../whatsnew/3.12.rst:2003 +#, fuzzy msgid "" "Add the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" "`PyType_FromModuleAndSpec` using an additional metaclass argument. " "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" +"新增新的\\ :ref:`受限 C API ` 函式 :c:func:" +"`PyType_FromMetaclass`,它使用附加元類別參數來概括現有的 :c:func:" +"`PyType_FromModuleAndSpec`。(由 Wenzel Jakob 在 :gh:`93012` 中貢獻。)" #: ../../whatsnew/3.12.rst:2008 +#, fuzzy msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" +"用於建立可使用\\ :ref:`向量呼叫協定 `\\ 進行呼叫的物件的 API 已新" +"增到 :ref:`有限 API ` 中:" #: ../../whatsnew/3.12.rst:2012 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" @@ -3176,6 +3994,7 @@ msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" #: ../../whatsnew/3.12.rst:2017 +#, 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 " @@ -3185,20 +4004,33 @@ msgid "" "``Py_TPFLAGS_HAVE_VECTORCALL`` flag. (Contributed by Petr Viktorin in :gh:" "`93274`.)" msgstr "" +"現在,當重新分配類的 :py:meth:`~object.__call__` 方法時,:c:macro:" +"`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:2025 +#, 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 "" +"新增了 :c:macro:`Py_TPFLAGS_MANAGED_DICT` 和 :c:macro:" +"`Py_TPFLAGS_MANAGED_WEAKREF` 旗標。這允許擴充類別以更少的簿記 (bookkeeping)、" +"使用更少的記憶體和更快的存取來支援物件 ``__dict__`` 和 weakrefs。" #: ../../whatsnew/3.12.rst:2030 +#, fuzzy msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" +"使用\\ :ref:`向量呼叫協定 `\\ 執行呼叫的 API 已新增到、、 :ref:`" +"有限 API ` 中:" #: ../../whatsnew/3.12.rst:2034 msgid ":c:func:`PyObject_Vectorcall`" @@ -3213,28 +4045,40 @@ msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" #: ../../whatsnew/3.12.rst:2038 +#, 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:`受限 API ` 中" +"使用。(由 Wenzel Jakob 在 :gh:`98586` 中貢獻。)" #: ../../whatsnew/3.12.rst:2042 +#, fuzzy msgid "" "Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " "functions in all running threads in addition to the calling one. " "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" +"新增兩個公開函式 :c:func:`PyEval_SetProfileAllThreads` 和 :c:func:" +"`PyEval_SetTraceAllThreads`,它們允許在除呼叫執行緒之外的所有正在執行的執行緒" +"中設定追蹤和分析函式。(由 Pablo Galindo 在 :gh:`93503` 中貢獻。)" #: ../../whatsnew/3.12.rst:2048 +#, fuzzy msgid "" "Add new function :c:func:`PyFunction_SetVectorcall` to the C API which sets " "the vectorcall field of a given :c:type:`PyFunctionObject`. (Contributed by " "Andrew Frost in :gh:`92257`.)" msgstr "" +"將新函式 :c:func:`PyFunction_SetVectorcall` 新增至 C API,用於設定給定 :c:" +"type:`PyFunctionObject` 的向量呼叫欄位。(由 Andrew Frost 在 :gh:`92257` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:2052 +#, fuzzy msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -3242,6 +4086,9 @@ 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:2058 msgid "" @@ -3249,6 +4096,8 @@ msgid "" "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" +"新增 :c:func:`PyType_AddWatcher` 和 :c:func:`PyType_Watch` API 來註冊回呼以接" +"收有關型別變更的通知。(由 Carl Meyer 在 :gh:`91051` 貢獻。)" #: ../../whatsnew/3.12.rst:2062 msgid "" @@ -3256,15 +4105,22 @@ msgid "" "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Oren in :gh:`91054`.)" msgstr "" +"新增 :c:func:`PyCode_AddWatcher` 和 :c:func:`PyCode_ClearWatcher` API 來註冊" +"回呼以接收有關建立和銷毀程式碼物件的通知。(由 Itamar Oren 在 :gh:`91054` 中" +"貢獻。)" #: ../../whatsnew/3.12.rst:2067 +#, 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` 函式以透過名" +"稱獲取 frame 變數。(由 Victor Stinner 在 :gh:`91248` 中貢獻。)" #: ../../whatsnew/3.12.rst:2071 +#, fuzzy msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -3273,81 +4129,111 @@ msgid "" "`PyErr_Restore`. This is less error prone and a bit more efficient. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" +"新增 :c:func:`PyErr_GetRaisedException` 和 :c:func:" +"`PyErr_SetRaisedException` 用於保存和恢復當前例外。這些函式回傳並接受單個例外" +"物件,而不是現已棄用的 :c:func:`PyErr_Fetch` 和 :c:func:`PyErr_Restore` 的三" +"重參數。這不容易出錯並且效率更高一些。(由 Mark Shannon 在 :gh:`101578` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:2079 +#, 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:2083 +#, 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:2088 +#, 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:2094 +#, fuzzy msgid "" ":pep:`683`: Introduce *Immortal Objects*, which allows objects to bypass " "reference counts, and related changes to the C-API:" msgstr "" +":pep:`683`:引入*不朽物件*,它允許物件繞過引用計數,以及對 C-API 的相關變更:" #: ../../whatsnew/3.12.rst:2097 +#, fuzzy msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" -msgstr "" +msgstr "``_Py_IMMORTAL_REFCNT``:參照計數,定義物件" #: ../../whatsnew/3.12.rst:2098 +#, fuzzy msgid "as immortal." -msgstr "" +msgstr "為不朽的。" #: ../../whatsnew/3.12.rst:2099 +#, fuzzy msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." -msgstr "" +msgstr "``_Py_IsImmortal`` 檢查物件是否具有不朽引用計數。" #: ../../whatsnew/3.12.rst:2100 +#, fuzzy msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" -msgstr "" +msgstr "``PyObject_HEAD_INIT`` 這現在將初始化引用計數" #: ../../whatsnew/3.12.rst:2101 +#, fuzzy msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." -msgstr "" +msgstr "與 ``Py_BUILD_CORE``一起使用時 ``_Py_IMMORTAL_REFCNT``。" #: ../../whatsnew/3.12.rst:2102 +#, fuzzy msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" -msgstr "" +msgstr "``SSTATE_INTERNED_IMMORTAL`` 內部 unicode 物件的標識符" #: ../../whatsnew/3.12.rst:2103 +#, fuzzy msgid "that are immortal." -msgstr "" +msgstr "那是不朽的。" #: ../../whatsnew/3.12.rst:2104 +#, fuzzy msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" -msgstr "" +msgstr "``SSSTATE_INTERNED_IMMORTAL_STATIC`` 內部 unicode 的識別器" #: ../../whatsnew/3.12.rst:2105 +#, fuzzy msgid "objects that are immortal and static" -msgstr "" +msgstr "不朽且靜態的物體" -#: ../../whatsnew/3.12.rst:2106 +#: ../../whatsnew/3.12.rst:2108 ../../whatsnew/3.12.rst:2106 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" -msgstr "" +msgstr "``sys.getunicodeinternedsize`` 這會回傳 unicode 的總數" #: ../../whatsnew/3.12.rst:2107 +#, fuzzy msgid "" "objects that have been interned. This is now needed for :file:`refleak.py` " "to correctly track reference counts and allocated blocks" msgstr "" +"已被拘留的物件。現在 :file:`refleak.py` 需要這個來正確追蹤引用計數和分配的區" +"塊" #: ../../whatsnew/3.12.rst:2110 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" @@ -3360,28 +4246,44 @@ msgid "" "with their own GILs. (See :ref:`whatsnew312-pep684` for more info.) " "(Contributed by Eric Snow in :gh:`104110`.)" msgstr "" +":pep:`684`:新增新的 :c:func:`Py_NewInterpreterFromConfig` 函式和 :c:type:" +"`PyInterpreterConfig`,它們可用於建立具有自己的 GIL 的子直譯器。(有關更多資" +"訊,請參閱 :ref:`whatsnew312-pep684`。)(由 Eric Snow 在 :gh:`104110` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:2118 +#, 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:2126 +#, 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:2129 +#, 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:2133 +#, 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 " @@ -3389,22 +4291,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:2140 +#, 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:2145 +#, 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:2149 +#, 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 " @@ -3412,8 +4326,12 @@ 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:2155 +#, fuzzy msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -3421,14 +4339,22 @@ msgid "" "the result string, and any extra arguments discarded. (Contributed by Serhiy " "Storchaka in :gh:`95781`.)" msgstr "" +":c:func:`PyUnicode_FromFormat` 和 :c:func:`PyUnicode_FromFormatV` 中無法識別" +"的格式字元現在會設定 :exc:`SystemError`。在以前的版本中,它導致格式字串的所有" +"其餘部分按原樣複製到結果字串,並丟棄任何額外的參數。(由 Serhiy Storchaka " +"在 :gh:`95781` 中貢獻。)" #: ../../whatsnew/3.12.rst:2161 +#, fuzzy msgid "" "Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" +"修正 :c:func:`PyUnicode_FromFormat` 和 :c:func:`PyUnicode_FromFormatV` 中錯誤" +"的符號位置。(由 Philip Georgi 在 :gh:`95504` 中貢獻。)" #: ../../whatsnew/3.12.rst:2165 +#, fuzzy msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -3441,44 +4367,69 @@ msgid "" "traverse and clear their instance's dictionaries. To clear weakrefs, call :c:" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" +"想要新增 ``__dict__`` 或弱參照槽的擴充類應該分別使用 :c:macro:" +"`Py_TPFLAGS_MANAGED_DICT` 和 :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` 而不是 " +"``tp_dictoffset`` 和 ``tp_weaklistoffset``。仍然支援使用 ``tp_dictoffset`` " +"和 ``tp_weaklistoffset``,但不完全支援多重繼承 (:gh:`95589`),並且性能可能會" +"更差。宣告 :c:macro:`Py_TPFLAGS_MANAGED_DICT` 的類別應呼叫 :c:func:`!" +"_PyObject_VisitManagedDict` 和 :c:func:`!_PyObject_ClearManagedDict` 來遍歷並" +"清除其實例的字典。要清除弱引用,請像以前一樣呼叫 :c:func:" +"`PyObject_ClearWeakRefs`。" #: ../../whatsnew/3.12.rst:2177 +#, 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 "" +":c:func:`PyUnicode_FSDecoder` 函式不再接受類似位元組的路徑,例如 :class:" +"`bytearray` 和 :class:`memoryview` 型別:對於位元組字串,僅接受確切的 :class:" +"`bytes` 型別。(由 Victor Stinner 在 :gh:`98393` 中貢獻。)" #: ../../whatsnew/3.12.rst:2182 +#, 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 "" +":c:macro:`Py_CLEAR`、:c:macro:`Py_SETREF` 和 :c:macro:`Py_XSETREF` 巨集現在僅" +"計算其引數一次。如果引數有副作用,這些副作用將不再重複。(由 Victor Stinner " +"在 :gh:`98724` 中貢獻。)" #: ../../whatsnew/3.12.rst:2187 +#, 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 "" +"直譯器的錯誤指示器現在總是標準化的。這意味著 :c:func:`PyErr_SetObject`、:c:" +"func:`PyErr_SetString` 和其他設定錯誤指示器的函式現在會在儲存例外之前對其進行" +"規範化。(由 Mark Shannon 在 :gh:`101578` 中貢獻。)" #: ../../whatsnew/3.12.rst:2192 +#, 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:2197 +#, fuzzy msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" -msgstr "" +msgstr "現在,以下函式為新建立的型別選擇適當的元類別:" #: ../../whatsnew/3.12.rst:2200 msgid ":c:func:`PyType_FromSpec`" @@ -3493,12 +4444,16 @@ msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" #: ../../whatsnew/3.12.rst:2204 +#, 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:2209 msgid "" @@ -3506,6 +4461,9 @@ msgid "" "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:2213 msgid "" @@ -3515,16 +4473,21 @@ 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:2220 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" -msgstr "" +msgstr "如果你控制元類別,請避免在其中使用 ``tp_new``:" #: ../../whatsnew/3.12.rst:2222 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:2224 msgid "" @@ -3533,6 +4496,9 @@ msgid "" "`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag. This makes it acceptable for " "``PyType_From*`` functions." msgstr "" +"如果元類別不需要從 Python 實例化,請使用 :c:macro:" +"`Py_TPFLAGS_DISALLOW_INSTANTIATION` 旗標將其 ``tp_new`` 設定為 ``NULL``。這使" +"得 ``PyType_From*`` 函式能夠接受。" #: ../../whatsnew/3.12.rst:2229 msgid "" @@ -3540,12 +4506,16 @@ msgid "" "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" +"避免使用 ``PyType_From*`` 函式:如果你不需要特定於 C 的功能(插槽 (slot) 或設" +"定實例大小),請透過\\ :ref:`呼叫 `\\ 元類別來建立型別。" #: ../../whatsnew/3.12.rst:2233 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:2236 msgid "" @@ -3554,15 +4524,22 @@ msgid "" "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` 不再在\\ :" +"ref:`子直譯器 (subinterpreter) ` 中呼叫。這是因為客" +"戶端通常依賴於行程作用域的全域狀態(因為這些回呼無法恢復擴充模組狀態)。" #: ../../whatsnew/3.12.rst:2241 +#, 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:2245 +#, fuzzy msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3572,6 +4549,10 @@ msgid "" "efficient access to the value of :c:struct:`PyLongObject`\\s which fit into " "a single machine word:" msgstr "" +":c:struct:`PyLongObject` 已更改其內部結構以獲得更好的效能。儘管 :c:struct:" +"`PyLongObject` 的內部是私有的,但它們被一些擴充模組使用。不應再直接存取內部欄" +"位,而應使用以 ``PyLong_...`` 開頭的 API 函式。提供了兩個新的*不穩定* API 函" +"式,用於有效存取適合單一機器字的 :c:struct:`PyLongObject` 的值:" #: ../../whatsnew/3.12.rst:2253 msgid ":c:func:`PyUnstable_Long_IsCompact`" @@ -3582,6 +4563,7 @@ msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr ":c:func:`PyUnstable_Long_CompactValue`" #: ../../whatsnew/3.12.rst:2256 +#, fuzzy msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -3589,8 +4571,13 @@ msgid "" "allocator is not already thread-safe and you need guidance then please " "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" +"透過 :c:func:`PyMem_SetAllocator` 設定的自訂分配器現在要求是執行緒安全的,無" +"論記憶體域如何。沒有自己狀態的分配器(包括 \"hooks\")不受影響。如果你的自訂" +"分配器還不是執行緒安全的並且你需要指導,請建立一個新的 GitHub 問題並抄送 " +"``@ericsnowcurrently``。" #: ../../whatsnew/3.12.rst:2266 +#, fuzzy msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -3598,94 +4585,98 @@ 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` 中貢獻。PEP 為 Ken " +"JinPEP 所貢獻。)" #: ../../whatsnew/3.12.rst:2271 msgid "Deprecate global configuration variable:" -msgstr "" +msgstr "棄用全域配置變數:" #: ../../whatsnew/3.12.rst:2273 ../../whatsnew/3.12.rst:2358 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" -msgstr ":c:var:`Py_DebugFlag`: 請改用 :c:member:`PyConfig.parser_debug`" +msgstr ":c:var:`Py_DebugFlag`:請改用 :c:member:`PyConfig.parser_debug`" #: ../../whatsnew/3.12.rst:2274 ../../whatsnew/3.12.rst:2359 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" -msgstr ":c:var:`Py_VerboseFlag`: 請改用 :c:member:`PyConfig.verbose`" +msgstr ":c:var:`Py_VerboseFlag`:請改用 :c:member:`PyConfig.verbose`" #: ../../whatsnew/3.12.rst:2275 ../../whatsnew/3.12.rst:2360 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" -msgstr ":c:var:`Py_QuietFlag`: 請改用 :c:member:`PyConfig.quiet`" +msgstr ":c:var:`Py_QuietFlag`:請改用 :c:member:`PyConfig.quiet`" #: ../../whatsnew/3.12.rst:2276 ../../whatsnew/3.12.rst:2361 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" -msgstr ":c:var:`Py_InteractiveFlag`: 請改用 :c:member:`PyConfig.interactive`" +msgstr ":c:var:`Py_InteractiveFlag`:請改用 :c:member:`PyConfig.interactive`" #: ../../whatsnew/3.12.rst:2277 ../../whatsnew/3.12.rst:2362 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" -msgstr ":c:var:`Py_InspectFlag`: 請改用 :c:member:`PyConfig.inspect`" +msgstr ":c:var:`Py_InspectFlag`:請改用 :c:member:`PyConfig.inspect`" #: ../../whatsnew/3.12.rst:2278 ../../whatsnew/3.12.rst:2363 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" -":c:var:`Py_OptimizeFlag`: 請改用 :c:member:`PyConfig.optimization_level`" +":c:var:`Py_OptimizeFlag`:請改用 :c:member:`PyConfig.optimization_level`" #: ../../whatsnew/3.12.rst:2279 ../../whatsnew/3.12.rst:2364 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" -msgstr ":c:var:`Py_NoSiteFlag`: 請改用 :c:member:`PyConfig.site_import`" +msgstr ":c:var:`Py_NoSiteFlag`:請改用 :c:member:`PyConfig.site_import`" #: ../../whatsnew/3.12.rst:2280 ../../whatsnew/3.12.rst:2365 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" -":c:var:`Py_BytesWarningFlag`: 請改用 :c:member:`PyConfig.bytes_warning`" +":c:var:`Py_BytesWarningFlag`:請改用 :c:member:`PyConfig.bytes_warning`" #: ../../whatsnew/3.12.rst:2281 ../../whatsnew/3.12.rst:2366 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" -":c:var:`Py_FrozenFlag`: 請改用 :c:member:`PyConfig.pathconfig_warnings`" +":c:var:`Py_FrozenFlag`:請改用 :c:member:`PyConfig.pathconfig_warnings`" #: ../../whatsnew/3.12.rst:2282 ../../whatsnew/3.12.rst:2367 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -":c:var:`Py_IgnoreEnvironmentFlag`: 請改用 :c:member:`PyConfig." +":c:var:`Py_IgnoreEnvironmentFlag`:請改用 :c:member:`PyConfig." "use_environment`" #: ../../whatsnew/3.12.rst:2283 ../../whatsnew/3.12.rst:2368 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" -":c:var:`Py_DontWriteBytecodeFlag`: 請改用 :c:member:`PyConfig.write_bytecode`" +":c:var:`Py_DontWriteBytecodeFlag`:請改用 :c:member:`PyConfig.write_bytecode`" #: ../../whatsnew/3.12.rst:2284 ../../whatsnew/3.12.rst:2369 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -":c:var:`Py_NoUserSiteDirectory`: 請改用 :c:member:`PyConfig." +":c:var:`Py_NoUserSiteDirectory`:請改用 :c:member:`PyConfig." "user_site_directory`" #: ../../whatsnew/3.12.rst:2285 ../../whatsnew/3.12.rst:2370 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" -":c:var:`Py_UnbufferedStdioFlag`: 請改用 :c:member:`PyConfig.buffered_stdio`" +":c:var:`Py_UnbufferedStdioFlag`:請改用 :c:member:`PyConfig.buffered_stdio`" #: ../../whatsnew/3.12.rst:2286 ../../whatsnew/3.12.rst:2371 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:var:`Py_HashRandomizationFlag`:請改用 :c:member:`PyConfig.use_hash_seed` " "和 :c:member:`PyConfig.hash_seed`" #: ../../whatsnew/3.12.rst:2288 ../../whatsnew/3.12.rst:2373 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" -msgstr ":c:var:`Py_IsolatedFlag`: 請改用 :c:member:`PyConfig.isolated`" +msgstr ":c:var:`Py_IsolatedFlag`:請改用 :c:member:`PyConfig.isolated`" #: ../../whatsnew/3.12.rst:2289 ../../whatsnew/3.12.rst:2374 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" msgstr "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: 請改用 :c:member:`PyPreConfig." +":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改用 :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" #: ../../whatsnew/3.12.rst:2290 ../../whatsnew/3.12.rst:2375 @@ -3693,7 +4684,7 @@ msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" msgstr "" -":c:var:`Py_LegacyWindowsStdioFlag`: 請改用 :c:member:`PyConfig." +":c:var:`Py_LegacyWindowsStdioFlag`:請改用 :c:member:`PyConfig." "legacy_windows_stdio`" #: ../../whatsnew/3.12.rst:2291 ../../whatsnew/3.12.rst:2376 @@ -3701,7 +4692,7 @@ msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -":c:var:`!Py_FileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." +":c:var:`!Py_FileSystemDefaultEncoding`:使用 :c:member:`PyConfig." "filesystem_encoding`" #: ../../whatsnew/3.12.rst:2292 ../../whatsnew/3.12.rst:2377 @@ -3709,7 +4700,7 @@ msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" msgstr "" -":c:var:`!Py_HasFileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." +":c:var:`!Py_HasFileSystemDefaultEncoding`:請改用 :c:member:`PyConfig." "filesystem_encoding`" #: ../../whatsnew/3.12.rst:2293 ../../whatsnew/3.12.rst:2378 @@ -3717,7 +4708,7 @@ msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" msgstr "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: 請改用 :c:member:`PyConfig." +":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改用 :c:member:`PyConfig." "filesystem_errors`" #: ../../whatsnew/3.12.rst:2294 ../../whatsnew/3.12.rst:2379 @@ -3725,7 +4716,7 @@ 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:" +":c:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參見 :c:" "func:`Py_PreInitialize`)" #: ../../whatsnew/3.12.rst:2296 @@ -3737,10 +4728,13 @@ msgstr "" "(由 Victor Stinner 於 :gh:`77782` 中貢獻。)" #: ../../whatsnew/3.12.rst:2300 +#, fuzzy msgid "" "Creating :c:data:`immutable types ` with mutable " "bases is deprecated and will be disabled in Python 3.14. (:gh:`95388`)" msgstr "" +"建立具有可變基數的\\ :c:data:`不可變型別 `\\ 已被棄" +"用,並將在 Python 3.14 中停用。(:gh:`95388`)" #: ../../whatsnew/3.12.rst:2303 msgid "" @@ -3753,6 +4747,7 @@ msgid "" "Its contents are now available just by including :file:`Python.h`, with a " "``Py`` prefix added if it was missing:" msgstr "" +"現在只需包含 :file:`Python.h` 即可使用其內容,如果缺少,則新增 ``Py`` 前綴:" #: ../../whatsnew/3.12.rst:2309 msgid "" @@ -3767,6 +4762,8 @@ 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:2313 msgid "" @@ -3805,6 +4802,8 @@ msgid "" "In some configurations, ```` is not included from :file:`Python." "h`. It should be included manually when using ``offsetof()``." msgstr "" +"在某些配置中,:file:`Python.h` 中不包含 ````。使用 ``offsetof()`` " +"時應手動包含它。" #: ../../whatsnew/3.12.rst:2326 msgid "" @@ -3812,12 +4811,16 @@ msgid "" "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" +"已棄用的標頭繼續以原始名稱提供其原始內容。你的舊程式碼可以保持不變,除非額外" +"的包含巨集和非命名空間巨集對你造成很大困擾。" #: ../../whatsnew/3.12.rst:2331 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:2334 msgid "" @@ -3825,6 +4828,9 @@ msgid "" "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` 已棄用。請改用 :c:func:" +"`PyErr_GetRaisedException` 和 :c:func:`PyErr_SetRaisedException`。(由 Mark " +"Shannon 在 :gh:`101578` 中貢獻。)" #: ../../whatsnew/3.12.rst:2339 msgid "" @@ -3848,16 +4854,21 @@ msgid "" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" +"不建議使用 :c:func:`PyType_FromSpec`、:c:func:`PyType_FromSpecWithBases` 或 :" +"c:func:`PyType_FromModuleAndSpec` 來建立其元類別覆蓋 :c:member:" +"`~PyTypeObject.tp_new` 之類別的方式已被棄用。請改為呼叫元類別。" #: ../../whatsnew/3.12.rst:2353 msgid "" "The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " "(:pep:`699`; :gh:`101193`)." msgstr "" +"擴充模組的 :c:type:`PyDictObject` 中的 ``ma_version_tag`` 欄位 (:pep:`699`; :" +"gh:`101193`)。" #: ../../whatsnew/3.12.rst:2356 msgid "Global configuration variables:" -msgstr "" +msgstr "全域設定變數:" #: ../../whatsnew/3.12.rst:2381 msgid "" @@ -3871,6 +4882,8 @@ msgid "" "Creating :c:data:`immutable types ` with mutable " "bases (:gh:`95388`)." msgstr "" +"建立具有可變基底的\\ :c:data:`不可變型別 ` (:gh:" +"`95388`)。" #: ../../whatsnew/3.12.rst:2390 msgid "" @@ -3949,7 +4962,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:2414 msgid ":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException`" -msgstr ":c:func:`PyErr_Restore`:請改用 :c:func:`PyErr_SetRaisedException`" +msgstr ":c:func:`PyErr_Restore`:請改用 :c:func:`PyErr_SetRaishedException`" #: ../../whatsnew/3.12.rst:2415 msgid "" @@ -4002,7 +5015,7 @@ msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead" msgstr "" -":c:member:`!PyBytesObject.ob_shash` 成員:請改用 :c:func:`PyObject_Hash`" +":c:member:`!PyBytesObject.ob_shash` 成員:請改為呼叫 :c:func:`PyObject_Hash`" #: ../../whatsnew/3.12.rst:2427 msgid ":c:member:`!PyDictObject.ma_version_tag` member" @@ -4010,7 +5023,7 @@ msgstr ":c:member:`!PyDictObject.ma_version_tag` 成員" #: ../../whatsnew/3.12.rst:2428 msgid "Thread Local Storage (TLS) API:" -msgstr "" +msgstr "執行緒區域儲存 (TLS) API:" #: ../../whatsnew/3.12.rst:2430 msgid ":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc`" @@ -4043,10 +5056,12 @@ msgid "" "C API. The :file:`token.h` header file was only designed to be used by " "Python internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" +"刪除 :file:`token.h` 標頭檔。從來沒有任何公開的分詞器 C API。:file:`token.h` " +"標頭檔僅供 Python 內部使用。(由 Victor Stinner 在 :gh:`92651` 中貢獻。)" #: ../../whatsnew/3.12.rst:2445 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." -msgstr "" +msgstr "舊版 Unicode API 已被刪除。有關詳細資訊,請參閱 :pep:`623`。" #: ../../whatsnew/3.12.rst:2447 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" @@ -4094,14 +5109,16 @@ msgstr "" #: ../../whatsnew/3.12.rst:2461 msgid "Notable changes in 3.12.4" -msgstr "" +msgstr "3.12.4 中的顯著變化" #: ../../whatsnew/3.12.rst:2464 msgid "ipaddress" -msgstr "" +msgstr "ipaddress" #: ../../whatsnew/3.12.rst:2466 msgid "" "Fixed ``is_global`` and ``is_private`` behavior in ``IPv4Address``, " "``IPv6Address``, ``IPv4Network`` and ``IPv6Network``." msgstr "" +"修正了 ``IPv4Address``、``IPv6Address``、``IPv4Network`` 和 ``IPv6Network`` " +"中的 ``is_global`` 和 ``is_private`` 行為。"