diff --git a/whatsnew/3.11.po b/whatsnew/3.11.po index 3aa85054ce..5a635a7b69 100644 --- a/whatsnew/3.11.po +++ b/whatsnew/3.11.po @@ -1,21 +1,23 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2022, Python Software Foundation # This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. +# Translators: +# Matt Wang , 2022 # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.11\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-10-31 08:13+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"POT-Creation-Date: 2022-10-15 20:43+0000\n" +"PO-Revision-Date: 2022-12-26 19:43+0800\n" +"Last-Translator: Matt Wang \n" +"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" +"tw)\n" "Language: zh_TW\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.2.2\n" #: ../../whatsnew/3.11.rst:3 msgid "What's New In Python 3.11" @@ -39,24 +41,24 @@ msgstr "|today|" #: ../../whatsnew/3.11.rst:0 msgid "Editor" -msgstr "" +msgstr "編輯者" #: ../../whatsnew/3.11.rst:7 msgid "Pablo Galindo Salgado" -msgstr "" +msgstr "Pablo Galindo Salgado" #: ../../whatsnew/3.11.rst:49 msgid "" "This article explains the new features in Python 3.11, compared to 3.10." -msgstr "" +msgstr "此文章解釋了 Python 3.11 和 3.10 相比多了哪些新特性。" #: ../../whatsnew/3.11.rst:51 msgid "For full details, see the :ref:`changelog `." -msgstr "" +msgstr "若想了解完整細節,請見\\ :ref:`更動日誌 `。" #: ../../whatsnew/3.11.rst:57 msgid "Summary -- Release highlights" -msgstr "" +msgstr "發布重點摘要" #: ../../whatsnew/3.11.rst:62 msgid "" @@ -64,40 +66,45 @@ msgid "" "measured a 1.25x speedup on the standard benchmark suite. See :ref:" "`whatsnew311-faster-cpython` for details." msgstr "" +"Python 3.11 比 Python 3.10 快了 10-60%。我們使用了標準基準量測套裝軟體 " +"(benchmark suite) 測得平均加速了 1.25x。細節請見\\ :ref:`whatsnew311-faster-" +"cpython`。" #: ../../whatsnew/3.11.rst:68 msgid "New syntax features:" -msgstr "" +msgstr "新增語法特性:" #: ../../whatsnew/3.11.rst:70 msgid ":ref:`whatsnew311-pep654`" -msgstr "" +msgstr ":ref:`whatsnew311-pep654`" #: ../../whatsnew/3.11.rst:72 msgid "New built-in features:" -msgstr "" +msgstr "新增內建特性:" #: ../../whatsnew/3.11.rst:74 msgid ":ref:`whatsnew311-pep678`" -msgstr "" +msgstr ":ref:`whatsnew311-pep678`" #: ../../whatsnew/3.11.rst:76 msgid "New standard library modules:" -msgstr "" +msgstr "新增標準函式庫模組:" #: ../../whatsnew/3.11.rst:78 msgid "" ":pep:`680`: :mod:`tomllib` — Support for parsing `TOML `_ " "in the Standard Library" msgstr "" +":pep:`680`:\\ :mod:`tomllib` — 在標準函式庫中支援 `TOML `_ 檔案的剖析" #: ../../whatsnew/3.11.rst:81 msgid "Interpreter improvements:" -msgstr "" +msgstr "直譯器的改進:" #: ../../whatsnew/3.11.rst:83 msgid ":ref:`whatsnew311-pep657`" -msgstr "" +msgstr ":ref:`whatsnew311-pep657`" #: ../../whatsnew/3.11.rst:84 msgid "" @@ -105,66 +112,74 @@ msgid "" "environment variable to :ref:`disable automatically prepending potentially " "unsafe paths ` to :data:`sys.path`" msgstr "" +"新增 :option:`-P` 命令列選項和 :envvar:`PYTHONSAFEPATH` 環境變數以停用自動" +"於 :data:`sys.path` 的開頭\\ :ref:`加上一個有潛在安全問題的路徑 `" #: ../../whatsnew/3.11.rst:88 msgid "New typing features:" -msgstr "" +msgstr "新增型別特性:" #: ../../whatsnew/3.11.rst:90 msgid ":ref:`whatsnew311-pep646`" -msgstr "" +msgstr ":ref:`whatsnew311-pep646`" #: ../../whatsnew/3.11.rst:91 msgid ":ref:`whatsnew311-pep655`" -msgstr "" +msgstr ":ref:`whatsnew311-pep655`" #: ../../whatsnew/3.11.rst:92 msgid ":ref:`whatsnew311-pep673`" -msgstr "" +msgstr ":ref:`whatsnew311-pep673`" #: ../../whatsnew/3.11.rst:93 msgid ":ref:`whatsnew311-pep675`" -msgstr "" +msgstr ":ref:`whatsnew311-pep675`" #: ../../whatsnew/3.11.rst:94 msgid ":ref:`whatsnew311-pep681`" -msgstr "" +msgstr ":ref:`whatsnew311-pep681`" #: ../../whatsnew/3.11.rst:96 msgid "Important deprecations, removals and restrictions:" -msgstr "" +msgstr "重要的棄用、移除與限制:" #: ../../whatsnew/3.11.rst:98 msgid "" ":pep:`594`: :ref:`Many legacy standard library modules have been deprecated " "` and will be removed in Python 3.13" msgstr "" +":pep:`594`:\\ :ref:`許多標準函式庫中的遺留模組已被棄用 `\\ 且將於 Python 3.13 移除" #: ../../whatsnew/3.11.rst:101 msgid "" ":pep:`624`: :ref:`Py_UNICODE encoder APIs have been removed `" msgstr "" +":pep:`624`:\\ :ref:`Py_UNICODE 編碼器 API 已被移除 `" #: ../../whatsnew/3.11.rst:103 msgid "" ":pep:`670`: :ref:`Macros converted to static inline functions `" -msgstr "" +msgstr ":pep:`670`:\\ :ref:`轉換為靜態行內函式的巨集 `" #: ../../whatsnew/3.11.rst:110 ../../whatsnew/3.11.rst:2175 msgid "New Features" -msgstr "" +msgstr "新增特性" #: ../../whatsnew/3.11.rst:115 msgid "PEP 657: Fine-grained error locations in tracebacks" -msgstr "" +msgstr "PEP 657:回溯 (traceback) 中更細緻的錯誤位置" #: ../../whatsnew/3.11.rst:117 msgid "" "When printing tracebacks, the interpreter will now point to the exact " "expression that caused the error, instead of just the line. For example:" msgstr "" +"當要印出回溯,直譯器現在會指出造成錯誤的確切運算式,而非只說明是哪一行。例" +"如:" #: ../../whatsnew/3.11.rst:131 msgid "" @@ -173,10 +188,12 @@ msgid "" "helpful when dealing with deeply nested :class:`dict` objects and multiple " "function calls:" msgstr "" +"前一版本的直譯器只會標明是哪一行,無法辨認哪一個物件是 ``None``。當處理多層的" +"巢狀 :class:`dict` 物件和多個函式呼叫時,這種強化錯誤提示也可能非常有用:" #: ../../whatsnew/3.11.rst:151 msgid "As well as complex arithmetic expressions:" -msgstr "" +msgstr "在複雜的計算運算式中也是:" #: ../../whatsnew/3.11.rst:161 msgid "" @@ -185,20 +202,25 @@ msgid "" "ref:`instructions ` with source code location. This information " "can be retrieved using:" msgstr "" +"此外,強化回溯特性所使用的資訊可以透過一般的 API 來取得,以用來使 :term:" +"`bytecode` :ref:`指示 (instruction) `\\ 與原始碼位置相互關聯。此項" +"資訊可以用以下方式取得:" #: ../../whatsnew/3.11.rst:166 msgid "The :meth:`codeobject.co_positions` method in Python." -msgstr "" +msgstr "Python 中的 :meth:`codeobject.co_positions` 方法。" #: ../../whatsnew/3.11.rst:167 msgid "The :c:func:`PyCode_Addr2Location` function in the C API." -msgstr "" +msgstr "C API 中的 :c:func:`PyCode_Addr2Location` 函式。" #: ../../whatsnew/3.11.rst:169 msgid "" "See :pep:`657` for more details. (Contributed by Pablo Galindo, Batuhan " "Taskaya and Ammar Askar in :issue:`43950`.)" msgstr "" +"詳情請見 :pep:`657`。(由 Pablo Galindo、Batuhan Taskaya 與 Ammar Askar 於 :" +"issue:`43950` 中所貢獻。)" #: ../../whatsnew/3.11.rst:173 msgid "" @@ -209,10 +231,14 @@ msgid "" "no_debug_ranges <-X>` command line option or the :envvar:" "`PYTHONNODEBUGRANGES` environment variable." msgstr "" +"這個特性必須要將欄的位置 (column position) 儲存於 :ref:`codeobjects`,這可能" +"會導致直譯器用於編譯 Python 檔案的記憶體使用量與硬碟使用量增加。為了避免儲存" +"多餘的資訊且停用印出多餘的回溯資訊,請用 :option:`-X no_debug_ranges <-X>` 命" +"令列選項或是 :envvar:`PYTHONNODEBUGRANGES` 環境變數。" #: ../../whatsnew/3.11.rst:185 msgid "PEP 654: Exception Groups and ``except*``" -msgstr "" +msgstr "PEP 654:例外群組與 ``except*``" #: ../../whatsnew/3.11.rst:187 msgid "" @@ -223,6 +249,10 @@ msgid "" "` syntax generalizes :keyword:`except` to match subgroups of " "exception groups." msgstr "" +":pep:`654` 引入了新的的語言特性,可讓程式同時引發並處理多個相互無關的例外。內" +"建型別 :exc:`ExceptionGroup` 和 :exc:`BaseExceptionGroup` 使得程式可為多個例" +"外組成群組並同時引發,新的 :keyword:`except* ` 語法也將 :" +"keyword:`except` 泛用化、能夠比對例外群組的子群組。" #: ../../whatsnew/3.11.rst:194 msgid "See :pep:`654` for more details." @@ -233,10 +263,12 @@ msgid "" "(Contributed by Irit Katriel in :issue:`45292`. PEP written by Irit Katriel, " "Yury Selivanov and Guido van Rossum.)" msgstr "" +"(由 Irit Katriel 於 :issue:`45292` 中所貢獻。PEP 由 Irit Katriel、Yury " +"Selivanov 與 Guido van Rossum 撰寫。)" #: ../../whatsnew/3.11.rst:203 msgid "PEP 678: Exceptions can be enriched with notes" -msgstr "" +msgstr "PEP 678:運用例外註解使其更加詳盡" #: ../../whatsnew/3.11.rst:205 msgid "" @@ -245,6 +277,9 @@ msgid "" "available at the time when the exception is raised. The added notes appear " "in the default traceback." msgstr "" +"新增 :meth:`~BaseException.add_note` 方法到 :exc:`BaseException`。當上下文資" +"訊在例外被引發時無法被取得,這個方法就可以用來為例外添加更多資訊。被添加的註" +"解會在預設回溯中出現。" #: ../../whatsnew/3.11.rst:210 msgid "See :pep:`678` for more details." @@ -255,10 +290,12 @@ msgid "" "(Contributed by Irit Katriel in :issue:`45607`. PEP written by Zac Hatfield-" "Dodds.)" msgstr "" +"(由 Irit Katriel 於 :issue:`45607` 中所貢獻。PEP 由 Zac Hatfield-Dodds 所撰" +"寫)" #: ../../whatsnew/3.11.rst:219 msgid "Windows ``py.exe`` launcher improvements" -msgstr "" +msgstr "Windows ``py.exe`` 啟動程式 (launcher) 的改進" #: ../../whatsnew/3.11.rst:221 msgid "" @@ -268,6 +305,10 @@ msgid "" ".``. This allows launching distributions other than " "``PythonCore``, the one hosted on `python.org `_." msgstr "" +"Python 3.11 所包含的 :ref:`launcher` 複製品有了顯著的改善。它現在支援 :pep:" +"`514` 所定義的公司/標籤 (tag) 語法,可用 ``-V:/`` 引數來取代受" +"限的 ``-.``。這允許了 `python.org `_ 上的 " +"``PythonCore`` 以外的發行版本發布。" #: ../../whatsnew/3.11.rst:227 msgid "" @@ -276,6 +317,9 @@ msgid "" "\"best\" tag registered for ``OtherPython``, while ``-V:3.11`` or ``-" "V:/3.11`` will select the \"best\" distribution with tag ``3.11``." msgstr "" +"使用 ``-V:`` 選擇器時,可以省略公司或標籤,但會搜索所有安裝。例如,``-V:" +"OtherPython/`` 將選擇 ``OtherPython`` 註冊的「最佳」標籤,而 ``-V:3.11`` 或 " +"``-V:/3.11`` 將選擇帶有 ``3.11`` 標籤的「最佳」發行版。" #: ../../whatsnew/3.11.rst:232 msgid "" @@ -288,20 +332,28 @@ msgid "" "for a ``-32`` suffix. All releases of Python since 3.5 have included this in " "their 32-bit builds." msgstr "" +"當使用遺留的 ``-``、``-.``、``--`` 或 " +"``-.-`` 引數時,所有過去版本的行為都應該保留下來,且只" +"有 ``PythonCore`` 中的發布版本會被選用。然而,``-64`` 後綴現在暗示了「非 32-" +"bit」(不用一定要是 x86-64),因為現在有多個支援 64-bit 的平台。32-bit 運行程" +"式會在檢查運行程式之標籤是否帶有 ``-32`` 後綴時被偵測出來。所有 Python 3.5 以" +"後發布版本的 32-bit 建置中都有這個行為。" #: ../../whatsnew/3.11.rst:246 msgid "New Features Related to Type Hints" -msgstr "" +msgstr "型別提示相關的新特性" #: ../../whatsnew/3.11.rst:248 msgid "" "This section covers major changes affecting :pep:`484` type hints and the :" "mod:`typing` module." msgstr "" +"這個部分涵蓋影響 :pep:`484` 型別提示 (type hints) 與 :mod:`typing` 模組的重大" +"變更。" #: ../../whatsnew/3.11.rst:255 msgid "PEP 646: Variadic generics" -msgstr "" +msgstr "PEP 646:可變參數泛型 (variadic generics)" #: ../../whatsnew/3.11.rst:257 msgid "" @@ -311,6 +363,10 @@ msgid "" "types. In other words, a :data:`~typing.TypeVarTuple` is a *variadic* type " "variable, enabling *variadic* generics." msgstr "" +":pep:`484` 先前引入了 :data:`~typing.TypeVar`,開啟了帶有單一型別的泛型參數" +"化。:pep:`646` 新增 :data:`~typing.TypeVarTuple`,開啟了帶有\\ *任意*\\ 數量" +"型別的參數化 (parameterisation)。換句話說,:data:`~typing.TypeVarTuple` 是\\ " +"*可變的*\\ 型別變數,啟用了\\ *可變的*\\ 泛型。" #: ../../whatsnew/3.11.rst:264 msgid "" @@ -320,6 +376,9 @@ msgid "" "will now be able to catch shape-related bugs in code that uses these " "libraries." msgstr "" +"這使其有非常多用例,特別是它允許了像是 NumPy 和 Tensorflow 的數值運算函式庫中" +"類似陣列結構的型別可用 *shape* 陣列來被參數化。靜態型別檢查工具現在也能夠為使" +"用這些函式庫的程式捕捉到維度相關的錯誤。" #: ../../whatsnew/3.11.rst:270 msgid "See :pep:`646` for more details." @@ -331,11 +390,14 @@ msgid "" "Serhiy Storchaka and Jelle Zijlstra. PEP written by Mark Mendoza, Matthew " "Rahtz, Pradeep Kumar Srinivasan, and Vincent Siles.)" msgstr "" +"(由 Matthew Rahtz 於 :issue:`43224` 中所貢獻,由 Serhiy Storchaka 與 Jelle " +"Zijlstra 協助。PEP 由 Mark Mendoza、Matthew Rahtz、Pradeep Kumar Srinivasan " +"與 Vincent Siles 所撰寫)" #: ../../whatsnew/3.11.rst:280 msgid "" "PEP 655: Marking individual ``TypedDict`` items as required or not-required" -msgstr "" +msgstr "PEP 655:標記獨立 ``TypedDict`` 項目為必要或不必要" #: ../../whatsnew/3.11.rst:282 msgid "" @@ -344,6 +406,9 @@ msgid "" "TypedDict` must be present. Previously, this was only possible using " "inheritance." msgstr "" +":data:`~typing.Required` 與 :data:`~typing.NotRequired` 提供了標記一個獨立項" +"目在 :class:`~typing.TypedDict` 中是否必須存在的直覺方法。在這之前,這只有透" +"過繼承才有可能做得到。" #: ../../whatsnew/3.11.rst:287 msgid "" @@ -352,10 +417,16 @@ msgid "" "default. For example, the following specifies a :class:`!TypedDict` with one " "required and one not-required key::" msgstr "" +"所有欄位都預設為是必要的,除非 *total* 參數有被設為 ``False``,那麼所有欄位就" +"會是非必要的。例如,這個範例指定了要有一個必要鍵與一個非必要鍵的 :class:`!" +"TypedDict`:" #: ../../whatsnew/3.11.rst:301 msgid "The following definition is equivalent::" msgstr "" +"以下定義等同於:\n" +"\n" +"::" #: ../../whatsnew/3.11.rst:307 msgid "See :pep:`655` for more details." @@ -366,10 +437,12 @@ msgid "" "(Contributed by David Foster and Jelle Zijlstra in :issue:`47087`. PEP " "written by David Foster.)" msgstr "" +"(由 David Foster 與 Jelle Zijlstra 於 :issue:`47087` 中所貢獻。PEP 由 David " +"Foster 所撰寫)" #: ../../whatsnew/3.11.rst:316 msgid "PEP 673: ``Self`` type" -msgstr "" +msgstr "PEP 673:``Self`` 型別" #: ../../whatsnew/3.11.rst:318 msgid "" @@ -379,6 +452,9 @@ msgid "" "484 <484#annotating-instance-and-class-methods>`, but is more concise and " "easier to follow." msgstr "" +"新的 :data:`~typing.Self` 標註提供了一種簡單直觀的方法來標註那些會回傳其類別" +"實例的方法。這與 :pep:`PEP 484 <484#annotating-instance-and-class-methods>` " +"中指定的基於 :class:`~typing.TypeVar` 的方法相同,但更簡潔且更易於遵循。" #: ../../whatsnew/3.11.rst:324 msgid "" @@ -386,12 +462,18 @@ msgid "" "`classmethod `\\s, and :meth:`~object.__enter__` methods that " "return ``self``::" msgstr "" +"常見用例包括作為 :func:`classmethod ` 的替代建構函式和會回傳 " +"``self`` 的 :meth:`~object.__enter__` 方法:\n" +"\n" +"::" #: ../../whatsnew/3.11.rst:342 msgid "" ":data:`~typing.Self` can also be used to annotate method parameters or " "attributes of the same type as their enclosing class." msgstr "" +":data:`~typing.Self` 也可用於標註與其封閉類類別 (enclosing class) 相同的方法" +"參數或屬性。" #: ../../whatsnew/3.11.rst:345 msgid "See :pep:`673` for more details." @@ -402,10 +484,12 @@ msgid "" "(Contributed by James Hilton-Balfe in :issue:`46534`. PEP written by Pradeep " "Kumar Srinivasan and James Hilton-Balfe.)" msgstr "" +"(由 James Hilton-Balfe 於 :issue:`46534` 中所貢獻。PEP 由 Pradeep Kumar " +"Srinivasan 與 James Hilton-Balfe 所撰寫)" #: ../../whatsnew/3.11.rst:354 msgid "PEP 675: Arbitrary literal string type" -msgstr "" +msgstr "PEP 675:任意的文本字串型別 (Arbitrary literal string type)" #: ../../whatsnew/3.11.rst:356 msgid "" @@ -417,10 +501,17 @@ msgid "" "commands, are called only with static arguments, providing protection " "against injection attacks." msgstr "" +"新的 :data:`~typing.LiteralString` 標註可用於標示一個函式參數可為任何文本字串" +"型別 (literal string type)。這允許函式接受任意的文本字串型別,以及從其他文本" +"字串創建的字串。型別檢查器就可以強制需審慎處理的函式(例如會執行 SQL 陳述式" +"或 shell 命令的函式)僅會以靜態引數呼叫,從而提供針對注入攻擊的保護。" #: ../../whatsnew/3.11.rst:364 msgid "For example, a SQL query function could be annotated as follows::" msgstr "" +"例如一個 SQL 查詢函式 (query function) 可以被標註為:\n" +"\n" +"::" #: ../../whatsnew/3.11.rst:382 msgid "See :pep:`675` for more details." @@ -431,10 +522,12 @@ msgid "" "(Contributed by Jelle Zijlstra in :issue:`47088`. PEP written by Pradeep " "Kumar Srinivasan and Graham Bleaney.)" msgstr "" +"(由 Jelle Zijlstra 於 :issue:`47088` 中所貢獻。PEP 由 Pradeep Kumar " +"Srinivasan 與 Graham Bleaney 所撰寫)" #: ../../whatsnew/3.11.rst:391 msgid "PEP 681: Data class transforms" -msgstr "" +msgstr "PEP 681:資料類別轉換 (Data class transforms)" #: ../../whatsnew/3.11.rst:393 msgid "" @@ -444,6 +537,10 @@ msgid "" "object performs runtime \"magic\" that transforms a class, giving it :func:" "`dataclass `-like behaviors." msgstr "" +":data:`~typing.dataclass_transform` 可以用來裝飾一個類別、元類別 " +"(metaclass)、或是一個本身就是裝飾器的函式。``@dataclass_transform()`` 的存在" +"會讓一個靜態型別檢查器知道被裝飾物件會在運行程式做出轉換類別的「魔法」,賦予" +"其類似 :func:`dataclass ` 的行為。" #: ../../whatsnew/3.11.rst:399 msgid "For example::" @@ -461,10 +558,12 @@ msgid "" "(Contributed by Jelle Zijlstra in :gh:`91860`. PEP written by Erik De Bonte " "and Eric Traut.)" msgstr "" +"(由 Jelle Zijlstra 於 :gh:`91860` 中所貢獻。PEP 由 Erik De Bonte 與 Eric " +"Traut 所撰寫)" #: ../../whatsnew/3.11.rst:426 msgid "PEP 563 may not be the future" -msgstr "" +msgstr "PEP 563 可能不是未來" #: ../../whatsnew/3.11.rst:428 msgid "" @@ -475,16 +574,23 @@ msgid "" "python-dev@python.org/message/VIZEBX5EYMSYIJNDBF6DMUMZOCWHARSO/>`__ for more " "information." msgstr "" +":pep:`563` 標註的推遲求值 (Postponed Evaluation of Annotations)(\\ ``from " +"__future__ import annotations`` :ref:`future 陳述式 `\\ )最初計劃在 " +"Python 3.10 中發布,但已被無限期擱置。請參閱\\ `來自指導委員會 (Steering " +"Counsil) 的訊息 `__\\ 以獲得更多資訊。" #: ../../whatsnew/3.11.rst:439 msgid "Other Language Changes" -msgstr "" +msgstr "其他語言更動" #: ../../whatsnew/3.11.rst:441 msgid "" "Starred unpacking expressions can now be used in :keyword:`for` statements. " "(See :issue:`46725` for more details.)" msgstr "" +"星號拆解 (starred unpacking) 運算式現在可以在 :keyword:`for` 陳述式中使用。" +"(詳情請見 :issue:`46725`。)" #: ../../whatsnew/3.11.rst:444 msgid "" @@ -493,6 +599,10 @@ msgid "" "comprehensions implicitly become asynchronous in this case. (Contributed by " "Serhiy Storchaka in :issue:`33346`.)" msgstr "" +"非同步\\ :ref:`綜合運算 (comprehension) ` 現在允許在\\ :ref:`" +"非同步函式中的內部綜合運算 (inside comprehension) `。在這種情況" +"下,外部綜合運算 (outer comprehension) 隱晦地變成了非同步的了。 (由 Serhiy " +"Storchaka 在 :issue:`33346` 中貢獻。)" #: ../../whatsnew/3.11.rst:449 msgid "" @@ -504,6 +614,12 @@ msgid "" "context manager` protocol. (Contributed by Serhiy Storchaka in :issue:" "`12022` and :issue:`44471`.)" msgstr "" +"現在在不支援 :term:`context manager` 協議的物件上使用 :keyword:`with` 陳述式" +"和 :meth:`contextlib.ExitStack.enter_context` 或在不支援 :term:`asynchronous " +"context manager` 協議的物件上使用 :keyword:`async with` 陳述式和 :meth:" +"`contextlib.AsyncExitStack.enter_async_context`,會引發 :exc:`TypeError` 而不" +"是 :exc:`AttributeError`。 (由 Serhiy Storchaka 在 :issue:`12022` 和 :issue:" +"`44471` 中貢獻。)" #: ../../whatsnew/3.11.rst:457 msgid "" @@ -515,6 +631,12 @@ msgid "" "and pickles instance attributes implemented as :term:`slots <__slots__>`. " "(Contributed by Serhiy Storchaka in :issue:`26579`.)" msgstr "" +"添加了 :meth:`object.__getstate__`,它提供 :meth:`!__getstate__` 方法的預設實" +"作。內建型別 :class:`bytearray`、:class:`set`、:class:`frozenset`、:class:" +"`collections.OrderedDict`、:class:`collections.deque`、:class:`weakref." +"WeakSet` 和 :class:`datetime.tzinfo` 的 :mod:`copy` 和 :mod:`pickle` 實例,現" +"在會以 :term:`slots <__slots__>` 形式複製和 pickle 實例屬性。 (由 Serhiy " +"Storchaka 在 :issue:`26579` 中貢獻。)" #: ../../whatsnew/3.11.rst:468 msgid "" @@ -527,6 +649,11 @@ msgid "" "typically user-writable) directory. (Contributed by Victor Stinner in :gh:" "`57684`.)" msgstr "" +"新增了一個 :option:`-P` 命令列選項和一個 :envvar:`PYTHONSAFEPATH` 環境變數," +"它們禁用了當使用 :option:`-c` 和 :option:`-m` 以在運行腳本或當前目錄時自動添" +"加到腳本目錄的 :data:`sys.path`。這確保只有 stdlib 和已安裝的模組會被 :" +"keyword:`import` 取用,以避免不小心或被惡意地將模組與本地(通常是使用者可寫入" +"的)目錄中的模組重疊。 (由 Victor Stinner 在 :gh:`57684` 中貢獻。)" #: ../../whatsnew/3.11.rst:479 msgid "" @@ -534,6 +661,8 @@ msgid "" "to positive zero after rounding to the format precision. See :pep:`682` for " "more details. (Contributed by John Belmonte in :gh:`90153`.)" msgstr "" +"``\"z\"`` 選項被新增到 :ref:`formatspec`,它會強迫負的 0 在進位到格式精度後成" +"為正的。更多詳情請見 :pep:`682`。(由 John Belmonte 於 :gh:`90153` 中貢獻。)" #: ../../whatsnew/3.11.rst:484 msgid "" @@ -544,10 +673,15 @@ msgid "" "there is a mixture of :class:`str` and :class:`bytes` keys. (Contributed by " "Thomas Grainger in :gh:`91181`.)" msgstr "" +":data:`sys.path` 不再接受位元組。支援已在 Python 3.2 和 3.6 之間的某個時間停" +"止,直到 Python 3.10.0 發布後才引起人們的注意。此外,由於混合使用 :class:" +"`str` 和 :class:`bytes` 鍵時 :option:`-b` 和 :data:`sys.path_importer_cache` " +"會出現的交互作用,恢復這項支援會出現問題。(由 Thomas Grainger 在 :gh:" +"`91181` 中貢獻。)" #: ../../whatsnew/3.11.rst:495 msgid "Other CPython Implementation Changes" -msgstr "" +msgstr "其他 CPython 實作更動" #: ../../whatsnew/3.11.rst:497 msgid "" @@ -556,6 +690,10 @@ msgid "" "class:`typing.SupportsComplex` and :class:`typing.SupportsBytes` protocols. " "(Contributed by Mark Dickinson and Dong-hee Na in :issue:`24234`.)" msgstr "" +"為支援 :class:`typing.SupportsComplex` 與 :class:`typing.SupportsBytes` 協" +"定,實作了 :class:`complex` 與 :class:`bytes` 的特殊方法 :meth:`~object." +"__complex__` 與 :meth:`~object.__bytes__`。(由 Mark Dickinson 和 Dong-hee " +"Na 於 :issue:`24234` 中所貢獻。)" #: ../../whatsnew/3.11.rst:502 msgid "" @@ -566,6 +704,11 @@ msgid "" "` now use ``siphash13`` too. (Contributed by Inada Naoki " "in :issue:`29410`.)" msgstr "" +"新增 ``siphash13`` 以作為內部的雜湊演算法,它有與 ``siphash24`` 相似的安全特" +"性,但是在處理較長的輸入時會更快一些。現在是 :class:`str`、:class:`bytes` 和" +"一些其他型別的 :func:`hash` 預設演算法。:pep:`552` :ref:`基於雜湊的 .pyc 檔" +"案 ` 現在也使用 ``siphash13``。(由 Inada Naoki 於 :issue:" +"`29410` 中貢獻。)" #: ../../whatsnew/3.11.rst:511 msgid "" @@ -575,6 +718,10 @@ msgid "" "in the current :keyword:`except` clause are reflected in the re-raised " "exception. (Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" +"當一個仍有效的例外被 :keyword:`raise` 陳述式在沒有參數的情況下重新引發,被附" +"於該例外的追蹤資訊現在都會是 ``sys.exc_info()[1].__traceback__``。這代表對於" +"當前 :keyword:`except` 子句的追蹤上做的改動會反映在被重複引發的例外上。(由 " +"Irit Katriel 於 :issue:`45711` 中貢獻。)" #: ../../whatsnew/3.11.rst:517 msgid "" @@ -583,6 +730,10 @@ msgid "" "``exc_type`` and ``exc_traceback`` have been removed, as they can be derived " "from ``exc_value``. (Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" +"有被處理的例外在直譯器狀態的表示(也就是 ``exc_info`` 或 " +"``_PyErr_StackItem``)現在只會有 ``exc_value`` 欄位;``exc_type`` 和 " +"``exc_traceback`` 已被移除,現在只能透過 ``exc_value`` 來取得它們。(由 Irit " +"Katriel 於 :issue:`45711` 中貢獻。)" #: ../../whatsnew/3.11.rst:523 msgid "" @@ -591,6 +742,9 @@ msgid "" "``PrependPath``, but appends the install and scripts directories instead of " "prepending them. (Contributed by Bastian Neuburger in :issue:`44934`.)" msgstr "" +"新增\\ :ref:`命令列選項 ` ``AppendPath``,已增加於 " +"Windows 安裝程式。它的行為類似於 ``PrependPath``,但在安裝和腳本目錄後面附加" +"而非新增於它們前面。 (由 Bastian Neuburger 在 :issue:`44934` 中貢獻。)" #: ../../whatsnew/3.11.rst:529 msgid "" @@ -599,6 +753,9 @@ msgid "" "initialize :data:`sys.path`. Otherwise, initialization will recalculate the " "path and replace any values added to ``module_search_paths``." msgstr "" +"初始化中若是要用 :c:member:`PyConfig.module_search_paths` 來初始化 :data:" +"`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " +"1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" #: ../../whatsnew/3.11.rst:534 msgid "" @@ -608,6 +765,10 @@ msgid "" "help-env` and :option:`--help-xoptions` flags, and with the new :option:`--" "help-all`. (Contributed by Éric Araujo in :issue:`46142`.)" msgstr "" +":option:`--help` 選項的輸出現在會在 50 列、80 欄的大小之內,:ref:`Python 環境" +"變數 `\\ 和 :option:`-X` 選項的資訊現在能夠分別透過 :" +"option:`--help-env` 和 :option:`--help-xoptions` 旗標與 :option:`--help-all` " +"一起使用來取得。(由 Éric Araujo 於 :issue:`46142` 中貢獻。)" #: ../../whatsnew/3.11.rst:541 msgid "" @@ -622,26 +783,38 @@ msgid "" "` documentation. The default limit is 4300 digits in " "string form." msgstr "" +"在除 2(binary、二進制)、4、8(octal、八進制)、16(hexadecimal、十六進制)" +"或 32 以外的基數中,例如以 10(decimal、十進制)為基數,進行 :class:`int` " +"和 :class:`str` 之間的轉換且字串形式的位數超過限制,現在會引發 :exc:" +"`ValueError`,以避免由於演算法複雜性而導致的潛在阻斷服務攻擊 (denial of " +"service attacks)。這是針對 `CVE-2020-10735 `_ 的緩解措施,可以透過環境變數、命令列旗標" +"或 :mod:`sys` API 來設定或禁用此限制。請參閱\\ :ref:`整數字串轉換長度限制 " +"` 文件。預設限制為字串形式的 4300 位數字。" #: ../../whatsnew/3.11.rst:556 msgid "New Modules" -msgstr "" +msgstr "新增模組" #: ../../whatsnew/3.11.rst:558 msgid "" ":mod:`tomllib`: For parsing `TOML `_. See :pep:`680` for " "more details. (Contributed by Taneli Hukkinen in :issue:`40059`.)" msgstr "" +":mod:`tomllib`:用於剖析 `TOML `_。詳情請見 :pep:`680`。" +"(由 Taneli Hukkinen 於 :issue:`40059` 中所貢獻。)" #: ../../whatsnew/3.11.rst:562 msgid "" ":mod:`wsgiref.types`: :pep:`WSGI <3333>`-specific types for static type " "checking. (Contributed by Sebastian Rittau in :issue:`42012`.)" msgstr "" +":mod:`wsgiref.types`:\\ :pep:`WSGI <3333>` 限定型別,用於靜態型別檢查。" +"(Sebastian Rittau 於 :issue:`42012` 中所貢獻。)" #: ../../whatsnew/3.11.rst:570 msgid "Improved Modules" -msgstr "" +msgstr "模組改進" #: ../../whatsnew/3.11.rst:575 msgid "asyncio" @@ -655,6 +828,11 @@ msgid "" "`~asyncio.create_task` and :func:`~asyncio.gather` directly. (Contributed by " "Yury Selivanov and others in :gh:`90908`.)" msgstr "" +"添加了 :class:`~asyncio.TaskGroup` 類別,為一個會持有任務群組並在退出時等待全" +"部完成的\\ :ref:`非同步情境管理器 (asynchronous context manager) `。對於新程式碼,建議直接使用 :func:`~asyncio.create_task` " +"和 :func:`~asyncio.gather`。(由 Yury Selivanov 和其他人在 :gh:`90908` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:584 msgid "" @@ -663,12 +841,17 @@ msgid "" "using :func:`~asyncio.wait_for` directly. (Contributed by Andrew Svetlov in :" "gh:`90927`.)" msgstr "" +"新增 :func:`~asyncio.timeout`,是一個用來為一個非同步操作設置超時的非同步情境" +"管理器,新的程式建議直接使用它以取代 :func:`~asyncio.wait_for`。(由 Andrew " +"Svetlov 於 :gh:`90927` 貢獻。)" #: ../../whatsnew/3.11.rst:589 msgid "" "Added the :class:`~asyncio.Runner` class, which exposes the machinery used " "by :func:`~asyncio.run`. (Contributed by Andrew Svetlov in :gh:`91218`.)" msgstr "" +"新增 :class:`~asyncio.Runner` 類別,它會對外公布了 :func:`~asyncio.run` 的使" +"用機制。(由 Andrew Svetlov 於 :gh:`91218` 貢獻。)" #: ../../whatsnew/3.11.rst:593 msgid "" @@ -676,6 +859,9 @@ msgid "" "in the asyncio library, and the related :exc:`~asyncio.BrokenBarrierError` " "exception. (Contributed by Yves Duprat and Andrew Svetlov in :gh:`87518`.)" msgstr "" +"於 asyncio 函式庫的同步化原始物件中新增 :class:`~asyncio.Barrier` 類別與和其" +"相關的 :exc:`~asyncio.BrokenBarrierError` 例外。(由 Yves Duprat 和 Andrew " +"Svetlov in :gh:`87518` 貢獻。)" #: ../../whatsnew/3.11.rst:598 msgid "" @@ -683,6 +869,8 @@ msgid "" "create_connection` so that multiple connection errors can be raised as an :" "exc:`ExceptionGroup`." msgstr "" +"在 :meth:`asyncio.loop.create_connection` 新增關鍵字引數 *all_errors*,這樣多" +"個連接錯誤就可以一起用一個 :exc:`ExceptionGroup` 來引發。" #: ../../whatsnew/3.11.rst:601 msgid "" @@ -690,6 +878,8 @@ msgid "" "existing stream-based connections to TLS. (Contributed by Ian Good in :issue:" "`34975`.)" msgstr "" +"新增 :meth:`asyncio.StreamWriter.start_tls` 方法,用來將已存在的串流連線升級" +"至 TLS。(由 Ian Good 於 :issue:`34975` 中貢獻。)" #: ../../whatsnew/3.11.rst:605 msgid "" @@ -699,6 +889,11 @@ msgid "" "SelectorEventLoop` and :class:`~asyncio.ProactorEventLoop`. (Contributed by " "Alex Grönholm in :issue:`46805`.)" msgstr "" +"在事件迴圈增加原始資料元 (raw datagram) socket 函式::meth:`~asyncio.loop." +"sock_sendto`、:meth:`~asyncio.loop.sock_recvfrom` 和 :meth:`~asyncio.loop." +"sock_recvfrom_into`。以上在 :class:`~asyncio.SelectorEventLoop` 和 :class:" +"`~asyncio.ProactorEventLoop` 中都有實作。(由 Alex Grönholm 在 :issue:" +"`46805` 中貢獻。)" #: ../../whatsnew/3.11.rst:613 msgid "" @@ -706,6 +901,9 @@ msgid "" "methods to :class:`~asyncio.Task`. These are primarily intended for internal " "use, notably by :class:`~asyncio.TaskGroup`." msgstr "" +"於 :class:`~asyncio.Task` 新增 :meth:`~asyncio.Task.cancelling` 和 :meth:" +"`~asyncio.Task.uncancel` 方法。這些預期是只用於內部,尤其是 :class:`~asyncio." +"TaskGroup`。" #: ../../whatsnew/3.11.rst:622 msgid "contextlib" @@ -717,6 +915,9 @@ msgid "" "the current working directory and then restore it on exit. Simple wrapper " "around :func:`~os.chdir`. (Contributed by Filipe Laíns in :issue:`25625`)" msgstr "" +"添加了非平行安全的 :func:`~contextlib.chdir` 情境管理器來更改當前工作目錄,然" +"後在退出時恢復它。:func:`~os.chdir` 的簡單包裝器。(由 Filipe Laíns 在 :" +"issue:`25625` 中貢獻)" #: ../../whatsnew/3.11.rst:632 msgid "dataclasses" @@ -729,6 +930,9 @@ msgid "" "`dict`, :class:`list` or :class:`set`. (Contributed by Eric V. Smith in :" "issue:`44674`.)" msgstr "" +"更改欄位預設的可變性檢查 (mutability check),僅允許預設值是 :term:`hashable` " +"而不是任何非 :class:`dict`、:class:`list` 或 :class:`set` 實例的物件。(由 " +"Eric V. Smith 在 :issue:`44674` 中貢獻。)" #: ../../whatsnew/3.11.rst:643 msgid "datetime" @@ -739,6 +943,8 @@ msgid "" "Add :attr:`datetime.UTC`, a convenience alias for :attr:`datetime.timezone." "utc`. (Contributed by Kabir Kwatra in :gh:`91973`.)" msgstr "" +"新增 :attr:`datetime.UTC`,一個 :attr:`datetime.timezone.utc` 的方便別名。" +"(由 Kabir Kwatra 於 :gh:`91973` 所貢獻。)" #: ../../whatsnew/3.11.rst:648 msgid "" @@ -747,6 +953,10 @@ msgid "" "ISO 8601 formats (barring only those that support fractional hours and " "minutes). (Contributed by Paul Ganssle in :gh:`80010`.)" msgstr "" +":meth:`datetime.date.fromisoformat`、:meth:`datetime.time.fromisoformat` 和 :" +"meth:`datetime.datetime.fromisoformat` 現在可以用來剖析大部分的 ISO 8601 格式" +"(除了那些支援分數形式的小時與分鐘)。(由 Paul Ganssle 於 :gh:`80010` 中所貢" +"獻。)" #: ../../whatsnew/3.11.rst:657 msgid "enum" @@ -757,12 +967,14 @@ msgid "" "Renamed :class:`!EnumMeta` to :class:`~enum.EnumType` (:class:`!EnumMeta` " "kept as an alias)." msgstr "" +":class:`!EnumMeta` 更名為 :class:`~enum.EnumType`\\ (:class:`!EnumMeta` 保留" +"為別名)。" #: ../../whatsnew/3.11.rst:662 msgid "" "Added :class:`~enum.StrEnum`, with members that can be used as (and must be) " "strings." -msgstr "" +msgstr "增加 :class:`~enum.StrEnum`,枚舉 (enum) 內的成員必須是字串。" #: ../../whatsnew/3.11.rst:665 msgid "" @@ -771,6 +983,10 @@ msgid "" "names) for :meth:`~object.__str__` and :meth:`~object.__format__` (used by :" "func:`str`, :func:`format` and :term:`f-string`\\s)." msgstr "" +"新增 :class:`~enum.ReprEnum`,它只修改成員的 :meth:`~object.__repr__`,同時回" +"傳成員的文本值 (literal value)(而不是名稱),以用於(為 :func:`str`、:func:" +"`format` 和 :term:`f-string` 所使用的)\\ :meth:`~object.__str__` 和 :meth:" +"`~object.__format__`。" #: ../../whatsnew/3.11.rst:671 msgid "" @@ -780,6 +996,10 @@ msgid "" "``format(AnIntEnum.ONE)`` return ``'1'``, whereas before ``str(AnIntEnum." "ONE)`` returned ``'AnIntEnum.ONE'``." msgstr "" +"更改 :class:`~enum.IntEnum`、:class:`~enum.IntFlag` 和 :class:`~enum." +"StrEnum` 以繼承自 :class:`~enum.ReprEnum`,所以它們的 :func:`str` 輸出現在" +"與 :func:`format` 相符(``str(AnIntEnum.ONE)`` 和 ``format(AnIntEnum.ONE)`` " +"都回傳 ``'1'``,但過去 ``str(AnIntEnum.ONE)`` 會回傳 ``'AnIntEnum.ONE'``)。" #: ../../whatsnew/3.11.rst:677 msgid "" @@ -790,6 +1010,11 @@ msgid "" "behavior of :meth:`enum.Enum.__str__`, returning e.g. ``'AnEnum.MEMBER'`` " "for an enum ``AnEnum(str, Enum)`` instead of just ``'MEMBER'``." msgstr "" +"改變了具有混合型別(例如 :class:`int`、:class:`str`)枚舉的(被 :func:" +"`format`、:meth:`str.format` 和 :term:`f-string` 預設使用的) :meth:`Enum." +"__format__() `,以在輸出中也包含類別名稱,而不僅有成員" +"的鍵。這與 :meth:`enum.Enum.__str__` 的現有行為相符,例如用於枚舉 " +"``AnEnum(str, Enum)`` 則會回傳 ``'AnEnum.MEMBER'`` 而不僅是 ``'MEMBER'``。" #: ../../whatsnew/3.11.rst:685 msgid "" @@ -797,6 +1022,8 @@ msgid "" "class:`~enum.FlagBoundary` enum with its options, to control how to handle " "out-of-range flag values." msgstr "" +"新增 *boundary* 類別參數與其選項到 :class:`~enum.Flag` 枚舉和 :class:`~enum." +"FlagBoundary` 枚舉以控制處理超出範圍旗標數值的方法。" #: ../../whatsnew/3.11.rst:689 msgid "" @@ -804,12 +1031,16 @@ msgid "" "EnumCheck` enum with its options, to check enum classes against several " "specific constraints." msgstr "" +"新增了 :func:`~enum.verify` 枚舉裝飾器和 :class:`~enum.EnumCheck` 枚舉及其選" +"項,以根據幾個特定限制檢查枚舉類別。" #: ../../whatsnew/3.11.rst:693 msgid "" "Added the :func:`~enum.member` and :func:`~enum.nonmember` decorators, to " "ensure the decorated object is/is not converted to an enum member." msgstr "" +"新增 :func:`~enum.member` 與 :func:`~enum.nonmember` 裝飾器以確保被裝飾的物件" +"會/不會被轉換成一個枚舉成員。" #: ../../whatsnew/3.11.rst:696 msgid "" @@ -817,6 +1048,8 @@ msgid "" "`property` except for enums. Use this instead of :func:`types." "DynamicClassAttribute`." msgstr "" +"新增 :func:`~enum.property` 裝飾器,它的作用類似 :func:`property` 但是是用於" +"枚舉,用以替代 :func:`types.DynamicClassAttribute`。" #: ../../whatsnew/3.11.rst:700 msgid "" @@ -826,6 +1059,10 @@ msgid "" "the :data:`~re.ASCII` member of :class:`re.RegexFlag` rather than " "``'RegexFlag.ASCII'``." msgstr "" +"新增 :func:`~enum.global_enum` 枚舉裝飾器,用來調整 :meth:`~object.__repr__` " +"和 :meth:`~object.__str__` 以模組成員形式而非枚舉類別來顯示值。例如,:class:" +"`re.RegexFlag` 的 :data:`~re.ASCII` 成員的 ``'re.ASCII'``,而非 ``'RegexFlag." +"ASCII'``。" #: ../../whatsnew/3.11.rst:706 msgid "" @@ -833,6 +1070,9 @@ msgid "" "`in`/:keyword:`not in` on its members. For example, the following now works: " "``len(AFlag(3)) == 2 and list(AFlag(3)) == (AFlag.ONE, AFlag.TWO)``" msgstr "" +"強化 :class:`~enum.Flag` 以支援使用 :func:`len`、疊代 (iteration) 和 :" +"keyword:`in`/:keyword:`not in` 於其成員。例如,以下程式現在能夠作用了:" +"``len(AFlag(3)) == 2 and list(AFlag(3)) == (AFlag.ONE, AFlag.TWO)``" #: ../../whatsnew/3.11.rst:711 msgid "" @@ -840,6 +1080,9 @@ msgid "" "defined before :meth:`~object.__init_subclass__` is called; :func:`dir` now " "includes methods, etc., from mixed-in data types." msgstr "" +"更改了 :class:`~enum.Enum` 和 :class:`~enum.Flag` 以在呼叫 :meth:`~object." +"__init_subclass__` 之前就定義成員;:func:`dir` 現在包括來自混合資料型別的方" +"法。" #: ../../whatsnew/3.11.rst:716 msgid "" @@ -847,6 +1090,9 @@ msgid "" "canonical while composite values (``3``, ``6``, ``10``, etc.) are considered " "aliases; inverted flags are coerced to their positive equivalent." msgstr "" +"更改 :class:`~enum.Flag` 以僅考慮主要值(2 的次方)規範,而複合值(``3``、" +"``6``、``10`` 等)被視為別名;倒置旗標 (inverted flags) 會被強制轉換為正等價" +"的值。" #: ../../whatsnew/3.11.rst:725 msgid "fcntl" @@ -858,6 +1104,8 @@ msgid "" "respectively are supported, the former equals to ``dup2`` usage while the " "latter set the ``FD_CLOEXEC`` flag in addition." msgstr "" +"FreeBSD 上,:data:`!F_DUP2FD` 和 :data:`!F_DUP2FD_CLOEXEC` 旗標分別有被支援," +"前者等同於 ``dup2`` 用法,而後者設定了 ``FD_CLOEXEC`` 旗標。" #: ../../whatsnew/3.11.rst:735 msgid "fractions" @@ -868,6 +1116,8 @@ msgid "" "Support :PEP:`515`-style initialization of :class:`~fractions.Fraction` from " "string. (Contributed by Sergey B Kirpichev in :issue:`44258`.)" msgstr "" +"支援有 :PEP:`515` 風格的 :class:`~fractions.Fraction` 以字串初始化。(Sergey " +"B Kirpichev 於 :issue:`44258` 中所貢獻。)" #: ../../whatsnew/3.11.rst:740 msgid "" @@ -875,6 +1125,9 @@ msgid "" "an ``isinstance(some_fraction, typing.SupportsInt)`` check passes. " "(Contributed by Mark Dickinson in :issue:`44547`.)" msgstr "" +":class:`~fractions.Fraction` 現在有實作了一個 ``__int__`` 方法,因此 " +"``isinstance(some_fraction, typing.SupportsInt)`` 的檢查會通過。(由 Mark " +"Dickinson 在 :issue:`44547` 中貢獻。)" #: ../../whatsnew/3.11.rst:748 msgid "functools" @@ -885,10 +1138,14 @@ msgid "" ":func:`functools.singledispatch` now supports :data:`types.UnionType` and :" "data:`typing.Union` as annotations to the dispatch argument.::" msgstr "" +":func:`functools.singledispatch` 現在支援 :data:`types.UnionType` 和 :data:" +"`typing.Union` 作為調度 (dispatch) 引數的標註。\n" +"\n" +"::" #: ../../whatsnew/3.11.rst:775 msgid "(Contributed by Yurii Karabas in :issue:`46014`.)" -msgstr "" +msgstr "(由 Yurii Karabas 於 :issue:`46014` 中所貢獻。)" #: ../../whatsnew/3.11.rst:781 msgid "hashlib" @@ -899,6 +1156,9 @@ msgid "" ":func:`hashlib.blake2b` and :func:`hashlib.blake2s` now prefer `libb2`_ over " "Python's vendored copy. (Contributed by Christian Heimes in :issue:`47095`.)" msgstr "" +":func:`hashlib.blake2b` 與 :func:`hashlib.blake2s` 現在偏好使用 `libb2`_ 多" +"於 Python 自發行版的複製。(由 Christian Heimes 於 :issue:`47095` 中所貢" +"獻。)" #: ../../whatsnew/3.11.rst:787 msgid "" @@ -908,28 +1168,38 @@ msgid "" "implementations from OpenSSL. The change affects only installations without " "OpenSSL support. (Contributed by Christian Heimes in :issue:`47098`.)" msgstr "" +"帶有 SHA3 和 SHAKE 演算法的內部 ``_sha3`` 模組現在使用 *tiny_sha3* 而不是 " +"*Keccak 程式碼套件*\\ 來減少程式碼和二進位檔案大小。:mod:`hashlib` 模組更喜歡" +"來自 OpenSSL 的 SHA3 和 SHAKE 最佳化實作。此更改僅影響沒有 OpenSSL 支援的安" +"裝。(由 Christian Heimes 在 :issue:`47098` 中貢獻。)" #: ../../whatsnew/3.11.rst:794 msgid "" "Add :func:`hashlib.file_digest`, a helper function for efficient hashing of " "files or file-like objects. (Contributed by Christian Heimes in :gh:`89313`.)" msgstr "" +"新增 :func:`hashlib.file_digest`,是個能夠為檔案或類檔案物件做高效率雜湊的幫" +"助函式。(由 Christian Heimes 於 :gh:`89313` 中貢獻。)" #: ../../whatsnew/3.11.rst:802 msgid "IDLE and idlelib" -msgstr "" +msgstr "IDLE 與 idlelib" #: ../../whatsnew/3.11.rst:804 msgid "" "Apply syntax highlighting to ``.pyi`` files. (Contributed by Alex Waygood " "and Terry Jan Reedy in :issue:`45447`.)" msgstr "" +"在 `.pyi` 檔案施用語法突顯 (syntax highlight)。(由 Alex Waygood 與 Terry " +"Jan Reedy 於 :issue:`45447` 中所貢獻。)" #: ../../whatsnew/3.11.rst:807 msgid "" "Include prompts when saving Shell with inputs and outputs. (Contributed by " "Terry Jan Reedy in :gh:`95191`.)" msgstr "" +"當帶有輸入與輸出地儲存 Shell 時,也會包含提示字元。(由 Terry Jan Reedy 於 :" +"gh:`95191` 中所貢獻。)" #: ../../whatsnew/3.11.rst:814 msgid "inspect" @@ -941,6 +1211,9 @@ msgid "" "triggering dynamic lookup via the descriptor protocol. (Contributed by " "Weipeng Hong in :issue:`30533`.)" msgstr "" +"添加 :func:`~inspect.getmembers_static` 以回傳所有成員,而不會通過描述器協議 " +"(descriptor protocol) 觸發動態查找。 (由 Weipeng Hong 在 :issue:`30533` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:820 msgid "" @@ -948,6 +1221,8 @@ msgid "" "is a :class:`~types.MethodWrapperType`. (Contributed by Hakan Çelik in :" "issue:`29418`.)" msgstr "" +"新增 :func:`inspect.ismethodwrapper`,用來檢查一個物件的型別是否為 :class:" +"`~types.MethodWrapperType`。(由 Hakan Çelik 於 :issue:`29418` 中所貢獻。)" #: ../../whatsnew/3.11.rst:824 msgid "" @@ -957,30 +1232,34 @@ msgid "" "interfaces) that includes the extended :pep:`657` position information (end " "line number, column and end column). The affected functions are:" msgstr "" +"更改 :mod:`inspect` 模組中與幀相關的函數以回傳新的 :class:`~inspect." +"FrameInfo` 和 :class:`~inspect.Traceback` 類別實例(向後相容之前類似於 :term:" +"`named tuple` 的介面),包括擴充的 :pep:`657` 位置資訊(結束行號、欄和結束" +"欄)。受影響的功能是:" #: ../../whatsnew/3.11.rst:830 msgid ":func:`inspect.getframeinfo`" -msgstr "" +msgstr ":func:`inspect.getframeinfo`" #: ../../whatsnew/3.11.rst:831 msgid ":func:`inspect.getouterframes`" -msgstr "" +msgstr ":func:`inspect.getouterframes`" #: ../../whatsnew/3.11.rst:832 msgid ":func:`inspect.getinnerframes`," -msgstr "" +msgstr ":func:`inspect.getinnerframes`," #: ../../whatsnew/3.11.rst:833 msgid ":func:`inspect.stack`" -msgstr "" +msgstr ":func:`inspect.stack`" #: ../../whatsnew/3.11.rst:834 msgid ":func:`inspect.trace`" -msgstr "" +msgstr ":func:`inspect.trace`" #: ../../whatsnew/3.11.rst:836 msgid "(Contributed by Pablo Galindo in :gh:`88116`.)" -msgstr "" +msgstr "(由 Pablo Galindo 於 :gh:`88116` 中所貢獻。)" #: ../../whatsnew/3.11.rst:842 msgid "locale" @@ -992,10 +1271,13 @@ msgid "" "similar to ``locale.getpreferredencoding(False)`` but ignores the :ref:" "`Python UTF-8 Mode `." msgstr "" +"新增 :func:`locale.getencoding` 以取得當前的區域編碼 (locale encoding)。和 " +"``locale.getpreferredencoding(False)`` 類似但不考慮 :ref:`Python UTF-8 模式 " +"`。" #: ../../whatsnew/3.11.rst:852 msgid "logging" -msgstr "" +msgstr "logging" #: ../../whatsnew/3.11.rst:854 msgid "" @@ -1004,6 +1286,9 @@ msgid "" "`levels` (e.g. ``50``, by default). (Contributed by Andrei Kulakovin in :gh:" "`88024`.)" msgstr "" +"新增 :func:`~logging.getLevelNamesMapping` 以回傳一個日誌級別名稱(例如 " +"``'CRITICAL'``)指到對應的 :ref:`levels` 數值(例如,預設為 ``50``)的映射。" +"(由 Andrei Kulakovin 於 :gh:`88024` 中貢獻。)" #: ../../whatsnew/3.11.rst:859 msgid "" @@ -1013,6 +1298,11 @@ msgid "" "automatically during handler initialization and when emitting an event, if " "there is no active socket. (Contributed by Kirill Pinchuk in :gh:`88457`.)" msgstr "" +"添加了一個 :meth:`~logging.handlers.SysLogHandler.createSocket` 方法到 :" +"class:`~logging.handlers.SysLogHandler`,以匹配 :meth:`SocketHandler." +"createSocket() ` 。如果沒有已啟" +"用的 socket,它會在處理程式初始化期間和發出一個事件時自動呼叫。 (由 Kirill " +"Pinchuk 在 :gh:`88457` 中貢獻。)" #: ../../whatsnew/3.11.rst:871 msgid "math" @@ -1023,12 +1313,16 @@ msgid "" "Add :func:`math.exp2`: return 2 raised to the power of x. (Contributed by " "Gideon Mitchell in :issue:`45917`.)" msgstr "" +"新增 :func:`math.exp2`:回傳 2 的 x 次方。(由 Gideon Mitchell 於 :issue:" +"`45917` 中所貢獻。)" #: ../../whatsnew/3.11.rst:876 msgid "" "Add :func:`math.cbrt`: return the cube root of x. (Contributed by Ajith " "Ramachandran in :issue:`44357`.)" msgstr "" +"新增 :func:`math.cbrt`:回傳 x 的立方根。(由 Ajith Ramachandran 於 :issue:" +"`44357` 中所貢獻。)" #: ../../whatsnew/3.11.rst:879 msgid "" @@ -1038,12 +1332,18 @@ msgid "" "they raised :exc:`ValueError`. (Contributed by Mark Dickinson in :issue:" "`44339`.)" msgstr "" +"為了與 IEEE 754 規範保持一致,更改了兩個 :func:`math.pow` 邊角案例 (corner " +"case) 的行為。``math.pow(0.0, -math.inf)`` 和 ``math.pow(-0.0, -math.inf)`` " +"現在回傳 ``inf``,之前它們會引發 :exc:`ValueError`。(由 Mark Dickinson 在 :" +"issue:`44339` 中貢獻。)" #: ../../whatsnew/3.11.rst:885 msgid "" "The :data:`math.nan` value is now always available. (Contributed by Victor " "Stinner in :issue:`46917`.)" msgstr "" +":data:`math.nan` 現為隨時可用。(由 Victor Stinner 於 :issue:`46917` 中所貢" +"獻。)" #: ../../whatsnew/3.11.rst:892 msgid "operator" @@ -1055,6 +1355,8 @@ msgid "" "call(obj, *args, **kwargs) == obj(*args, **kwargs)``. (Contributed by Antony " "Lee in :issue:`44019`.)" msgstr "" +"新增 ``operator.call`` 函式,使得 ``operator.call(obj, *args, **kwargs) == " +"obj(*args, **kwargs)``。(由 Antony Lee 於 :issue:`44019` 中所貢獻。)" #: ../../whatsnew/3.11.rst:902 msgid "os" @@ -1066,6 +1368,8 @@ msgid "" "``CryptGenRandom()`` which is deprecated. (Contributed by Dong-hee Na in :" "issue:`44611`.)" msgstr "" +"在 Windows 上,:func:`os.urandom` 現在使用 ``BCryptGenRandom()`` 以取代被棄用" +"的 ``CryptGenRandom()``。(由 Dong-hee Na 於 :issue:`44611` 中所貢獻。)" #: ../../whatsnew/3.11.rst:912 msgid "pathlib" @@ -1078,6 +1382,9 @@ msgid "" "`~os.sep` or :data:`~os.altsep`. (Contributed by Eisuke Kawasima in :issue:" "`22276` and :issue:`33392`.)" msgstr "" +"如果 *pattern* 以路徑名稱元件分隔符號 :data:`~os.sep` 或 :data:`~os.altsep` " +"結尾,:meth:`~pathlib.Path.glob` 和 :meth:`~pathlib.Path.rglob` 只回傳目錄。" +"(由 Eisuke Kawasima 於 :issue:`22276` 與 :issue:`33392` 中所貢獻。)" #: ../../whatsnew/3.11.rst:923 msgid "re" @@ -1089,6 +1396,10 @@ msgid "" "+``, ``{m,n}+``) are now supported in regular expressions. (Contributed by " "Jeffrey C. Jacobs and Serhiy Storchaka in :issue:`433030`.)" msgstr "" +"現在規則運算式 (regular expression) 是有支援原子性群組 (atomic grouping) " +"(``(?>...)``) 和佔有性量詞 (possessive quantifier) (``*+``, ``++``, ``?+``, " +"``{m,n}+``) 的。 (由 Jeffrey C. Jacobs 和 Serhiy Storchaka 在 :issue:" +"`433030` 中貢獻。)" #: ../../whatsnew/3.11.rst:933 msgid "shutil" @@ -1099,6 +1410,8 @@ msgid "" "Add optional parameter *dir_fd* in :func:`shutil.rmtree`. (Contributed by " "Serhiy Storchaka in :issue:`46245`.)" msgstr "" +"新增 :func:`shutil.rmtree` 的可選參數 *dir_fd*。(由 Serhiy Storchaka 於 :" +"issue:`46245` 中所貢獻。)" #: ../../whatsnew/3.11.rst:942 msgid "socket" @@ -1109,6 +1422,8 @@ msgid "" "Add CAN Socket support for NetBSD. (Contributed by Thomas Klausner in :issue:" "`30512`.)" msgstr "" +"新增 NetBSD 對於 CAN Socket 的支援。(由 Thomas Klausner 於 :issue:`30512` 中" +"所貢獻。)" #: ../../whatsnew/3.11.rst:947 msgid "" @@ -1116,6 +1431,9 @@ msgid "" "to connect, an :exc:`ExceptionGroup` containing all errors instead of only " "raising the last error. (Contributed by Irit Katriel in :issue:`29980`.)" msgstr "" +"當連接失敗時,:meth:`~socket.create_connection` 有個選項可以引發一個包含所有" +"錯誤的 :exc:`ExceptionGroup`,而非只引發最後一個錯誤。(由 Irit Katriel 於 :" +"issue:`29980` 中貢獻。)" #: ../../whatsnew/3.11.rst:956 msgid "sqlite3" @@ -1127,6 +1445,9 @@ msgid "" "`~sqlite3.Connection.set_authorizer`. (Contributed by Erlend E. Aasland in :" "issue:`44491`.)" msgstr "" +"現在可以透過將 :const:`None` 傳遞給 :meth:`~sqlite3.Connection." +"set_authorizer` 來停用 authorizer。(由 Erlend E. Aasland 於 :issue:`44491` " +"中貢獻。)" #: ../../whatsnew/3.11.rst:962 msgid "" @@ -1135,6 +1456,10 @@ msgid "" "exc:`UnicodeEncodeError` instead of :exc:`sqlite3.ProgrammingError`. " "(Contributed by Erlend E. Aasland in :issue:`44688`.)" msgstr "" +"定序 (collation) 名稱 :meth:`~sqlite3.Connection.create_collation` 現在可以包" +"含任何 Unicode 字元。帶有無效字元的定序名稱現在會引發 :exc:" +"`UnicodeEncodeError` 而不是 :exc:`sqlite3.ProgrammingError`。(由 Erlend E. " +"Aasland 在 :issue:`44688` 中貢獻。)" #: ../../whatsnew/3.11.rst:967 msgid "" @@ -1143,6 +1468,10 @@ msgid "" "`~sqlite3.Error.sqlite_errorname`. (Contributed by Aviv Palivoda, Daniel " "Shahaf, and Erlend E. Aasland in :issue:`16379` and :issue:`24139`.)" msgstr "" +":mod:`sqlite3` 例外現在包含 SQLite 擴充錯誤碼和 SQLite 錯誤名稱(分別為 :" +"attr:`~sqlite3.Error.sqlite_errorcode` 和 :attr:`~sqlite3.Error." +"sqlite_errorname`)。(由 Aviv Palivoda、Daniel Shahaf 和 Erlend E. Aasland " +"在 :issue:`16379` 和 :issue:`24139` 中貢獻。)" #: ../../whatsnew/3.11.rst:973 msgid "" @@ -1151,6 +1480,9 @@ msgid "" "limits by connection basis. (Contributed by Erlend E. Aasland in :issue:" "`45243`.)" msgstr "" +"將 :meth:`~sqlite3.Connection.setlimit` 和 :meth:`~sqlite3.Connection." +"getlimit` 新增到 :class:`sqlite3.Connection` 以根據連線來設定和取得 SQLite 限" +"制。(由 Erlend E. Aasland 在 :issue:`45243` 中貢獻。)" #: ../../whatsnew/3.11.rst:978 msgid "" @@ -1158,6 +1490,9 @@ msgid "" "threading mode the underlying SQLite library has been compiled with. " "(Contributed by Erlend E. Aasland in :issue:`45613`.)" msgstr "" +":mod:`sqlite3` 現在會基於底層 SQLite 函式庫編譯時所使用的預設執行緒模式來設" +"定 :attr:`sqlite3.threadsafety`。(由 Erlend E. Aasland 在 :issue:`45613` 中" +"貢獻。)" #: ../../whatsnew/3.11.rst:982 msgid "" @@ -1166,6 +1501,10 @@ msgid "" "handler ` to improve their debug experience. " "(Contributed by Erlend E. Aasland in :issue:`45828`.)" msgstr "" +":mod:`sqlite3` 如果啟用回呼回溯 (callback traceback),C 回呼現在使用無法被引" +"發的例外。使用者現在可以註冊一個\\ :func:`無法被引發的掛鈎處理程式 " +"(unraisable hook handler) ` 來改善他們的除錯體驗。(由 " +"Erlend E. Aasland 在 :issue:`45828` 中貢獻。)" #: ../../whatsnew/3.11.rst:988 msgid "" @@ -1173,6 +1512,9 @@ msgid "" "Instead we leave it to the SQLite library to handle these cases. " "(Contributed by Erlend E. Aasland in :issue:`44092`.)" msgstr "" +"跨越不同回滾 (rollback) 的拿取動作不再引發 :exc:`~sqlite3.InterfaceError`,我" +"們將其留給 SQLite 函式庫來處理這些情況。(由 Erlend E. Aasland 在 :issue:" +"`44092` 中貢獻。)" #: ../../whatsnew/3.11.rst:992 msgid "" @@ -1181,6 +1523,9 @@ msgid "" "deserializing databases. (Contributed by Erlend E. Aasland in :issue:" "`41930`.)" msgstr "" +"將 :meth:`~sqlite3.Connection.serialize` 和 :meth:`~sqlite3.Connection." +"deserialize` 新增到 :class:`sqlite3.Connection` 以用於序列化和反序列化資料" +"庫。(由 Erlend E. Aasland 在 :issue:`41930` 中貢獻。)" #: ../../whatsnew/3.11.rst:997 msgid "" @@ -1188,6 +1533,9 @@ msgid "" "Connection` for creating aggregate window functions. (Contributed by Erlend " "E. Aasland in :issue:`34916`.)" msgstr "" +"於 :class:`sqlite3.Connection` 加入 :meth:`~sqlite3.Connection." +"create_window_function` 已建立聚合視窗函式 (aggregate window function)。(由 " +"Erlend E. Aasland 於 :issue:`34916` 中貢獻。)" #: ../../whatsnew/3.11.rst:1001 msgid "" @@ -1195,10 +1543,14 @@ msgid "" "class:`sqlite3.Blob` allows incremental I/O operations on blobs. " "(Contributed by Aviv Palivoda and Erlend E. Aasland in :issue:`24905`.)" msgstr "" +"在 :class:`sqlite3.Connection` 新增 :meth:`~sqlite3.Connection.blobopen`。 :" +"class:`sqlite3.Blob` 允許對 blob 進行增量 I/O 操作 (incremental I/O " +"operations)。(由 Aviv Palivoda 和 Erlend E. Aasland 在 :issue:`24905` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:1009 msgid "string" -msgstr "" +msgstr "string" #: ../../whatsnew/3.11.rst:1011 msgid "" @@ -1207,6 +1559,10 @@ msgid "" "placeholders, and whether any invalid placeholders are present. (Contributed " "by Ben Kehoe in :gh:`90465`.)" msgstr "" +"新增 :meth:`~string.Template.get_identifiers` 和 :meth:`~string.Template." +"is_valid` 於 :class:`string.Template`,分別能夠回傳所有合格的預留位置 " +"(placeholder) 與是否有任何不合格的預留位置存在。(由 Ben Kehoe 於 :gh:" +"`90465` 中貢獻。)" #: ../../whatsnew/3.11.rst:1021 msgid "sys" @@ -1220,6 +1576,9 @@ msgid "" "subsequent calls to :func:`!exc_info`. (Contributed by Irit Katriel in :" "issue:`45711`.)" msgstr "" +":func:`sys.exc_info` 現在從 ``value``\\ (例外實例)衍生出 ``type`` 和 " +"``traceback`` 欄位,因此當例外在處理過程中被修改時,變更會反映在 :func:`!" +"exc_info` 後續呼叫的結果中。 (由 Irit Katriel 在 :issue:`45711` 中貢獻。)" #: ../../whatsnew/3.11.rst:1029 msgid "" @@ -1227,12 +1586,17 @@ msgid "" "(equivalent to ``sys.exc_info()[1]``). (Contributed by Irit Katriel in :" "issue:`46328`.)" msgstr "" +"新增會回傳活躍例外實例 (active exception instance) 的 :func:`sys." +"exception`\\ (等價於 ``sys.exc_info()[1]``\\ )。(由 Irit Katriel 於 :" +"issue:`46328` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1033 msgid "" "Add the :data:`sys.flags.safe_path ` flag. (Contributed by Victor " "Stinner in :gh:`57684`.)" msgstr "" +"新增 :data:`sys.flags.safe_path ` 旗標。(由 Victor Stinner 於 :" +"gh:`57684` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1040 msgid "sysconfig" @@ -1251,10 +1615,17 @@ msgid "" "installation scheme to determine the paths, as does :mod:`venv`. " "(Contributed by Miro Hrončok in :issue:`45413`.)" msgstr "" +"新增了三個\\ :ref:`安裝方案 `\\ (*posix_venv*、" +"*nt_venv* 和 *venv*),它們在 Python 建立新的虛擬環境或在虛擬環境中運行時使" +"用。前兩個方案(*posix_venv* 和 *nt_venv*)是非 Windows 和 Windows 作業系統所" +"特有的,*venv* 本質上會根據 Python 運行的操作系統來做為其中之一的別名。這對修" +"改 :func:`sysconfig.get_preferred_scheme` 的下游發布者很有用。建立新虛擬環境" +"的第三方程式碼應該使用新的 *venv* 安裝方案來確定路徑,就像 :mod:`venv` 一樣。" +"(由 Miro Hrončok 在 :issue:`45413` 中貢獻。)" #: ../../whatsnew/3.11.rst:1059 msgid "tempfile" -msgstr "" +msgstr "tempfile" #: ../../whatsnew/3.11.rst:1061 msgid "" @@ -1264,6 +1635,10 @@ msgid "" "objects, such as compression modules. (Contributed by Carey Metcalfe in :gh:" "`70363`.)" msgstr "" +":class:`~tempfile.SpooledTemporaryFile` 物件現在完整實作了 :class:`io." +"BufferedIOBase` 或 :class:`io.TextIOBase` 的方法(取決於檔案模式),這使它們" +"能夠正確地使用需要類檔案物件的 API,例如壓縮模組。(由 Carey Metcalfe 在 :gh:" +"`70363` 中貢獻。)" #: ../../whatsnew/3.11.rst:1072 msgid "threading" @@ -1278,6 +1653,11 @@ msgid "" "affected by system clock changes. (Contributed by Victor Stinner in :issue:" "`41710`.)" msgstr "" +"在 Unix 上,如果 ``sem_clockwait()`` 函式在 C 函式庫(glibc 2.30 與其更新的版" +"本)中可被使用,則 :meth:`threading.Lock.acquire` 方法現在會使用單調時鐘 (:" +"data:`time. CLOCK_MONOTONIC`) 用於超時 (timeout),而不是使用系統時鐘 (:data:" +"`time.CLOCK_REALTIME`),以免受系統時鐘變化的影響。 由 Victor Stinner 在 :" +"issue:`41710` 中貢獻。)" #: ../../whatsnew/3.11.rst:1085 msgid "time" @@ -1291,6 +1671,10 @@ msgid "" "has a resolution of 1 microsecond (10\\ :sup:`-6` seconds). (Contributed by " "Benjamin Szőke and Victor Stinner in :issue:`21302`.)" msgstr "" +"在 Unix 上,如果可用的話,:func:`time.sleep` 現在會使用 " +"``clock_nanosleep()`` 或 ``nanosleep()`` 函式,其解析度為 1 納秒(10\\ :sup:" +"`-9` 秒),而不是使用解析度為 1 微秒(10\\ :sup:`-6` 秒)的 ``select()``。" +"(由 Benjamin Szőke 和 Victor Stinner 在 :issue:`21302` 中貢獻。)" #: ../../whatsnew/3.11.rst:1093 msgid "" @@ -1301,6 +1685,12 @@ msgid "" "1 millisecond (10\\ :sup:`-3` seconds). (Contributed by Benjamin Szőke, Dong-" "hee Na, Eryk Sun and Victor Stinner in :issue:`21302` and :issue:`45429`.)" msgstr "" +"在 Windows 8.1 或更新的平台上,:func:`time.sleep` 現在使用了一個基於\\ `高解" +"析度計時器 `_\\ 的可等待 (waitable) 計時器,解析度為 100 奈秒" +"(即 10\\ :sup:`-7` 秒)。在這之前,它只有 1 微秒(10\\ :sup:`-3` 秒) 的解析" +"度。(由 Benjamin Szőke、Dong-hee Na、Eryk Sun 和 Victor Stinner 於 :issue:" +"`21302` 與 :issue:`45429` 中貢獻。)" #: ../../whatsnew/3.11.rst:1104 msgid "tkinter" @@ -1312,6 +1702,9 @@ msgid "" "Tcl library as a named tuple similar to :data:`sys.version_info`. " "(Contributed by Serhiy Storchaka in :gh:`91827`.)" msgstr "" +"新增了 ``info_patchlevel()`` 方法,它會回傳 Tcl 函式庫的確切版本以作為類似" +"於 :data:`sys.version_info` 的附名元組。(由 Serhiy Storchaka 在 :gh:`91827` " +"中貢獻。)" #: ../../whatsnew/3.11.rst:1114 msgid "traceback" @@ -1323,6 +1716,8 @@ msgid "" "override which frames appear in the traceback, and how they are formatted. " "(Contributed by Ammar Askar in :issue:`44569`.)" msgstr "" +"新增 :func:`traceback.StackSummary.format_frame_summary` 以允許使用者覆蓋回溯" +"中出現的幀及它們的格式。(由 Ammar Askar 在 :issue:`44569` 中貢獻。)" #: ../../whatsnew/3.11.rst:1121 msgid "" @@ -1330,6 +1725,9 @@ msgid "" "exc:`~traceback.TracebackException` instance to a file. (Contributed by Irit " "Katriel in :issue:`33809`.)" msgstr "" +"新增 :func:`traceback.TracebackException.print`,它會印出格式化的 :exc:" +"`~traceback.TracebackException` 實例至一個檔案。(由 Irit Katriel 在 :issue:" +"`33809` 中貢獻。)" #: ../../whatsnew/3.11.rst:1129 msgid "typing" @@ -1337,7 +1735,7 @@ msgstr "typing" #: ../../whatsnew/3.11.rst:1131 msgid "For major changes, see :ref:`new-feat-related-type-hints-311`." -msgstr "" +msgstr "重大變更請見 :ref:`new-feat-related-type-hints-311`。" #: ../../whatsnew/3.11.rst:1133 msgid "" @@ -1346,6 +1744,9 @@ msgid "" "code is not reachable. At runtime, it raises an :exc:`AssertionError`. " "(Contributed by Jelle Zijlstra in :gh:`90633`.)" msgstr "" +"新增 :func:`typing.assert_never` 和 :class:`typing.Never`。 :func:`typing." +"assert_never` 可用於要型別檢查器確認某行程式碼是否不可觸及。在運行時間,它會" +"引發 :exc:`AssertionError`。(由 Jelle Zijlstra 在 :gh:`90633` 中貢獻。)" #: ../../whatsnew/3.11.rst:1139 msgid "" @@ -1353,6 +1754,9 @@ msgid "" "what type it has inferred for a given expression. At runtime it prints the " "type of the received value. (Contributed by Jelle Zijlstra in :gh:`90572`.)" msgstr "" +"新增 :func:`typing.reveal_type`,這可用於請求型別檢查器為給定運算式推斷出什麼" +"型別。在運行時間它會印出接收到的值的型別。(由 Jelle Zijlstra 在 :gh:`90572` " +"中貢獻。)" #: ../../whatsnew/3.11.rst:1144 msgid "" @@ -1361,18 +1765,25 @@ msgid "" "given type. At runtime it simply returns the received value. (Contributed by " "Jelle Zijlstra in :gh:`90638`.)" msgstr "" +"新增 :func:`typing.assert_type`,這可用於要型別檢查器確認它為給定運算式推斷的" +"型別是否與給定型別相符。在運行時間,它只會回傳接收到的值。(由 Jelle " +"Zijlstra 在 :gh:`90638` 中貢獻。)" #: ../../whatsnew/3.11.rst:1149 msgid "" ":data:`typing.TypedDict` types can now be generic. (Contributed by Samodya " "Abeysiriwardane in :gh:`89026`.)" msgstr "" +":data:`typing.TypedDict` 型別現可為泛型。(由 Samodya Abeysiriwardane 於 :gh:" +"`89026` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1152 msgid "" ":class:`~typing.NamedTuple` types can now be generic. (Contributed by Serhiy " "Storchaka in :issue:`43923`.)" msgstr "" +":class:`~typing.NamedTuple` 型別現可為泛型。(由 Serhiy Storchaka 於 :issue:" +"`43923` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1155 msgid "" @@ -1380,12 +1791,16 @@ msgid "" "checker errors related to highly dynamic class, such as mocks. (Contributed " "by Shantanu Jain in :gh:`91154`.)" msgstr "" +"允許繼承 :class:`typing.Any`,這能有效避免與高度動態類別(例如 mock)相關的型" +"別檢查器錯誤。(由 Shantanu Jain 在 :gh:`91154` 中貢獻。)" #: ../../whatsnew/3.11.rst:1159 msgid "" "The :func:`typing.final` decorator now sets the ``__final__`` attributed on " "the decorated object. (Contributed by Jelle Zijlstra in :gh:`90500`.)" msgstr "" +":func:`typing.final` 裝飾器現在會在被裝飾的物件上設定 ``__final__`` 屬性。" +"(由 Serhiy Storchaka 於 :gh:`90500` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1163 msgid "" @@ -1394,12 +1809,17 @@ msgid "" "all registered overloads of a function. (Contributed by Jelle Zijlstra in :" "gh:`89263`.)" msgstr "" +":func:`typing.get_overloads` 函式可用於自我檢查 (introspect) 一個函式的過載 " +"(overload)。:func:`typing.clear_overloads` 可用於清除一個函式的所有已註冊過" +"載。(由 Jelle Zijlstra 在 :gh:`89263` 中貢獻。)" #: ../../whatsnew/3.11.rst:1168 msgid "" "The :meth:`~object.__init__` method of :class:`~typing.Protocol` subclasses " "is now preserved. (Contributed by Adrian Garcia Badarasco in :gh:`88970`.)" msgstr "" +":class:`~typing.Protocol` 子類別的 :meth:`~object.__init__` 方法現在被保留。" +"(由 Adrian Garcia Badarasco 在 :gh:`88970` 中貢獻。)" #: ../../whatsnew/3.11.rst:1171 msgid "" @@ -1407,6 +1827,9 @@ msgid "" "affects introspection, e.g. ``get_args(Tuple[()])`` now evaluates to ``()`` " "instead of ``((),)``. (Contributed by Serhiy Storchaka in :gh:`91137`.)" msgstr "" +"空元組型別 (``Tuple[()]``) 的表示法得到簡化,這會影響自我檢查 " +"(introspection),例如 ``get_args(Tuple[()])`` 的求值現在會是 ``()`` 而不是 " +"``((),)``。(由 Serhiy Storchaka 在 :gh:`91137` 中貢獻。)" #: ../../whatsnew/3.11.rst:1176 msgid "" @@ -1414,6 +1837,8 @@ msgid "" "check in the private ``typing._type_check`` function. (Contributed by " "Gregory Beauregard in :gh:`90802`.)" msgstr "" +"通過刪除私有 ``typing._type_check`` 函式中的可呼叫檢查,放寬型別標註的運行時" +"間要求。(由 Gregory Beauregard 在 :gh:`90802` 中貢獻。)" #: ../../whatsnew/3.11.rst:1180 msgid "" @@ -1421,6 +1846,9 @@ msgid "" "references in :ref:`PEP 585 generic aliases `. " "(Contributed by Niklas Rosenstein in :gh:`85542`.)" msgstr "" +"作為\\ :ref:`PEP 585 泛化別名 `\\ 中的前向參照,:func:" +"`typing.get_type_hints` 現支援了為字串求值 (evaluate)。(由 Niklas " +"Rosenstein 在 :gh:`85542` 中貢獻。)" #: ../../whatsnew/3.11.rst:1184 msgid "" @@ -1428,6 +1856,8 @@ msgid "" "parameters with ``None`` as a default. (Contributed by Nikita Sobolev in :gh:" "`90353`.)" msgstr "" +":func:`typing.get_type_hints` 不再將 :data:`~typing.Optional` 新增到預設為 " +"``None`` 的參數中。(由 Nikita Sobolev 在 :gh:`90353` 中貢獻。)" #: ../../whatsnew/3.11.rst:1188 msgid "" @@ -1435,6 +1865,9 @@ msgid "" "`~typing.ClassVar` annotations. (Contributed by Gregory Beauregard in :gh:" "`90711`.)" msgstr "" +":func:`typing.get_type_hints` 現在支援為無修飾 (bare) 字串化 (stringified) " +"的 :data:`~typing.ClassVar` 標註來求值。(由 Gregory Beauregard 在 :gh:" +"`90711` 中貢獻。)" #: ../../whatsnew/3.11.rst:1192 msgid "" @@ -1442,6 +1875,8 @@ msgid "" "functions. It also now correctly marks classmethods as not to be type " "checked. (Contributed by Nikita Sobolev in :gh:`90729`.)" msgstr "" +":func:`typing.no_type_check` 不再修改外部類別和函式。它現在也正確地將類別方法" +"標記為不需進行型別檢查。(由 Nikita Sobolev 在 :gh:`90729` 中貢獻。)" #: ../../whatsnew/3.11.rst:1200 msgid "unicodedata" @@ -1452,6 +1887,8 @@ msgid "" "The Unicode database has been updated to version 14.0.0. (Contributed by " "Benjamin Peterson in :issue:`45190`)." msgstr "" +"Unicode 資料庫被更新為 14.0.0 版本。(Benjamin Peterson 於 :issue:`45190` 中" +"所貢獻。)" #: ../../whatsnew/3.11.rst:1209 msgid "unittest" @@ -1465,6 +1902,11 @@ msgid "" "`~unittest.IsolatedAsyncioTestCase` and function :func:`unittest." "enterModuleContext`. (Contributed by Serhiy Storchaka in :issue:`45046`.)" msgstr "" +"新增 :class:`~unittest.TestCase` 類別的 :meth:`~unittest.TestCase." +"enterContext` 與 :meth:`~unittest.TestCase.enterClassContext` 方法、 :class:" +"`~unittest.IsolatedAsyncioTestCase` 類別 的 :meth:`~unittest." +"IsolatedAsyncioTestCase.enterAsyncContext` 方法、:func:`unittest." +"enterModuleContext` 函式。(由 Serhiy Storchaka 於 :issue:`45046` 貢獻。)" #: ../../whatsnew/3.11.rst:1223 msgid "venv" @@ -1481,6 +1923,11 @@ msgid "" "environments should do the same. (Contributed by Miro Hrončok in :issue:" "`45413`.)" msgstr "" +"建立新的 Python 虛擬環境時,*venv* :ref:`sysconfig 安裝方案 " +"`\\ 會被用於確定環境內的路徑。當 Python 在虛擬環境中運行" +"時,預設使用相同的安裝方案。這意味著下游發布者可以在不改變虛擬環境行為的情況" +"下更改預設的 sysconfig 安裝方案。建立新虛擬環境的第三方程式碼也應該這樣做。" +"(由 Miro Hrončok 在 :issue:`45413` 中貢獻。)" #: ../../whatsnew/3.11.rst:1239 msgid "warnings" @@ -1493,6 +1940,9 @@ msgid "" "convert them to errors. (Contributed by Zac Hatfield-Dodds in :issue:" "`47074`.)" msgstr "" +":func:`warnings.catch_warnings` 現在接受 :func:`warnings.simplefilter` 的引" +"數,提供了一種更簡潔的方法來在本地端忽略警告或將它們轉換為錯誤。 (由 Zac " +"Hatfield-Dodds 在 :issue:`47074` 中貢獻。)" #: ../../whatsnew/3.11.rst:1249 msgid "zipfile" @@ -1504,12 +1954,17 @@ msgid "" "class:`~zipfile.ZipFile`'s directory and file headers. (Contributed by " "Stephen J. Turnbull and Serhiy Storchaka in :issue:`28080`.)" msgstr "" +"新增了對指定成員名稱編碼的支援,以便在 :class:`~zipfile.ZipFile` 的目錄和檔案" +"標頭中讀取元資料 (metadata)。(由 Stephen J. Turnbull 和 Serhiy Storchaka " +"在 :issue:`28080` 中貢獻。)" #: ../../whatsnew/3.11.rst:1255 msgid "" "Added :meth:`ZipFile.mkdir() ` for creating new " "directories inside ZIP archives. (Contributed by Sam Ezeh in :gh:`49083`.)" msgstr "" +"新增 :meth:`ZipFile.mkdir() ` 以在 ZIP 歸檔中建立新的" +"目錄。(由 Sam Ezeh 於 :gh:`49083` 貢獻。)" #: ../../whatsnew/3.11.rst:1259 msgid "" @@ -1517,24 +1972,33 @@ msgid "" "`~zipfile.Path.suffixes` to :class:`zipfile.Path`. (Contributed by Miguel " "Brito in :gh:`88261`.)" msgstr "" +"於 :class:`zipfile.Path` 新增 :attr:`~zipfile.Path.stem`、:attr:`~zipfile." +"Path.suffix` 和 :attr:`~zipfile.Path.suffixes`。(由 Miguel Brito 於 :gh:" +"`88261` 貢獻。)" #: ../../whatsnew/3.11.rst:1267 msgid "Optimizations" -msgstr "" +msgstr "最佳化" #: ../../whatsnew/3.11.rst:1269 msgid "" "This section covers specific optimizations independent of the :ref:" "`whatsnew311-faster-cpython` project, which is covered in its own section." msgstr "" +"這個部分會涵蓋到特定的最佳化,但獨立於擁有自己一個說明的\\ :ref:`whatsnew311-" +"faster-cpython` 計畫。" #: ../../whatsnew/3.11.rst:1272 msgid "" "The compiler now optimizes simple :ref:`printf-style % formatting ` on string literals containing only the format codes ``" -"%s``, ``%r`` and ``%a`` and makes it as fast as a corresponding :term:`f-" +"string-formatting>` on string literals containing only the format codes " +"``%s``, ``%r`` and ``%a`` and makes it as fast as a corresponding :term:`f-" "string` expression. (Contributed by Serhiy Storchaka in :issue:`28307`.)" msgstr "" +"編譯器現在對僅包含格式程式碼 ``%s``、``%r`` 和 ``%a`` 的字串文本 (string " +"literal) 進行簡單的 :ref:`printf 風格 % 格式化 (printf-style % formatting) " +"` 最佳化並使其與相應的 :term:`f-string` 運算式一樣快。" +"(由 Serhiy Storchaka 在 :issue:`28307` 中貢獻。)" #: ../../whatsnew/3.11.rst:1278 msgid "" @@ -1543,12 +2007,17 @@ msgid "" "smaller than ``2**30``. (Contributed by Gregory P. Smith and Tim Peters in :" "gh:`90564`.)" msgstr "" +"整數除法 (``//``) 為了編譯器最佳化而被調校過。現在將 :class:`int` 除以小於 " +"``2**30`` 的值時,在 x86-64 上快了大約 20%。(由 Gregory P. Smith 和 Tim " +"Peters 在 :gh:`90564` 中貢獻。)" #: ../../whatsnew/3.11.rst:1283 msgid "" ":func:`sum` is now nearly 30% faster for integers smaller than ``2**30``. " "(Contributed by Stefan Behnel in :gh:`68264`.)" msgstr "" +"針對小於 ``2**30`` 的整數,:func:`sum` 現在快了將近 30%。(由 Stefan Behnel " +"於 :gh:`68264` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1286 msgid "" @@ -1556,6 +2025,9 @@ msgid "" "append` by ≈15% and simple :term:`list comprehension`\\s by up to 20-30% " "(Contributed by Dennis Sweeney in :gh:`91165`.)" msgstr "" +"調整 list 大小在常見情況下增進了效能,為 :meth:`list.append` 加快了約 15% 並" +"為簡單的 :term:`list comprehension` 加快了高達 20-30%(由 Dennis Sweeney 在 :" +"gh:`91165` 中貢獻。)" #: ../../whatsnew/3.11.rst:1291 msgid "" @@ -1564,6 +2036,10 @@ msgid "" "fromkeys(\"abcdefg\"))`` is reduced from 352 bytes to 272 bytes (23% " "smaller) on 64-bit platforms. (Contributed by Inada Naoki in :issue:`46845`.)" msgstr "" +"當所有鍵都是 Unicode 物件時,字典不存儲雜湊值,減少了 :class:`dict` 的大小。" +"例如,``sys.getsizeof(dict.fromkeys(\"abcdefg\"))`` 在 64-bit 平台上從 352 位" +"元組減少到 272 位元組(減少 23%)。(由 Inada Naoki 在 :issue:`46845` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:1297 msgid "" @@ -1571,6 +2047,9 @@ msgid "" "when transferring large files over UDP, with speeds over 100 times higher " "for a ≈60 MiB file. (Contributed by msoxzw in :gh:`91487`.)" msgstr "" +"使用 :class:`asyncio.DatagramProtocol` 以透過 UDP 傳輸大文件時,現在速度提高" +"了幾個數量級,傳輸 ≈60 MiB 檔案的速度提高了 100 多倍。(由 msoxzw 在 :gh:" +"`91487` 中貢獻。)" #: ../../whatsnew/3.11.rst:1302 msgid "" @@ -1578,6 +2057,9 @@ msgid "" "times faster for large arguments (with a larger speedup for larger *k*). " "(Contributed by Serhiy Storchaka in :issue:`37295`.)" msgstr "" +":mod:`math` 函式 :func:`~math.comb` 和 :func:`~math.perm` 針對較大引數現在快" +"了 ≈10 倍(對於更大的 *k* 有更大的加速)。(由 Serhiy Storchaka 在 :issue:" +"`37295` 中貢獻。)" #: ../../whatsnew/3.11.rst:1306 msgid "" @@ -1587,16 +2069,22 @@ msgid "" "and can save substantial memory. (Contributed by Raymond Hettinger in :gh:" "`90415`.)" msgstr "" +":mod:`statistics` 函式 :func:`~statistics.mean`、:func:`~statistics." +"variance` 和 :func:`~statistics.stdev` 現在會一次性的消耗疊代器,而不是先將它" +"們轉換為 :class:`list`,這讓速度提升為兩倍並可以節省大量記憶體空間。(由 " +"Raymond Hettinger 在 :gh:`90415` 中貢獻。)" #: ../../whatsnew/3.11.rst:1312 msgid "" ":func:`unicodedata.normalize` now normalizes pure-ASCII strings in constant " "time. (Contributed by Dong-hee Na in :issue:`44987`.)" msgstr "" +":func:`unicodedata.normalize` 現在在常數時間內規範化 (normalize) 純 ASCII 字" +"串。(由 Dong-hee Na 在 :issue:`44987` 中貢獻。)" #: ../../whatsnew/3.11.rst:1320 msgid "Faster CPython" -msgstr "" +msgstr "更快的 CPython" #: ../../whatsnew/3.11.rst:1322 msgid "" @@ -1606,6 +2094,10 @@ msgid "" "and compiled with GCC on Ubuntu Linux. Depending on your workload, the " "speedup could be up to 10-60% faster." msgstr "" +"當使用基準量測套裝軟體 `pyperformance `_ 量測並以 GCC 於 Ubuntu Linux 上編譯,Python 3.11 平均比 " +"Python 3.10 `快了 25% `_。根據程式工作量可能有所不同,加速程度可能高達 10-60%。" #: ../../whatsnew/3.11.rst:1328 msgid "" @@ -1613,73 +2105,86 @@ msgid "" "runtime. Other optimizations not under this project are listed in " "`Optimizations`_." msgstr "" +"這個計畫著重於 Python 的兩個地方:更快的啟動 (faster startup) 與更快的運行程" +"式 (faster runtime)。其他不在此計畫的最佳化項目列於 `Optimizations`_。" #: ../../whatsnew/3.11.rst:1335 msgid "Faster Startup" -msgstr "" +msgstr "更快的啟動" #: ../../whatsnew/3.11.rst:1340 msgid "Frozen imports / Static code objects" -msgstr "" +msgstr "凍結引入 (Frozen imports) / 靜態程式碼物件 (Static code objects)" #: ../../whatsnew/3.11.rst:1342 msgid "" "Python caches bytecode in the :ref:`__pycache__` directory to " "speed up module loading." msgstr "" +"Python 將位元組碼於 :ref:`__pycache__` 目錄中存為快取來加速模組" +"的載入。" #: ../../whatsnew/3.11.rst:1345 msgid "Previously in 3.10, Python module execution looked like this:" -msgstr "" +msgstr "在先前的 3.10 中,執行 Python 模組會像是這樣:" #: ../../whatsnew/3.11.rst:1351 msgid "" -"In Python 3.11, the core modules essential for Python startup are \"frozen" -"\". This means that their code objects (and bytecode) are statically " +"In Python 3.11, the core modules essential for Python startup are " +"\"frozen\". This means that their code objects (and bytecode) are statically " "allocated by the interpreter. This reduces the steps in module execution " "process to this:" msgstr "" +"在 Python 3.11 中,核心模組在 Python 啟動時必須被「凍結」,這意味著它們的程式" +"碼物件(和位元組碼)是由直譯器靜態分配的。這將模組執行過程中的步驟減少為:" #: ../../whatsnew/3.11.rst:1359 msgid "" "Interpreter startup is now 10-15% faster in Python 3.11. This has a big " "impact for short-running programs using Python." msgstr "" +"在 Python 3.11 中直譯器啟動速度快了 10-15%。這對於使用 Python 所撰寫的短暫程" +"式有著巨大影響。" #: ../../whatsnew/3.11.rst:1362 msgid "" "(Contributed by Eric Snow, Guido van Rossum and Kumar Aditya in numerous " "issues.)" msgstr "" +"(由 Eric Snow、Guido van Rossum 與 Kumar Aditya 於多個 issue 中貢獻。)" #: ../../whatsnew/3.11.rst:1368 msgid "Faster Runtime" -msgstr "" +msgstr "更快的運行程式" #: ../../whatsnew/3.11.rst:1373 msgid "Cheaper, lazy Python frames" -msgstr "" +msgstr "所需資源更少 (cheaper) 且惰性的 (lazy)) Python 幀 (frame)" #: ../../whatsnew/3.11.rst:1375 msgid "" "Python frames are created whenever Python calls a Python function. This " "frame holds execution information. The following are new frame optimizations:" msgstr "" +"每當 Python 呼叫 Python 函數時,就會建立 Python 幀。該幀保存執行資訊。以下是" +"針對幀而做的新最佳化:" #: ../../whatsnew/3.11.rst:1378 msgid "Streamlined the frame creation process." -msgstr "" +msgstr "使幀的建立過程更有效率。" #: ../../whatsnew/3.11.rst:1379 msgid "" "Avoided memory allocation by generously re-using frame space on the C stack." -msgstr "" +msgstr "在 C 堆疊 (stack) 中盡量重複利用幀的空間來避免記憶體分配。" #: ../../whatsnew/3.11.rst:1380 msgid "" "Streamlined the internal frame struct to contain only essential information. " "Frames previously held extra debugging and memory management information." msgstr "" +"讓內部幀結構只包含必要資訊,使其更加精簡。在過去,幀必須帶有額外的偵錯與記憶" +"體管理的資訊。" #: ../../whatsnew/3.11.rst:1383 msgid "" @@ -1689,14 +2194,18 @@ msgid "" "a result, nearly all Python functions calls have sped up significantly. We " "measured a 3-7% speedup in pyperformance." msgstr "" +"舊式幀物件現在僅在除錯器或 Python 自我檢查函式(例如 ``sys._getframe`` 或 " +"``inspect.currentframe``)請求時才建立。對於大多數使用者程式碼,根本不會建立" +"任何幀物件。結果幾乎所有 Python 函式呼叫都顯著加速。我們以 pyperformance 測得" +"了 3-7% 的加速。" #: ../../whatsnew/3.11.rst:1389 msgid "(Contributed by Mark Shannon in :issue:`44590`.)" -msgstr "" +msgstr "(由 Mark Shannon 於 :issue:`44590` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1396 msgid "Inlined Python function calls" -msgstr "" +msgstr "行內 Python 函式呼叫" #: ../../whatsnew/3.11.rst:1398 msgid "" @@ -1704,6 +2213,8 @@ msgid "" "interpret that function's code. This effectively limits pure Python " "recursion to what's safe for the C stack." msgstr "" +"在 Python 函式呼叫期間,Python 將呼叫一個正在求值的 C 函式來直譯該函式的程式" +"碼,這有效地將純 Python 遞迴限制在對 C 堆疊的安全範圍內。" #: ../../whatsnew/3.11.rst:1402 msgid "" @@ -1711,6 +2222,9 @@ msgid "" "it sets up a new frame, and \"jumps\" to the new code inside the new frame. " "This avoids calling the C interpreting function altogether." msgstr "" +"在 3.11 中,當 CPython 檢測到 Python 程式碼呼叫另一個 Python 函式時,它會設立" +"一個新框架 (frame),並「跳轉」到新框架內的新程式碼,這避免了呼叫整個 C 直譯函" +"式。" #: ../../whatsnew/3.11.rst:1406 msgid "" @@ -1720,14 +2234,18 @@ msgid "" "significantly deeper (if the user increases the recursion limit). We " "measured a 1-3% improvement in pyperformance." msgstr "" +"現在大多數 Python 函式的呼叫不會佔用 C 堆疊空間,這加快了大多數此類呼叫的速" +"度。在斐波那契 (fibonacci) 或階乘等簡單遞迴函式中,觀察到 1.7 倍的加速。這也" +"意味著遞迴函式可以遞迴得更深(如果使用者有增加遞迴限制)。我們在 " +"pyperformance 測得 1-3% 的改進。" #: ../../whatsnew/3.11.rst:1412 msgid "(Contributed by Pablo Galindo and Mark Shannon in :issue:`45256`.)" -msgstr "" +msgstr "(由 Pablo Galindo 與 Mark Shannon 於 :issue:`45256` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1418 msgid "PEP 659: Specializing Adaptive Interpreter" -msgstr "" +msgstr "PEP 659:特化的適應性直譯器" #: ../../whatsnew/3.11.rst:1420 msgid "" @@ -1736,6 +2254,9 @@ msgid "" "regions where objects and types rarely change. This concept is known as " "*type stability*." msgstr "" +":pep:`659` 是加速 CPython 專案的關鍵部分之一。一般的想法是,雖然 Python 是一" +"種動態語言,但大多數程式碼都有物件和型別很少去更改的區域。這個概念被稱為\\ *" +"型別穩定 (type stability)*\\ 。" #: ../../whatsnew/3.11.rst:1424 msgid "" @@ -1747,12 +2268,19 @@ msgid "" "where Python caches the results of expensive operations directly in the " "bytecode." msgstr "" +"在運行時間,Python 將嘗試在執行中的程式碼內尋找常用模式和型別穩定,然後 " +"Python 將用更特化的操作替換當前操作。這種特化操作運用了僅適用於那些用例/型別" +"的快速路徑,這通常優於它們的泛用對應 (generic counterparts)。這也引入了另一個" +"稱為\\ *行內快取 (inline caching)*\\ 的概念,其中 Python 將繁重操作的結果直接" +"快取在位元組碼中。" #: ../../whatsnew/3.11.rst:1431 msgid "" "The specializer will also combine certain common instruction pairs into one " "superinstruction. This reduces the overhead during execution." msgstr "" +"特化程式 (specializer) 還將某些常用指示 (common instruction) 組合成一個超級指" +"示 (superinstruction),這減少了執行期間的開銷。" #: ../../whatsnew/3.11.rst:1434 msgid "" @@ -1763,6 +2291,10 @@ msgid "" "attempts are not too expensive. This allows specialization to adapt to new " "circumstances." msgstr "" +"Python 只會在看到「熱」(被多次執行的)程式碼時特化,這可以防止 Python 將時間" +"浪費在只運行一次的程式碼上。當程式碼過於動態或用途發生變化時,Python 也可以去" +"特化 (de-specialize)。特化會定期被嘗試執行,而嘗試的成本也不會太高,這讓特化" +"得以適應新的環境。" #: ../../whatsnew/3.11.rst:1441 msgid "" @@ -1770,30 +2302,33 @@ msgid "" "pep:`659` for more information. Implementation by Mark Shannon and Brandt " "Bucher, with additional help from Irit Katriel and Dennis Sweeney.)" msgstr "" +"(PEP 由 Mark Shannon 撰寫、概念啟發自 Stefan Brunthaler。詳情請見 :pep:" +"`659`。由 Mark Shannon 和 Brandt Bucher 實作,Irit Katriel 和 Dennis Sweeney " +"亦提供了額外的幫助。)" #: ../../whatsnew/3.11.rst:1449 msgid "Operation" -msgstr "" +msgstr "操作" #: ../../whatsnew/3.11.rst:1449 msgid "Form" -msgstr "" +msgstr "形式" #: ../../whatsnew/3.11.rst:1449 msgid "Specialization" -msgstr "" +msgstr "特化" #: ../../whatsnew/3.11.rst:1449 msgid "Operation speedup (up to)" -msgstr "" +msgstr "操作加速程度(上限)" #: ../../whatsnew/3.11.rst:1449 msgid "Contributor(s)" -msgstr "" +msgstr "貢獻者" #: ../../whatsnew/3.11.rst:1452 msgid "Binary operations" -msgstr "" +msgstr "二元操作" #: ../../whatsnew/3.11.rst:1452 msgid "``x+x; x*x; x-x;``" @@ -1804,6 +2339,8 @@ msgid "" "Binary add, multiply and subtract for common types such as ``int``, " "``float``, and ``str`` take custom fast paths for their underlying types." msgstr "" +"常見型別如 ``int``、``float`` 與 ``str`` 的二元加法、乘法與減法,為底層型別採" +"取了特製的快速路徑。" #: ../../whatsnew/3.11.rst:1452 msgid "10%" @@ -1811,11 +2348,11 @@ msgstr "10%" #: ../../whatsnew/3.11.rst:1452 msgid "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" -msgstr "" +msgstr "Mark Shannon, Dong-hee Na, Brandt Bucher, Dennis Sweeney" #: ../../whatsnew/3.11.rst:1457 msgid "Subscript" -msgstr "" +msgstr "下標" #: ../../whatsnew/3.11.rst:1457 msgid "``a[i]``" @@ -1826,12 +2363,13 @@ msgid "" "Subscripting container types such as ``list``, ``tuple`` and ``dict`` " "directly index the underlying data structures." msgstr "" +"下標容器型別如 ``list``、``tuple`` 和 ``dict`` 直接索引底層的資料結構。" #: ../../whatsnew/3.11.rst:1461 msgid "" "Subscripting custom ``__getitem__`` is also inlined similar to :ref:`inline-" "calls`." -msgstr "" +msgstr "下標自定義 ``__getitem__`` 也是行內的,類似於 :ref:`inline-calls`。" #: ../../whatsnew/3.11.rst:1457 ../../whatsnew/3.11.rst:1464 msgid "10-25%" @@ -1843,7 +2381,7 @@ msgstr "Irit Katriel, Mark Shannon" #: ../../whatsnew/3.11.rst:1464 msgid "Store subscript" -msgstr "" +msgstr "儲存下標" #: ../../whatsnew/3.11.rst:1464 msgid "``a[i] = z``" @@ -1851,7 +2389,7 @@ msgstr "``a[i] = z``" #: ../../whatsnew/3.11.rst:1464 msgid "Similar to subscripting specialization above." -msgstr "" +msgstr "類似於上面的下標特化。" #: ../../whatsnew/3.11.rst:1464 msgid "Dennis Sweeney" @@ -1859,7 +2397,7 @@ msgstr "Dennis Sweeney" #: ../../whatsnew/3.11.rst:1467 msgid "Calls" -msgstr "" +msgstr "呼叫" #: ../../whatsnew/3.11.rst:1467 msgid "``f(arg)`` ``C(arg)``" @@ -1871,6 +2409,8 @@ msgid "" "directly call their underlying C version. This avoids going through the " "internal calling convention." msgstr "" +"常見內建 (C) 函式和型別的呼叫,例如 ``len`` 和 ``str``,會直接呼叫它們的 C 版" +"本底層,這避免了通過內部呼叫的慣例。" #: ../../whatsnew/3.11.rst:1467 msgid "20%" @@ -1882,7 +2422,7 @@ msgstr "Mark Shannon, Ken Jin" #: ../../whatsnew/3.11.rst:1473 msgid "Load global variable" -msgstr "" +msgstr "載入全域變數" #: ../../whatsnew/3.11.rst:1473 msgid "``print`` ``len``" @@ -1893,6 +2433,8 @@ msgid "" "The object's index in the globals/builtins namespace is cached. Loading " "globals and builtins require zero namespace lookups." msgstr "" +"全域/內建之命名空間內的物件索引被快取起來。載入全域與內建變數不需要任何命名空" +"間的查找。" #: ../../whatsnew/3.11.rst:1473 msgid "[1]_" @@ -1905,7 +2447,7 @@ msgstr "Mark Shannon" #: ../../whatsnew/3.11.rst:1477 msgid "Load attribute" -msgstr "" +msgstr "載入屬性" #: ../../whatsnew/3.11.rst:1477 msgid "``o.attr``" @@ -1917,6 +2459,8 @@ msgid "" "object's namespace is cached. In most cases, attribute loading will require " "zero namespace lookups." msgstr "" +"和載入全域變數類似,類別/物件之命名空間內的屬性索引被快取起來。在大部分情況" +"中,載入屬性不需要任何命名空間的查找。" #: ../../whatsnew/3.11.rst:1477 msgid "[2]_" @@ -1924,7 +2468,7 @@ msgstr "[2]_" #: ../../whatsnew/3.11.rst:1482 msgid "Load methods for call" -msgstr "" +msgstr "載入要呼叫的方法" #: ../../whatsnew/3.11.rst:1482 msgid "``o.meth()``" @@ -1935,6 +2479,8 @@ msgid "" "The actual address of the method is cached. Method loading now has no " "namespace lookups -- even for classes with long inheritance chains." msgstr "" +"方法的真實記憶體地址被快取 (cache) 起來,方法的載入現在不需要命名空間的查找 " +"-- 即便有很長繼承鏈結的類別也是。" #: ../../whatsnew/3.11.rst:1482 msgid "10-20%" @@ -1946,7 +2492,7 @@ msgstr "Ken Jin, Mark Shannon" #: ../../whatsnew/3.11.rst:1486 msgid "Store attribute" -msgstr "" +msgstr "儲存屬性" #: ../../whatsnew/3.11.rst:1486 msgid "``o.attr = z``" @@ -1954,15 +2500,15 @@ msgstr "``o.attr = z``" #: ../../whatsnew/3.11.rst:1486 msgid "Similar to load attribute optimization." -msgstr "" +msgstr "和載入屬性的最佳化相似。" #: ../../whatsnew/3.11.rst:1486 msgid "2% in pyperformance" -msgstr "" +msgstr "2% 於 pyperformance 中" #: ../../whatsnew/3.11.rst:1489 msgid "Unpack Sequence" -msgstr "" +msgstr "拆解 (unpack) 序列" #: ../../whatsnew/3.11.rst:1489 msgid "``*seq``" @@ -1972,7 +2518,7 @@ msgstr "``*seq``" msgid "" "Specialized for common containers such as ``list`` and ``tuple``. Avoids " "internal calling convention." -msgstr "" +msgstr "為像是 ``list`` 和 ``tuple`` 的常見容器所特化,避免了內部呼叫慣例。" #: ../../whatsnew/3.11.rst:1489 msgid "8%" @@ -1980,13 +2526,15 @@ msgstr "8%" #: ../../whatsnew/3.11.rst:1489 msgid "Brandt Bucher" -msgstr "" +msgstr "Brandt Bucher" #: ../../whatsnew/3.11.rst:1493 msgid "" "A similar optimization already existed since Python 3.8. 3.11 specializes " "for more forms and reduces some overhead." msgstr "" +"類似的最佳化自從 Python 3.8 就存在。3.11 特別處理了更多形式並減少效能開銷 " +"(overhead)。" #: ../../whatsnew/3.11.rst:1496 msgid "" @@ -1994,10 +2542,12 @@ msgid "" "for more forms. Furthermore, all attribute loads should be sped up by :issue:" "`45947`." msgstr "" +"類似的最佳化自從 Python 3.10 就存在。3.11 特別處理了更多形式。此外,所有屬性" +"載入也被 :issue:`45947` 所加速。" #: ../../whatsnew/3.11.rst:1504 msgid "Misc" -msgstr "" +msgstr "雜項" #: ../../whatsnew/3.11.rst:1506 msgid "" @@ -2005,6 +2555,9 @@ msgid "" "Their namespace dictionaries now also share keys more freely. (Contributed " "Mark Shannon in :issue:`45340` and :issue:`40116`.)" msgstr "" +"物件現在因為使用了惰性建立的物件命名空間所以需要更少的記憶體。它們的命名空間" +"字典現在也更自由地共享鍵。(由 Mark Shannon 於 :issue:`45340` 和 :issue:" +"`40116` 貢獻。 )" #: ../../whatsnew/3.11.rst:1510 msgid "" @@ -2012,14 +2565,16 @@ msgid "" "time required for catching an exception by about 10%. (Contributed by Irit " "Katriel in :issue:`45711`.)" msgstr "" +"在直譯器內使用更簡潔的例外表示法將捕獲一個例外所需的時間減少了大約 10%。 由 " +"Irit Katriel 在 :issue:`45711` 中貢獻。)" #: ../../whatsnew/3.11.rst:1518 msgid "FAQ" -msgstr "" +msgstr "FAQ" #: ../../whatsnew/3.11.rst:1520 msgid "Q: How should I write my code to utilize these speedups?" -msgstr "" +msgstr "問:我該如何在程式碼中獲取這些加速?" #: ../../whatsnew/3.11.rst:1524 msgid "" @@ -2027,10 +2582,13 @@ msgid "" "common best practices. The Faster CPython project optimizes for common code " "patterns we observe." msgstr "" +"答:你不需要改變你的程式碼。撰寫符合 Python 風格 (Pythonic) 且依循常見最佳實" +"踐的程式碼就好。CPython 加速計畫中,我們為所觀察到的常見程式編寫模式來做最佳" +"化。" #: ../../whatsnew/3.11.rst:1527 msgid "Q: Will CPython 3.11 use more memory?" -msgstr "" +msgstr "問:Python 3.11 會不會使用更多記憶體?" #: ../../whatsnew/3.11.rst:1531 msgid "" @@ -2038,10 +2596,12 @@ msgid "" "is offset by memory optimizations for frame objects and object dictionaries " "as mentioned above." msgstr "" +"答:也許不會。我們預期不會有超出 3.10 20% 的記憶體使用量。這數字會和上述禎物" +"件與物件字典的記憶體最佳化而有所偏差。" #: ../../whatsnew/3.11.rst:1534 msgid "Q: I don't see any speedups in my workload. Why?" -msgstr "" +msgstr "問:我在我的程式當中沒感覺到任何加速,為什麼?" #: ../../whatsnew/3.11.rst:1539 msgid "" @@ -2050,6 +2610,9 @@ msgid "" "extension library like numpy, there won't be significant speedup. This " "project currently benefits pure-Python workloads the most." msgstr "" +"答:某些程式中不會有顯著的好處。如果你的程式花了大部分的時間在 I/O 操作上,或" +"已經將大部分計算用像是 numpy 的 C 擴充函式庫處理,那就不會有明顯的加速。這個" +"計畫是對純 Python 的工作負荷最有幫助。" #: ../../whatsnew/3.11.rst:1543 msgid "" @@ -2057,18 +2620,20 @@ msgid "" "pyperformance benchmarks, certain benchmarks have slowed down slightly, " "while others have sped up by nearly 2x!" msgstr "" +"此外,pyperformance 數值為一個幾何平均數 (geometric mean)。即便在 " +"pyperformance 基準量測中,某些測試稍微慢了一些,但其他加快了將近兩倍!" #: ../../whatsnew/3.11.rst:1546 msgid "Q: Is there a JIT compiler?" -msgstr "" +msgstr "問:有用到 JIT 編譯器嗎?" #: ../../whatsnew/3.11.rst:1548 msgid "A: No. We're still exploring other optimizations." -msgstr "" +msgstr "答:沒有,我們還在探索其他最佳化方式。" #: ../../whatsnew/3.11.rst:1554 msgid "About" -msgstr "" +msgstr "關於" #: ../../whatsnew/3.11.rst:1556 msgid "" @@ -2077,10 +2642,13 @@ msgid "" "funded by Bloomberg LP to work on the project part-time. Finally, many " "contributors are volunteers from the community." msgstr "" +"CPython 加速計畫探索了各種 :term:`CPython` 最佳化的可能性。主要團隊由微軟 " +"(microsoft) 所資助以全職發展該計畫,Pablo Galindo Salgado 亦由彭博有限合夥企" +"業 (Bloomberg LP) 資助來兼職開發,更有許許多多來自社群的自發性貢獻者。" #: ../../whatsnew/3.11.rst:1565 msgid "CPython bytecode changes" -msgstr "" +msgstr "CPython 位元組碼 (bytecode) 變更" #: ../../whatsnew/3.11.rst:1567 msgid "" @@ -2091,32 +2659,40 @@ msgid "" "care should be taken when reading or modifying raw, adaptive bytecode " "containing quickened data." msgstr "" +"位元組碼現在包含行內快取條目,它們採用新添加的 :opcode:`CACHE` 指示的形式。許" +"多操作碼預期後面要有確切數量的快取,並指示直譯器在運行時跳過它們。傳遞的 " +"(populated) 快取看起來像任意指示,因此在讀取或修改包含加速資料的原始且適應 " +"(adaptive) 位元組碼時應格外小心。" #: ../../whatsnew/3.11.rst:1579 msgid "New opcodes" -msgstr "" +msgstr "新增 opcode" #: ../../whatsnew/3.11.rst:1581 msgid "" ":opcode:`ASYNC_GEN_WRAP`, :opcode:`RETURN_GENERATOR` and :opcode:`SEND`, " "used in generators and co-routines." msgstr "" +":opcode:`ASYNC_GEN_WRAP`、:opcode:`RETURN_GENERATOR` 和 :opcode:`SEND` 被用於" +"產生器與協程。" #: ../../whatsnew/3.11.rst:1584 msgid "" ":opcode:`COPY_FREE_VARS`, which avoids needing special caller-side code for " "closures." msgstr "" +":opcode:`COPY_FREE_VARS`,避免了為閉包 (closure) 而生的特殊呼叫方 (caller-" +"side) 程式碼的需求。" #: ../../whatsnew/3.11.rst:1587 msgid "" ":opcode:`JUMP_BACKWARD_NO_INTERRUPT`, for use in certain loops where " "handling interrupts is undesirable." -msgstr "" +msgstr ":opcode:`JUMP_BACKWARD_NO_INTERRUPT`,用於某些不需要處理中斷的循環。" #: ../../whatsnew/3.11.rst:1590 msgid ":opcode:`MAKE_CELL`, to create :ref:`cell-objects`." -msgstr "" +msgstr ":opcode:`MAKE_CELL` 被用於建立 :ref:`cell-objects`。" #: ../../whatsnew/3.11.rst:1592 msgid "" @@ -2124,176 +2700,182 @@ msgid "" "ref:`new exception groups and except* ` added in :pep:" "`654`." msgstr "" +":opcode:`CHECK_EG_MATCH` 和 :opcode:`PREP_RERAISE_STAR`,處理 :pep:`654` 所加" +"入的\\ :ref:`新增例外群組和 except* `。" #: ../../whatsnew/3.11.rst:1596 msgid ":opcode:`PUSH_EXC_INFO`, for use in exception handlers." -msgstr "" +msgstr ":opcode:`PUSH_EXC_INFO` 被用於例外處理函式。" #: ../../whatsnew/3.11.rst:1598 msgid "" ":opcode:`RESUME`, a no-op, for internal tracing, debugging and optimization " "checks." -msgstr "" +msgstr ":opcode:`RESUME`,為無操作 (no-po),用於內部追查、除錯和最佳化檢查。" #: ../../whatsnew/3.11.rst:1605 msgid "Replaced opcodes" -msgstr "" +msgstr "被取代的操作碼 (opcode)" #: ../../whatsnew/3.11.rst:1608 msgid "Replaced Opcode(s)" -msgstr "" +msgstr "被取代的操作碼" #: ../../whatsnew/3.11.rst:1608 msgid "New Opcode(s)" -msgstr "" +msgstr "新的操作碼" #: ../../whatsnew/3.11.rst:1608 msgid "Notes" -msgstr "" +msgstr "註記" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!BINARY_*`" -msgstr "" +msgstr ":opcode:`!BINARY_*`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!INPLACE_*`" -msgstr "" +msgstr ":opcode:`!INPLACE_*`" #: ../../whatsnew/3.11.rst:1610 msgid ":opcode:`BINARY_OP`" -msgstr "" +msgstr ":opcode:`BINARY_OP`" #: ../../whatsnew/3.11.rst:1610 msgid "Replaced all numeric binary/in-place opcodes with a single opcode" -msgstr "" +msgstr "以單一一個操作碼來取代所有數值的、二進位/原位 (in-place) 操作碼" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!CALL_FUNCTION`" -msgstr "" +msgstr ":opcode:`!CALL_FUNCTION`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!CALL_FUNCTION_KW`" -msgstr "" +msgstr ":opcode:`!CALL_FUNCTION_KW`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!CALL_METHOD`" -msgstr "" +msgstr ":opcode:`!CALL_METHOD`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`CALL`" -msgstr "" +msgstr ":opcode:`CALL`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`KW_NAMES`" -msgstr "" +msgstr ":opcode:`KW_NAMES`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`PRECALL`" -msgstr "" +msgstr ":opcode:`PRECALL`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`PUSH_NULL`" -msgstr "" +msgstr ":opcode:`PUSH_NULL`" #: ../../whatsnew/3.11.rst:1613 msgid "" "Decouples argument shifting for methods from handling of keyword arguments; " "allows better specialization of calls" msgstr "" +"將方法的引數搬移 (argument shifting) 與關鍵字引數的處理分離開來;允許更好的呼" +"叫特化" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!DUP_TOP`" -msgstr "" +msgstr ":opcode:`!DUP_TOP`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!DUP_TOP_TWO`" -msgstr "" +msgstr ":opcode:`!DUP_TOP_TWO`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!ROT_TWO`" -msgstr "" +msgstr ":opcode:`!ROT_TWO`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!ROT_THREE`" -msgstr "" +msgstr ":opcode:`!ROT_THREE`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!ROT_FOUR`" -msgstr "" +msgstr ":opcode:`!ROT_FOUR`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!ROT_N`" -msgstr "" +msgstr ":opcode:`!ROT_N`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`COPY`" -msgstr "" +msgstr ":opcode:`COPY`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`SWAP`" -msgstr "" +msgstr ":opcode:`SWAP`" #: ../../whatsnew/3.11.rst:1618 msgid "Stack manipulation instructions" -msgstr "" +msgstr "堆疊操作指示" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!JUMP_IF_NOT_EXC_MATCH`" -msgstr "" +msgstr ":opcode:`!JUMP_IF_NOT_EXC_MATCH`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`CHECK_EXC_MATCH`" -msgstr "" +msgstr ":opcode:`CHECK_EXC_MATCH`" #: ../../whatsnew/3.11.rst:1625 msgid "Now performs check but doesn't jump" -msgstr "" +msgstr "現在執行檢查但不跳位 (jump)" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!JUMP_ABSOLUTE`" -msgstr "" +msgstr ":opcode:`!JUMP_ABSOLUTE`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!POP_JUMP_IF_FALSE`" -msgstr "" +msgstr ":opcode:`!POP_JUMP_IF_FALSE`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!POP_JUMP_IF_TRUE`" -msgstr "" +msgstr ":opcode:`!POP_JUMP_IF_TRUE`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`JUMP_BACKWARD`" -msgstr "" +msgstr ":opcode:`JUMP_BACKWARD`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`POP_JUMP_BACKWARD_IF_* `" -msgstr "" +msgstr ":opcode:`POP_JUMP_BACKWARD_IF_* `" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`POP_JUMP_FORWARD_IF_* `" -msgstr "" +msgstr ":opcode:`POP_JUMP_FORWARD_IF_* `" #: ../../whatsnew/3.11.rst:1627 msgid "" "See [#bytecode-jump]_; ``TRUE``, ``FALSE``, ``NONE`` and ``NOT_NONE`` " "variants for each direction" msgstr "" +"參見 [#bytecode-jump]_;每個方向的 ``TRUE``、``FALSE``、``NONE`` 和 " +"``NOT_NONE`` 變體" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!SETUP_WITH`" -msgstr "" +msgstr ":opcode:`!SETUP_WITH`" #: ../../whatsnew/3.11.rst:0 msgid ":opcode:`!SETUP_ASYNC_WITH`" -msgstr "" +msgstr ":opcode:`!SETUP_ASYNC_WITH`" #: ../../whatsnew/3.11.rst:1633 msgid ":opcode:`BEFORE_WITH`" -msgstr "" +msgstr ":opcode:`BEFORE_WITH`" #: ../../whatsnew/3.11.rst:1633 msgid ":keyword:`with` block setup" -msgstr "" +msgstr ":keyword:`with` 區塊設置" #: ../../whatsnew/3.11.rst:1637 msgid "" @@ -2301,10 +2883,13 @@ msgid "" "`JUMP_IF_TRUE_OR_POP` and :opcode:`JUMP_IF_FALSE_OR_POP`. The argument is " "now an offset from the current instruction rather than an absolute location." msgstr "" +"所有跳位操作碼 (jump opcode) 現在都是相對的,包括現有的 :opcode:" +"`JUMP_IF_TRUE_OR_POP` 和 :opcode:`JUMP_IF_FALSE_OR_POP`。該引數現在是當前指" +"示 (instruction) 的偏移量而不是絕對位置。" #: ../../whatsnew/3.11.rst:1648 msgid "Changed/removed opcodes" -msgstr "" +msgstr "有更動/被移除的 opcode" #: ../../whatsnew/3.11.rst:1650 msgid "" @@ -2312,37 +2897,44 @@ msgid "" "additional boolean value to indicate success/failure. Instead, ``None`` is " "pushed on failure in place of the tuple of extracted values." msgstr "" +"更改了 :opcode:`MATCH_CLASS` 和 :opcode:`MATCH_KEYS` ,不再推送一個額外的布林" +"值來表示成功/失敗。取而代之的是會在失敗時推送 ``None``,而非一個包含提取值的" +"元組。" #: ../../whatsnew/3.11.rst:1655 msgid "" "Changed opcodes that work with exceptions to reflect them now being " "represented as one item on the stack instead of three (see :gh:`89874`)." msgstr "" +"更改了運作於例外的操作碼以反映它們現在在堆疊中的表示為一項而不是三項(請參" +"閱 :gh:`89874`)。" #: ../../whatsnew/3.11.rst:1659 msgid "" "Removed :opcode:`!COPY_DICT_WITHOUT_KEYS`, :opcode:`!GEN_START`, :opcode:`!" "POP_BLOCK`, :opcode:`!SETUP_FINALLY` and :opcode:`!YIELD_FROM`." msgstr "" +"刪除 :opcode:`!COPY_DICT_WITHOUT_KEYS`、:opcode:`!GEN_START`、:opcode:`!" +"POP_BLOCK`、:opcode:`!SETUP_FINALLY` 和 :opcode:`!YIELD_FROM`。" #: ../../whatsnew/3.11.rst:1667 ../../whatsnew/3.11.rst:2543 msgid "Deprecated" -msgstr "" +msgstr "已棄用" #: ../../whatsnew/3.11.rst:1669 msgid "" "This section lists Python APIs that have been deprecated in Python 3.11." -msgstr "" +msgstr "這個部分列出了在 Python 3.11 中棄用的 Python API。" #: ../../whatsnew/3.11.rst:1671 msgid "" "Deprecated C APIs are :ref:`listed separately `." -msgstr "" +msgstr "被棄用的 C API 被\\ :ref:`獨立列出 `。" #: ../../whatsnew/3.11.rst:1678 msgid "Language/Builtins" -msgstr "" +msgstr "語言/內建" #: ../../whatsnew/3.11.rst:1680 msgid "" @@ -2353,6 +2945,11 @@ msgid "" "consider using the :attr:`!__wrapped__` attribute that was added in Python " "3.10. (Contributed by Raymond Hettinger in :gh:`89519`.)" msgstr "" +"鏈接 :class:`classmethod` 描述器(在 :issue:`19072` 中引入)現已棄用。它不能" +"再用於包裝其他描述器,例如 :class:`property`。此功能的核心設計存在缺陷,並導" +"致了許多下游問題。要「傳遞通過 (pass-through)」\\ :class:`classmethod`,請考" +"慮使用 Python 3.10 中添加的 :attr:`!__wrapped__` 屬性。(由 Raymond " +"Hettinger 在 :gh:`89519` 中貢獻。)" #: ../../whatsnew/3.11.rst:1688 msgid "" @@ -2361,6 +2958,10 @@ msgid "" "version, they will raise a :exc:`SyntaxWarning` and eventually a :exc:" "`SyntaxError`. (Contributed by Serhiy Storchaka in :gh:`81548`.)" msgstr "" +"值大於 ``0o377``\\(十進位為 255)的字串和位元組文本值 (bytes literal) 中的八" +"進位跳脫 (octal escape) 現在會產生 :exc:`DeprecationWarning`。在未來的 " +"Python 版本中,他們將引發一個 :exc:`SyntaxWarning` 並最終引發一個 :exc:" +"`SyntaxError`。(由 Serhiy Storchaka 在 :gh:`81548` 中貢獻。)" #: ../../whatsnew/3.11.rst:1694 msgid "" @@ -2370,16 +2971,20 @@ msgid "" "raises a :exc:`DeprecationWarning`. (Contributed by Zackery Spytz in :issue:" "`44977`.)" msgstr "" +":func:`int` 到 :meth:`~object.__trunc__` 的授權 (delegation) 現已棄用。當 " +"``type(a)`` 有實作 :meth:`!__trunc__` 但沒有 :meth:`~object.__int__` 或 :" +"meth:`~object.__index__`,呼叫 ``int(a)`` 現在會引發一個 :exc:" +"`DeprecationWarning`。(由 Zackery Spytz 在 :issue:`44977` 中貢獻。)" #: ../../whatsnew/3.11.rst:1704 msgid "Modules" -msgstr "" +msgstr "模組" #: ../../whatsnew/3.11.rst:1708 msgid "" ":pep:`594` led to the deprecations of the following modules slated for " "removal in Python 3.13:" -msgstr "" +msgstr ":pep:`594` 引領下列模組的棄用,並排訂於 Python 3.13 移除:" #: ../../whatsnew/3.11.rst:1712 msgid ":mod:`aifc`" @@ -2462,6 +3067,8 @@ msgid "" "(Contributed by Brett Cannon in :issue:`47061` and Victor Stinner in :gh:" "`68966`.)" msgstr "" +"(由 Brett Cannon 和 Victor Stinner 分別於 :issue:`47061` 與 :gh:`68966` 中所" +"貢獻。)" #: ../../whatsnew/3.11.rst:1724 msgid "" @@ -2470,6 +3077,9 @@ msgid "" "warnings have now been updated to note they will be removed in Python 3.12. " "(Contributed by Hugo van Kemenade in :issue:`47022`.)" msgstr "" +":mod:`asynchat`、:mod:`asyncore` 和 :mod:`smtpd` 至少在 Python 3.6 以前就被棄" +"用,它們的文件與棄用警告現在已被更新為會提示它們即將於 Python 3.12 中移除。" +"(由 Hugo van Kemenade 於 :issue:`47022` 中貢獻。)" #: ../../whatsnew/3.11.rst:1729 msgid "" @@ -2478,6 +3088,9 @@ msgid "" "`617`, introducing the new PEG parser, for details. (Contributed by Victor " "Stinner in :issue:`40360`.)" msgstr "" +":mod:`lib2to3` 套件和 :ref:`2to3 <2to3-reference>` 工具現已棄用,可能無法剖" +"析 Python 3.10 或更新版本。有關詳細資訊請參閱 :pep:`617`,它引入了新的 PEG 剖" +"析器。(由 Victor Stinner 在 :issue:`40360` 中貢獻。)" #: ../../whatsnew/3.11.rst:1734 msgid "" @@ -2485,10 +3098,13 @@ msgid "" "sre_parse` are now deprecated. (Contributed by Serhiy Storchaka in :issue:" "`47152`.)" msgstr "" +"未被記錄於文件中的 :mod:`!sre_compile`、:mod:`!sre_constants` 和 :mod:`!" +"sre_parse` 模組現在已被棄用。(由 Serhiy Storchaka 在 :issue:`47152` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:1742 msgid "Standard Library" -msgstr "" +msgstr "標準函式庫" #: ../../whatsnew/3.11.rst:1744 msgid "" @@ -2496,14 +3112,16 @@ msgid "" "Their deprecation warnings have now been updated to note they will be " "removed in Python 3.12:" msgstr "" +"以下 :mod:`configparser` 相關項目已在 Python 3.2 中棄用,它們的棄用警告現在會" +"提示它們即將於 Python 3.12 中移除:" #: ../../whatsnew/3.11.rst:1748 msgid "the :class:`!configparser.SafeConfigParser` class" -msgstr "" +msgstr ":class:`!configparser.SafeConfigParser` 類別" #: ../../whatsnew/3.11.rst:1749 msgid "the :attr:`!configparser.ParsingError.filename` property" -msgstr "" +msgstr ":attr:`!configparser.ParsingError.filename` 屬性" #: ../../whatsnew/3.11.rst:1750 msgid "the :meth:`configparser.RawConfigParser.readfp` method" @@ -2511,7 +3129,7 @@ msgstr ":meth:`configparser.RawConfigParser.readfp` 方法" #: ../../whatsnew/3.11.rst:1752 msgid "(Contributed by Hugo van Kemenade in :issue:`45173`.)" -msgstr "" +msgstr "(由 Hugo van Kemenade 於 :issue:`45173` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1754 msgid "" @@ -2522,6 +3140,11 @@ msgid "" "`configparser.ExtendedInterpolation` instead. (Contributed by Hugo van " "Kemenade in :issue:`46607`.)" msgstr "" +":class:`!configparser.LegacyInterpolation` 自 Python 3.2 起已在文件字串中棄" +"用,並且未在 :mod:`configparser` 文檔中列出。它現在會發出一個 :exc:" +"`DeprecationWarning` 並將在 Python 3.13 中刪除。請改用 :class:`configparser." +"BasicInterpolation` 或 :class:`configparser.ExtendedInterpolation`。(由 " +"Hugo van Kemenade 在 :issue:`46607` 中貢獻。)" #: ../../whatsnew/3.11.rst:1761 msgid "" @@ -2530,34 +3153,37 @@ msgid "" "future Python version, due to not supporting resources located within " "package subdirectories:" msgstr "" +"舊的 :mod:`importlib.resources` 函式集因為不支援定位套件子目錄中的資源而被棄" +"用、並將在未來的 Python 版本中刪除,取而代之的是在 Python 3.9 中添加的替代方" +"案:" #: ../../whatsnew/3.11.rst:1766 msgid ":func:`importlib.resources.contents`" -msgstr "" +msgstr ":func:`importlib.resources.contents`" #: ../../whatsnew/3.11.rst:1767 msgid ":func:`importlib.resources.is_resource`" -msgstr "" +msgstr ":func:`importlib.resources.is_resource`" #: ../../whatsnew/3.11.rst:1768 msgid ":func:`importlib.resources.open_binary`" -msgstr "" +msgstr ":func:`importlib.resources.open_binary`" #: ../../whatsnew/3.11.rst:1769 msgid ":func:`importlib.resources.open_text`" -msgstr "" +msgstr ":func:`importlib.resources.open_text`" #: ../../whatsnew/3.11.rst:1770 msgid ":func:`importlib.resources.read_binary`" -msgstr "" +msgstr ":func:`importlib.resources.read_binary`" #: ../../whatsnew/3.11.rst:1771 msgid ":func:`importlib.resources.read_text`" -msgstr "" +msgstr ":func:`importlib.resources.read_text`" #: ../../whatsnew/3.11.rst:1772 msgid ":func:`importlib.resources.path`" -msgstr "" +msgstr ":func:`importlib.resources.path`" #: ../../whatsnew/3.11.rst:1774 msgid "" @@ -2566,6 +3192,10 @@ msgid "" "getpreferredencoding(False) ` and :func:`locale." "getlocale` functions instead. (Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" +":func:`locale.getdefaultlocale` 函式已被棄用且將於 Python 3.13 中移除。請改" +"用 :func:`locale.setlocale`、:func:`locale.getpreferredencoding(False) " +"` 和 :func:`locale.getlocale`。(Victor Stinner " +"於 :gh:`90817` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1780 msgid "" @@ -2573,6 +3203,9 @@ msgid "" "Python 3.13. Use ``locale.setlocale(locale.LC_ALL, \"\")`` instead. " "(Contributed by Victor Stinner in :gh:`90817`.)" msgstr "" +":func:`locale.resetlocale` 函式已棄用並將於 Python 3.13 中移除,請改用 " +"``locale.setlocale(locale.LC_ALL, \"\")``。(由 Victor Stinner 於 :gh:" +"`90817` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1784 msgid "" @@ -2584,6 +3217,11 @@ msgid "" "for syntax violating these rules. (Contributed by Serhiy Storchaka in :gh:" "`91760`.)" msgstr "" +"現在將對\\ :ref:`規則運算式 `\\ 中的數值群組參照 (numerical group " +"references) 和群組名稱套用更嚴格的規則。現在只接受 ASCII 數字序列作為數值參" +"照,並且 :class:`bytes` 模式 (pattern) 的群組名稱和替換字串中只能包含 ASCII " +"字母、數字和底線。目前,會針對違反這些規則的語法發出棄用警告。(由 Serhiy " +"Storchaka 在 :gh:`91760` 中貢獻。)" #: ../../whatsnew/3.11.rst:1792 msgid "" @@ -2593,6 +3231,10 @@ msgid "" "removed in Python 3.13. (Contributed by Serhiy Storchaka and Miro Hrončok " "in :gh:`92728`.)" msgstr "" +"在 :mod:`re` 模組中,:func:`!re.template` 函式和相應的 :data:`!re.TEMPLATE` " +"和 :data:`!re.T` 旗標被棄用,因為它們沒被記錄於文件中並且缺乏明顯的目的。它們" +"將在 Python 3.13 中被刪除。(由 Serhiy Storchaka 和 Miro Hrončok 在 :gh:" +"`92728` 中貢獻。)" #: ../../whatsnew/3.11.rst:1798 msgid "" @@ -2602,6 +3244,10 @@ msgid "" "and its docstring is now corrected). (Contributed by Hugo van Kemenade in :" "issue:`45837`.)" msgstr "" +":func:`turtle.settiltangle` 自 Python 3.1 以來已被棄用;它現在會發出棄用警" +"告,並將在 Python 3.13 中刪除。請改用 :func:`turtle.tiltangle`\\ (它之前被錯" +"誤地標記為已棄用,其文件字串現在已更正)。(由 Hugo van Kemenade 在 :issue:" +"`45837` 中貢獻。)" #: ../../whatsnew/3.11.rst:1804 msgid "" @@ -2610,6 +3256,9 @@ msgid "" "currently unplanned, but users are encouraged to use :class:`str` instead " "wherever possible. (Contributed by Alex Waygood in :gh:`92332`.)" msgstr "" +"僅用於支援 Python 2 和 Python 3 程式碼間相容性的 :class:`typing.Text` 現已棄" +"用。目前未計劃刪除它,但鼓勵用戶盡可能使用 :class:`str` 代替。(由 Alex " +"Waygood 在 :gh:`92332` 中貢獻。)" #: ../../whatsnew/3.11.rst:1810 msgid "" @@ -2617,6 +3266,8 @@ msgid "" "is now deprecated. Support will be removed in Python 3.13. (Contributed by " "Jingchen Ye in :gh:`90224`.)" msgstr "" +"用於建構 :data:`typing.TypedDict` 型別的關鍵字引數語法現已棄用。將在 Python " +"3.13 中停止支援。(由 Jingchen Ye 在 :gh:`90224` 中貢獻。)" #: ../../whatsnew/3.11.rst:1814 msgid "" @@ -2624,6 +3275,9 @@ msgid "" "3.13. It is untested, undocumented, and not used by :mod:`webbrowser` " "itself. (Contributed by Dong-hee Na in :issue:`42255`.)" msgstr "" +":class:`!webbrowser.MacOSX` 已被棄用且將於 Python 3.13 中移除。它並沒有被測試" +"過、沒紀錄於文件、也沒有被 :mod:`webbrowser` 本身使用。(由 Dong-hee Na 於 :" +"issue:`42255`。)" #: ../../whatsnew/3.11.rst:1818 msgid "" @@ -2631,28 +3285,33 @@ msgid "" "class:`~unittest.IsolatedAsyncioTestCase` test methods (other than the " "default ``None`` value) is now deprecated." msgstr "" +"回傳從 :class:`~unittest.TestCase` 和 :class:`~unittest." +"IsolatedAsyncioTestCase` 測試方法(預設的 ``None`` 值除外)給定值的行為現已棄" +"用。" #: ../../whatsnew/3.11.rst:1822 msgid "" "Deprecated the following not-formally-documented :mod:`unittest` functions, " "scheduled for removal in Python 3.13:" msgstr "" +"棄用以下並沒有正式紀錄於文件中的 :mod:`unittest` 函式,並預計於 Python 3.13 " +"中移除:" #: ../../whatsnew/3.11.rst:1825 msgid ":func:`!unittest.findTestCases`" -msgstr "" +msgstr ":func:`!unittest.findTestCases`" #: ../../whatsnew/3.11.rst:1826 msgid ":func:`!unittest.makeSuite`" -msgstr "" +msgstr ":func:`!unittest.makeSuite`" #: ../../whatsnew/3.11.rst:1827 msgid ":func:`!unittest.getTestCaseNames`" -msgstr "" +msgstr ":func:`!unittest.getTestCaseNames`" #: ../../whatsnew/3.11.rst:1829 msgid "Use :class:`~unittest.TestLoader` methods instead:" -msgstr "" +msgstr "改用 :class:`~unittest.TestLoader` 方法:" #: ../../whatsnew/3.11.rst:1831 msgid ":meth:`unittest.TestLoader.loadTestsFromModule`" @@ -2668,51 +3327,53 @@ msgstr ":meth:`unittest.TestLoader.getTestCaseNames`" #: ../../whatsnew/3.11.rst:1835 msgid "(Contributed by Erlend E. Aasland in :issue:`5846`.)" -msgstr "" +msgstr "(由 Erlend E. Aasland 於 :issue:`5846` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1842 ../../whatsnew/3.11.rst:2571 msgid "Pending Removal in Python 3.12" -msgstr "" +msgstr "Python 3.12 中待決議的移除項目" #: ../../whatsnew/3.11.rst:1844 msgid "" "The following Python APIs have been deprecated in earlier Python releases, " "and will be removed in Python 3.12." -msgstr "" +msgstr "下列 API 已在先前的 Python 發布版本中棄用,並將於 Python 3.12 中移除。" #: ../../whatsnew/3.11.rst:1847 msgid "" "C APIs pending removal are :ref:`listed separately `." msgstr "" +"待定的 C API 移除項目為\\ :ref:`獨立列出的 `。" #: ../../whatsnew/3.11.rst:1850 msgid "The :mod:`asynchat` module" -msgstr "" +msgstr ":mod:`asynchat` 模組" #: ../../whatsnew/3.11.rst:1851 msgid "The :mod:`asyncore` module" -msgstr "" +msgstr ":mod:`asyncore` 模組" #: ../../whatsnew/3.11.rst:1852 msgid "The :ref:`entire distutils package `" -msgstr "" +msgstr ":ref:`整個 distutils 套件 `" #: ../../whatsnew/3.11.rst:1853 msgid "The :mod:`imp` module" -msgstr "" +msgstr ":mod:`imp` 模組" #: ../../whatsnew/3.11.rst:1854 msgid "The :class:`typing.io ` namespace" -msgstr "" +msgstr ":class:`typing.io ` 命名空間" #: ../../whatsnew/3.11.rst:1855 msgid "The :class:`typing.re ` namespace" -msgstr "" +msgstr ":class:`typing.re ` 命名空間" #: ../../whatsnew/3.11.rst:1856 msgid ":func:`!cgi.log`" -msgstr "" +msgstr ":func:`!cgi.log`" #: ../../whatsnew/3.11.rst:1857 msgid ":func:`importlib.find_loader`" @@ -2736,27 +3397,27 @@ msgstr ":meth:`importlib.abc.PathEntryFinder.find_module`" #: ../../whatsnew/3.11.rst:1862 msgid ":meth:`!importlib.machinery.BuiltinImporter.find_module`" -msgstr "" +msgstr ":meth:`!importlib.machinery.BuiltinImporter.find_module`" #: ../../whatsnew/3.11.rst:1863 msgid ":meth:`!importlib.machinery.BuiltinLoader.module_repr`" -msgstr "" +msgstr ":meth:`!importlib.machinery.BuiltinLoader.module_repr`" #: ../../whatsnew/3.11.rst:1864 msgid ":meth:`!importlib.machinery.FileFinder.find_loader`" -msgstr "" +msgstr ":meth:`!importlib.machinery.FileFinder.find_loader`" #: ../../whatsnew/3.11.rst:1865 msgid ":meth:`!importlib.machinery.FileFinder.find_module`" -msgstr "" +msgstr ":meth:`!importlib.machinery.FileFinder.find_module`" #: ../../whatsnew/3.11.rst:1866 msgid ":meth:`!importlib.machinery.FrozenImporter.find_module`" -msgstr "" +msgstr ":meth:`!importlib.machinery.FrozenImporter.find_module`" #: ../../whatsnew/3.11.rst:1867 msgid ":meth:`!importlib.machinery.FrozenLoader.module_repr`" -msgstr "" +msgstr ":meth:`!importlib.machinery.FrozenLoader.module_repr`" #: ../../whatsnew/3.11.rst:1868 msgid ":meth:`importlib.machinery.PathFinder.find_module`" @@ -2764,7 +3425,7 @@ msgstr ":meth:`importlib.machinery.PathFinder.find_module`" #: ../../whatsnew/3.11.rst:1869 msgid ":meth:`!importlib.machinery.WindowsRegistryFinder.find_module`" -msgstr "" +msgstr ":meth:`!importlib.machinery.WindowsRegistryFinder.find_module`" #: ../../whatsnew/3.11.rst:1870 msgid ":func:`importlib.util.module_for_loader`" @@ -2772,11 +3433,11 @@ msgstr ":func:`importlib.util.module_for_loader`" #: ../../whatsnew/3.11.rst:1871 msgid ":func:`!importlib.util.set_loader_wrapper`" -msgstr "" +msgstr ":func:`!importlib.util.set_loader_wrapper`" #: ../../whatsnew/3.11.rst:1872 msgid ":func:`!importlib.util.set_package_wrapper`" -msgstr "" +msgstr ":func:`!importlib.util.set_package_wrapper`" #: ../../whatsnew/3.11.rst:1873 msgid ":class:`pkgutil.ImpImporter`" @@ -2792,162 +3453,162 @@ msgstr ":meth:`pathlib.Path.link_to`" #: ../../whatsnew/3.11.rst:1876 msgid ":func:`!sqlite3.enable_shared_cache`" -msgstr "" +msgstr ":func:`!sqlite3.enable_shared_cache`" #: ../../whatsnew/3.11.rst:1877 msgid ":func:`!sqlite3.OptimizedUnicode`" -msgstr "" +msgstr ":func:`!sqlite3.OptimizedUnicode`" #: ../../whatsnew/3.11.rst:1878 msgid ":envvar:`PYTHONTHREADDEBUG` environment variable" -msgstr "" +msgstr ":envvar:`PYTHONTHREADDEBUG` 環境變數" #: ../../whatsnew/3.11.rst:1879 msgid "The following deprecated aliases in :mod:`unittest`:" -msgstr "" +msgstr ":mod:`unittest` 中被棄用的別名:" #: ../../whatsnew/3.11.rst:1882 msgid "Deprecated alias" -msgstr "" +msgstr "已棄用的別名" #: ../../whatsnew/3.11.rst:1882 msgid "Method Name" -msgstr "" +msgstr "方法名稱" #: ../../whatsnew/3.11.rst:1882 msgid "Deprecated in" -msgstr "" +msgstr "棄用於" #: ../../whatsnew/3.11.rst:1884 msgid "``failUnless``" -msgstr "" +msgstr "``failUnless``" #: ../../whatsnew/3.11.rst:1884 ../../whatsnew/3.11.rst:1891 msgid ":meth:`.assertTrue`" -msgstr "" +msgstr ":meth:`.assertTrue`" #: ../../whatsnew/3.11.rst:1884 ../../whatsnew/3.11.rst:1885 #: ../../whatsnew/3.11.rst:1886 ../../whatsnew/3.11.rst:1887 #: ../../whatsnew/3.11.rst:1888 ../../whatsnew/3.11.rst:1889 #: ../../whatsnew/3.11.rst:1890 msgid "3.1" -msgstr "" +msgstr "3.1" #: ../../whatsnew/3.11.rst:1885 msgid "``failIf``" -msgstr "" +msgstr "``failIf``" #: ../../whatsnew/3.11.rst:1885 msgid ":meth:`.assertFalse`" -msgstr "" +msgstr ":meth:`.assertFalse`" #: ../../whatsnew/3.11.rst:1886 msgid "``failUnlessEqual``" -msgstr "" +msgstr "``failUnlessEqual``" #: ../../whatsnew/3.11.rst:1886 ../../whatsnew/3.11.rst:1892 msgid ":meth:`.assertEqual`" -msgstr "" +msgstr ":meth:`.assertEqual`" #: ../../whatsnew/3.11.rst:1887 msgid "``failIfEqual``" -msgstr "" +msgstr "``failIfEqual``" #: ../../whatsnew/3.11.rst:1887 ../../whatsnew/3.11.rst:1893 msgid ":meth:`.assertNotEqual`" -msgstr "" +msgstr ":meth:`.assertNotEqual`" #: ../../whatsnew/3.11.rst:1888 msgid "``failUnlessAlmostEqual``" -msgstr "" +msgstr "``failUnlessAlmostEqual``" #: ../../whatsnew/3.11.rst:1888 ../../whatsnew/3.11.rst:1894 msgid ":meth:`.assertAlmostEqual`" -msgstr "" +msgstr ":meth:`.assertAlmostEqual`" #: ../../whatsnew/3.11.rst:1889 msgid "``failIfAlmostEqual``" -msgstr "" +msgstr "``failIfAlmostEqual``" #: ../../whatsnew/3.11.rst:1889 ../../whatsnew/3.11.rst:1895 msgid ":meth:`.assertNotAlmostEqual`" -msgstr "" +msgstr ":meth:`.assertNotAlmostEqual`" #: ../../whatsnew/3.11.rst:1890 msgid "``failUnlessRaises``" -msgstr "" +msgstr "``failUnlessRaises``" #: ../../whatsnew/3.11.rst:1890 msgid ":meth:`.assertRaises`" -msgstr "" +msgstr ":meth:`.assertRaises`" #: ../../whatsnew/3.11.rst:1891 msgid "``assert_``" -msgstr "" +msgstr "``assert_``" #: ../../whatsnew/3.11.rst:1891 ../../whatsnew/3.11.rst:1892 #: ../../whatsnew/3.11.rst:1893 ../../whatsnew/3.11.rst:1894 #: ../../whatsnew/3.11.rst:1895 ../../whatsnew/3.11.rst:1896 #: ../../whatsnew/3.11.rst:1897 msgid "3.2" -msgstr "" +msgstr "3.2" #: ../../whatsnew/3.11.rst:1892 msgid "``assertEquals``" -msgstr "" +msgstr "``assertEquals``" #: ../../whatsnew/3.11.rst:1893 msgid "``assertNotEquals``" -msgstr "" +msgstr "``assertNotEquals``" #: ../../whatsnew/3.11.rst:1894 msgid "``assertAlmostEquals``" -msgstr "" +msgstr "``assertAlmostEquals``" #: ../../whatsnew/3.11.rst:1895 msgid "``assertNotAlmostEquals``" -msgstr "" +msgstr "``assertNotAlmostEquals``" #: ../../whatsnew/3.11.rst:1896 msgid "``assertRegexpMatches``" -msgstr "" +msgstr "``assertRegexpMatches``" #: ../../whatsnew/3.11.rst:1896 msgid ":meth:`.assertRegex`" -msgstr "" +msgstr ":meth:`.assertRegex`" #: ../../whatsnew/3.11.rst:1897 msgid "``assertRaisesRegexp``" -msgstr "" +msgstr "``assertRaisesRegexp``" #: ../../whatsnew/3.11.rst:1897 msgid ":meth:`.assertRaisesRegex`" -msgstr "" +msgstr ":meth:`.assertRaisesRegex`" #: ../../whatsnew/3.11.rst:1898 msgid "``assertNotRegexpMatches``" -msgstr "" +msgstr "``assertNotRegexpMatches``" #: ../../whatsnew/3.11.rst:1898 msgid ":meth:`.assertNotRegex`" -msgstr "" +msgstr ":meth:`.assertNotRegex`" #: ../../whatsnew/3.11.rst:1898 msgid "3.5" -msgstr "" +msgstr "3.5" #: ../../whatsnew/3.11.rst:1905 ../../whatsnew/3.11.rst:2597 msgid "Removed" -msgstr "" +msgstr "已移除" #: ../../whatsnew/3.11.rst:1907 msgid "This section lists Python APIs that have been removed in Python 3.11." -msgstr "" +msgstr "此部分列出 Python 3.11 中移除的 Python API。" #: ../../whatsnew/3.11.rst:1909 msgid "" "Removed C APIs are :ref:`listed separately `." -msgstr "" +msgstr "被移除的 C API 被\\ :ref:`獨立列出 `。" #: ../../whatsnew/3.11.rst:1911 msgid "" @@ -2957,6 +3618,10 @@ msgid "" "removal was initially scheduled for Python 3.10. Use :keyword:`async def` " "instead. (Contributed by Illia Volochii in :issue:`43216`.)" msgstr "" +"刪除了 :func:`!@asyncio.coroutine` :term:`decorator` 使遺留的基於生成器的協" +"程 (generator-based coroutine) 與 :keyword:`async` / :keyword:`await` 程式碼" +"相容。該函數自 Python 3.8 起已被棄用,計劃於 Python 3.10 刪除。請改用 :" +"keyword:`async def`。(由 Illia Volochii 在 :issue:`43216` 中貢獻。)" #: ../../whatsnew/3.11.rst:1918 msgid "" @@ -2964,6 +3629,8 @@ msgid "" "generator-based coroutine objects in the debug mode. (Contributed by Illia " "Volochii in :issue:`43216`.)" msgstr "" +"移除除錯模式中用於包裝遺留基於產生器之協程物件的 :class:`!asyncio.coroutines." +"CoroWrapper`。(由 Illia Volochii 於 :issue:`43216` 中貢獻。)" #: ../../whatsnew/3.11.rst:1922 msgid "" @@ -2973,36 +3640,42 @@ msgid "" "``SO_REUSEADDR`` in UDP. (Contributed by Hugo van Kemenade in :issue:" "`45129`.)" msgstr "" +"因為有重大的安全性考量,Python 3.9 中停用的 :meth:`asyncio.loop." +"create_datagram_endpoint` 之 *reuse_address* 參數目前已經移除。這是因為 UDP " +"socket 選項 ``SO_REUSEADDR`` 的行為所致。(由 Hugo van Kemenade 於 :issue:" +"`45129` 中貢獻。)" #: ../../whatsnew/3.11.rst:1928 msgid "" "Removed the :mod:`!binhex` module, deprecated in Python 3.9. Also removed " "the related, similarly-deprecated :mod:`binascii` functions:" msgstr "" +"移除 Python 3.9 中棄用的 :mod:`!binhex` 模組,與其相關且相似的 :mod:" +"`binascii` 函式也一併被移除:" #: ../../whatsnew/3.11.rst:1931 msgid ":func:`!binascii.a2b_hqx`" -msgstr "" +msgstr ":func:`!binascii.a2b_hqx`" #: ../../whatsnew/3.11.rst:1932 msgid ":func:`!binascii.b2a_hqx`" -msgstr "" +msgstr ":func:`!binascii.b2a_hqx`" #: ../../whatsnew/3.11.rst:1933 msgid ":func:`!binascii.rlecode_hqx`" -msgstr "" +msgstr ":func:`!binascii.rlecode_hqx`" #: ../../whatsnew/3.11.rst:1934 msgid ":func:`!binascii.rldecode_hqx`" -msgstr "" +msgstr ":func:`!binascii.rldecode_hqx`" #: ../../whatsnew/3.11.rst:1936 msgid "The :func:`binascii.crc_hqx` function remains available." -msgstr "" +msgstr ":func:`binascii.crc_hqx` 維持可用。" #: ../../whatsnew/3.11.rst:1938 msgid "(Contributed by Victor Stinner in :issue:`45085`.)" -msgstr "" +msgstr "(由 Victor Stinner 於 :issue:`45085` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1940 msgid "" @@ -3010,6 +3683,9 @@ msgid "" "Use ``bdist_wheel`` (wheel packages) instead. (Contributed by Hugo van " "Kemenade in :issue:`45124`.)" msgstr "" +"移除 Python 3.9 中棄用的 :mod:`distutils` ``bdist_msi`` 命令。請改用 " +"``bdist_wheel``\\ (wheel 套件)。(由 Hugo van Kemenade 於 :issue:`45124` 中" +"貢獻。)" #: ../../whatsnew/3.11.rst:1944 msgid "" @@ -3018,6 +3694,10 @@ msgid "" "FileInput`, deprecated since Python 3.9. (Contributed by Hugo van Kemenade " "in :issue:`45132`.)" msgstr "" +"將 :class:`xml.dom.pulldom.DOMEventStream`、:class:`wsgiref.util." +"FileWrapper` 和 :class:`fileinput.FileInput` 自 Python 3.9 中棄用的 :meth:" +"`~object.__getitem__` 方法移除。(由 Hugo van Kemenade 在 :issue:`45132` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:1949 msgid "" @@ -3029,16 +3709,24 @@ msgid "" "since they are only used for the :func:`!l*gettext` functions. (Contributed " "by Dong-hee Na and Serhiy Storchaka in :issue:`44235`.)" msgstr "" +"刪除了已棄用的 :mod:`gettext` 函式 :func:`!lgettext`、:func:`!ldgettext`、:" +"func:`!lngettext` 和 :func:`!ldngettext`,也刪除了 :func:`!" +"bind_textdomain_codeset` 函式、:meth:`!NullTranslations.output_charset` 和 :" +"meth:`!NullTranslations.set_output_charset` 方法,以及 :func:`!translation` " +"和 :func:`!install` 的 *codeset* 參數,因為它們僅被用於 :func:`!l*gettext` 函" +"式。 (由 Dong-hee Na 和 Serhiy Storchaka 在 :issue:`44235` 中貢獻。)" #: ../../whatsnew/3.11.rst:1959 msgid "Removed from the :mod:`inspect` module:" -msgstr "" +msgstr "於 :mod:`inspect` 模組中移除:" #: ../../whatsnew/3.11.rst:1961 msgid "" "The :func:`!getargspec` function, deprecated since Python 3.0; use :func:" "`inspect.signature` or :func:`inspect.getfullargspec` instead." msgstr "" +"Python 3.0 中棄用的 :func:`!getargspec`;改用 :func:`inspect.signature` 或 :" +"func:`inspect.getfullargspec`。" #: ../../whatsnew/3.11.rst:1964 msgid "" @@ -3046,6 +3734,8 @@ msgid "" "func:`inspect.signature` function or the :class:`inspect.Signature` object " "directly." msgstr "" +"Python 3.5 中棄用的 :func:`!formatargspec` 函式;請直接用 :func:`inspect." +"signature` 函式或 :class:`inspect.Signature` 物件。" #: ../../whatsnew/3.11.rst:1968 msgid "" @@ -3053,10 +3743,13 @@ msgid "" "from_function` methods, deprecated since Python 3.5; use the :meth:" "`Signature.from_callable() ` method instead." msgstr "" +"Python 3.5 中停用且沒有被紀錄於文件上的 :meth:`!Signature.from_builtin` 和 :" +"meth:`!Signature.from_function` 方法;改用 :meth:`Signature.from_callable() " +"` 方法。" #: ../../whatsnew/3.11.rst:1973 msgid "(Contributed by Hugo van Kemenade in :issue:`45320`.)" -msgstr "" +msgstr "(由 Hugo van Kemenade 於 :issue:`45320` 中所貢獻。)" #: ../../whatsnew/3.11.rst:1975 msgid "" @@ -3064,6 +3757,9 @@ msgid "" "PurePath`, because it was not used and added by mistake in previous " "versions. (Contributed by Nikita Sobolev in :issue:`46483`.)" msgstr "" +"自 :class:`pathlib.PurePath` 中移除 :meth:`~object.__class_getitem__` 方法," +"因為它是前一版本中誤加且沒被使用。(由 Nikita Sobolev 於 :issue:`46483` 中所" +"貢獻。)" #: ../../whatsnew/3.11.rst:1980 msgid "" @@ -3071,12 +3767,16 @@ msgid "" "is unusable without the external :mod:`!mailman` package. (Contributed by " "Dong-hee Na in :issue:`35800`.)" msgstr "" +"移除 :mod:`smtpd` 模組中的 :class:`!MailmanProxy` 類別,因為它無法獨立於外部" +"套件 :mod:`!mailman` 使用。(由 Dong-hee Na 於 :issue:`35800` 貢獻。)" #: ../../whatsnew/3.11.rst:1984 msgid "" "Removed the deprecated :meth:`!split` method of :class:`!_tkinter." "TkappType`. (Contributed by Erlend E. Aasland in :issue:`38371`.)" msgstr "" +"移除 :class:`!_tkinter.TkappType` 已被棄用的 :meth:`!split` 方法。(由 " +"Erlend E. Aasland 於 :issue:`38371` 貢獻。)" #: ../../whatsnew/3.11.rst:1987 msgid "" @@ -3084,6 +3784,8 @@ msgid "" "introduced in Python 3.4 but has been broken since Python 3.7. (Contributed " "by Inada Naoki in :issue:`23882`.)" msgstr "" +"從 :mod:`unittest` 中刪除了命名空間套件支援。它在 Python 3.4 中引入,但自 " +"Python 3.7 以來已無法運作。(由 Inada Naoki 在 :issue:`23882` 中貢獻。)" #: ../../whatsnew/3.11.rst:1991 msgid "" @@ -3093,6 +3795,10 @@ msgid "" "mainly to be used in Python's test suite.\" (Contributed by Victor Stinner " "in :issue:`46852`.)" msgstr "" +"將未被記錄於文件中的私有方法 :meth:`!float.__set_format__()` 移除,它過去是 " +"Python 3.7 中的 :meth:`!float.__setformat__()`。它的文件字串 (docstring) 說" +"到:「你大概不會想要使用這個函式,它只為了讓 Python 測試系列套件 (suite) 使用" +"而存在。」(由 Victor Stinner 於 :issue:`46852` 中貢獻。)" #: ../../whatsnew/3.11.rst:1997 msgid "" @@ -3100,6 +3806,8 @@ msgid "" "corresponding :c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` macro) have " "been removed." msgstr "" +"移除 :option:`!--experimental-isolated-subinterpreters` 配置旗標(與對應的 :" +"c:macro:`!EXPERIMENTAL_ISOLATED_SUBINTERPRETERS` 巨集)。" #: ../../whatsnew/3.11.rst:2001 msgid "" @@ -3108,22 +3816,27 @@ msgid "" "`being developed independently `_ from the Python source tree." msgstr "" +"`Pynche `_ --- Python 風格的自然色彩與色調" +"編輯器 --- 已被移出 ``Tools/scripts``,`獨立開發 `_\\ 於 Python 原始碼之外。" #: ../../whatsnew/3.11.rst:2011 ../../whatsnew/3.11.rst:2241 msgid "Porting to Python 3.11" -msgstr "" +msgstr "移植至 Python 3.11" #: ../../whatsnew/3.11.rst:2013 msgid "" "This section lists previously described changes and other bugfixes in the " "Python API that may require changes to your Python code." msgstr "" +"本部分列出了之前描述的 Python API 中可能需要你去更改 Python 程式碼的變更和其" +"他錯誤修復。" #: ../../whatsnew/3.11.rst:2016 msgid "" "Porting notes for the C API are :ref:`listed separately `." -msgstr "" +msgstr "C API 的移植被\\ :ref:`獨立列出 `。" #: ../../whatsnew/3.11.rst:2019 msgid "" @@ -3135,6 +3848,12 @@ msgid "" "functions controls how universal newlines work. (Contributed by Victor " "Stinner in :issue:`37330`.)" msgstr "" +":func:`open`、:func:`io.open`、:func:`codecs.open` 和 :class:`fileinput." +"FileInput` 不再接受 ``'U'``\\ (\"universal newline\",通用換行符)文件模式。" +"在 Python 3 中,每當以文本模式 (text mode) 打開檔案時,預設情況下會使用「通用" +"換行符」模式,並且自 Python 3.3 以來就不推薦使用 ``'U'`` 旗標。這些函式的 :" +"ref:`newline 參數 `\\ 控制了通用換行符的作用方式。" +"(由 Victor Stinner 在 :issue:`37330` 中貢獻。)" #: ../../whatsnew/3.11.rst:2028 msgid "" @@ -3143,6 +3862,9 @@ msgid "" "exc:`ValueError` will be raised. (Contributed by Pablo Galindo in :gh:" "`93351`)" msgstr "" +":class:`ast.AST` 節點位置現在會在提供給 :func:`compile` 和其他相關函式時被驗" +"證。如果檢測到無效位置,則會引發 :exc:`ValueError`。(由 Pablo Galindo 在 :" +"gh:`93351` 中貢獻)" #: ../../whatsnew/3.11.rst:2032 msgid "" @@ -3150,6 +3872,9 @@ msgid "" "executors to :meth:`asyncio.loop.set_default_executor` following a " "deprecation in Python 3.8. (Contributed by Illia Volochii in :issue:`43234`.)" msgstr "" +"在 Python 3.8 中棄用後,禁止將非 :class:`concurrent.futures." +"ThreadPoolExecutor` 執行器傳遞給 :meth:`asyncio.loop.set_default_executor`。" +"(由 Illia Volochii 在 :issue:`43234` 中貢獻。)" #: ../../whatsnew/3.11.rst:2037 msgid "" @@ -3158,6 +3883,10 @@ msgid "" "instead of using :func:`locale.getdefaultlocale`, if no locale is specified. " "(Contributed by Victor Stinner in :issue:`46659`.)" msgstr "" +":mod:`calendar`::class:`calendar.LocaleTextCalendar` 和 :class:`calendar." +"LocaleHTMLCalendar` 類別如果沒有指定語言環境,現在會使用 :func:`locale." +"getlocale` 而非 :func:`locale.getdefaultlocale`。(由 Victor Stinner 在 :" +"issue:`46659` 中貢獻。)" #: ../../whatsnew/3.11.rst:2043 msgid "" @@ -3165,6 +3894,8 @@ msgid "" "the ``'UTF-8'`` encoding. (Contributed by Srinivas Reddy Thatiparthy (శ్రీనివాస్ " "రెడ్డి తాటిపర్తి) in :issue:`41137`.)" msgstr "" +":mod:`pdb` 模組現在會讀取 ``'UTF-8'`` 編碼的 :file:`.pdbrc` 配置檔案。" +"(Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) 於 :issue:`41137` 貢獻。)" #: ../../whatsnew/3.11.rst:2047 msgid "" @@ -3174,6 +3905,9 @@ msgid "" "exc:`ValueError` is raised. (Contributed by Raymond Hettinger in :issue:" "`40465`.)" msgstr "" +":func:`random.sample` 的 *population* 參數必須是一個序列,不再支援 :class:" +"`set` 到 :class:`list` 的自動轉換。此外,如果抽樣大小大於總體大小,則會引發 :" +"exc:`ValueError`。(由 Raymond Hettinger 在 :issue:`40465` 中貢獻。)" #: ../../whatsnew/3.11.rst:2053 msgid "" @@ -3181,6 +3915,9 @@ msgid "" "was previously an arbitrary random function to use for the shuffle; now, :" "func:`random.random` (its previous default) will always be used." msgstr "" +"刪除了 :func:`random.shuffle` 的 *random* 可選參數。它以前是用於隨機排列 " +"(shuffle) 的任意隨機函式;現在都會使用 :func:`random.random`\\ (這是它以前的" +"預設值)。" #: ../../whatsnew/3.11.rst:2057 msgid "" @@ -3189,6 +3926,9 @@ msgid "" "been deprecated since Python 3.6. (Contributed by Serhiy Storchaka in :issue:" "`47066`.)" msgstr "" +"在 :mod:`re` :ref:`re-syntax` 中,全域行內旗標(例如 ``(?i)``)現在只能在規則" +"運算式的開頭使用。自 Python 3.6 以來,在其他地方使用它們已被棄用。 (由 " +"Serhiy Storchaka 在 :issue:`47066` 中貢獻。)" #: ../../whatsnew/3.11.rst:2062 msgid "" @@ -3197,10 +3937,13 @@ msgid "" "this could change the captured output in these cases. (Contributed by Ma Lin " "in :issue:`35859`.)" msgstr "" +"在 :mod:`re` 模組中修復了幾個長期存在的錯誤,在極少數情況下,這些錯誤可能會導" +"致捕獲群組 (capture group) 得到錯誤的結果。因此,這可能會在這些情況下更改捕獲" +"的輸出。(Ma Lin 在 :issue:`35859` 中貢獻。)" #: ../../whatsnew/3.11.rst:2071 msgid "Build Changes" -msgstr "" +msgstr "建置變更" #: ../../whatsnew/3.11.rst:2073 msgid "" @@ -3216,10 +3959,19 @@ msgid "" "and Ethan Smith in :gh:`84461` and WASI contributed by Christian Heimes in :" "gh:`90473`; platforms promoted in :gh:`95085`)" msgstr "" +"CPython 現在有 :pep:`11` :pep:`Tier 3 支援 <11#tier-3>` 以用於交叉編譯至 " +"`WebAssembly `_ 平台 `Emscripten `_\\ (``wasm32-unknown-emscripten``,即瀏覽器中的 Python)" +"和 `WebAssembly 系統介面 (WASI) `_ (``wasm32-unknown-" +"wasi``)。這個靈感來自過往的貢獻,例如 `Pyodide `_。這些" +"平台提供了有限的 POSIX API 子集;Python 標準函式庫功能和與網路、行程、執行" +"緒、訊號、mmap、用戶/群組相關的模組不開放使用或無法正常使用。(Emscripten 由 " +"Christian Heimes 和 Ethan Smith 在 :gh:`84461` 貢獻,WASI 由 Christian " +"Heimes 在 :gh:`90473` 貢獻;平台在 :gh:`95085` 中推廣)" #: ../../whatsnew/3.11.rst:2087 msgid "Building Python now requires:" -msgstr "" +msgstr "建置 Python 現在必須要有:" #: ../../whatsnew/3.11.rst:2089 msgid "" @@ -3228,12 +3980,18 @@ msgid "" "C11_(C_standard_revision)#Optional_features>`_ are not required. " "(Contributed by Victor Stinner in :issue:`46656`.)" msgstr "" +"`C11 `_ 編譯器。`可選的 C11 特性 " +"`_ 並非必要。(由 Victor Stinner " +"於 :issue:`46656` 中貢獻。)" #: ../../whatsnew/3.11.rst:2095 msgid "" "Support for `IEEE 754 `_ floating " "point numbers. (Contributed by Victor Stinner in :issue:`46917`.)" msgstr "" +"對 `IEEE 754 `_ 浮點數的支援(由 " +"Victor Stinner 於 :issue:`46917` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2099 msgid "" @@ -3241,6 +3999,9 @@ msgid "" "wiki/NaN#Floating_point>`_, as the :c:macro:`!Py_NO_NAN` macro has been " "removed. (Contributed by Victor Stinner in :issue:`46656`.)" msgstr "" +"支援\\ `浮點非數字 (floating point NaN) `_,因為 :c:macro:`!Py_NO_NAN` 巨集已被刪除。 (由 Victor " +"Stinner 在 :issue:`46656` 中貢獻。)" #: ../../whatsnew/3.11.rst:2104 msgid "" @@ -3251,12 +4012,19 @@ msgid "" "c:func:`!__builtin_nan` function (Contributed by Victor Stinner in :issue:" "`46640`)." msgstr "" +"`C99 `_ ```` 標頭檔提供了 :c:" +"func:`!copysign`、:c:func:`!hypot`、:c:func:`!isfinite`、:c:func:`!isinf`、:" +"c:func:`!isnan` 和 :c:func:`!round` 函數(由 Victor Stinner 在 :issue:" +"`45440` 中貢獻);和一個 :c:data:`!NAN` 常數或 :c:func:`!__builtin_nan` 函式" +"(由 Victor Stinner 在 :issue:`46640` 中貢獻)。" #: ../../whatsnew/3.11.rst:2112 msgid "" "The :mod:`tkinter` package now requires `Tcl/Tk `_ " "version 8.5.12 or newer. (Contributed by Serhiy Storchaka in :issue:`46996`.)" msgstr "" +":mod:`tkinter` 套件現在必須要有 `Tcl/Tk `_ 8.5.12 或更新" +"的版本。(由 Serhiy Storchaka 於 :issue:`46996` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2116 msgid "" @@ -3269,12 +4037,21 @@ msgid "" "(Contributed by Christian Heimes and Erlend Egeberg Aasland in :issue:" "`45847`, :issue:`45747`, and :issue:`45763`.)" msgstr "" +"大多數 stdlib 擴充模組的依賴套件、編譯器旗標 (compiler flag) 和鏈接器旗標 " +"(linker flags) 現在可以透過 :program:`configure` 檢測出來。(當可用時)\\ " +"`pkg-config `_ 會檢測" +"出 libffi、libnsl、libsqlite3、zlib、bzip2、liblzma、libcrypt、Tcl/Tk 和 " +"uuid 旗標。:mod:`tkinter` 現在需要一個 pkg-config 命令來檢測 `Tcl/Tk`_ 標頭檔" +"和函式庫的開發設定。(由 Christian Heimes 和 Erlend Egeberg Aasland 在 :" +"issue:`45847`、:issue:`45747` 和 :issue:`45763` 中貢獻。)" #: ../../whatsnew/3.11.rst:2126 msgid "" "libpython is no longer linked against libcrypt. (Contributed by Mike Gilbert " "in :issue:`45433`.)" msgstr "" +"libpython 不再鏈接到 libcrypt。 (由 Mike Gilbert 在 :issue:`45433` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:2129 msgid "" @@ -3283,6 +4060,10 @@ msgid "" "``--with-lto=thin``. (Contributed by Dong-hee Na and Brett Holman in :issue:" "`44340`.)" msgstr "" +"CPython 現在可以透過將 ``thin`` 傳遞給 :option:`--with-lto`\\ (也就是 ``--" +"with-lto=thin``\\ )來以 `ThinLTO `_ 選項建置。(由 Dong-hee Na 與 Brett Holman 於 :issue:`44340` 中所貢" +"獻。)" #: ../../whatsnew/3.11.rst:2134 msgid "" @@ -3291,6 +4072,9 @@ msgid "" "except empty tuple singleton. (Contributed by Christian Heimes in :issue:" "`45522`.)" msgstr "" +"物件結構的空閒列表現在可被禁用。一個新的 :program:`configure` 選項 :option:`!" +"—without-freelists` 可用於禁用除空元組單例之外的所有空閒列表。(由 Christian " +"Heimes 在 :issue:`45522` 中貢獻。)" #: ../../whatsnew/3.11.rst:2139 msgid "" @@ -3300,6 +4084,10 @@ msgid "" "(Contributed by Brett Cannon and Christian Heimes in :issue:`45548`, :issue:" "`45570`, :issue:`45571`, and :issue:`43974`.)" msgstr "" +"``Modules/Setup`` 和 ``Modules/makesetup`` 已得到改進和綁定。現在可以通過 " +"``makesetup`` 建置擴充模組。除了一些測試模組外,所有模組都可以靜態鏈接到主要" +"的二進制文件或函式庫中。(由 Brett Cannon 和 Christian Heimes 在 :issue:" +"`45548`、:issue:`45570`、:issue:`45571` 和 :issue:`43974` 中貢獻。)" #: ../../whatsnew/3.11.rst:2146 msgid "" @@ -3308,6 +4096,9 @@ msgid "" "libraries. The :program:`configure` options :option:`!--with-tcltk-includes` " "and :option:`!--with-tcltk-libs` have been removed." msgstr "" +"使用環境變數 :envvar:`!TCLTK_CFLAGS` 和 :envvar:`!TCLTK_LIBS` 以手動指定 Tcl/" +"Tk 標頭檔和函式庫的位置。:program:`configure` 選項 :option:`!—with-tcltk-" +"includes` 和 :option:`!—with-tcltk-libs` 已被刪除。" #: ../../whatsnew/3.11.rst:2152 msgid "" @@ -3316,6 +4107,10 @@ msgid "" "directory ``Misc/rhel7`` contains ``.pc`` files and instructions on how to " "build Python with RHEL 7's and CentOS 7's Tcl/Tk and OpenSSL." msgstr "" +"RHEL 7 和 CentOS 7 上的開發套件並無提供 ``tcl.pc`` 和 ``tk.pc``;要使用 " +"``TCLTK_LIBS=\"-ltk8.5 -ltkstub8.5 -ltcl8.5\"``。目錄 ``Misc/rhel7`` 包含 ``." +"pc`` 檔案與如何使用 RHEL 7 和 CentOS 7 的 Tcl/Tk 與 OpenSSL 建置 Python 的指" +"示。" #: ../../whatsnew/3.11.rst:2157 msgid "" @@ -3328,22 +4123,32 @@ msgid "" "may be removed at some point in the future. (Contributed by Mark Dickinson " "in :issue:`45569`.)" msgstr "" +"CPython 現在預設使用 30-bit 數字來實作 Python :class:`int`。以前,在 " +"``SIZEOF_VOID_P >= 8`` 的平台上預設使用 30-bit 數字,否則使用 15-bit 數字,但" +"仍能通過配置腳本的 :option:`--enable-big-digits` 選項或(於 Windows)\\ ``PC/" +"pyconfig.h`` 中的 ``PYLONG_BITS_IN_DIGIT`` 變數來明確請求使用 15-bit 數字,但" +"此選項可能會在將來的某個時候被刪除。 (由 Mark Dickinson 在 :issue:`45569` 中" +"貢獻。)" #: ../../whatsnew/3.11.rst:2170 msgid "C API Changes" -msgstr "" +msgstr "C API 變更" #: ../../whatsnew/3.11.rst:2177 msgid "" "Add a new :c:func:`PyType_GetName` function to get type's short name. " "(Contributed by Hai Shi in :issue:`42035`.)" msgstr "" +"新增 :c:func:`PyType_GetName` 函式來取得型別的短名。(由 Hai Shi 於 :issue:" +"`42035` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2180 msgid "" "Add a new :c:func:`PyType_GetQualName` function to get type's qualified " "name. (Contributed by Hai Shi in :issue:`42035`.)" msgstr "" +"新增 :c:func:`PyType_GetQualName` 函式來取得型別的合格名稱 (qualified name)。" +"(由 Hai Shi 於 :issue:`42035` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2183 msgid "" @@ -3352,6 +4157,9 @@ msgid "" "resume tracing and profiling. (Contributed by Victor Stinner in :issue:" "`43760`.)" msgstr "" +"在受限 C API (limited C API) 中新增 :c:func:`PyThreadState_EnterTracing` 和 :" +"c:func:`PyThreadState_LeaveTracing` 函式來中止和繼續追蹤 (tracing) 和性能分" +"析 (profiling)。(由 Victor Stinner 於 :issue:`43760` 中貢獻。)" #: ../../whatsnew/3.11.rst:2188 msgid "" @@ -3359,12 +4167,14 @@ msgid "" "macro:`PY_VERSION_HEX`. (Contributed by Gabriele N. Tornetta in :issue:" "`43931`.)" msgstr "" +"添加了 :c:data:`Py_Version` 常數,其值與 :c:macro:`PY_VERSION_HEX` 相同。" +"(由 Gabriele N. Tornetta 在 :issue:`43931` 中貢獻。)" #: ../../whatsnew/3.11.rst:2192 msgid "" ":c:type:`Py_buffer` and APIs are now part of the limited API and the stable " "ABI:" -msgstr "" +msgstr ":c:type:`Py_buffer` 與 API 目前是受限 API 與穩定 ABI 中的一部分:" #: ../../whatsnew/3.11.rst:2195 msgid ":c:func:`PyObject_CheckBuffer`" @@ -3419,10 +4229,12 @@ msgid "" ":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." "bf_releasebuffer` type slots" msgstr "" +":c:member:`~PyBufferProcs.bf_getbuffer` 與 :c:member:`~PyBufferProcs." +"bf_releasebuffer` 型別插槽 (type slot)" #: ../../whatsnew/3.11.rst:2210 msgid "(Contributed by Christian Heimes in :issue:`45459`.)" -msgstr "" +msgstr "(由 Christian Heimes 於 :issue:`45459` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2212 msgid "" @@ -3431,6 +4243,9 @@ msgid "" "available directly (via :c:type:`PyCMethod`). (Contributed by Petr Viktorin " "in :issue:`46613`.)" msgstr "" +"新增 :c:data:`PyType_GetModuleByDef` 函式,它將被用於取得定義一個方法的模組," +"以免這項資訊無法直接被取得(透過 :c:type:`PyCMethod`)。(由 Petr Viktorin " +"於 :issue:`46613` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2217 msgid "" @@ -3439,6 +4254,10 @@ msgid "" "func:`PyFloat_Unpack2`, :c:func:`PyFloat_Unpack4` and :c:func:" "`PyFloat_Unpack8`. (Contributed by Victor Stinner in :issue:`46906`.)" msgstr "" +"新增函式以打包 (pack) 和取出 (unpack) C double(序列化和反序列化)::c:func:" +"`PyFloat_Pack2`、:c:func:`PyFloat_Pack4`、:c:func:`PyFloat_Pack8`、:c:func:" +"`PyFloat_Unpack2` , :c:func:`PyFloat_Unpack4` 和 :c:func:`PyFloat_Unpack8`。" +"(由 Victor Stinner 在 :issue:`46906` 中貢獻。)" #: ../../whatsnew/3.11.rst:2223 msgid "" @@ -3446,6 +4265,9 @@ msgid "" "`PyFrame_GetBuiltins`, :c:func:`PyFrame_GetGenerator`, :c:func:" "`PyFrame_GetGlobals`, :c:func:`PyFrame_GetLasti`." msgstr "" +"新增取得幀物件屬性的函式::c:func:`PyFrame_GetBuiltins`、:c:func:" +"`PyFrame_GetGenerator`、:c:func:`PyFrame_GetGlobals`、:c:func:" +"`PyFrame_GetLasti`。" #: ../../whatsnew/3.11.rst:2227 msgid "" @@ -3455,12 +4277,19 @@ msgid "" "`PyErr_GetExcInfo()` which work with the legacy 3-tuple representation of " "exceptions. (Contributed by Irit Katriel in :issue:`46343`.)" msgstr "" +"添加了兩個新函式來獲得和設置仍在作用的例外實例::c:func:" +"`PyErr_GetHandledException` 和 :c:func:`PyErr_SetHandledException`。這些是 :" +"c:func:`PyErr_SetExcInfo()` 和 :c:func:`PyErr_GetExcInfo()` 的替代品,它們與" +"例外的遺留三元組表示法一起作用。(由 Irit Katriel 在 :issue:`46343` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:2234 msgid "" "Added the :c:member:`PyConfig.safe_path` member. (Contributed by Victor " "Stinner in :gh:`57684`.)" msgstr "" +"新增 :c:member:`PyConfig.safe_path` 成員。(由 Victor Stinner 於 :gh:`57684` " +"中所貢獻。)" #: ../../whatsnew/3.11.rst:2245 msgid "" @@ -3473,6 +4302,12 @@ msgid "" "expected types. See :pep:`670` for more details. (Contributed by Victor " "Stinner and Erlend E. Aasland in :gh:`89653`.)" msgstr "" +"一些巨集已轉換為行內靜態函式以避免\\ `巨集陷阱 (macro pitfalls) `_。這種變化對用戶來說應該是透明" +"的,因為替換函式會將它們的引數轉換為預期的型別,以避免由於靜態型別檢查而產生" +"的編譯器警告。但是,當受限 C API 設置為 >=3.11 時,這些轉換不會完成,使用者需" +"要將引數轉換為他們期望的型別。有關更多詳細資訊,請參閱 :pep:`670`。 (由 " +"Victor Stinner 和 Erlend E. Aasland 在 :gh:`89653` 中貢獻。)" #: ../../whatsnew/3.11.rst:2256 msgid "" @@ -3481,6 +4316,9 @@ msgid "" "instance (the ``value`` argument). The function still steals references of " "all three arguments. (Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" +":c:func:`PyErr_SetExcInfo()` 不再使用 ``type`` 和 ``traceback`` 引數,直譯器" +"現在從例外實例(``value`` 引數)中獲得這些值。該函式仍會偷用這三個引數的參" +"照。(由 Irit Katriel 在 :issue:`45711` 中貢獻。)" #: ../../whatsnew/3.11.rst:2262 msgid "" @@ -3488,6 +4326,9 @@ msgid "" "fields of the result from the exception instance (the ``value`` field). " "(Contributed by Irit Katriel in :issue:`45711`.)" msgstr "" +":c:func:`PyErr_GetExcInfo()` 現在從例外實例的結果(``value`` 欄位)中導出 " +"``type`` 和 ``traceback`` 欄位。(由 Irit Katriel 在 :issue:`45711` 中貢" +"獻。)" #: ../../whatsnew/3.11.rst:2266 msgid "" @@ -3496,6 +4337,9 @@ msgid "" "``size`` field was the indicator. Now only non-negative values be used for " "``size``. (Contributed by Kumar Aditya in :issue:`46608`.)" msgstr "" +":c:struct:`_frozen` 有一個新的 ``is_package`` 欄位來表示凍結模組是否為一個套" +"件。以前 ``size`` 欄位中的負值是指標,現在只有非負值可用於 ``size``。 (由 " +"Kumar Aditya 在 :issue:`46608` 中貢獻。)" #: ../../whatsnew/3.11.rst:2272 msgid "" @@ -3503,6 +4347,9 @@ msgid "" "second parameter, instead of ``PyFrameObject*``. See :pep:`523` for more " "details of how to use this function pointer type." msgstr "" +":c:func:`_PyFrameEvalFunction` 現在將 ``_PyInterpreterFrame*`` 作為其第二個參" +"數,而不是 ``PyFrameObject*``。有關如何使用此函式指標型別的更多詳細資訊,請參" +"閱 :pep:`523`。" #: ../../whatsnew/3.11.rst:2276 msgid "" @@ -3512,6 +4359,10 @@ msgid "" "object using the compiler, then get a modified version with the ``replace`` " "method." msgstr "" +":c:func:`PyCode_New` 和 :c:func:`PyCode_NewWithPosOnlyArgs` 現在採用額外的 " +"``exception_table`` 引數。如果可能的話應該避免使用這些函數。要獲取自定義程式" +"碼物件,使用編譯器建立一個程式碼物件,然後使用 ``replace`` 方法來得到修改後的" +"版本。" #: ../../whatsnew/3.11.rst:2282 msgid "" @@ -3522,6 +4373,11 @@ msgid "" "(Contributed by Brandt Bucher in :issue:`46841` and Ken Jin in :gh:`92154` " "and :gh:`94936`.)" msgstr "" +":c:type:`PyCodeObject` 不再會有 ``co_code``、``co_varnames``、" +"``co_cellvars`` 和 ``co_freevars`` 欄位。分別被改為透過 C API 的 :c:func:" +"`PyCode_GetCode`、:c:func:`PyCode_GetVarnames`、:c:func:`PyCode_GetCellvars` " +"和 :c:func:`PyCode_GetFreevars` 來存取。(由 Brandt Bucher 在 :issue:" +"`46841`、Ken Jin 在 :gh:`92154` 與 :gh:`94936` 中貢獻。)" #: ../../whatsnew/3.11.rst:2290 msgid "" @@ -3529,20 +4385,31 @@ msgid "" "``Py_TRASHCAN_SAFE_END``) are now deprecated. They should be replaced by the " "new macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``." msgstr "" +"舊的回收筒巨集 (trashcan macro) (``Py_TRASHCAN_SAFE_BEGIN``/" +"``Py_TRASHCAN_SAFE_END``) 現在已經被棄用,它們應被新的巨集 " +"``Py_TRASHCAN_BEGIN`` 和 ``Py_TRASHCAN_END`` 所取代。" #: ../../whatsnew/3.11.rst:2294 msgid "A tp_dealloc function that has the old macros, such as::" msgstr "" +"一個用到老舊巨集的 tp_dealloc 函式,像是:\n" +"\n" +"::" #: ../../whatsnew/3.11.rst:2305 msgid "should migrate to the new macros as follows::" msgstr "" +"應該要搬遷到新的巨集,如下所示:\n" +"\n" +"::" #: ../../whatsnew/3.11.rst:2316 msgid "" "Note that ``Py_TRASHCAN_BEGIN`` has a second argument which should be the " "deallocation function it is in." msgstr "" +"請注意 ``Py_TRASHCAN_BEGIN`` 有第二個引數,它應該是它所在的釋放函數 " +"(deallocation function)。" #: ../../whatsnew/3.11.rst:2319 msgid "" @@ -3550,6 +4417,10 @@ msgid "" "following macros and use them throughout the code (credit: these were copied " "from the ``mypy`` codebase)::" msgstr "" +"為支援舊版 Python 在同一份程式碼中,你可以定義以下巨集並在程式碼中使用它們" +"(要歸功於 ``mypy`` 程式碼,這些是從那邊複製過來的):\n" +"\n" +"::" #: ../../whatsnew/3.11.rst:2331 msgid "" @@ -3558,6 +4429,10 @@ msgid "" "c:member:`PyTypeObject.tp_traverse`). (Contributed by Victor Stinner in :" "issue:`44263`.)" msgstr "" +"如果一個型別是以 :const:`Py_TPFLAGS_HAVE_GC` 旗標來定義,但卻沒有遍歷函式 " +"(traverse function) (:c:member:`PyTypeObject.tp_traverse`),那 :c:func:" +"`PyType_Ready` 函式現在會引發一個錯誤。(由 Victor Stinner 於 :issue:`44263` " +"中貢獻。)" #: ../../whatsnew/3.11.rst:2336 msgid "" @@ -3566,6 +4441,9 @@ msgid "" "ref:`static types `. (Contributed by Erlend E. Aasland in :" "issue:`43908`)" msgstr "" +"帶有 :const:`Py_TPFLAGS_IMMUTABLETYPE` 旗標的堆積型別現在可以繼承 :pep:`590` " +"向量呼叫協定 (vectorcall protocol)。以前這僅適用於 :ref:`static types " +"`。(由 Erlend E. Aasland 在 :issue:`43908` 中貢獻)。" #: ../../whatsnew/3.11.rst:2341 msgid "" @@ -3574,10 +4452,14 @@ msgid "" "new_type)``: see the :c:func:`Py_SET_TYPE()` function (available since " "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" +"由於 :c:func:`Py_TYPE()` 更改為行內靜態函式 (inline static function),因此 " +"``Py_TYPE(obj) = new_type`` 必須替換為 ``Py_SET_TYPE(obj, new_type)``:參見 :" +"c:func:`Py_SET_TYPE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這" +"個巨集:" #: ../../whatsnew/3.11.rst:2353 ../../whatsnew/3.11.rst:2367 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" -msgstr "" +msgstr "(由 Victor Stinner 於 :issue:`39573` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2355 msgid "" @@ -3586,6 +4468,10 @@ msgid "" "new_size)``: see the :c:func:`Py_SET_SIZE()` function (available since " "Python 3.9). For backward compatibility, this macro can be used::" msgstr "" +"由於 :c:func:`Py_SIZE()` 更改為行內靜態函式,因此 ``Py_SIZE(obj) = " +"new_size`` 必須替換為 ``Py_SET_SIZE(obj, new_size)``:參見 :c:func:" +"`Py_SET_SIZE()` 函式(自 Python 3.9 起可用)。為了向後相容,可以使用這個巨" +"集:" #: ../../whatsnew/3.11.rst:2369 msgid "" @@ -3595,6 +4481,10 @@ msgid "" "explicitly include the header files after ``#include ``. " "(Contributed by Victor Stinner in :issue:`45434`.)" msgstr "" +"當 ``Py_LIMITED_API`` 巨集被設定為 ``0x030b0000``\\ (Python 3.11)或以上," +"```` 不再會包含標頭檔 ````、````、```` " +"和 ````。C 擴充程式應該要清楚的在 ``#include `` 之後引入" +"標頭檔案。(由 Victor Stinner 於 :issue:`45434` 中貢獻。)" #: ../../whatsnew/3.11.rst:2375 msgid "" @@ -3606,6 +4496,12 @@ msgid "" "If they have been included directly, consider including ``Python.h`` " "instead. (Contributed by Victor Stinner in :issue:`35134`.)" msgstr "" +"非受限 API (non-limited API) 檔案 ``cellobject.h``、``classobject.h``、" +"``code.h``、``context.h``、``funcobject.h``、``genobject. h`` 和 " +"``longintrepr.h`` 已移至 ``Include/cpython`` 目錄。此外,``eval.h`` 標頭檔已" +"被刪除。不能直接引入這些文件,因為它們已被包含在 ``Python.h`` 中::ref:`引入" +"檔案 `。如果它們已被直接引入,請考慮改為引入 ``Python.h``。 " +"(由 Victor Stinner 在 :issue:`35134` 中貢獻。)" #: ../../whatsnew/3.11.rst:2383 msgid "" @@ -3614,6 +4510,9 @@ msgid "" "structures which are not available in the limited C API. (Contributed by " "Victor Stinner in :issue:`46007`.)" msgstr "" +":c:func:`PyUnicode_CHECK_INTERNED` 巨集已從受限 C API 中移出,它從來沒辦法被" +"使用,因為它使用了受限 C API 不提供的內部結構。(由 Victor Stinner 於 :issue:" +"`46007` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2388 msgid "" @@ -3621,6 +4520,8 @@ msgid "" "``#include ``, it's no longer needed to add ``#include " "``:" msgstr "" +"以下用於幀 (frame) 的函式與型別現在可直接透過 ``#include `` 來使" +"用,不必再加上 ``#include ``:" #: ../../whatsnew/3.11.rst:2392 msgid ":c:func:`PyFrame_Check`" @@ -3656,13 +4557,13 @@ msgstr ":c:type:`PyFrame_Type`" #: ../../whatsnew/3.11.rst:2401 msgid "(Contributed by Victor Stinner in :gh:`93937`.)" -msgstr "" +msgstr "(由 Victor Stinner 於 :gh:`93937` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2405 msgid "" "The :c:type:`PyFrameObject` structure members have been removed from the " "public C API." -msgstr "" +msgstr ":c:type:`PyFrameObject` 結構成員已經從公開的 C API 中移除。" #: ../../whatsnew/3.11.rst:2408 msgid "" @@ -3670,6 +4571,8 @@ msgid "" "subject to change at any time, they have been stable for a long time and " "were used in several popular extensions." msgstr "" +"雖然文件指出 :c:type:`PyFrameObject` 欄位隨時可能發生變化,但它們已經穩定了很" +"長時間,並被用於幾個流行的擴充套件中。" #: ../../whatsnew/3.11.rst:2412 msgid "" @@ -3677,38 +4580,40 @@ msgid "" "optimizations. Some fields were removed entirely, as they were details of " "the old implementation." msgstr "" +"Python 3.11 中,幀的結構被重新編制來為性能做最佳化,有些作為舊版實作細節的欄" +"位被整個移除。" #: ../../whatsnew/3.11.rst:2416 msgid ":c:type:`PyFrameObject` fields:" -msgstr "" +msgstr ":c:type:`PyFrameObject` 欄位:" #: ../../whatsnew/3.11.rst:2418 msgid "``f_back``: use :c:func:`PyFrame_GetBack`." -msgstr "" +msgstr "``f_back``:使用 :c:func:`PyFrame_GetBack`。" #: ../../whatsnew/3.11.rst:2419 msgid "``f_blockstack``: removed." -msgstr "" +msgstr "``f_blockstack``:已移除。" #: ../../whatsnew/3.11.rst:2420 msgid "``f_builtins``: use :c:func:`PyFrame_GetBuiltins`." -msgstr "" +msgstr "``f_builtins``:使用 :c:func:`PyFrame_GetBuiltins`。" #: ../../whatsnew/3.11.rst:2421 msgid "``f_code``: use :c:func:`PyFrame_GetCode`." -msgstr "" +msgstr "``f_code``:使用 :c:func:`PyFrame_GetCode`。" #: ../../whatsnew/3.11.rst:2422 msgid "``f_gen``: use :c:func:`PyFrame_GetGenerator`." -msgstr "" +msgstr "``f_gen``:使用 :c:func:`PyFrame_GetGenerator`。" #: ../../whatsnew/3.11.rst:2423 msgid "``f_globals``: use :c:func:`PyFrame_GetGlobals`." -msgstr "" +msgstr "``f_globals``:使用 :c:func:`PyFrame_GetGlobals`。" #: ../../whatsnew/3.11.rst:2424 msgid "``f_iblock``: removed." -msgstr "" +msgstr "``f_iblock``:已移除。" #: ../../whatsnew/3.11.rst:2425 msgid "" @@ -3716,46 +4621,53 @@ msgid "" "``PyCode_Addr2Line()`` should use :c:func:`PyFrame_GetLineNumber` instead; " "it may be faster." msgstr "" +"``f_lasti``:使用 :c:func:`PyFrame_GetLasti`。程式碼中 ``f_lasti`` 有與 " +"``PyCode_Addr2Line()`` 同時使用的部分應該改用 :c:func:" +"`PyFrame_GetLineNumber`;它可能會更快。" #: ../../whatsnew/3.11.rst:2428 msgid "``f_lineno``: use :c:func:`PyFrame_GetLineNumber`" -msgstr "" +msgstr "``f_lineno``:使用 :c:func:`PyFrame_GetLineNumber`" #: ../../whatsnew/3.11.rst:2429 msgid "``f_locals``: use :c:func:`PyFrame_GetLocals`." -msgstr "" +msgstr "``f_locals``:使用 :c:func:`PyFrame_GetLocals`。" #: ../../whatsnew/3.11.rst:2430 msgid "``f_stackdepth``: removed." -msgstr "" +msgstr "``f_stackdepth``:已移除。" #: ../../whatsnew/3.11.rst:2431 msgid "``f_state``: no public API (renamed to ``f_frame.f_state``)." -msgstr "" +msgstr "``f_state``:無公開 API(重新命名為 ``f_frame.f_state``)。" #: ../../whatsnew/3.11.rst:2432 msgid "``f_trace``: no public API." -msgstr "" +msgstr "``f_trace``:無公開 API。" #: ../../whatsnew/3.11.rst:2433 msgid "" "``f_trace_lines``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_lines\")``." msgstr "" +"``f_trace_lines``:使用 ``PyObject_GetAttrString((PyObject*)frame, " +"“f_trace_lines”)``。" #: ../../whatsnew/3.11.rst:2434 msgid "" "``f_trace_opcodes``: use ``PyObject_GetAttrString((PyObject*)frame, " "\"f_trace_opcodes\")``." msgstr "" +"``f_trace_opcodes``:使用 ``PyObject_GetAttrString((PyObject*)frame, " +"“f_trace_opcodes”)``。" #: ../../whatsnew/3.11.rst:2435 msgid "``f_localsplus``: no public API (renamed to ``f_frame.localsplus``)." -msgstr "" +msgstr "``f_localsplus``:無公開 API(重新命名為 ``f_frame.localsplus``)。" #: ../../whatsnew/3.11.rst:2436 msgid "``f_valuestack``: removed." -msgstr "" +msgstr "``f_valuestack``:已移除。" #: ../../whatsnew/3.11.rst:2438 msgid "" @@ -3764,6 +4676,8 @@ msgid "" "computed lazily. The :c:func:`PyFrame_GetBack` function must be called " "instead." msgstr "" +"Python 幀物件的建立現為惰性的 (lazily),一個副作用是 ``f_back`` 成員不能被直" +"接存取,因為其職的計算也是惰性的,要改呼叫 :c:func:`PyFrame_GetBack`。" #: ../../whatsnew/3.11.rst:2443 msgid "" @@ -3773,24 +4687,36 @@ msgid "" "they should not call those functions. The necessary updating of the frame is " "now managed by the virtual machine." msgstr "" +"直接存取 ``f_locals`` 的除錯器\\ *必須*\\ 改為呼叫 :c:func:" +"`PyFrame_GetLocals`。他們不再需要呼叫 :c:func:" +"`PyFrame_FastToLocalsWithError` 或 :c:func:`PyFrame_LocalsToFast`,事實上他們" +"不應該呼叫這些函式。框架的必要更新現在由虛擬機管理。" #: ../../whatsnew/3.11.rst:2449 msgid "Code defining ``PyFrame_GetCode()`` on Python 3.8 and older::" msgstr "" +"``PyFrame_GetCode()`` 在 Python 3.8 以前的程式定義:\n" +"\n" +"::" #: ../../whatsnew/3.11.rst:2459 msgid "Code defining ``PyFrame_GetBack()`` on Python 3.8 and older::" msgstr "" +"``PyFrame_GetBack()`` 在 Python 3.8 以前的程式定義:\n" +"\n" +"::" #: ../../whatsnew/3.11.rst:2469 msgid "" "Or use the `pythoncapi_compat project `__ to get these two functions on older Python versions." msgstr "" +"或是使用 `pythoncapi_compat 計畫 `__\\ 來在舊版 Python 中取得它們。" #: ../../whatsnew/3.11.rst:2473 msgid "Changes of the :c:type:`PyThreadState` structure members:" -msgstr "" +msgstr ":c:type:`PyThreadState` 結構成員的改動:" #: ../../whatsnew/3.11.rst:2475 msgid "" @@ -3798,6 +4724,9 @@ msgid "" "Python 3.9 by :issue:`40429`). Warning: the function returns a :term:`strong " "reference`, need to call :c:func:`Py_XDECREF`." msgstr "" +"``frame``:已移除,改用 :c:func:`PyThreadState_GetFrame`\\ (:issue:`40429` " +"於 Python 3.9 新增的函式)。警告:會回傳 :term:`strong reference` 的函式必須" +"呼叫 :c:func:`Py_XDECREF`。" #: ../../whatsnew/3.11.rst:2479 msgid "" @@ -3805,38 +4734,52 @@ msgid "" "`PyThreadState_LeaveTracing` (functions added to Python 3.11 by :issue:" "`43760`)." msgstr "" +"``tracing``:已變更,改用 :c:func:`PyThreadState_EnterTracing` 和 :c:func:" +"`PyThreadState_LeaveTracing`\\ (:issue:`43760` 於 Python 3.11 中新增的函" +"式)。" #: ../../whatsnew/3.11.rst:2482 msgid "" "``recursion_depth``: removed, use ``(tstate->recursion_limit - tstate-" ">recursion_remaining)`` instead." msgstr "" +"``recursion_depth``:已移除,請改用 ``(tstate->recursion_limit - tstate-" +">recursion_remaining)``。" #: ../../whatsnew/3.11.rst:2484 msgid "``stackcheck_counter``: removed." -msgstr "" +msgstr "``stackcheck_counter``:已移除。" #: ../../whatsnew/3.11.rst:2486 msgid "Code defining ``PyThreadState_GetFrame()`` on Python 3.8 and older::" msgstr "" +"``PyThreadState_GetFrame()`` 在 Python 3.8 以前的程式定義:\n" +"\n" +"::" #: ../../whatsnew/3.11.rst:2496 msgid "" "Code defining ``PyThreadState_EnterTracing()`` and " "``PyThreadState_LeaveTracing()`` on Python 3.10 and older::" msgstr "" +"``PyThreadState_EnterTracing()`` 與 ``PyThreadState_LeaveTracing()`` 在 " +"Python 3.10 以前的程式定義:\n" +"\n" +"::" #: ../../whatsnew/3.11.rst:2522 msgid "" "Or use `the pythoncapi_compat project `__ to get these functions on old Python functions." msgstr "" +"或是使用 `pythoncapi_compat 計畫 `__\\ 來在舊版 Python 函式中取得它們。" #: ../../whatsnew/3.11.rst:2526 msgid "" "Distributors are encouraged to build Python with the optimized Blake2 " "library `libb2`_." -msgstr "" +msgstr "鼓勵發布者們使用最佳化過的 Blake2 函式庫 `libb2`_ 來建置 Python。" #: ../../whatsnew/3.11.rst:2529 msgid "" @@ -3845,6 +4788,9 @@ msgid "" "initialize :data:`sys.path`. Otherwise, initialization will recalculate the " "path and replace any values added to ``module_search_paths``." msgstr "" +"初始化中若是要用 :c:member:`PyConfig.module_search_paths` 來初始化 :data:" +"`sys.path`,則現在 :c:member:`PyConfig.module_search_paths_set` 必須被設為 " +"1。否則,初始化會重新計算路徑並取代所有被加到 ``module_search_paths`` 的值。" #: ../../whatsnew/3.11.rst:2534 msgid "" @@ -3854,11 +4800,15 @@ msgid "" "c:func:`PySys_GetObject` to retrieve :data:`sys.path` as a Python list " "object and modify it directly." msgstr "" +":c:func:`PyConfig_Read` 不再計算初始搜索路徑,並且不會將任何值填充到 :c:" +"member:`PyConfig.module_search_paths` 中。若要計算預設路徑然後修改它們,完成" +"初始化並使用 :c:func:`PySys_GetObject` 以取得 :data:`sys.path` 作為 Python 列" +"表物件並直接修改它。" #: ../../whatsnew/3.11.rst:2545 msgid "" "Deprecate the following functions to configure the Python initialization:" -msgstr "" +msgstr "棄用以下用來配置 Python 初始化的函式:" #: ../../whatsnew/3.11.rst:2547 msgid ":c:func:`PySys_AddWarnOptionUnicode`" @@ -3914,18 +4864,22 @@ msgid "" "Configuration ` instead (:pep:`587`). (Contributed by Victor " "Stinner in :gh:`88279`.)" msgstr "" +"請改用 :ref:`Python 初始化配置 `\\ 中新的 :c:type:`PyConfig` " +"API。(由 Victor Stinner 於 :gh:`88279` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2564 msgid "" "Deprecate the ``ob_shash`` member of the :c:type:`PyBytesObject`. Use :c:" "func:`PyObject_Hash` instead. (Contributed by Inada Naoki in :issue:`46864`.)" msgstr "" +"棄用 :c:type:`PyBytesObject` 中的 ``ob_shash`` 成員。請改用 :c:func:" +"`PyObject_Hash`。(由 Inada Naoki 於 :issue:`46864` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2573 msgid "" "The following C APIs have been deprecated in earlier Python releases, and " "will be removed in Python 3.12." -msgstr "" +msgstr "以下 C API 已於先前 Python 發布版本中棄用,並將於 Python 3.12 中移除。" #: ../../whatsnew/3.11.rst:2576 msgid ":c:func:`PyUnicode_AS_DATA`" @@ -3996,10 +4950,12 @@ msgid "" ":c:func:`PyFrame_BlockSetup` and :c:func:`PyFrame_BlockPop` have been " "removed. (Contributed by Mark Shannon in :issue:`40222`.)" msgstr "" +"移除 :c:func:`PyFrame_BlockSetup` 和 :c:func:`PyFrame_BlockPop`。(由 Mark " +"Shannon 於 :issue:`40222` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2603 msgid "Remove the following math macros using the ``errno`` variable:" -msgstr "" +msgstr "移除以下使用到 ``errno`` 變數的數學巨集:" #: ../../whatsnew/3.11.rst:2605 msgid "``Py_ADJUST_ERANGE1()``" @@ -4023,7 +4979,7 @@ msgstr "``Py_SET_ERRNO_ON_MATH_ERROR()``" #: ../../whatsnew/3.11.rst:2611 msgid "(Contributed by Victor Stinner in :issue:`45412`.)" -msgstr "" +msgstr "(由 Victor Stinner 於 :issue:`45412` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2613 msgid "" @@ -4032,6 +4988,10 @@ msgid "" "(``wchar_t*`` string), and ``PyUnicode_Fill()`` functions instead. " "(Contributed by Victor Stinner in :issue:`41123`.)" msgstr "" +"移除在 Python 3.3 中棄用的 ``Py_UNICODE_COPY()`` 和 ``Py_UNICODE_FILL()``。請" +"改用 ``PyUnicode_CopyCharacters()`` 或 ``memcpy()``\\ (``wchar_t*`` 字串)" +"和 ``PyUnicode_Fill()`` 函式。(由 Victor Stinner 於 :issue:`41123` 中所貢" +"獻。)" #: ../../whatsnew/3.11.rst:2618 msgid "" @@ -4039,6 +4999,8 @@ msgid "" "extensions should only include the main ```` header file. " "(Contributed by Victor Stinner in :issue:`45434`.)" msgstr "" +"移除 ``pystrhex.h`` 標頭檔案。它只有包含私有函式。C 的擴充應該只要引入主要的 " +"```` 標頭檔案。(由 Victor Stinner 於 :issue:`45434` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2622 msgid "" @@ -4046,12 +5008,14 @@ msgid "" "``Py_IS_INFINITY()`` macro. (Contributed by Victor Stinner in :issue:" "`45440`.)" msgstr "" +"移除 ``Py_FORCE_DOUBLE()`` 巨集。它先前被用於 ``Py_IS_INFINITY()`` 巨集。" +"(由 Victor Stinner 於 :issue:`45440` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2626 msgid "" "The following items are no longer available when :c:macro:`Py_LIMITED_API` " "is defined:" -msgstr "" +msgstr "當 :c:macro:`Py_LIMITED_API` 有被定義時,以下項目將無法被取得:" #: ../../whatsnew/3.11.rst:2629 msgid ":c:func:`PyMarshal_WriteLongToFile`" @@ -4075,11 +5039,11 @@ msgstr "``Py_MARSHAL_VERSION`` 巨集" #: ../../whatsnew/3.11.rst:2635 msgid "These are not part of the :ref:`limited API `." -msgstr "" +msgstr "這些並非\\ :ref:`受限 API ` 的一部分。" #: ../../whatsnew/3.11.rst:2637 msgid "(Contributed by Victor Stinner in :issue:`45474`.)" -msgstr "" +msgstr "(由 Victor Stinner 於 :issue:`45474` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2639 msgid "" @@ -4087,6 +5051,9 @@ msgid "" "worked since the :c:type:`PyWeakReference` structure is opaque in the " "limited C API. (Contributed by Victor Stinner in :issue:`35134`.)" msgstr "" +"將 :c:func:`PyWeakref_GET_OBJECT` 排除於受限 C API 之外,它因為 :c:type:" +"`PyWeakReference` 結構在受限 C API 中過於晦澀而從未運作。(由 Victor Stinner " +"於 :issue:`35134` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2644 msgid "" @@ -4095,12 +5062,17 @@ msgid "" "``PyTypeObject.tp_members`` member instead. (Contributed by Victor Stinner " "in :issue:`40170`.)" msgstr "" +"移除 ``PyHeapType_GET_MEMBERS()`` 巨集,它是不小心才被放到公開的 C API 中,應" +"該只能被 Python 內部所使用。請改用 ``PyTypeObject.tp_members``。(由 Victor " +"Stinner 於 :issue:`40170` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2649 msgid "" "Remove the ``HAVE_PY_SET_53BIT_PRECISION`` macro (moved to the internal C " "API). (Contributed by Victor Stinner in :issue:`45412`.)" msgstr "" +"移除 ``HAVE_PY_SET_53BIT_PRECISION`` 巨集(移動至內部 C API)。(由 Victor " +"Stinner 於 :issue:`45412` 中所貢獻。)" #: ../../whatsnew/3.11.rst:2655 msgid "" @@ -4108,10 +5080,12 @@ msgid "" "since Python 3.3, are little used and are inefficient relative to the " "recommended alternatives." msgstr "" +"移除 :c:type:`Py_UNICODE` 編碼器 API,它們自從 Python 3.3 就被棄用,非常少用" +"且和推薦的替代方案已無太大關聯。" #: ../../whatsnew/3.11.rst:2660 msgid "The removed functions are:" -msgstr "" +msgstr "被移除的函式為:" #: ../../whatsnew/3.11.rst:2662 msgid ":func:`!PyUnicode_Encode`" @@ -4170,69 +5144,5 @@ msgid "" "See :pep:`624` for details and :pep:`migration guidance <624#alternative-" "apis>`. (Contributed by Inada Naoki in :issue:`44029`.)" msgstr "" - -#~ msgid ":func:`unittest.findTestCases`" -#~ msgstr ":func:`unittest.findTestCases`" - -#~ msgid ":func:`unittest.makeSuite`" -#~ msgstr ":func:`unittest.makeSuite`" - -#~ msgid ":func:`unittest.getTestCaseNames`" -#~ msgstr ":func:`unittest.getTestCaseNames`" - -#~ msgid "Use :class:`~unittest.TestLoader` method instead:" -#~ msgstr "改用 :class:`~unittest.TestLoader`:" - -#~ msgid "the :class:`configparser.SafeConfigParser` class" -#~ msgstr ":class:`configparser.SafeConfigParser` class" - -#~ msgid "the :attr:`configparser.ParsingError.filename` property" -#~ msgstr ":attr:`configparser.ParsingError.filename` 特性" - -#~ msgid ":envvar:`PYTHONTHREADDEBUG`" -#~ msgstr ":envvar:`PYTHONTHREADDEBUG`" - -#~ msgid ":func:`importlib.util.set_loader_wrapper`" -#~ msgstr ":func:`importlib.util.set_loader_wrapper`" - -#~ msgid ":func:`importlib.util.set_package_wrapper`" -#~ msgstr ":func:`importlib.util.set_package_wrapper`" - -#~ msgid ":meth:`importlib.abc.Loadermodule_repr`" -#~ msgstr ":meth:`importlib.abc.Loadermodule_repr`" - -#~ msgid ":meth:`importlib.machinery.BuiltinImporter.find_module`" -#~ msgstr ":meth:`importlib.machinery.BuiltinImporter.find_module`" - -#~ msgid ":meth:`importlib.machinery.BuiltinLoader.module_repr`" -#~ msgstr ":meth:`importlib.machinery.BuiltinLoader.module_repr`" - -#~ msgid ":meth:`importlib.machinery.FileFinder.find_loader`" -#~ msgstr ":meth:`importlib.machinery.FileFinder.find_loader`" - -#~ msgid ":meth:`importlib.machinery.FileFinder.find_module`" -#~ msgstr ":meth:`importlib.machinery.FileFinder.find_module`" - -#~ msgid ":meth:`importlib.machinery.FrozenImporter.find_module`" -#~ msgstr ":meth:`importlib.machinery.FrozenImporter.find_module`" - -#~ msgid ":meth:`importlib.machinery.FrozenLoader.module_repr`" -#~ msgstr ":meth:`importlib.machinery.FrozenLoader.module_repr`" - -#~ msgid ":meth:`importlib.machinery.WindowsRegistryFinder.find_module`" -#~ msgstr ":meth:`importlib.machinery.WindowsRegistryFinder.find_module`" - -#~ msgid ":func:`cgi.log`" -#~ msgstr ":func:`cgi.log`" - -#~ msgid ":func:`sqlite3.OptimizedUnicode`" -#~ msgstr ":func:`sqlite3.OptimizedUnicode`" - -#~ msgid ":func:`sqlite3.enable_shared_cache`" -#~ msgstr ":func:`sqlite3.enable_shared_cache`" - -#~ msgid "``a2b_hqx()``, ``b2a_hqx()``;" -#~ msgstr "``a2b_hqx()``, ``b2a_hqx()``;" - -#~ msgid "``rlecode_hqx()``, ``rledecode_hqx()``." -#~ msgstr "``rlecode_hqx()``, ``rledecode_hqx()``." +"詳情請見 :pep:`624` 與\\ :pep:`搬遷指南 <624#alternative-apis>`。(由 Inada " +"Naoki 於 :issue:`44029` 中所貢獻。)"