From a4bf458b606ea105fb54b3b4cc6b864a73719051 Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Sun, 11 May 2025 23:19:42 +0800 Subject: [PATCH] wip --- whatsnew/3.12.po | 952 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 890 insertions(+), 62 deletions(-) diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index b03e6092a8..0f245475c9 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.13\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-04-30 00:15+0000\n" +"POT-Creation-Date: 2025-05-11 22:48+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -132,6 +132,8 @@ 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:" @@ -142,6 +144,8 @@ 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:" @@ -167,6 +171,8 @@ 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 "" @@ -186,6 +192,8 @@ 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:" @@ -198,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:" @@ -209,7 +220,7 @@ msgstr ":ref:`PEP 697 `,不穩定 C API 層" #: ../../whatsnew/3.12.rst:137 msgid ":ref:`PEP 683 `, immortal objects" -msgstr "" +msgstr ":ref:`PEP 683 `,不滅的物體" #: ../../whatsnew/3.12.rst:139 msgid "CPython implementation improvements:" @@ -218,14 +229,15 @@ 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:" @@ -252,6 +264,8 @@ 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 "" @@ -261,6 +275,11 @@ msgid "" "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 "" @@ -270,6 +289,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 "" @@ -295,6 +318,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 "" @@ -302,6 +327,8 @@ msgid "" "create :ref:`generic classes ` and :ref:`functions `::" msgstr "" +":pep:`695` 引入了一種新的、更簡潔和顯式的方法來建立\\ :ref:`泛型類別 " +"`\\ 和\\ :ref:`函式 `: ::" #: ../../whatsnew/3.12.rst:190 msgid "" @@ -331,6 +358,9 @@ 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:204 msgid "type Point = tuple[float, float]" @@ -350,6 +380,9 @@ msgid "" "and :class:`~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:214 msgid "" @@ -359,6 +392,10 @@ msgid "" "type IntOrStrSequence[T: (int, str)] = Sequence[T] # TypeVar with " "constraints" msgstr "" +"type IntFunc[**P] = Callable[P, int] # ParamSpec\n" +"type LabeledTuple[*Ts] = tuple[str, *Ts] # TypeVarTuple\n" +"type HashableSequence[T: Hashable] = Sequence[T] # 帶有邊界的 TypeVar\n" +"type IntOrStrSequence[T: (int, str)] = Sequence[T] # 帶有限制的 TypeVar" #: ../../whatsnew/3.12.rst:219 msgid "" @@ -367,8 +404,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 " @@ -377,6 +418,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 "" @@ -386,6 +431,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." @@ -396,12 +445,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 " @@ -409,30 +461,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 " @@ -440,8 +508,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 " @@ -450,18 +522,26 @@ msgid "" "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:310 msgid "" @@ -478,12 +558,16 @@ msgstr "" "SyntaxError: f-string: invalid syntax. Perhaps you forgot a comma?" #: ../../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:322 msgid "" @@ -500,11 +584,15 @@ msgstr "" "SyntaxError: invalid syntax. Perhaps you forgot a comma?" #: ../../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 msgid "PEP 684: A Per-Interpreter GIL" @@ -524,10 +612,12 @@ msgstr "" "中釋出 <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:348 msgid "" @@ -565,9 +655,10 @@ msgstr "(由 Eric Snow 於 :gh:`104210` 等貢獻。)" #: ../../whatsnew/3.12.rst:369 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 " @@ -576,6 +667,10 @@ 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 msgid "(Contributed by Mark Shannon in :gh:`103082`.)" @@ -583,16 +678,20 @@ 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 " @@ -600,47 +699,66 @@ msgid "" "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 " @@ -649,6 +767,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`.)" @@ -656,16 +779,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 " @@ -673,6 +800,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 "" @@ -680,6 +810,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 "" @@ -688,6 +820,9 @@ msgid "" "based on the available names in ````. (Contributed by Pablo Galindo " "in :gh:`91058`.)" msgstr "" +"由失敗的 ``from import `` 陳述式引發的 :exc:`ImportError` 例外" +"現在包含基於 ```` 中可用名稱的 ```` 值的建議。(由 Pablo " +"Galindo 在 :gh:`91058` 中貢獻。)" #: ../../whatsnew/3.12.rst:480 msgid "New Features Related to Type Hints" @@ -702,20 +837,25 @@ msgstr "" #: ../../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:497 msgid "" @@ -745,9 +885,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 " @@ -755,6 +896,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::" @@ -792,12 +936,16 @@ 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, " @@ -807,8 +955,15 @@ msgid "" "version, :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 " @@ -816,8 +971,13 @@ msgid "" "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 := " @@ -826,23 +986,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 " @@ -851,6 +1023,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 "" @@ -858,12 +1034,17 @@ 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 "" @@ -871,22 +1052,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 " @@ -895,12 +1085,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 "" @@ -913,6 +1109,13 @@ msgid "" "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" @@ -920,7 +1123,7 @@ msgstr "新增模組" #: ../../whatsnew/3.12.rst:630 msgid "None." -msgstr "" +msgstr "無。" #: ../../whatsnew/3.12.rst:634 msgid "Improved Modules" @@ -935,6 +1138,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" @@ -947,8 +1152,13 @@ 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 " @@ -956,6 +1166,10 @@ msgid "" "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 "" @@ -964,6 +1178,10 @@ msgid "" "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 "" @@ -973,18 +1191,26 @@ msgid "" "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 "" @@ -992,12 +1218,16 @@ msgid "" "as :mod:`asyncio` does not support legacy generator-based coroutines. " "(Contributed by Kumar Aditya in :gh:`102748`.)" msgstr "" +":func:`asyncio.iscoroutine` 現在為產生器回傳 ``False``,因為 :mod:`asyncio` " +"不支援傳統的基於產生器的協程。(由 Kumar Aditya 在 :gh:`102748` 中貢獻。)" #: ../../whatsnew/3.12.rst: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" @@ -1009,6 +1239,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" @@ -1026,6 +1258,7 @@ 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` " @@ -1033,12 +1266,19 @@ msgid "" "not useful for 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" @@ -1049,6 +1289,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" @@ -1134,6 +1376,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" @@ -1145,6 +1390,8 @@ msgid "" "with :func:`os.pidfd_open` in non-blocking mode. (Contributed by Kumar " "Aditya in :gh:`93312`.)" msgstr "" +"新增 :data:`os.PIDFD_NONBLOCK` 以便在非阻塞模式下使用 :func:`os.pidfd_open` " +"為行程打開檔案描述器。(由 Kumar Aditya 在 :gh:`93312` 中貢獻。)" #: ../../whatsnew/3.12.rst:763 msgid "" @@ -1152,6 +1399,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 "" @@ -1159,8 +1408,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 " @@ -1172,6 +1425,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" @@ -1198,19 +1457,26 @@ 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 "" @@ -1219,6 +1485,9 @@ 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 "" @@ -1226,6 +1495,8 @@ msgid "" "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 "" @@ -1234,6 +1505,9 @@ msgid "" "and :meth:`pathlib.PurePath.match` for matching the path's case sensitivity, " "allowing for more precise control over the matching process." msgstr "" +"為 :meth:`pathlib.Path.glob`、:meth:`pathlib.Path.rglob` " +"和 :meth:`pathlib.PurePath.match` 新增可選參數 *case_sensitive*,以匹配路徑的" +"大小區分程度,從而更精確控制匹配過程。" #: ../../whatsnew/3.12.rst:815 msgid "platform" @@ -1252,11 +1526,14 @@ msgid "pdb" msgstr "pdb" #: ../../whatsnew/3.12.rst:825 +#, 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:831 msgid "random" @@ -1289,6 +1566,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:848 msgid "" @@ -1297,6 +1577,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:853 msgid "" @@ -1304,6 +1587,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:858 msgid "" @@ -1312,13 +1598,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:863 +#, 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:869 ../../whatsnew/3.12.rst:1544 msgid "sqlite3" @@ -1340,6 +1633,11 @@ msgid "" "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:881 msgid "" @@ -1347,6 +1645,9 @@ msgid "" "to :meth:`sqlite3.Connection.load_extension`, for overriding the SQLite " "extension entry point. (Contributed by Erlend E. Aasland in :gh:`103015`.)" msgstr "" +"將僅關鍵字參數 *entrypoint* 新增" +"至 :meth:`sqlite3.Connection.load_extension`,以覆蓋 SQLite 擴充進入點。(由 " +"Erlend E. Aasland 在 :gh:`103015` 中貢獻。)" #: ../../whatsnew/3.12.rst:886 msgid "" @@ -1355,6 +1656,9 @@ msgid "" "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:892 msgid "statistics" @@ -1366,6 +1670,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:899 msgid "sys" @@ -1377,8 +1683,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:905 +#, fuzzy msgid "" "Add :func:`sys.activate_stack_trampoline` " "and :func:`sys.deactivate_stack_trampoline` for activating and deactivating " @@ -1387,6 +1696,11 @@ msgid "" "Galindo and 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:914 msgid "" @@ -1397,13 +1711,20 @@ msgid "" "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:920 ../../whatsnew/3.12.rst:1739 +#, 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:924 msgid "" @@ -1412,6 +1733,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:930 msgid "tempfile" @@ -1444,6 +1768,10 @@ msgid "" "profiling functions in all running threads in addition to the calling one. " "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" +"新增 :func:`threading.settrace_all_threads` " +"和 :func:`threading.setprofile_all_threads`,允許在除呼叫執行緒之外的所有正在" +"運行的執行緒中設定追蹤 (tracing) 和分析 (profiling) 函式。(由 Pablo Galindo " +"在 :gh:`93503` 中貢獻。)" #: ../../whatsnew/3.12.rst:946 msgid "tkinter" @@ -1458,6 +1786,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:957 msgid "tokenize" @@ -1470,6 +1803,9 @@ msgid "" "See :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:965 msgid "types" @@ -1481,12 +1817,16 @@ msgid "" "of :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:974 msgid "typing" msgstr "typing" #: ../../whatsnew/3.12.rst:976 +#, fuzzy msgid "" ":func:`isinstance` checks against :func:`runtime-checkable protocols " "` now use :func:`inspect.getattr_static` rather " @@ -1499,14 +1839,25 @@ msgid "" "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:987 +#, 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:992 msgid "" @@ -1549,9 +1900,10 @@ msgstr "" msgid "" "This change was made in order to speed up ``isinstance()`` checks against " "runtime-checkable protocols." -msgstr "" +msgstr "進行此更改是為了加快針對可 runtime 檢查協定的 ``isinstance()`` 檢查。" #: ../../whatsnew/3.12.rst:1012 +#, fuzzy msgid "" "The performance profile of :func:`isinstance` checks against :func:`runtime-" "checkable protocols ` has changed significantly. " @@ -1561,6 +1913,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:1020 msgid "" @@ -1568,6 +1926,9 @@ 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:1024 msgid "" @@ -1586,6 +1947,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:1034 ../../whatsnew/3.12.rst:1584 msgid "unittest" @@ -1652,6 +2015,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:1068 msgid "" @@ -1659,14 +2025,21 @@ 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:1072 +#, 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:1077 msgid "" @@ -1677,12 +2050,16 @@ msgstr "" "Itamar Oren 於 :gh:`103793` 中貢獻。)" #: ../../whatsnew/3.12.rst:1080 +#, 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:1085 msgid "" @@ -1690,6 +2067,8 @@ msgid "" "new :opcode:`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:1091 msgid "CPython bytecode changes" @@ -1811,7 +2190,7 @@ msgstr "" #: ../../whatsnew/3.12.rst:1137 msgid "Demos and Tools" -msgstr "" +msgstr "演示和工具" #: ../../whatsnew/3.12.rst:1139 msgid "" @@ -1819,6 +2198,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:1144 msgid "" @@ -1826,6 +2208,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:1151 ../../whatsnew/3.12.rst:2142 msgid "Deprecated" @@ -1899,6 +2284,10 @@ msgid "" "and :class:`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:1179 #: ../../deprecations/pending-removal-in-3.14.rst:30 @@ -1937,6 +2326,7 @@ msgstr "" "Roshan 於 :gh:`103636` 貢獻。)" #: ../../whatsnew/3.12.rst:1194 +#, fuzzy msgid "" ":mod:`collections.abc`: Deprecated :class:`collections.abc.ByteString`. " "Prefer :class:`Sequence` or :class:`collections.abc.Buffer`. For use in " @@ -1944,8 +2334,14 @@ msgid "" "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:1199 +#, fuzzy msgid "" ":mod:`datetime`: :class:`datetime.datetime`'s :meth:`~datetime.datetime.utcnow` " "and :meth:`~datetime.datetime.utcfromtimestamp` are deprecated and will be " @@ -1955,6 +2351,13 @@ msgid "" "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:1207 msgid "" @@ -2014,6 +2417,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:1230 msgid "" @@ -2027,6 +2433,14 @@ msgid "" "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:1240 msgid "" @@ -2046,6 +2460,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:1250 msgid ":mod:`os`:" @@ -2059,8 +2477,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:1258 +#, fuzzy msgid "" "On POSIX platforms, :func:`os.fork` can now raise " "a :exc:`DeprecationWarning` when it can detect being called from a " @@ -2073,14 +2496,24 @@ msgid "" "with-alive-threads/33555>`_ for *why* we're now surfacing this longstanding " "platform compatibility problem to developers." msgstr "" +"在 POSIX 平台上,當 os.fork 偵測到從多執行緒行程呼叫時,它現在可以引發 " +"DeprecationWarning。這樣做時始終存在與 POSIX 平台根本不相容的問題。即使這樣的" +"程式碼*看起來*可以工作。我們新增了警告,以提高人們的認識,因為執行此操作的程" +"式碼遇到的問題變得越來越頻繁。請參閱 os.fork 文件以獲取更多詳細資訊,以及“關" +"於 fork 與執行緒不相容的討論 ”_ 了解*為什" +"麼*我們現在向開發人員展示這個長期存在的平台相容性問題。" #: ../../whatsnew/3.12.rst:1268 +#, 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:1272 msgid "" @@ -2097,13 +2530,18 @@ msgid ":mod:`sqlite3`:" msgstr ":mod:`sqlite3`:" #: ../../whatsnew/3.12.rst:1277 +#, 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:1283 +#, fuzzy msgid "" "In :meth:`~sqlite3.Cursor.execute`, :exc:`DeprecationWarning` is now emitted " "when :ref:`named placeholders ` are used together with " @@ -2112,6 +2550,12 @@ 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:1290 msgid "" @@ -2125,11 +2569,15 @@ msgstr "" "(由 Irit Katriel 於 :gh:`102778` 中貢獻。)" #: ../../whatsnew/3.12.rst:1294 +#, 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:1298 #: ../../deprecations/pending-removal-in-3.15.rst:80 @@ -2142,6 +2590,9 @@ msgid "" "for :class:`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:1304 msgid "" @@ -2149,16 +2600,24 @@ msgid "" "a :exc:`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:1308 +#, 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:1314 +#, fuzzy msgid "" "The 3-arg signatures (type, value, traceback) of :meth:`coroutine throw() " "`, :meth:`generator throw() ` " @@ -2166,24 +2625,36 @@ msgid "" "removed in a future version of Python. Use the single-arg versions of these " "functions instead. (Contributed by Ofey Chan in :gh:`89874`.)" msgstr "" +":meth:`coroutine throw() `、:meth:`generator throw() " +"` 和 :meth:`async generator throw ` 的三引數簽" +"名 (type, value, traceback) 已棄用,並且可能會在 Python 的未來版本中刪除。請" +"改用這些函式的單引數版本。(由 Ofey Chan 在 :gh:`89874` 中貢獻。)" #: ../../whatsnew/3.12.rst:1320 +#, fuzzy msgid "" ":exc:`DeprecationWarning` is now raised when :attr:`~module.__package__` on " "a module differs from :attr:`__spec__.parent " "` (previously it " "was :exc:`ImportWarning`). (Contributed by Brett Cannon in :gh:`65961`.)" msgstr "" +"現在,當模組上的 ``__package__`` 與 ``__spec__.parent`` 不同時,會引" +"發 :exc:`DeprecationWarning`\\ (以前是 :exc:`ImportWarning`\\ )。(由 " +"Brett Cannon 在 :gh:`65961` 中貢獻。)" #: ../../whatsnew/3.12.rst:1326 +#, fuzzy msgid "" "Setting :attr:`~module.__package__` or :attr:`~module.__cached__` on a " "module is deprecated, and will cease to be set or taken into consideration " "by the import system in Python 3.14. (Contributed by Brett Cannon " "in :gh:`65961`.)" msgstr "" +"在模組上設定 ``__package__`` 或 ``__cached__`` 已被棄用,並且 Python 3.14 中" +"的引入系統將不再設定或考慮該設定。(由 Brett Cannon 在 :gh:`65961` 中貢獻。)" #: ../../whatsnew/3.12.rst:1330 +#, fuzzy msgid "" "The bitwise inversion operator (``~``) on bool is deprecated. It will throw " "an error in Python 3.16. Use ``not`` for logical negation of bools instead. " @@ -2191,8 +2662,13 @@ 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:1336 +#, fuzzy msgid "" "Accessing :attr:`~codeobject.co_lnotab` on code objects was deprecated in " "Python 3.10 via :pep:`626`, but it only got a " @@ -3228,6 +3704,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:1367 msgid "configparser" @@ -3276,6 +3754,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:1391 msgid "ensurepip" @@ -3286,16 +3768,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:1396 +#, 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:1402 +#, fuzzy msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -3304,6 +3793,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:1409 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" @@ -3338,6 +3831,7 @@ msgid "gzip" msgstr "gzip" #: ../../whatsnew/3.12.rst:1428 +#, 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 " @@ -3345,12 +3839,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:1435 msgid "hashlib" msgstr "hashlib" #: ../../whatsnew/3.12.rst:1437 +#, fuzzy msgid "" "Remove the pure Python implementation " "of :mod:`hashlib`'s :func:`hashlib.pbkdf2_hmac`, deprecated in Python 3.10. " @@ -3358,6 +3856,10 @@ msgid "" "version provides a C implementation 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:1444 ../../whatsnew/3.12.rst:1473 msgid "importlib" @@ -3383,18 +3885,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:1456 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:1459 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:1465 ../../whatsnew/3.12.rst:1473 msgid "imp" @@ -3561,10 +4070,13 @@ msgid "``imp.load_package()``" msgstr "``imp.load_package()``" #: ../../whatsnew/3.12.rst:1512 +#, 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:1514 msgid "" @@ -3588,6 +4100,10 @@ msgid "" "3.10, :func:`!_pyio.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:1528 msgid "locale" @@ -3599,6 +4115,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:1535 msgid "smtpd" @@ -3636,14 +4155,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:1555 +#, 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:1560 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" @@ -3659,6 +4186,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:1569 msgid "" @@ -3667,6 +4197,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:1575 msgid "" @@ -3678,6 +4211,11 @@ msgid "" "to :cwe:`295` (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:1586 msgid "Remove many long-deprecated :mod:`unittest` features:" @@ -3833,11 +4371,15 @@ msgstr "" "``assertDictContainsSubset``\\ (自 Python 3.2 起已棄用)。" #: ../../whatsnew/3.12.rst:1618 +#, fuzzy msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule " "` parameter *use_load_tests* " "(deprecated and ignored since Python 3.5)." msgstr "" +"未記錄的 TestLoader.loadTestsFromModule " +"` 參數 *use_load_tests* (自 Python " +"3.5 起已棄用並忽略)。" #: ../../whatsnew/3.12.rst:1622 msgid "" @@ -3861,6 +4403,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:1635 msgid "xml.etree.ElementTree" @@ -3874,6 +4419,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:1644 msgid "zipimport" @@ -3886,6 +4435,9 @@ msgid "" "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:1652 msgid "Others" @@ -3898,6 +4450,9 @@ msgid "" "github.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:1659 msgid "" @@ -3908,6 +4463,11 @@ msgid "" "*context* parameter (*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:1667 msgid "" @@ -3933,13 +4493,14 @@ msgstr "移植至 Python 3.12" msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." -msgstr "" +msgstr "本節列出了前面描述的變更以及可能需要你更改程式碼的其他錯誤修復。" #: ../../whatsnew/3.12.rst:1684 msgid "Changes in the Python API" msgstr "Python API 的變更" #: ../../whatsnew/3.12.rst:1686 +#, 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 " @@ -3947,6 +4508,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:1693 msgid "" @@ -3959,6 +4523,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:1701 msgid "" @@ -3969,6 +4540,12 @@ 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:1707 msgid "" @@ -3976,6 +4553,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:1711 msgid "" @@ -3983,6 +4562,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:1716 msgid "" @@ -3991,8 +4573,12 @@ msgid "" "exact :class:`bytes` 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:1721 +#, fuzzy msgid "" ":func:`syslog.openlog` and :func:`syslog.closelog` now fail if used in " "subinterpreters. :func:`syslog.syslog` may still be used in subinterpreters, " @@ -4003,8 +4589,15 @@ 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:1730 +#, fuzzy msgid "" "The undocumented locking behavior of :func:`~functools.cached_property` is " "removed, because it locked across all instances of the class, leading to " @@ -4015,6 +4608,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:1743 msgid "" @@ -4023,8 +4622,12 @@ msgid "" "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:1748 +#, fuzzy msgid "" "The output of the :func:`tokenize.tokenize` " "and :func:`tokenize.generate_tokens` functions is now changed due to the " @@ -4036,6 +4639,12 @@ msgid "" "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:1757 msgid "1,0-1,18: STRING 'f\"start {1+1} end\"'" @@ -4043,7 +4652,7 @@ msgstr "1,0-1,18: STRING 'f\"start {1+1} end\"'" #: ../../whatsnew/3.12.rst:1759 msgid "while the new version emits::" -msgstr "" +msgstr "而新版本會發出: ::" #: ../../whatsnew/3.12.rst:1761 msgid "" @@ -4072,30 +4681,41 @@ 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:1774 +#, 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:1777 msgid "" "Incomplete single-line strings now also raise :exc:`tokenize.TokenError` as " "incomplete multiline strings do." msgstr "" +"不完整的單列字串現在也會像不完整的多列字串一樣引" +"發 :exc:`tokenize.TokenError`。" #: ../../whatsnew/3.12.rst:1780 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:1783 +#, 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:1786 msgid "" @@ -4103,18 +4723,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:1791 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:1796 msgid "Build Changes" msgstr "建置變更" #: ../../whatsnew/3.12.rst:1798 +#, 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`` " @@ -4122,6 +4748,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:1804 msgid "" @@ -4129,6 +4759,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:1809 msgid "" @@ -4136,6 +4769,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:1813 msgid "" @@ -4145,10 +4780,14 @@ msgid "" "build .pyc files for all 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:1819 msgid "Add platform triplets for 64-bit LoongArch:" -msgstr "" +msgstr "為 64 位元 LoongArch 新增平台三元組:" #: ../../whatsnew/3.12.rst:1821 msgid "loongarch64-linux-gnusf" @@ -4175,23 +4814,29 @@ 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:1833 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:1837 msgid "C API Changes" msgstr "C API 變更" #: ../../whatsnew/3.12.rst:1844 +#, 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:1850 msgid "Code object constructors:" @@ -4240,10 +4885,11 @@ msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" #: ../../whatsnew/3.12.rst:1866 +#, 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:1869 msgid "" @@ -4258,6 +4904,8 @@ 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:1873 msgid "" @@ -4265,30 +4913,43 @@ 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:1876 +#, 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:1879 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" #: ../../whatsnew/3.12.rst:1881 +#, 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:1886 +#, 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:1890 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" @@ -4307,6 +4968,7 @@ msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" #: ../../whatsnew/3.12.rst:1895 +#, 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 " @@ -4316,20 +4978,35 @@ 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:1903 +#, 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 :attr:`~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:1908 +#, 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:1912 msgid ":c:func:`PyObject_Vectorcall`" @@ -4344,28 +5021,41 @@ msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" #: ../../whatsnew/3.12.rst:1916 +#, 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:1920 +#, 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:1926 +#, 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:1930 +#, fuzzy msgid "" "The C API now permits registering callbacks " "via :c:func:`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to " @@ -4373,6 +5063,9 @@ msgid "" "optimizing 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:1936 msgid "" @@ -4380,6 +5073,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:1940 msgid "" @@ -4387,15 +5082,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:1945 +#, 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:1949 +#, fuzzy msgid "" "Add :c:func:`PyErr_GetRaisedException` " "and :c:func:`PyErr_SetRaisedException` for saving and restoring the current " @@ -4404,34 +5106,52 @@ msgid "" "and :c:func:`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:1957 +#, 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:1961 +#, 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:1966 +#, 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:1972 +#, 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:1975 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" @@ -4439,12 +5159,12 @@ msgstr "``_Py_IMMORTAL_REFCNT``:定義物件的參照計數" #: ../../whatsnew/3.12.rst:1976 msgid "as immortal." -msgstr "" +msgstr "為不滅的。" #: ../../whatsnew/3.12.rst:1977 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." -msgstr "" +msgstr "``_Py_IsImmortal`` 檢查物件是否具有不滅參照計數。" #: ../../whatsnew/3.12.rst:1978 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" @@ -4456,29 +5176,31 @@ msgstr "``_Py_IMMORTAL_REFCNT``\\ (與 ``Py_BUILD_CORE`` 一起使用時)。 #: ../../whatsnew/3.12.rst:1980 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" -msgstr "" +msgstr "``SSTATE_INTERNED_IMMORTAL`` 駐留的 (interned) unicode 物件的識別字" #: ../../whatsnew/3.12.rst:1981 msgid "that are immortal." -msgstr "" +msgstr "那是不滅的。" #: ../../whatsnew/3.12.rst:1982 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" -msgstr "" +msgstr "``SSSTATE_INTERNED_IMMORTAL_STATIC`` 駐留的 unicode 的識別字" #: ../../whatsnew/3.12.rst:1983 msgid "objects that are immortal and static" -msgstr "" +msgstr "不滅且靜態的物體" #: ../../whatsnew/3.12.rst:1984 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "``sys.getunicodeinternedsize`` 這會回傳 unicode 的總數" #: ../../whatsnew/3.12.rst:1985 +#, 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:1988 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" @@ -4491,29 +5213,45 @@ msgid "" "interpreters with their own GILs. (See :ref:`whatsnew312-pep684` for more " "info.) (Contributed by Eric Snow in :gh:`104110`.)" msgstr "" +":pep:`684`:新增新的 :c:func:`Py_NewInterpreterFromConfig` 函式" +"和 :c:type:`PyInterpreterConfig`,它們可用於建立具有自己的 GIL 的子直譯器。" +"(有關更多資訊,請參閱 :ref:`whatsnew312-pep684`。)(由 Eric Snow " +"在 :gh:`104110` 中貢獻。)" #: ../../whatsnew/3.12.rst:1996 +#, 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:2004 +#, 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:2007 +#, 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:2011 +#, 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 " @@ -4521,23 +5259,35 @@ 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:2018 +#, 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:2023 +#, fuzzy msgid "" "To get a list of subclasses, call the Python " "method :py:meth:`~type.__subclasses__` (using :c:func:`PyObject_CallMethod`, " "for example)." msgstr "" +"要獲取子類別串列,請呼叫 Python 方法 :py:meth:`~class.__subclasses__`\\ (例" +"如,使用 :c:func:`PyObject_CallMethod`)。" #: ../../whatsnew/3.12.rst:2027 +#, 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 " @@ -4545,8 +5295,13 @@ msgid "" "and :c:func:`PyUnicode_FromFormatV`. (Contributed by Serhiy Storchaka " "in :gh:`98836`.)" msgstr "" +"在 :c:func:`PyUnicode_FromFormat` 中新增對更多格式化選項的支援(左對齊、八進" +"制、大寫十六進位、intmax_t、ptrdiff_t、wchar_t C 字串、可變寬度和精度)" +"和:c:func:`PyUnicode_FromFormatV`。(由 Serhiy Storchaka 在 :gh:`98836` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:2033 +#, fuzzy msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` " "and :c:func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In " @@ -4554,13 +5309,20 @@ msgid "" "as-is to 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:2039 +#, 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:2043 msgid "" @@ -4577,42 +5339,60 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:2055 +#, 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:2060 +#, 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:2065 +#, 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:2070 +#, 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:2075 +#, fuzzy msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" -msgstr "" +msgstr "現在,以下函式為新建立的型別選擇適當的元類別:" #: ../../whatsnew/3.12.rst:2078 msgid ":c:func:`PyType_FromSpec`" @@ -4627,12 +5407,16 @@ msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" #: ../../whatsnew/3.12.rst:2082 +#, 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:2087 msgid "" @@ -4640,6 +5424,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:2091 msgid "" @@ -4649,16 +5436,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:2098 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" -msgstr "" +msgstr "如果你控制元類別,請避免在其中使用 ``tp_new``:" #: ../../whatsnew/3.12.rst:2100 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:2102 msgid "" @@ -4667,6 +5459,9 @@ msgid "" "the :c:macro:`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:2107 msgid "" @@ -4674,12 +5469,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:2111 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:2114 msgid "" @@ -4688,15 +5487,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:2119 +#, 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:2123 +#, fuzzy msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -4706,6 +5512,11 @@ msgid "" "provided for 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:2131 msgid ":c:func:`PyUnstable_Long_IsCompact`" @@ -4716,6 +5527,7 @@ msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr ":c:func:`PyUnstable_Long_CompactValue`" #: ../../whatsnew/3.12.rst:2134 +#, 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 " @@ -4723,8 +5535,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:2144 +#, fuzzy msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field " "in :c:type:`PyDictObject` is deprecated for extension modules. Accessing " @@ -4732,6 +5549,10 @@ msgid "" "be removed 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:2149 msgid "Deprecate global configuration variable:" @@ -4739,87 +5560,87 @@ msgstr "棄用全域配置變數:" #: ../../whatsnew/3.12.rst:2151 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:2152 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:2153 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:2154 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:2155 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:2156 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:2157 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:2158 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:2159 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:2160 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" -":c:var:`Py_IgnoreEnvironmentFlag`: 請改" +":c:var:`Py_IgnoreEnvironmentFlag`:請改" "用 :c:member:`PyConfig.use_environment`" #: ../../whatsnew/3.12.rst:2161 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:2162 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" -":c:var:`Py_NoUserSiteDirectory`: 請改" +":c:var:`Py_NoUserSiteDirectory`:請改" "用 :c:member:`PyConfig.user_site_directory`" #: ../../whatsnew/3.12.rst:2163 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:2164 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:2166 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:2167 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: " "use :c:member:`PyPreConfig.legacy_windows_fs_encoding`" msgstr "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: 請改" +":c:var:`Py_LegacyWindowsFSEncodingFlag`:請改" "用 :c:member:`PyPreConfig.legacy_windows_fs_encoding`" #: ../../whatsnew/3.12.rst:2168 @@ -4827,7 +5648,7 @@ msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: " "use :c:member:`PyConfig.legacy_windows_stdio`" msgstr "" -":c:var:`Py_LegacyWindowsStdioFlag`: 請改" +":c:var:`Py_LegacyWindowsStdioFlag`:請改" "用 :c:member:`PyConfig.legacy_windows_stdio`" #: ../../whatsnew/3.12.rst:2169 @@ -4835,7 +5656,7 @@ msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: " "use :c:member:`PyConfig.filesystem_encoding`" msgstr "" -":c:var:`!Py_FileSystemDefaultEncoding`: 請改" +":c:var:`!Py_FileSystemDefaultEncoding`:使" "用 :c:member:`PyConfig.filesystem_encoding`" #: ../../whatsnew/3.12.rst:2170 @@ -4843,7 +5664,7 @@ msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: " "use :c:member:`PyConfig.filesystem_encoding`" msgstr "" -":c:var:`!Py_HasFileSystemDefaultEncoding`: 請改" +":c:var:`!Py_HasFileSystemDefaultEncoding`:請改" "用 :c:member:`PyConfig.filesystem_encoding`" #: ../../whatsnew/3.12.rst:2171 @@ -4851,7 +5672,7 @@ msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: " "use :c:member:`PyConfig.filesystem_errors`" msgstr "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: 請改" +":c:var:`!Py_FileSystemDefaultEncodeErrors`:請改" "用 :c:member:`PyConfig.filesystem_errors`" #: ../../whatsnew/3.12.rst:2172 @@ -4859,7 +5680,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:var:`!Py_UTF8Mode`:請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參" "見 :c:func:`Py_PreInitialize`)" #: ../../whatsnew/3.12.rst:2174 @@ -4872,10 +5693,13 @@ msgstr "" "(由 Victor Stinner 於 :gh:`77782` 中貢獻。)" #: ../../whatsnew/3.12.rst:2178 +#, 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:2181 msgid "" @@ -4888,6 +5712,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:2187 msgid "" @@ -4902,6 +5727,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:2191 msgid "" @@ -4941,6 +5768,8 @@ msgid "" "from :file:`Python.h`. It should be included manually when using " "``offsetof()``." msgstr "" +"在某些配置中,:file:`Python.h` 中不包含 ````。使用 ``offsetof()`` " +"時應手動包含它。" #: ../../whatsnew/3.12.rst:2204 msgid "" @@ -4948,12 +5777,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:2209 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:2212 msgid "" @@ -4962,6 +5795,9 @@ msgid "" "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:2217 msgid "" @@ -5024,7 +5860,7 @@ msgid "" ":c:func:`!Py_SetProgramName()`: Set :c:member:`PyConfig.program_name` " "instead." msgstr "" -":c:func:`!Py_SetProgramName()``:請改以 :c:member:`PyConfig.program_name` 設" +":c:func:`!Py_SetProgramName()`:請改以 :c:member:`PyConfig.program_name` 設" "定。" #: ../../deprecations/c-api-pending-removal-in-3.14.rst:18 @@ -5227,6 +6063,7 @@ msgstr "" "與 :data:`sys.exec_prefix`。" #: ../../deprecations/c-api-pending-removal-in-3.15.rst:17 +#, fuzzy msgid ":c:func:`Py_GetPath`: Get :data:`sys.path` instead." msgstr ":c:func:`Py_GetPath`:請改用 :data:`sys.path`。" @@ -5391,13 +6228,13 @@ msgid "" "C API. The :file:`token.h` header file was only designed to be used by " "Python internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -"移除 :file:`token.h` 標頭檔案。從未有任何公開的 tokenizer C " -"API。:file:`token.h` 標頭檔案的設計是僅限用於 Python 內部。(由 Victor " -"Stinner 於 :gh:`92651` 中貢獻。)" +"移除 :file:`token.h` 標頭檔案。從未有任何公開的分詞器 C API。:file:`token.h` " +"標頭檔案的設計是僅限用於 Python 內部。(由 Victor Stinner 於 :gh:`92651` 中貢" +"獻。)" #: ../../whatsnew/3.12.rst:2244 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." -msgstr "" +msgstr "舊版 Unicode API 已被刪除。有關詳細資訊請參閱 :pep:`623`。" #: ../../whatsnew/3.12.rst:2246 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" @@ -5442,12 +6279,3 @@ msgid "" msgstr "" "移除 ``PyUnicode_InternImmortal()`` 函式巨集。(由 Victor Stinner " "於 :gh:`85858` 中貢獻。)" - -#~ msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" -#~ msgstr ":mod:`array` 的 ``'u'`` 格式碼 (:gh:`57281`)" - -#~ msgid "" -#~ ":func:`sysconfig.is_python_build` *check_home* parameter is deprecated " -#~ "and ignored." -#~ msgstr "" -#~ ":func:`sysconfig.is_python_build` 的 *check_home* 參數已被棄用並被忽略。"