diff --git a/.scripts/summarize_progress/main.py b/.scripts/summarize_progress/main.py index c51541d347..8b4d86b4e4 100644 --- a/.scripts/summarize_progress/main.py +++ b/.scripts/summarize_progress/main.py @@ -77,7 +77,7 @@ def get_github_issues() -> list: match = re.search("(?P[^\s`][a-zA-z-]+)/(?P[a-zA-Z0-9._-]+(.po)?)", title) if not match: continue - + dirname, filename = match.group('dirname', 'filename') if not filename.endswith('.po'): filename += '.po' @@ -98,7 +98,7 @@ def format_line_directory(dirname: str) -> str: issue_list = get_github_issues() ''' - Search all the po file in the directory, + Search all the po file in the directory, and record the translation progress of each files. ''' BASE_DIR = Path("../") diff --git a/README.rst b/README.rst index e6454d97ff..17d75894ad 100644 --- a/README.rst +++ b/README.rst @@ -322,8 +322,8 @@ rST 語法注意事項 術語表 Glossary =============== -為了讓翻譯保持統一,我們整理了一份 `術語列表 -`_ \ +為了讓翻譯保持統一,我們整理了一份 \ +`術語列表 `_ \ 如果翻譯過程中你覺得需要術語列表有所缺漏,請至 `Discussion \ `_ 開啟新的討論補充術語。\ 新增的術語,將會於每次 Sprint 中共同討論是否合併進術語列表。 diff --git a/c-api/function.po b/c-api/function.po index 82a3b718aa..5881bd5baa 100644 --- a/c-api/function.po +++ b/c-api/function.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-12-07 00:03+0000\n" "PO-Revision-Date: 2022-11-12 15:45+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -66,22 +66,24 @@ msgid "" "The function's docstring and name are retrieved from the code object. " "*__module__* is retrieved from *globals*. The argument defaults, annotations " "and closure are set to ``NULL``. *__qualname__* is set to the same value as " -"the code object's ``co_qualname`` field." +"the code object's :attr:`~codeobject.co_qualname` field." msgstr "" "函式的文件字串 (docstring) 和名稱是從程式碼物件所取得,*__module__* 是自 " "*globals* 所取得。引數預設值、標註 (annotation) 和閉包 (closure) 被設為 " -"``NULL``,*__qualname__* 被設為和程式碼物件 ``co_qualname`` 欄位相同的值。" +"``NULL``,*__qualname__* 被設為和程式碼物件 :attr:`~codeobject.co_qualname` " +"欄位相同的值。" #: ../../c-api/function.rst:45 msgid "" "As :c:func:`PyFunction_New`, but also allows setting the function object's " "``__qualname__`` attribute. *qualname* should be a unicode object or " "``NULL``; if ``NULL``, the ``__qualname__`` attribute is set to the same " -"value as the code object's ``co_qualname`` field." +"value as the code object's :attr:`~codeobject.co_qualname` field." msgstr "" "和 :c:func:`PyFunction_New` 相似,但也允許函式物件 ``__qualname__`` 屬性的設" "定,*qualname* 應為一個 unicode 物件或是 ``NULL``;如為 ``NULL``," -"``__qualname__`` 屬性會被設為與程式碼物件 ``co_qualname`` 欄位相同的值。" +"``__qualname__`` 屬性會被設為與程式碼物件 :attr:`~codeobject.co_qualname` 欄" +"位相同的值。" #: ../../c-api/function.rst:55 msgid "Return the code object associated with the function object *op*." diff --git a/c-api/import.po b/c-api/import.po index 357ddf9c79..38826bfcd9 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-29 00:03+0000\n" +"POT-Creation-Date: 2023-12-07 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:06+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -154,7 +154,8 @@ msgstr "" #: ../../c-api/import.rst:140 msgid "" "The module's :attr:`__file__` attribute will be set to the code object's :" -"attr:`!co_filename`. If applicable, :attr:`__cached__` will also be set." +"attr:`~codeobject.co_filename`. If applicable, :attr:`__cached__` will also " +"be set." msgstr "" #: ../../c-api/import.rst:144 diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 1c052f1ed6..d56edab094 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-29 12:27+0000\n" +"POT-Creation-Date: 2023-12-07 00:03+0000\n" "PO-Revision-Date: 2018-05-23 14:33+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -417,12 +417,13 @@ msgstr ":c:member:`~PyTypeObject.tp_dict`" #: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:113 #: ../../c-api/typeobj.rst:132 ../../c-api/typeobj.rst:134 #: ../../c-api/typeobj.rst:136 ../../c-api/typeobj.rst:140 -#: ../../c-api/typeobj.rst:341 ../../c-api/typeobj.rst:356 -#: ../../c-api/typeobj.rst:368 ../../c-api/typeobj.rst:370 -#: ../../c-api/typeobj.rst:381 ../../c-api/typeobj.rst:392 -#: ../../c-api/typeobj.rst:404 ../../c-api/typeobj.rst:406 -#: ../../c-api/typeobj.rst:412 ../../c-api/typeobj.rst:414 -#: ../../c-api/typeobj.rst:416 ../../c-api/typeobj.rst:431 +#: ../../c-api/typeobj.rst:341 ../../c-api/typeobj.rst:346 +#: ../../c-api/typeobj.rst:356 ../../c-api/typeobj.rst:368 +#: ../../c-api/typeobj.rst:370 ../../c-api/typeobj.rst:381 +#: ../../c-api/typeobj.rst:392 ../../c-api/typeobj.rst:404 +#: ../../c-api/typeobj.rst:406 ../../c-api/typeobj.rst:412 +#: ../../c-api/typeobj.rst:414 ../../c-api/typeobj.rst:416 +#: ../../c-api/typeobj.rst:429 ../../c-api/typeobj.rst:431 #: ../../c-api/typeobj.rst:435 ../../c-api/typeobj.rst:440 #: ../../c-api/typeobj.rst:446 msgid ":c:type:`PyObject` *" @@ -533,8 +534,7 @@ msgid "[:c:member:`~PyTypeObject.tp_subclasses`]" msgstr "[:c:member:`~PyTypeObject.tp_subclasses`]" #: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:138 -#: ../../c-api/typeobj.rst:279 ../../c-api/typeobj.rst:346 -#: ../../c-api/typeobj.rst:348 ../../c-api/typeobj.rst:429 +#: ../../c-api/typeobj.rst:279 ../../c-api/typeobj.rst:348 msgid "void *" msgstr "void *" diff --git a/glossary.po b/glossary.po index 0b844c07ab..3576f8f629 100644 --- a/glossary.po +++ b/glossary.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-09 00:04+0000\n" +"POT-Creation-Date: 2023-12-07 00:03+0000\n" "PO-Revision-Date: 2023-07-02 22:47+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -370,15 +370,15 @@ msgstr "binary file(二進位檔案)" msgid "" "A :term:`file object` able to read and write :term:`bytes-like objects " "`. Examples of binary files are files opened in binary " -"mode (``'rb'``, ``'wb'`` or ``'rb+'``), :data:`sys.stdin.buffer`, :data:`sys." -"stdout.buffer`, and instances of :class:`io.BytesIO` and :class:`gzip." -"GzipFile`." +"mode (``'rb'``, ``'wb'`` or ``'rb+'``), :data:`sys.stdin.buffer `, :data:`sys.stdout.buffer `, and instances of :class:`io." +"BytesIO` and :class:`gzip.GzipFile`." msgstr "" "一個能夠讀取和寫入 :term:`bytes-like objects `\\ (類位元" "組串物件)的 :term:`file object`\\ (檔案物件)。二進位檔案的例子有:以二進位" -"模式(``'rb'``、``'wb'`` 或 ``'rb+'``)開啟的檔案、:data:`sys.stdin." -"buffer`、:data:`sys.stdout.buffer`,以及 :class:`io.BytesIO` 和 :class:`gzip." -"GzipFile` 實例。" +"模式(``'rb'``、``'wb'`` 或 ``'rb+'``)開啟的檔案、:data:`sys.stdin.buffer " +"`、:data:`sys.stdout.buffer `,以及 :class:`io." +"BytesIO` 和 :class:`gzip.GzipFile` 實例。" #: ../../glossary.rst:167 msgid "" @@ -694,25 +694,25 @@ msgstr "descriptor(描述器)" #: ../../glossary.rst:316 msgid "" -"Any object which defines the methods :meth:`__get__`, :meth:`__set__`, or :" -"meth:`__delete__`. When a class attribute is a descriptor, its special " -"binding behavior is triggered upon attribute lookup. Normally, using *a.b* " -"to get, set or delete an attribute looks up the object named *b* in the " -"class dictionary for *a*, but if *b* is a descriptor, the respective " -"descriptor method gets called. Understanding descriptors is a key to a deep " -"understanding of Python because they are the basis for many features " -"including functions, methods, properties, class methods, static methods, and " -"reference to super classes." -msgstr "" -"任何定義了 :meth:`__get__`、:meth:`__set__` 或 :meth:`__delete__` method 的物" -"件。當一個 class 屬性是一個描述器時,它的特殊連結行為會在屬性查找時被觸發。通" -"常,使用 *a.b* 來取得、設定或刪除某個屬性時,會在 *a* 的 class 字典中查找名稱" -"為 *b* 的物件,但如果 *b* 是一個描述器,則相對應的描述器 method 會被呼叫。對" -"描述器的理解是深入理解 Python 的關鍵,因為它們是許多功能的基礎,這些功能包括" -"函式、method、屬性 (property)、class method、靜態 method,以及對 super class" -"(父類別)的參照。" - -#: ../../glossary.rst:326 +"Any object which defines the methods :meth:`~object.__get__`, :meth:`~object." +"__set__`, or :meth:`~object.__delete__`. When a class attribute is a " +"descriptor, its special binding behavior is triggered upon attribute " +"lookup. Normally, using *a.b* to get, set or delete an attribute looks up " +"the object named *b* in the class dictionary for *a*, but if *b* is a " +"descriptor, the respective descriptor method gets called. Understanding " +"descriptors is a key to a deep understanding of Python because they are the " +"basis for many features including functions, methods, properties, class " +"methods, static methods, and reference to super classes." +msgstr "" +"任何定義了 :meth:`~object.__get__`、:meth:`~object.__set__` 或 :meth:" +"`~object.__delete__` method 的物件。當一個 class 屬性是一個描述器時,它的特殊" +"連結行為會在屬性查找時被觸發。通常,使用 *a.b* 來取得、設定或刪除某個屬性時," +"會在 *a* 的 class 字典中查找名稱為 *b* 的物件,但如果 *b* 是一個描述器,則相" +"對應的描述器 method 會被呼叫。對描述器的理解是深入理解 Python 的關鍵,因為它" +"們是許多功能的基礎,這些功能包括函式、method、屬性 (property)、class method、" +"靜態 method,以及對 super class(父類別)的參照。" + +#: ../../glossary.rst:327 msgid "" "For more information about descriptors' methods, see :ref:`descriptors` or " "the :ref:`Descriptor How To Guide `." @@ -720,25 +720,25 @@ msgstr "" "關於描述器 method 的更多資訊,請參閱\\ :ref:`descriptors`\\ 或\\ :ref:`描述器" "使用指南 `。" -#: ../../glossary.rst:328 +#: ../../glossary.rst:329 msgid "dictionary" msgstr "dictionary(字典)" -#: ../../glossary.rst:330 +#: ../../glossary.rst:331 msgid "" "An associative array, where arbitrary keys are mapped to values. The keys " -"can be any object with :meth:`__hash__` and :meth:`__eq__` methods. Called a " -"hash in Perl." +"can be any object with :meth:`~object.__hash__` and :meth:`~object.__eq__` " +"methods. Called a hash in Perl." msgstr "" "一個關聯陣列 (associative array),其中任意的鍵會被映射到值。鍵可以是任何帶" -"有 :meth:`__hash__` 和 :meth:`__eq__` method 的物件。在 Perl 中被稱為雜湊 " -"(hash)。" +"有 :meth:`~object.__hash__` 和 :meth:`~object.__eq__` method 的物件。在 Perl " +"中被稱為雜湊 (hash)。" -#: ../../glossary.rst:333 +#: ../../glossary.rst:335 msgid "dictionary comprehension" msgstr "dictionary comprehension(字典綜合運算)" -#: ../../glossary.rst:335 +#: ../../glossary.rst:337 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a dictionary with the results. ``results = {n: n ** 2 for n in " @@ -749,11 +749,11 @@ msgstr "" "字典回傳。``results = {n: n ** 2 for n in range(10)}`` 會產生一個字典,它包含" "了鍵 ``n`` 映射到值 ``n ** 2``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:339 +#: ../../glossary.rst:341 msgid "dictionary view" msgstr "dictionary view(字典檢視)" -#: ../../glossary.rst:341 +#: ../../glossary.rst:343 msgid "" "The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:" "`dict.items` are called dictionary views. They provide a dynamic view on the " @@ -766,11 +766,11 @@ msgstr "" "反映這些變動。若要強制將字典檢視轉為完整的 list(串列),須使用 " "``list(dictview)``。請參閱\\ :ref:`dict-views`。" -#: ../../glossary.rst:347 +#: ../../glossary.rst:349 msgid "docstring" msgstr "docstring(說明字串)" -#: ../../glossary.rst:349 +#: ../../glossary.rst:351 msgid "" "A string literal which appears as the first expression in a class, function " "or module. While ignored when the suite is executed, it is recognized by " @@ -783,11 +783,11 @@ msgstr "" "`__doc__` 屬性中。由於說明字串可以透過內省 (introspection) 來瀏覽,因此它是物" "件的說明文件存放的標準位置。" -#: ../../glossary.rst:355 +#: ../../glossary.rst:357 msgid "duck-typing" msgstr "duck-typing(鴨子型別)" -#: ../../glossary.rst:357 +#: ../../glossary.rst:359 msgid "" "A programming style which does not look at an object's type to determine if " "it has the right interface; instead, the method or attribute is simply " @@ -808,11 +808,11 @@ msgstr "" "來補充。)然而,它通常會採用 :func:`hasattr` 測試,或是 :term:`EAFP` 程式設計" "風格。" -#: ../../glossary.rst:366 +#: ../../glossary.rst:368 msgid "EAFP" msgstr "EAFP" -#: ../../glossary.rst:368 +#: ../../glossary.rst:370 msgid "" "Easier to ask for forgiveness than permission. This common Python coding " "style assumes the existence of valid keys or attributes and catches " @@ -827,11 +827,11 @@ msgstr "" "keyword:`except` 陳述式。該技術與許多其他語言(例如 C)常見的 :term:`LBYL` 風" "格形成了對比。" -#: ../../glossary.rst:374 +#: ../../glossary.rst:376 msgid "expression" msgstr "expression(運算式)" -#: ../../glossary.rst:376 +#: ../../glossary.rst:378 msgid "" "A piece of syntax which can be evaluated to some value. In other words, an " "expression is an accumulation of expression elements like literals, names, " @@ -847,11 +847,11 @@ msgstr "" "(陳述式)不能被用作運算式,例如 :keyword:`while`。賦值 (assignment) 也是陳述" "式,而不是運算式。" -#: ../../glossary.rst:383 +#: ../../glossary.rst:385 msgid "extension module" msgstr "extension module(擴充模組)" -#: ../../glossary.rst:385 +#: ../../glossary.rst:387 msgid "" "A module written in C or C++, using Python's C API to interact with the core " "and with user code." @@ -859,11 +859,11 @@ msgstr "" "一個以 C 或 C++ 編寫的模組,它使用 Python 的 C API 來與核心及使用者程式碼進行" "互動。" -#: ../../glossary.rst:387 +#: ../../glossary.rst:389 msgid "f-string" msgstr "f-string(f 字串)" -#: ../../glossary.rst:389 +#: ../../glossary.rst:391 msgid "" "String literals prefixed with ``'f'`` or ``'F'`` are commonly called \"f-" "strings\" which is short for :ref:`formatted string literals `. " @@ -872,26 +872,26 @@ msgstr "" "以 ``'f'`` 或 ``'F'`` 為前綴的字串文本通常被稱為「f 字串」,它是\\ :ref:`格式" "化的字串文本 `\\ 的縮寫。另請參閱 :pep:`498`。" -#: ../../glossary.rst:392 +#: ../../glossary.rst:394 msgid "file object" msgstr "file object(檔案物件)" -#: ../../glossary.rst:394 +#: ../../glossary.rst:396 msgid "" -"An object exposing a file-oriented API (with methods such as :meth:`read()` " -"or :meth:`write()`) to an underlying resource. Depending on the way it was " +"An object exposing a file-oriented API (with methods such as :meth:`!read` " +"or :meth:`!write`) to an underlying resource. Depending on the way it was " "created, a file object can mediate access to a real on-disk file or to " "another type of storage or communication device (for example standard input/" "output, in-memory buffers, sockets, pipes, etc.). File objects are also " "called :dfn:`file-like objects` or :dfn:`streams`." msgstr "" -"一個讓使用者透過檔案導向 (file-oriented) API(如 :meth:`read()` 或 :meth:" -"`write()` 等 method)來操作底層資源的物件。根據檔案物件被建立的方式,它能夠協" -"調對真實磁碟檔案或是其他類型的儲存器或通訊裝置(例如標準輸入/輸出、記憶體內" -"緩衝區、socket(插座)、管線 (pipe) 等)的存取。檔案物件也被稱為\\ :dfn:`類檔" -"案物件 (file-like object)` 或\\ :dfn:`串流 (stream)`。" +"一個讓使用者透過檔案導向 (file-oriented) API(如 :meth:`!read` 或 :meth:`!" +"write` 等 method)來操作底層資源的物件。根據檔案物件被建立的方式,它能夠協調" +"對真實磁碟檔案或是其他類型的儲存器或通訊裝置(例如標準輸入/輸出、記憶體內緩" +"衝區、socket(插座)、管線 (pipe) 等)的存取。檔案物件也被稱為\\ :dfn:`類檔案" +"物件 (file-like object)` 或\\ :dfn:`串流 (stream)`。" -#: ../../glossary.rst:402 +#: ../../glossary.rst:404 msgid "" "There are actually three categories of file objects: raw :term:`binary files " "`, buffered :term:`binary files ` and :term:`text " @@ -903,19 +903,19 @@ msgstr "" "term:`二進位檔案 `\\ 和\\ :term:`文字檔案 `。它們的介" "面在 :mod:`io` 模組中被定義。建立檔案物件的標準方法是使用 :func:`open` 函式。" -#: ../../glossary.rst:407 +#: ../../glossary.rst:409 msgid "file-like object" msgstr "file-like object(類檔案物件)" -#: ../../glossary.rst:409 +#: ../../glossary.rst:411 msgid "A synonym for :term:`file object`." msgstr ":term:`file object`\\ (檔案物件)的同義字。" -#: ../../glossary.rst:410 +#: ../../glossary.rst:412 msgid "filesystem encoding and error handler" msgstr "filesystem encoding and error handler(檔案系統編碼和錯誤處理函式)" -#: ../../glossary.rst:412 +#: ../../glossary.rst:414 msgid "" "Encoding and error handler used by Python to decode bytes from the operating " "system and encode Unicode to the operating system." @@ -923,7 +923,7 @@ msgstr "" "Python 所使用的一種編碼和錯誤處理函式,用來解碼來自作業系統的位元組,以及將 " "Unicode 編碼到作業系統。" -#: ../../glossary.rst:415 +#: ../../glossary.rst:417 msgid "" "The filesystem encoding must guarantee to successfully decode all bytes " "below 128. If the file system encoding fails to provide this guarantee, API " @@ -932,7 +932,7 @@ msgstr "" "檔案系統編碼必須保證能成功解碼所有小於 128 的位元組。如果檔案系統編碼無法提供" "此保證,則 API 函式會引發 :exc:`UnicodeError`。" -#: ../../glossary.rst:419 +#: ../../glossary.rst:421 msgid "" "The :func:`sys.getfilesystemencoding` and :func:`sys." "getfilesystemencodeerrors` functions can be used to get the filesystem " @@ -941,7 +941,7 @@ msgstr "" ":func:`sys.getfilesystemencoding` 和 :func:`sys.getfilesystemencodeerrors` 函" "式可用於取得檔案系統編碼和錯誤處理函式。" -#: ../../glossary.rst:423 +#: ../../glossary.rst:425 msgid "" "The :term:`filesystem encoding and error handler` are configured at Python " "startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." @@ -953,22 +953,22 @@ msgstr "" "member:`~PyConfig.filesystem_encoding`,以及 :c:type:`PyConfig` 的成員 :c:" "member:`~PyConfig.filesystem_errors`。" -#: ../../glossary.rst:428 +#: ../../glossary.rst:430 msgid "See also the :term:`locale encoding`." msgstr "另請參閱 :term:`locale encoding`\\ (區域編碼)。" -#: ../../glossary.rst:429 +#: ../../glossary.rst:431 msgid "finder" msgstr "finder(尋檢器)" -#: ../../glossary.rst:431 +#: ../../glossary.rst:433 msgid "" "An object that tries to find the :term:`loader` for a module that is being " "imported." msgstr "" "一個物件,它會嘗試為正在被 import 的模組尋找 :term:`loader`\\ (載入器)。" -#: ../../glossary.rst:434 +#: ../../glossary.rst:436 msgid "" "Since Python 3.3, there are two types of finder: :term:`meta path finders " "` for use with :data:`sys.meta_path`, and :term:`path " @@ -979,15 +979,15 @@ msgstr "" "目尋檢器 (path entry finder) ` 會使用 :data:`sys." "path_hooks`。" -#: ../../glossary.rst:438 +#: ../../glossary.rst:440 msgid "See :pep:`302`, :pep:`420` and :pep:`451` for much more detail." msgstr "請參閱 :pep:`302`、:pep:`420` 和 :pep:`451` 以了解更多細節。" -#: ../../glossary.rst:439 +#: ../../glossary.rst:441 msgid "floor division" msgstr "floor division(向下取整除法)" -#: ../../glossary.rst:441 +#: ../../glossary.rst:443 msgid "" "Mathematical division that rounds down to nearest integer. The floor " "division operator is ``//``. For example, the expression ``11 // 4`` " @@ -1000,11 +1000,11 @@ msgstr "" "``2.75`` 不同。請注意,``(-11) // 4`` 的結果是 ``-3``,因為是 ``-2.75`` 被\\ " "*向下*\\ 無條件捨去。請參閱 :pep:`238`。" -#: ../../glossary.rst:446 +#: ../../glossary.rst:448 msgid "function" msgstr "function(函式)" -#: ../../glossary.rst:448 +#: ../../glossary.rst:450 msgid "" "A series of statements which returns some value to a caller. It can also be " "passed zero or more :term:`arguments ` which may be used in the " @@ -1016,15 +1016,15 @@ msgstr "" "`parameter`\\ (參數)、\\ :term:`method`\\ (方法),以及\\ :ref:" "`function`\\ 章節。" -#: ../../glossary.rst:452 +#: ../../glossary.rst:454 msgid "function annotation" msgstr "function annotation(函式註釋)" -#: ../../glossary.rst:454 +#: ../../glossary.rst:456 msgid "An :term:`annotation` of a function parameter or return value." msgstr "函式參數或回傳值的一個 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:456 +#: ../../glossary.rst:458 msgid "" "Function annotations are usually used for :term:`type hints `: " "for example, this function is expected to take two :class:`int` arguments " @@ -1033,11 +1033,11 @@ msgstr "" "函式註釋通常被使用於\\ :term:`型別提示 `\\ :例如,這個函式預期會" "得到兩個 :class:`int` 引數,並會有一個 :class:`int` 回傳值: ::" -#: ../../glossary.rst:464 +#: ../../glossary.rst:466 msgid "Function annotation syntax is explained in section :ref:`function`." msgstr "函式註釋的語法在\\ :ref:`function`\\ 章節有詳細解釋。" -#: ../../glossary.rst:466 +#: ../../glossary.rst:468 msgid "" "See :term:`variable annotation` and :pep:`484`, which describe this " "functionality. Also see :ref:`annotations-howto` for best practices on " @@ -1046,11 +1046,11 @@ msgstr "" "請參閱 :term:`variable annotation` 和 :pep:`484`,皆有此功能的描述。關於註釋" "的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:470 +#: ../../glossary.rst:472 msgid "__future__" msgstr "__future__" -#: ../../glossary.rst:472 +#: ../../glossary.rst:474 msgid "" "A :ref:`future statement `, ``from __future__ import ``, " "directs the compiler to compile the current module using syntax or semantics " @@ -1066,11 +1066,11 @@ msgstr "" "import 此模組並對其變數求值,你可以看見一個新的功能是何時首次被新增到此語言" "中,以及它何時將會(或已經)成為預設的功能: ::" -#: ../../glossary.rst:483 +#: ../../glossary.rst:485 msgid "garbage collection" msgstr "garbage collection(垃圾回收)" -#: ../../glossary.rst:485 +#: ../../glossary.rst:487 msgid "" "The process of freeing memory when it is not used anymore. Python performs " "garbage collection via reference counting and a cyclic garbage collector " @@ -1082,11 +1082,11 @@ msgstr "" "垃圾回收器 (cyclic garbage collector) 來完成。垃圾回收器可以使用 :mod:`gc` 模" "組對其進行控制。" -#: ../../glossary.rst:490 ../../glossary.rst:491 +#: ../../glossary.rst:492 ../../glossary.rst:493 msgid "generator" msgstr "generator(產生器)" -#: ../../glossary.rst:493 +#: ../../glossary.rst:495 msgid "" "A function which returns a :term:`generator iterator`. It looks like a " "normal function except that it contains :keyword:`yield` expressions for " @@ -1097,7 +1097,7 @@ msgstr "" "個正常的函式,但不同的是它包含了 :keyword:`yield` 運算式,能產生一系列的值," "這些值可用於 for 迴圈,或是以 :func:`next` 函式,每次檢索其中的一個值。" -#: ../../glossary.rst:498 +#: ../../glossary.rst:500 msgid "" "Usually refers to a generator function, but may refer to a *generator " "iterator* in some contexts. In cases where the intended meaning isn't " @@ -1106,15 +1106,15 @@ msgstr "" "這個術語通常用來表示一個產生器函式,但在某些情境中,也可能是表示\\ *產生器疊" "代器*。萬一想表達的意思不夠清楚,那就使用完整的術語,以避免歧義。" -#: ../../glossary.rst:501 +#: ../../glossary.rst:503 msgid "generator iterator" msgstr "generator iterator(產生器疊代器)" -#: ../../glossary.rst:503 +#: ../../glossary.rst:505 msgid "An object created by a :term:`generator` function." msgstr "一個由 :term:`generator`\\ (產生器)函式所建立的物件。" -#: ../../glossary.rst:505 +#: ../../glossary.rst:507 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " "location execution state (including local variables and pending try-" @@ -1125,11 +1125,11 @@ msgstr "" "中的 try 陳述式)。當\\ *產生器疊代器*\\ 回復時,它會從停止的地方繼續執行(與" "那些每次調用時都要重新開始的函式有所不同)。" -#: ../../glossary.rst:511 ../../glossary.rst:512 +#: ../../glossary.rst:513 ../../glossary.rst:514 msgid "generator expression" msgstr "generator expression(產生器運算式)" -#: ../../glossary.rst:514 +#: ../../glossary.rst:516 msgid "" "An expression that returns an iterator. It looks like a normal expression " "followed by a :keyword:`!for` clause defining a loop variable, range, and an " @@ -1140,11 +1140,11 @@ msgstr "" "`!for` 子句,該子句定義了迴圈變數、範圍以及一個選擇性的 :keyword:`!if` 子句。" "該組合運算式會為外層函式產生多個值: ::" -#: ../../glossary.rst:521 +#: ../../glossary.rst:523 msgid "generic function" msgstr "generic function(泛型函式)" -#: ../../glossary.rst:523 +#: ../../glossary.rst:525 msgid "" "A function composed of multiple functions implementing the same operation " "for different types. Which implementation should be used during a call is " @@ -1153,7 +1153,7 @@ msgstr "" "一個由多個函式組成的函式,該函式會對不同的型別實作相同的運算。呼叫期間應該使" "用哪種實作,是由調度演算法 (dispatch algorithm) 來決定。" -#: ../../glossary.rst:527 +#: ../../glossary.rst:529 msgid "" "See also the :term:`single dispatch` glossary entry, the :func:`functools." "singledispatch` decorator, and :pep:`443`." @@ -1161,11 +1161,11 @@ msgstr "" "另請參閱 :term:`single dispatch`\\ (單一調度)術語表條目、\\ :func:" "`functools.singledispatch` 裝飾器和 :pep:`443`。" -#: ../../glossary.rst:529 +#: ../../glossary.rst:531 msgid "generic type" msgstr "generic type(泛型型別)" -#: ../../glossary.rst:531 +#: ../../glossary.rst:533 msgid "" "A :term:`type` that can be parameterized; typically a :ref:`container " "class` such as :class:`list` or :class:`dict`. Used for :" @@ -1175,7 +1175,7 @@ msgstr "" "`容器型別 `,像是 :class:`list` 和 :class:`dict`。它被用於" "\\ :term:`型別提示 `\\ 和\\ :term:`註釋 `。" -#: ../../glossary.rst:536 +#: ../../glossary.rst:538 msgid "" "For more details, see :ref:`generic alias types`, :pep:" "`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." @@ -1183,19 +1183,19 @@ msgstr "" "詳情請參閱\\ :ref:`泛型別名型別 `、:pep:`483`、:pep:" "`484`、:pep:`585` 和 :mod:`typing` 模組。" -#: ../../glossary.rst:538 +#: ../../glossary.rst:540 msgid "GIL" msgstr "GIL" -#: ../../glossary.rst:540 +#: ../../glossary.rst:542 msgid "See :term:`global interpreter lock`." msgstr "請參閱 :term:`global interpreter lock`\\ (全域直譯器鎖)。" -#: ../../glossary.rst:541 +#: ../../glossary.rst:543 msgid "global interpreter lock" msgstr "global interpreter lock(全域直譯器鎖)" -#: ../../glossary.rst:543 +#: ../../glossary.rst:545 msgid "" "The mechanism used by the :term:`CPython` interpreter to assure that only " "one thread executes Python :term:`bytecode` at a time. This simplifies the " @@ -1212,7 +1212,7 @@ msgstr "" "(multi-threaded),但代價是會犧牲掉多處理器的機器能夠提供的一大部分平行性 " "(parallelism)。" -#: ../../glossary.rst:552 +#: ../../glossary.rst:554 msgid "" "However, some extension modules, either standard or third-party, are " "designed so as to release the GIL when doing computationally intensive tasks " @@ -1223,7 +1223,7 @@ msgstr "" "計算密集 (computationally intensive) 的任務時,可以解除 GIL。另外,在執行 I/" "O 時,GIL 總是會被解除。" -#: ../../glossary.rst:557 +#: ../../glossary.rst:559 msgid "" "Past efforts to create a \"free-threaded\" interpreter (one which locks " "shared data at a much finer granularity) have not been successful because " @@ -1235,11 +1235,11 @@ msgstr "" "力並未成功,因為在一般的單一處理器情況下,效能會有所損失。一般認為,若要克服" "這個效能問題,會使實作變得複雜許多,進而付出更高的維護成本。" -#: ../../glossary.rst:563 +#: ../../glossary.rst:565 msgid "hash-based pyc" msgstr "hash-based pyc(雜湊架構的 pyc)" -#: ../../glossary.rst:565 +#: ../../glossary.rst:567 msgid "" "A bytecode cache file that uses the hash rather than the last-modified time " "of the corresponding source file to determine its validity. See :ref:`pyc-" @@ -1248,23 +1248,23 @@ msgstr "" "一個位元組碼 (bytecode) 暫存檔,它使用雜湊值而不是對應原始檔案的最後修改時" "間,來確定其有效性。請參閱\\ :ref:`pyc-invalidation`。" -#: ../../glossary.rst:568 +#: ../../glossary.rst:570 msgid "hashable" msgstr "hashable(可雜湊的)" -#: ../../glossary.rst:570 +#: ../../glossary.rst:572 msgid "" "An object is *hashable* if it has a hash value which never changes during " -"its lifetime (it needs a :meth:`__hash__` method), and can be compared to " -"other objects (it needs an :meth:`__eq__` method). Hashable objects which " -"compare equal must have the same hash value." +"its lifetime (it needs a :meth:`~object.__hash__` method), and can be " +"compared to other objects (it needs an :meth:`~object.__eq__` method). " +"Hashable objects which compare equal must have the same hash value." msgstr "" "如果一個物件有一個雜湊值,該值在其生命週期中永不改變(它需要一個 :meth:" -"`__hash__` method),且可與其他物件互相比較(它需要一個 :meth:`__eq__` " -"method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的多個可雜湊物件," -"它們必須擁有相同的雜湊值。" +"`~object.__hash__` method),且可與其他物件互相比較(它需要一個 :meth:" +"`~object.__eq__` method),那麼它就是一個\\ *可雜湊*\\ 物件。比較結果為相等的" +"多個可雜湊物件,它們必須擁有相同的雜湊值。" -#: ../../glossary.rst:575 +#: ../../glossary.rst:578 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." @@ -1272,7 +1272,7 @@ msgstr "" "可雜湊性 (hashability) 使一個物件可用作 dictionary(字典)的鍵和 set(集合)" "的成員,因為這些資料結構都在其內部使用了雜湊值。" -#: ../../glossary.rst:578 +#: ../../glossary.rst:581 msgid "" "Most of Python's immutable built-in objects are hashable; mutable containers " "(such as lists or dictionaries) are not; immutable containers (such as " @@ -1287,11 +1287,11 @@ msgstr "" "則這些物件會被預設為可雜湊的。它們在互相比較時都是不相等的(除非它們與自己比" "較),而它們的雜湊值則是衍生自它們的 :func:`id`。" -#: ../../glossary.rst:585 +#: ../../glossary.rst:588 msgid "IDLE" msgstr "IDLE" -#: ../../glossary.rst:587 +#: ../../glossary.rst:590 msgid "" "An Integrated Development and Learning Environment for Python. :ref:`idle` " "is a basic editor and interpreter environment which ships with the standard " @@ -1301,11 +1301,11 @@ msgstr "" "境)。:ref:`idle` 是一個基本的編輯器和直譯器環境,它和 Python 的標準發行版本" "一起被提供。" -#: ../../glossary.rst:590 +#: ../../glossary.rst:593 msgid "immutable" msgstr "immutable(不可變物件)" -#: ../../glossary.rst:592 +#: ../../glossary.rst:595 msgid "" "An object with a fixed value. Immutable objects include numbers, strings " "and tuples. Such an object cannot be altered. A new object has to be " @@ -1317,11 +1317,11 @@ msgstr "" "能被改變的。如果一個不同的值必須被儲存,則必須建立一個新的物件。它們在需要恆" "定雜湊值的地方,扮演重要的角色,例如 dictionary(字典)中的一個鍵。" -#: ../../glossary.rst:597 +#: ../../glossary.rst:600 msgid "import path" msgstr "import path(引入路徑)" -#: ../../glossary.rst:599 +#: ../../glossary.rst:602 msgid "" "A list of locations (or :term:`path entries `) that are searched " "by the :term:`path based finder` for modules to import. During import, this " @@ -1333,11 +1333,11 @@ msgstr "" "的位置。在 import 期間,此位置列表通常是來自 :data:`sys.path`,但對於子套件 " "(subpackage) 而言,它也可能是來自父套件的 ``__path__`` 屬性。" -#: ../../glossary.rst:604 +#: ../../glossary.rst:607 msgid "importing" msgstr "importing(引入)" -#: ../../glossary.rst:606 +#: ../../glossary.rst:609 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." @@ -1345,11 +1345,11 @@ msgstr "" "一個過程。一個模組中的 Python 程式碼可以透過此過程,被另一個模組中的 Python " "程式碼使用。" -#: ../../glossary.rst:608 +#: ../../glossary.rst:611 msgid "importer" msgstr "importer(引入器)" -#: ../../glossary.rst:610 +#: ../../glossary.rst:613 msgid "" "An object that both finds and loads a module; both a :term:`finder` and :" "term:`loader` object." @@ -1357,11 +1357,11 @@ msgstr "" "一個能夠尋找及載入模組的物件;它既是 :term:`finder`\\ (尋檢器)也是 :term:" "`loader`\\ (載入器)物件。" -#: ../../glossary.rst:612 +#: ../../glossary.rst:615 msgid "interactive" msgstr "interactive(互動的)" -#: ../../glossary.rst:614 +#: ../../glossary.rst:617 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " @@ -1374,11 +1374,11 @@ msgstr "" "從你的電腦的主選單選擇它)。這是測試新想法或檢查模塊和包的非常強大的方法(請" "記住help(x))。" -#: ../../glossary.rst:620 +#: ../../glossary.rst:623 msgid "interpreted" msgstr "interpreted(直譯的)" -#: ../../glossary.rst:622 +#: ../../glossary.rst:625 msgid "" "Python is an interpreted language, as opposed to a compiled one, though the " "distinction can be blurry because of the presence of the bytecode compiler. " @@ -1392,11 +1392,11 @@ msgstr "" "一個執行檔,然後再執行它。直譯語言通常比編譯語言有更短的開發/除錯週期,不過" "它們的程式通常也運行得較慢。另請參閱 :term:`interactive`\\ (互動的)。" -#: ../../glossary.rst:629 +#: ../../glossary.rst:632 msgid "interpreter shutdown" msgstr "interpreter shutdown(直譯器關閉)" -#: ../../glossary.rst:631 +#: ../../glossary.rst:634 msgid "" "When asked to shut down, the Python interpreter enters a special phase where " "it gradually releases all allocated resources, such as modules and various " @@ -1414,102 +1414,103 @@ msgstr "" "段被執行的程式碼會遇到各種例外,因為它所依賴的資源可能不再有作用了(常見的例" "子是函式庫模組或是警告機制)。" -#: ../../glossary.rst:640 +#: ../../glossary.rst:643 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." msgstr "" "直譯器關閉的主要原因,是 ``__main__`` 模組或正被運行的腳本已經執行完成。" -#: ../../glossary.rst:642 +#: ../../glossary.rst:645 msgid "iterable" msgstr "iterable(可疊代物件)" -#: ../../glossary.rst:644 +#: ../../glossary.rst:647 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " "and :class:`tuple`) and some non-sequence types like :class:`dict`, :term:" "`file objects `, and objects of any classes you define with an :" -"meth:`__iter__` method or with a :meth:`~object.__getitem__` method that " -"implements :term:`sequence` semantics." +"meth:`~iterator.__iter__` method or with a :meth:`~object.__getitem__` " +"method that implements :term:`sequence` semantics." msgstr "" "一種能夠一次回傳一個其中成員的物件。可疊代物件的例子包括所有的序列型別(像" "是 :class:`list`、:class:`str` 和 :class:`tuple`\\ )和某些非序列型別,像是 :" "class:`dict`、:term:`檔案物件 `,以及你所定義的任何 class 物件," -"只要那些 class 有 :meth:`__iter__` method 或是實作 :term:`sequence`\\ (序" -"列)語意的 :meth:`~object.__getitem__` method,該物件就是可疊代物件。" +"只要那些 class 有 :meth:`~iterator.__iter__` method 或是實作 :term:" +"`sequence`\\ (序列)語意的 :meth:`~object.__getitem__` method,該物件就是可" +"疊代物件。" -#: ../../glossary.rst:651 +#: ../../glossary.rst:655 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " "iterable object is passed as an argument to the built-in function :func:" "`iter`, it returns an iterator for the object. This iterator is good for " "one pass over the set of values. When using iterables, it is usually not " -"necessary to call :func:`iter` or deal with iterator objects yourself. The " -"``for`` statement does that automatically for you, creating a temporary " -"unnamed variable to hold the iterator for the duration of the loop. See " -"also :term:`iterator`, :term:`sequence`, and :term:`generator`." +"necessary to call :func:`iter` or deal with iterator objects yourself. The :" +"keyword:`for` statement does that automatically for you, creating a " +"temporary unnamed variable to hold the iterator for the duration of the " +"loop. See also :term:`iterator`, :term:`sequence`, and :term:`generator`." msgstr "" "可疊代物件可用於 :keyword:`for` 迴圈和許多其他需要一個序列的地方 (:func:" "`zip`、:func:`map`\\ ...)。當一個可疊代物件作為引數被傳遞給內建函式 :func:" "`iter` 時,它會為該物件回傳一個疊代器。此疊代器適用於針對一組值進行一遍 (one " "pass) 運算。使用疊代器時,通常不一定要呼叫 :func:`iter` 或自行處理疊代器物" -"件。``for`` 陳述式會自動地為你處理這些事,它會建立一個暫時性的未命名變數,用" -"於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、:term:" -"`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" +"件。:keyword:`for` 陳述式會自動地為你處理這些事,它會建立一個暫時性的未命名變" +"數,用於在迴圈期間保有該疊代器。另請參閱 :term:`iterator`\\ (疊代器)、:" +"term:`sequence`\\ (序列)和 :term:`generator`\\ (產生器)。" -#: ../../glossary.rst:661 +#: ../../glossary.rst:665 msgid "iterator" msgstr "iterator(疊代器)" -#: ../../glossary.rst:663 +#: ../../glossary.rst:667 msgid "" "An object representing a stream of data. Repeated calls to the iterator's :" "meth:`~iterator.__next__` method (or passing it to the built-in function :" "func:`next`) return successive items in the stream. When no more data are " "available a :exc:`StopIteration` exception is raised instead. At this " -"point, the iterator object is exhausted and any further calls to its :meth:" -"`__next__` method just raise :exc:`StopIteration` again. Iterators are " -"required to have an :meth:`__iter__` method that returns the iterator object " -"itself so every iterator is also iterable and may be used in most places " -"where other iterables are accepted. One notable exception is code which " -"attempts multiple iteration passes. A container object (such as a :class:" -"`list`) produces a fresh new iterator each time you pass it to the :func:" -"`iter` function or use it in a :keyword:`for` loop. Attempting this with an " -"iterator will just return the same exhausted iterator object used in the " -"previous iteration pass, making it appear like an empty container." +"point, the iterator object is exhausted and any further calls to its :meth:`!" +"__next__` method just raise :exc:`StopIteration` again. Iterators are " +"required to have an :meth:`~iterator.__iter__` method that returns the " +"iterator object itself so every iterator is also iterable and may be used in " +"most places where other iterables are accepted. One notable exception is " +"code which attempts multiple iteration passes. A container object (such as " +"a :class:`list`) produces a fresh new iterator each time you pass it to the :" +"func:`iter` function or use it in a :keyword:`for` loop. Attempting this " +"with an iterator will just return the same exhausted iterator object used in " +"the previous iteration pass, making it appear like an empty container." msgstr "" "一個表示資料流的物件。重複地呼叫疊代器的 :meth:`~iterator.__next__` method" "(或是將它傳遞給內建函式 :func:`next`\\ )會依序回傳資料流中的各項目。當不再" "有資料時,則會引發 :exc:`StopIteration` 例外。此時,該疊代器物件已被用盡,而" -"任何對其 :meth:`__next__` method 的進一步呼叫,都只會再次引發 :exc:" -"`StopIteration`。疊代器必須有一個 :meth:`__iter__` method,它會回傳疊代器物件" -"本身,所以每個疊代器也都是可疊代物件,且可以用於大多數適用其他可疊代物件的場" -"合。一個明顯的例外,是嘗試多遍疊代 (multiple iteration passes) 的程式碼。一個" -"容器物件(像是 :class:`list`)在每次你將它傳遞給 :func:`iter` 函式或在 :" -"keyword:`for` 迴圈中使用它時,都會產生一個全新的疊代器。使用疊代器嘗試此事" -"(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物件," -"使其看起來就像一個空的容器。" - -#: ../../glossary.rst:678 +"任何對其 :meth:`!__next__` method 的進一步呼叫,都只會再次引發 :exc:" +"`StopIteration`。疊代器必須有一個 :meth:`~iterator.__iter__` method,它會回傳" +"疊代器物件本身,所以每個疊代器也都是可疊代物件,且可以用於大多數適用其他可疊" +"代物件的場合。一個明顯的例外,是嘗試多遍疊代 (multiple iteration passes) 的程" +"式碼。一個容器物件(像是 :class:`list`)在每次你將它傳遞給 :func:`iter` 函式" +"或在 :keyword:`for` 迴圈中使用它時,都會產生一個全新的疊代器。使用疊代器嘗試" +"此事(多遍疊代)時,只會回傳在前一遍疊代中被用過的、同一個已被用盡的疊代器物" +"件,使其看起來就像一個空的容器。" + +#: ../../glossary.rst:682 msgid "More information can be found in :ref:`typeiter`." msgstr "在\\ :ref:`typeiter`\\ 文中可以找到更多資訊。" -#: ../../glossary.rst:682 +#: ../../glossary.rst:686 msgid "" "CPython does not consistently apply the requirement that an iterator define :" -"meth:`__iter__`." +"meth:`~iterator.__iter__`." msgstr "" -"CPython 並不是始終如一地都會檢查「疊代器有定義 :meth:`__iter__`\\ 」這個規" -"定。" +"CPython 並不是始終如一地都會檢查「疊代器有定義 :meth:`~iterator." +"__iter__`\\ 」這個規定。" -#: ../../glossary.rst:684 +#: ../../glossary.rst:688 msgid "key function" msgstr "key function(鍵函式)" -#: ../../glossary.rst:686 +#: ../../glossary.rst:690 msgid "" "A key function or collation function is a callable that returns a value used " "for sorting or ordering. For example, :func:`locale.strxfrm` is used to " @@ -1519,7 +1520,7 @@ msgstr "" "一個用於排序 (sorting) 或定序 (ordering) 的值。例如,\\ :func:`locale." "strxfrm` 被用來產生一個了解區域特定排序慣例的排序鍵。" -#: ../../glossary.rst:691 +#: ../../glossary.rst:695 msgid "" "A number of tools in Python accept key functions to control how elements are " "ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" @@ -1531,7 +1532,7 @@ msgstr "" "merge`、:func:`heapq.nsmallest`、:func:`heapq.nlargest` 和 :func:`itertools." "groupby`。" -#: ../../glossary.rst:697 +#: ../../glossary.rst:701 msgid "" "There are several ways to create a key function. For example. the :meth:" "`str.lower` method can serve as a key function for case insensitive sorts. " @@ -1548,19 +1549,19 @@ msgstr "" "式 (constructor)。關於如何建立和使用鍵函式的範例,請參閱\\ :ref:`如何排序 " "`。" -#: ../../glossary.rst:704 +#: ../../glossary.rst:708 msgid "keyword argument" msgstr "keyword argument(關鍵字引數)" -#: ../../glossary.rst:706 ../../glossary.rst:995 +#: ../../glossary.rst:710 ../../glossary.rst:1000 msgid "See :term:`argument`." msgstr "請參閱 :term:`argument`\\ (引數)。" -#: ../../glossary.rst:707 +#: ../../glossary.rst:711 msgid "lambda" msgstr "lambda" -#: ../../glossary.rst:709 +#: ../../glossary.rst:713 msgid "" "An anonymous inline function consisting of a single :term:`expression` which " "is evaluated when the function is called. The syntax to create a lambda " @@ -1570,11 +1571,11 @@ msgstr "" "function),於該函式被呼叫時求值。建立 lambda 函式的語法是 ``lambda " "[parameters]: expression``" -#: ../../glossary.rst:712 +#: ../../glossary.rst:716 msgid "LBYL" msgstr "LBYL" -#: ../../glossary.rst:714 +#: ../../glossary.rst:718 msgid "" "Look before you leap. This coding style explicitly tests for pre-conditions " "before making calls or lookups. This style contrasts with the :term:`EAFP` " @@ -1585,7 +1586,7 @@ msgstr "" "地測試先決條件。這種風格與 :term:`EAFP` 方式形成對比,且它的特色是會有許多 :" "keyword:`if` 陳述式的存在。" -#: ../../glossary.rst:719 +#: ../../glossary.rst:723 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a " "race condition between \"the looking\" and \"the leaping\". For example, " @@ -1599,11 +1600,11 @@ msgstr "" "了 *key*,則該程式碼就會失效。這個問題可以用鎖 (lock) 或使用 EAFP 編碼方式來" "解決。" -#: ../../glossary.rst:724 +#: ../../glossary.rst:728 msgid "locale encoding" msgstr "locale encoding(區域編碼)" -#: ../../glossary.rst:726 +#: ../../glossary.rst:730 msgid "" "On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:" "`locale.setlocale(locale.LC_CTYPE, new_locale) `." @@ -1611,28 +1612,28 @@ msgstr "" "在 Unix 上,它是 LC_CTYPE 區域設定的編碼。它可以用 :func:`locale." "setlocale(locale.LC_CTYPE, new_locale) ` 來設定。" -#: ../../glossary.rst:729 +#: ../../glossary.rst:733 msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." msgstr "在 Windows 上,它是 ANSI 代碼頁(code page,例如 ``\"cp1252\"``\\ )。" -#: ../../glossary.rst:731 +#: ../../glossary.rst:735 msgid "" "On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." msgstr "在 Android 和 VxWorks 上,Python 使用 ``\"utf-8\"`` 作為區域編碼。" -#: ../../glossary.rst:733 +#: ../../glossary.rst:737 msgid "``locale.getencoding()`` can be used to get the locale encoding." msgstr "``locale.getencoding()`` 可以用來取得區域編碼。" -#: ../../glossary.rst:735 +#: ../../glossary.rst:739 msgid "See also the :term:`filesystem encoding and error handler`." msgstr "也請參考 :term:`filesystem encoding and error handler`。" -#: ../../glossary.rst:736 +#: ../../glossary.rst:740 msgid "list" msgstr "list(串列)" -#: ../../glossary.rst:738 +#: ../../glossary.rst:742 msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " @@ -1642,11 +1643,11 @@ msgstr "" "似其他語言中的一個陣列 (array) 而較不像一個鏈結串列 (linked list),因為存取元" "素的時間複雜度是 O(1)。" -#: ../../glossary.rst:741 +#: ../../glossary.rst:745 msgid "list comprehension" msgstr "list comprehension(串列綜合運算)" -#: ../../glossary.rst:743 +#: ../../glossary.rst:747 msgid "" "A compact way to process all or part of the elements in a sequence and " "return a list with the results. ``result = ['{:#04x}'.format(x) for x in " @@ -1660,11 +1661,11 @@ msgstr "" "keyword:`if` 子句是選擇性的。如果省略它,則 ``range(256)`` 中的所有元素都會被" "處理。" -#: ../../glossary.rst:749 +#: ../../glossary.rst:753 msgid "loader" msgstr "loader(載入器)" -#: ../../glossary.rst:751 +#: ../../glossary.rst:755 msgid "" "An object that loads a module. It must define a method named :meth:" "`load_module`. A loader is typically returned by a :term:`finder`. See :pep:" @@ -1676,19 +1677,19 @@ msgstr "" "`302`,關於 :term:`abstract base class`\\ (抽象基底類別),請參閱 :class:" "`importlib.abc.Loader`。" -#: ../../glossary.rst:755 +#: ../../glossary.rst:759 msgid "magic method" msgstr "magic method(魔術方法)" -#: ../../glossary.rst:759 +#: ../../glossary.rst:763 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method`\\ (特殊方法)的一個非正式同義詞。" -#: ../../glossary.rst:760 +#: ../../glossary.rst:764 msgid "mapping" msgstr "mapping(對映)" -#: ../../glossary.rst:762 +#: ../../glossary.rst:766 msgid "" "A container object that supports arbitrary key lookups and implements the " "methods specified in the :class:`collections.abc.Mapping` or :class:" @@ -1703,11 +1704,11 @@ msgstr "" "包括 :class:`dict`、:class:`collections.defaultdict`、:class:`collections." "OrderedDict` 和 :class:`collections.Counter`。" -#: ../../glossary.rst:768 +#: ../../glossary.rst:772 msgid "meta path finder" msgstr "meta path finder(元路徑尋檢器)" -#: ../../glossary.rst:770 +#: ../../glossary.rst:774 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders ` " "相關但是不同。" -#: ../../glossary.rst:774 +#: ../../glossary.rst:778 msgid "" "See :class:`importlib.abc.MetaPathFinder` for the methods that meta path " "finders implement." msgstr "" "關於元路徑尋檢器實作的 method,請參閱 :class:`importlib.abc.MetaPathFinder`。" -#: ../../glossary.rst:776 +#: ../../glossary.rst:780 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../glossary.rst:778 +#: ../../glossary.rst:782 msgid "" "The class of a class. Class definitions create a class name, a class " "dictionary, and a list of base classes. The metaclass is responsible for " @@ -1748,15 +1749,15 @@ msgstr "" "性存取、增加執行緒安全性、追蹤物件建立、實作單例模式 (singleton),以及許多其" "他的任務。" -#: ../../glossary.rst:788 +#: ../../glossary.rst:792 msgid "More information can be found in :ref:`metaclasses`." msgstr "更多資訊可以在\\ :ref:`metaclasses`\\ 章節中找到。" -#: ../../glossary.rst:757 ../../glossary.rst:789 ../../glossary.rst:1123 +#: ../../glossary.rst:761 ../../glossary.rst:793 ../../glossary.rst:1128 msgid "method" msgstr "method(方法)" -#: ../../glossary.rst:791 +#: ../../glossary.rst:795 msgid "" "A function which is defined inside a class body. If called as an attribute " "of an instance of that class, the method will get the instance object as its " @@ -1768,11 +1769,11 @@ msgstr "" "通常被稱為 ``self``)。請參閱 :term:`function`\\ (函式)和 :term:`nested " "scope`\\ (巢狀作用域)。" -#: ../../glossary.rst:795 +#: ../../glossary.rst:799 msgid "method resolution order" msgstr "method resolution order(方法解析順序)" -#: ../../glossary.rst:797 +#: ../../glossary.rst:801 msgid "" "Method Resolution Order is the order in which base classes are searched for " "a member during lookup. See `The Python 2.3 Method Resolution Order `_。" -#: ../../glossary.rst:801 +#: ../../glossary.rst:805 msgid "module" msgstr "module(模組)" -#: ../../glossary.rst:803 +#: ../../glossary.rst:807 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " @@ -1797,15 +1798,15 @@ msgstr "" "空間,它包含任意的 Python 物件。模組是藉由 :term:`importing` 的過程,被載入" "至 Python。" -#: ../../glossary.rst:807 +#: ../../glossary.rst:811 msgid "See also :term:`package`." msgstr "另請參閱 :term:`package`\\ (套件)。" -#: ../../glossary.rst:808 +#: ../../glossary.rst:812 msgid "module spec" msgstr "module spec(模組規格)" -#: ../../glossary.rst:810 +#: ../../glossary.rst:814 msgid "" "A namespace containing the import-related information used to load a module. " "An instance of :class:`importlib.machinery.ModuleSpec`." @@ -1813,19 +1814,19 @@ msgstr "" "一個命名空間,它包含用於載入模組的 import 相關資訊。它是 :class:`importlib." "machinery.ModuleSpec` 的一個實例。" -#: ../../glossary.rst:812 +#: ../../glossary.rst:816 msgid "MRO" msgstr "MRO" -#: ../../glossary.rst:814 +#: ../../glossary.rst:818 msgid "See :term:`method resolution order`." msgstr "請參閱 :term:`method resolution order`\\ (方法解析順序)。" -#: ../../glossary.rst:815 +#: ../../glossary.rst:819 msgid "mutable" msgstr "mutable(可變物件)" -#: ../../glossary.rst:817 +#: ../../glossary.rst:821 msgid "" "Mutable objects can change their value but keep their :func:`id`. See also :" "term:`immutable`." @@ -1833,11 +1834,11 @@ msgstr "" "可變物件可以改變它們的值,但維持它們的 :func:`id`。另請參閱 :term:" "`immutable`\\ (不可變物件)。" -#: ../../glossary.rst:819 +#: ../../glossary.rst:823 msgid "named tuple" msgstr "named tuple(附名元組)" -#: ../../glossary.rst:821 +#: ../../glossary.rst:825 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " @@ -1847,7 +1848,7 @@ msgstr "" "索引 (indexable) 元素也可以用附名屬性來存取。這些型別或 class 也可以具有其他" "的特性。" -#: ../../glossary.rst:825 +#: ../../glossary.rst:829 msgid "" "Several built-in types are named tuples, including the values returned by :" "func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." @@ -1856,7 +1857,7 @@ msgstr "" "有些內建型別是 named tuple,包括由 :func:`time.localtime` 和 :func:`os.stat` " "回傳的值。另一個例子是 :data:`sys.float_info`: ::" -#: ../../glossary.rst:836 +#: ../../glossary.rst:840 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " @@ -1872,11 +1873,11 @@ msgstr "" "些額外的 method,這些 method 可能是在手寫或內建的 named tuple 中,無法找到" "的。" -#: ../../glossary.rst:843 +#: ../../glossary.rst:847 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../glossary.rst:845 +#: ../../glossary.rst:849 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " @@ -1896,11 +1897,11 @@ msgstr "" "func:`itertools.islice` 明確地表示,這些函式分別是由 :mod:`random` 和 :mod:" "`itertools` 模組在實作。" -#: ../../glossary.rst:855 +#: ../../glossary.rst:859 msgid "namespace package" msgstr "namespace package(命名空間套件)" -#: ../../glossary.rst:857 +#: ../../glossary.rst:861 msgid "" "A :pep:`420` :term:`package` which serves only as a container for " "subpackages. Namespace packages may have no physical representation, and " @@ -1911,15 +1912,15 @@ msgstr "" "一個容器。命名空間套件可能沒有實體的表示法,而且具體來說它們不像是一個 :term:" "`regular package`\\ (正規套件),因為它們並沒有 ``__init__.py`` 這個檔案。" -#: ../../glossary.rst:862 +#: ../../glossary.rst:866 msgid "See also :term:`module`." msgstr "另請參閱 :term:`module`\\ (模組)。" -#: ../../glossary.rst:863 +#: ../../glossary.rst:867 msgid "nested scope" msgstr "nested scope(巢狀作用域)" -#: ../../glossary.rst:865 +#: ../../glossary.rst:869 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -1934,27 +1935,27 @@ msgstr "" "寫入。同樣地,全域變數是在全域命名空間中讀取及寫入。:keyword:`nonlocal` 容許" "對外層作用域進行寫入。" -#: ../../glossary.rst:872 +#: ../../glossary.rst:876 msgid "new-style class" msgstr "new-style class(新式類別)" -#: ../../glossary.rst:874 +#: ../../glossary.rst:878 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " "versatile features like :attr:`~object.__slots__`, descriptors, properties, :" -"meth:`__getattribute__`, class methods, and static methods." +"meth:`~object.__getattribute__`, class methods, and static methods." msgstr "" "一個舊名,它是指現在所有的 class 物件所使用的 class 風格。在早期的 Python 版" "本中,只有新式 class 才能使用 Python 較新的、多樣的功能,像是 :attr:`~object." -"__slots__`、描述器 (descriptor)、屬性 (property)、:meth:`__getattribute__`、" -"class method(類別方法)和 static method(靜態方法)。" +"__slots__`、描述器 (descriptor)、屬性 (property)、:meth:`~object." +"__getattribute__`、class method(類別方法)和 static method(靜態方法)。" -#: ../../glossary.rst:878 +#: ../../glossary.rst:883 msgid "object" msgstr "object(物件)" -#: ../../glossary.rst:880 +#: ../../glossary.rst:885 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." @@ -1962,11 +1963,11 @@ msgstr "" "具有狀態(屬性或值)及被定義的行為(method)的任何資料。它也是任何 :term:" "`new-style class`\\ (新式類別)的最終 base class(基底類別)。" -#: ../../glossary.rst:883 +#: ../../glossary.rst:888 msgid "package" msgstr "package(套件)" -#: ../../glossary.rst:885 +#: ../../glossary.rst:890 msgid "" "A Python :term:`module` which can contain submodules or recursively, " "subpackages. Technically, a package is a Python module with a ``__path__`` " @@ -1976,17 +1977,17 @@ msgstr "" "迴的子套件 (subpackage)。技術上而言,套件就是具有 ``__path__`` 屬性的一個 " "Python 模組。" -#: ../../glossary.rst:889 +#: ../../glossary.rst:894 msgid "See also :term:`regular package` and :term:`namespace package`." msgstr "" "另請參閱 :term:`regular package`\\ (正規套件)和 :term:`namespace " "package`\\ (命名空間套件)。" -#: ../../glossary.rst:890 +#: ../../glossary.rst:895 msgid "parameter" msgstr "parameter(參數)" -#: ../../glossary.rst:892 +#: ../../glossary.rst:897 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " @@ -1996,7 +1997,7 @@ msgstr "" "它指明該函式能夠接受的一個 :term:`argument`\\ (引數),或在某些情況下指示多" "個引數。共有有五種不同的參數類型:" -#: ../../glossary.rst:896 +#: ../../glossary.rst:901 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " @@ -2007,7 +2008,7 @@ msgstr "" "置 `\\ 或是作為\\ :term:`關鍵字引數 `\\ 被傳遞的引數。這" "是參數的預設類型,例如以下的 *foo* 和 *bar*: ::" -#: ../../glossary.rst:905 +#: ../../glossary.rst:910 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " @@ -2018,7 +2019,7 @@ msgstr "" "式定義的參數列表中包含一個 ``/`` 字元,就可以在該字元前面定義僅限位置參數,例" "如以下的 *posonly1* 和 *posonly2*: ::" -#: ../../glossary.rst:914 +#: ../../glossary.rst:919 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -2031,7 +2032,7 @@ msgstr "" "單純的 ``*`` 字元,就可以在其後方定義僅限關鍵字參數,例如以下的 *kw_only1* " "和 *kw_only2*: ::" -#: ../../glossary.rst:922 +#: ../../glossary.rst:927 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2043,7 +2044,7 @@ msgstr "" "數(在已被其他參數接受的任何位置引數之外)。這類參數是透過在其參數名稱字首加" "上 ``*`` 來定義的,例如以下的 *args*: ::" -#: ../../glossary.rst:930 +#: ../../glossary.rst:935 msgid "" ":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " "provided (in addition to any keyword arguments already accepted by other " @@ -2054,14 +2055,14 @@ msgstr "" "已被其他參數接受的任何關鍵字引數之外)。這類參數是透過在其參數名稱字首加上 " "``**`` 來定義的,例如上面範例中的 *kwargs*。" -#: ../../glossary.rst:936 +#: ../../glossary.rst:941 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." msgstr "" "參數可以指明引數是選擇性的或必需的,也可以為一些選擇性的引數指定預設值。" -#: ../../glossary.rst:939 +#: ../../glossary.rst:944 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " @@ -2072,11 +2073,11 @@ msgstr "" "參數之間的差異 `、:class:`inspect.Parameter` " "class、:ref:`function`\\ 章節,以及 :pep:`362`。" -#: ../../glossary.rst:943 +#: ../../glossary.rst:948 msgid "path entry" msgstr "path entry(路徑項目)" -#: ../../glossary.rst:945 +#: ../../glossary.rst:950 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." @@ -2084,11 +2085,11 @@ msgstr "" "在 :term:`import path`\\ (引入路徑)中的一個位置,而 :term:`path based " "finder` (基於路徑的尋檢器)會參考該位置來尋找要 import 的模組。" -#: ../../glossary.rst:947 +#: ../../glossary.rst:952 msgid "path entry finder" msgstr "path entry finder(路徑項目尋檢器)" -#: ../../glossary.rst:949 +#: ../../glossary.rst:954 msgid "" "A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" "term:`path entry hook`) which knows how to locate modules given a :term:" @@ -2098,7 +2099,7 @@ msgstr "" "`path entry hook`\\ )所回傳的一種 :term:`finder`,它知道如何以一個 :term:" "`path entry`\\ 定位模組。" -#: ../../glossary.rst:953 +#: ../../glossary.rst:958 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." @@ -2106,25 +2107,25 @@ msgstr "" "關於路徑項目尋檢器實作的 method,請參閱 :class:`importlib.abc." "PathEntryFinder`。" -#: ../../glossary.rst:955 +#: ../../glossary.rst:960 msgid "path entry hook" msgstr "path entry hook(路徑項目鉤)" -#: ../../glossary.rst:957 +#: ../../glossary.rst:962 msgid "" -"A callable on the :data:`sys.path_hook` list which returns a :term:`path " +"A callable on the :data:`sys.path_hooks` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " "entry`." msgstr "" -"在 :data:`sys.path_hook` 列表中的一個可呼叫物件 (callable),若它知道如何在一" +"在 :data:`sys.path_hooks` 列表中的一個可呼叫物件 (callable),若它知道如何在一" "個特定的 :term:`path entry` 中尋找模組,則會回傳一個 :term:`path entry " "finder`\\ (路徑項目尋檢器)。" -#: ../../glossary.rst:960 +#: ../../glossary.rst:965 msgid "path based finder" msgstr "path based finder(基於路徑的尋檢器)" -#: ../../glossary.rst:962 +#: ../../glossary.rst:967 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." @@ -2132,11 +2133,11 @@ msgstr "" "預設的\\ :term:`元路徑尋檢器 (meta path finder) ` 之一,它" "會在一個 :term:`import path` 中搜尋模組。" -#: ../../glossary.rst:964 +#: ../../glossary.rst:969 msgid "path-like object" msgstr "path-like object(類路徑物件)" -#: ../../glossary.rst:966 +#: ../../glossary.rst:971 msgid "" "An object representing a file system path. A path-like object is either a :" "class:`str` or :class:`bytes` object representing a path, or an object " @@ -2154,11 +2155,11 @@ msgstr "" "`os.fsencode` 則分別可用於確保 :class:`str` 及 :class:`bytes` 的結果。由 :" "pep:`519` 引入。" -#: ../../glossary.rst:974 +#: ../../glossary.rst:979 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:976 +#: ../../glossary.rst:981 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " @@ -2169,7 +2170,7 @@ msgstr "" "為 Python 社群提供資訊,或是描述 Python 的一個新功能或該功能的程序和環境。" "PEP 應該要提供簡潔的技術規範以及被提案功能的運作原理。" -#: ../../glossary.rst:982 +#: ../../glossary.rst:987 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2181,15 +2182,15 @@ msgstr "" "已納入 Python 的設計決策的記錄,這些過程的主要機制。PEP 的作者要負責在社群內" "建立共識並記錄反對意見。" -#: ../../glossary.rst:988 +#: ../../glossary.rst:993 msgid "See :pep:`1`." msgstr "請參閱 :pep:`1`。" -#: ../../glossary.rst:989 +#: ../../glossary.rst:994 msgid "portion" msgstr "portion(部分)" -#: ../../glossary.rst:991 +#: ../../glossary.rst:996 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." @@ -2197,15 +2198,15 @@ msgstr "" "在單一目錄中的一組檔案(也可能儲存在一個 zip 檔中),這些檔案能對一個命名空間" "套件 (namespace package) 有所貢獻,如同 :pep:`420` 中的定義。" -#: ../../glossary.rst:993 +#: ../../glossary.rst:998 msgid "positional argument" msgstr "positional argument(位置引數)" -#: ../../glossary.rst:996 +#: ../../glossary.rst:1001 msgid "provisional API" msgstr "provisional API(暫行 API)" -#: ../../glossary.rst:998 +#: ../../glossary.rst:1003 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " @@ -2221,7 +2222,7 @@ msgstr "" "該介面)。這種變更並不會無端地產生——只有 API 被納入之前未察覺的嚴重基本缺陷被" "揭露時,它們才會發生。" -#: ../../glossary.rst:1007 +#: ../../glossary.rst:1012 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " @@ -2230,7 +2231,7 @@ msgstr "" "即使對於暫行 API,向後不相容的變更也會被視為「最後的解決方案」——對於任何被發" "現的問題,仍然會盡可能找出一個向後相容的解決方案。" -#: ../../glossary.rst:1011 +#: ../../glossary.rst:1016 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " @@ -2239,19 +2240,19 @@ msgstr "" "這個過程使得標準函式庫能隨著時間不斷進化,而避免耗費過長的時間去鎖定有問題的" "設計錯誤。請參閱 :pep:`411` 了解更多細節。" -#: ../../glossary.rst:1014 +#: ../../glossary.rst:1019 msgid "provisional package" msgstr "provisional package(暫行套件)" -#: ../../glossary.rst:1016 +#: ../../glossary.rst:1021 msgid "See :term:`provisional API`." msgstr "請參閱 :term:`provisional API`\\ (暫行 API)。" -#: ../../glossary.rst:1017 +#: ../../glossary.rst:1022 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1019 +#: ../../glossary.rst:1024 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " "of version 3 was something in the distant future.) This is also abbreviated " @@ -2260,11 +2261,11 @@ msgstr "" "Python 3.x 系列版本的暱稱(很久以前創造的,當時第 3 版的發布是在遙遠的未" "來。)也可以縮寫為「Py3k」。" -#: ../../glossary.rst:1022 +#: ../../glossary.rst:1027 msgid "Pythonic" msgstr "Pythonic(Python 風格的)" -#: ../../glossary.rst:1024 +#: ../../glossary.rst:1029 msgid "" "An idea or piece of code which closely follows the most common idioms of the " "Python language, rather than implementing code using concepts common to " @@ -2278,15 +2279,15 @@ msgstr "" "keyword:`for` 陳述式,對一個可疊代物件的所有元素進行迴圈。許多其他語言並沒有" "這種類型的架構,所以不熟悉 Python 的人有時會使用一個數值計數器來代替: ::" -#: ../../glossary.rst:1034 +#: ../../glossary.rst:1039 msgid "As opposed to the cleaner, Pythonic method::" msgstr "相較之下,以下方法更簡潔、更具有 Python 風格: ::" -#: ../../glossary.rst:1038 +#: ../../glossary.rst:1043 msgid "qualified name" msgstr "qualified name(限定名稱)" -#: ../../glossary.rst:1040 +#: ../../glossary.rst:1045 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " @@ -2297,7 +2298,7 @@ msgstr "" "或 method 的「路徑」,如 :pep:`3155` 中的定義。對於頂層的函式和 class 而言," "限定名稱與其物件名稱相同: ::" -#: ../../glossary.rst:1057 +#: ../../glossary.rst:1062 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " "dotted path to the module, including any parent packages, e.g. ``email.mime." @@ -2306,11 +2307,11 @@ msgstr "" "當用於引用模組時,\\ *完全限定名稱 (fully qualified name)* 是表示該模組的完整" "點分隔路徑,包括任何的父套件,例如 ``email.mime.text``: ::" -#: ../../glossary.rst:1064 +#: ../../glossary.rst:1069 msgid "reference count" msgstr "reference count(參照計數)" -#: ../../glossary.rst:1066 +#: ../../glossary.rst:1071 msgid "" "The number of references to an object. When the reference count of an " "object drops to zero, it is deallocated. Some objects are \"immortal\" and " @@ -2326,11 +2327,11 @@ msgstr "" "`CPython` 實作的一個關鍵元素。程式設計師可以呼叫 :func:`~sys.getrefcount` 函" "式來回傳一個特定物件的參照計數。" -#: ../../glossary.rst:1074 +#: ../../glossary.rst:1079 msgid "regular package" msgstr "regular package(正規套件)" -#: ../../glossary.rst:1076 +#: ../../glossary.rst:1081 msgid "" "A traditional :term:`package`, such as a directory containing an ``__init__." "py`` file." @@ -2338,15 +2339,15 @@ msgstr "" "一個傳統的 :term:`package`\\ (套件),例如一個包含 ``__init__.py`` 檔案的目" "錄。" -#: ../../glossary.rst:1079 +#: ../../glossary.rst:1084 msgid "See also :term:`namespace package`." msgstr "另請參閱 :term:`namespace package`\\ (命名空間套件)。" -#: ../../glossary.rst:1080 +#: ../../glossary.rst:1085 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1082 +#: ../../glossary.rst:1087 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2359,48 +2360,49 @@ msgstr "" "最好保留給那種在一個記憶體關鍵 (memory-critical) 的應用程式中存在大量實例的罕" "見情況。" -#: ../../glossary.rst:1087 +#: ../../glossary.rst:1092 msgid "sequence" msgstr "sequence(序列)" -#: ../../glossary.rst:1089 +#: ../../glossary.rst:1094 msgid "" "An :term:`iterable` which supports efficient element access using integer " "indices via the :meth:`~object.__getitem__` special method and defines a :" -"meth:`__len__` method that returns the length of the sequence. Some built-in " -"sequence types are :class:`list`, :class:`str`, :class:`tuple`, and :class:" -"`bytes`. Note that :class:`dict` also supports :meth:`~object.__getitem__` " -"and :meth:`__len__`, but is considered a mapping rather than a sequence " -"because the lookups use arbitrary :term:`immutable` keys rather than " -"integers." +"meth:`~object.__len__` method that returns the length of the sequence. Some " +"built-in sequence types are :class:`list`, :class:`str`, :class:`tuple`, " +"and :class:`bytes`. Note that :class:`dict` also supports :meth:`~object." +"__getitem__` and :meth:`!__len__`, but is considered a mapping rather than a " +"sequence because the lookups use arbitrary :term:`immutable` keys rather " +"than integers." msgstr "" "一個 :term:`iterable`\\ (可疊代物件),它透過 :meth:`~object.__getitem__` " "special method(特殊方法),使用整數索引來支援高效率的元素存取,並定義了一" -"個 :meth:`__len__` method 來回傳該序列的長度。一些內建序列型別包括 :class:" -"`list`、:class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖然 :class:" -"`dict` 也支援 :meth:`~object.__getitem__` 和 :meth:`__len__`,但它被視為對映 " -"(mapping) 而不是序列,因為其查找方式是使用任意的 :term:`immutable` 鍵,而不是" -"整數。" +"個 :meth:`~object.__len__` method 來回傳該序列的長度。一些內建序列型別包括 :" +"class:`list`、:class:`str`、:class:`tuple` 和 :class:`bytes`。請注意,雖然 :" +"class:`dict` 也支援 :meth:`~object.__getitem__` 和 :meth:`!__len__`,但它被視" +"為對映 (mapping) 而不是序列,因為其查找方式是使用任意的 :term:`immutable` " +"鍵,而不是整數。" -#: ../../glossary.rst:1098 +#: ../../glossary.rst:1103 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " "richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" -"`__len__`, adding :meth:`count`, :meth:`index`, :meth:`__contains__`, and :" -"meth:`__reversed__`. Types that implement this expanded interface can be " -"registered explicitly using :func:`~abc.ABCMeta.register`." +"`~object.__len__`, adding :meth:`count`, :meth:`index`, :meth:`~object." +"__contains__`, and :meth:`~object.__reversed__`. Types that implement this " +"expanded interface can be registered explicitly using :func:`~abc.ABCMeta." +"register`." msgstr "" "抽象基底類別 (abstract base class) :class:`collections.abc.Sequence` 定義了一" -"個更加豐富的介面,並不僅止於 :meth:`~object.__getitem__` 和 :meth:`__len__`," -"還增加了 :meth:`count`、:meth:`index`、:meth:`__contains__` 和 :meth:" -"`__reversed__`。實作此擴充介面的型別,可以使用 :func:`~abc.ABCMeta.register` " -"被明確地註冊。" +"個更加豐富的介面,並不僅止於 :meth:`~object.__getitem__` 和 :meth:`~object." +"__len__`,還增加了 :meth:`count`、:meth:`index`、:meth:`~object." +"__contains__` 和 :meth:`~object.__reversed__`。實作此擴充介面的型別,可以使" +"用 :func:`~abc.ABCMeta.register` 被明確地註冊。" -#: ../../glossary.rst:1105 +#: ../../glossary.rst:1110 msgid "set comprehension" msgstr "set comprehension(集合綜合運算)" -#: ../../glossary.rst:1107 +#: ../../glossary.rst:1112 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " @@ -2411,11 +2413,11 @@ msgstr "" "set 回傳。``results = {c for c in 'abracadabra' if c not in 'abc'}`` 會產生一" "個字串 set:``{'r', 'd'}``。請參閱\\ :ref:`comprehensions`。" -#: ../../glossary.rst:1111 +#: ../../glossary.rst:1116 msgid "single dispatch" msgstr "single dispatch(單一調度)" -#: ../../glossary.rst:1113 +#: ../../glossary.rst:1118 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." @@ -2423,11 +2425,11 @@ msgstr "" ":term:`generic function`\\ (泛型函式)調度的一種形式,在此,實作的選擇是基於" "單一引數的型別。" -#: ../../glossary.rst:1115 +#: ../../glossary.rst:1120 msgid "slice" msgstr "slice(切片)" -#: ../../glossary.rst:1117 +#: ../../glossary.rst:1122 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " @@ -2439,11 +2441,11 @@ msgstr "" "之間使用冒號,例如 ``variable_name[1:3:5]``。在括號(下標)符號的內部,會使" "用 :class:`slice` 物件。" -#: ../../glossary.rst:1121 +#: ../../glossary.rst:1126 msgid "special method" msgstr "special method(特殊方法)" -#: ../../glossary.rst:1125 +#: ../../glossary.rst:1130 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " @@ -2454,11 +2456,11 @@ msgstr "" "種 method 的名稱會在開頭和結尾有兩個下底線。Special method 在\\ :ref:" "`specialnames`\\ 中有詳細說明。" -#: ../../glossary.rst:1129 +#: ../../glossary.rst:1134 msgid "statement" msgstr "statement(陳述式)" -#: ../../glossary.rst:1131 +#: ../../glossary.rst:1136 msgid "" "A statement is part of a suite (a \"block\" of code). A statement is either " "an :term:`expression` or one of several constructs with a keyword, such as :" @@ -2468,11 +2470,11 @@ msgstr "" "term:`expression`\\ (運算式),或是含有關鍵字(例如 :keyword:`if`、:keyword:" "`while` 或 :keyword:`for`\\ )的多種結構之一。" -#: ../../glossary.rst:1134 +#: ../../glossary.rst:1139 msgid "static type checker" msgstr "static type checker(靜態型別檢查器)" -#: ../../glossary.rst:1136 +#: ../../glossary.rst:1141 msgid "" "An external tool that reads Python code and analyzes it, looking for issues " "such as incorrect types. See also :term:`type hints ` and the :" @@ -2482,11 +2484,11 @@ msgstr "" "另請參閱\\ :term:`型別提示 (type hints) ` 以及 :mod:`typing` 模" "組。" -#: ../../glossary.rst:1139 +#: ../../glossary.rst:1144 msgid "strong reference" msgstr "strong reference(強參照)" -#: ../../glossary.rst:1141 +#: ../../glossary.rst:1146 msgid "" "In Python's C API, a strong reference is a reference to an object which is " "owned by the code holding the reference. The strong reference is taken by " @@ -2497,7 +2499,7 @@ msgstr "" "有。建立參照時透過呼叫 :c:func:`Py_INCREF` 來獲得強參照、刪除參照時透過 :c:" "func:`Py_DECREF` 釋放強參照。" -#: ../../glossary.rst:1147 +#: ../../glossary.rst:1152 msgid "" "The :c:func:`Py_NewRef` function can be used to create a strong reference to " "an object. Usually, the :c:func:`Py_DECREF` function must be called on the " @@ -2507,15 +2509,15 @@ msgstr "" ":c:func:`Py_NewRef` 函式可用於建立一個對物件的強參照。通常,在退出強參照的作" "用域之前,必須在該強參照上呼叫 :c:func:`Py_DECREF` 函式,以避免洩漏一個參照。" -#: ../../glossary.rst:1152 +#: ../../glossary.rst:1157 msgid "See also :term:`borrowed reference`." msgstr "另請參閱 :term:`borrowed reference`\\ (借用參照)。" -#: ../../glossary.rst:1153 +#: ../../glossary.rst:1158 msgid "text encoding" msgstr "text encoding(文字編碼)" -#: ../../glossary.rst:1155 +#: ../../glossary.rst:1160 msgid "" "A string in Python is a sequence of Unicode code points (in range " "``U+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " @@ -2524,7 +2526,7 @@ msgstr "" "Python 中的字串是一個 Unicode 碼點 (code point) 的序列(範圍在 ``U+0000`` -- " "``U+10FFFF`` 之間)。若要儲存或傳送一個字串,它必須被序列化為一個位元組序列。" -#: ../../glossary.rst:1159 +#: ../../glossary.rst:1164 msgid "" "Serializing a string into a sequence of bytes is known as \"encoding\", and " "recreating the string from the sequence of bytes is known as \"decoding\"." @@ -2532,7 +2534,7 @@ msgstr "" "將一個字串序列化為位元組序列,稱為「編碼」,而從位元組序列重新建立該字串則稱" "為「解碼 (decoding)」。" -#: ../../glossary.rst:1162 +#: ../../glossary.rst:1167 msgid "" "There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." @@ -2540,11 +2542,11 @@ msgstr "" "有多種不同的文字序列化編解碼器 (:ref:`codecs `),它們被統" "稱為「文字編碼」。" -#: ../../glossary.rst:1165 +#: ../../glossary.rst:1170 msgid "text file" msgstr "text file(文字檔案)" -#: ../../glossary.rst:1167 +#: ../../glossary.rst:1172 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " "text file actually accesses a byte-oriented datastream and handles the :term:" @@ -2558,7 +2560,7 @@ msgstr "" "有:以文字模式(``'r'`` 或 ``'w'``)開啟的檔案、\\ :data:`sys.stdin`、:data:" "`sys.stdout` 以及 :class:`io.StringIO` 的實例。" -#: ../../glossary.rst:1174 +#: ../../glossary.rst:1179 msgid "" "See also :term:`binary file` for a file object able to read and write :term:" "`bytes-like objects `." @@ -2566,11 +2568,11 @@ msgstr "" "另請參閱 :term:`binary file`\\ (二進位檔案),它是一個能夠讀取和寫入\\ :" "term:`類位元組串物件 (bytes-like object) ` 的檔案物件。" -#: ../../glossary.rst:1176 +#: ../../glossary.rst:1181 msgid "triple-quoted string" msgstr "triple-quoted string(三引號內字串)" -#: ../../glossary.rst:1178 +#: ../../glossary.rst:1183 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -2585,11 +2587,11 @@ msgstr "" "中包含未跳脫 (unescaped) 的單引號和雙引號,而且它們不需使用連續字元 " "(continuation character) 就可以跨越多行,這使得它們在編寫說明字串時特別有用。" -#: ../../glossary.rst:1185 +#: ../../glossary.rst:1190 msgid "type" msgstr "type(型別)" -#: ../../glossary.rst:1187 +#: ../../glossary.rst:1192 msgid "" "The type of a Python object determines what kind of object it is; every " "object has a type. An object's type is accessible as its :attr:`~instance." @@ -2599,34 +2601,34 @@ msgstr "" "件的型別可以用它的 :attr:`~instance.__class__` 屬性來存取,或以 " "``type(obj)`` 來檢索。" -#: ../../glossary.rst:1191 +#: ../../glossary.rst:1196 msgid "type alias" msgstr "type alias(型別別名)" -#: ../../glossary.rst:1193 +#: ../../glossary.rst:1198 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "一個型別的同義詞,透過將型別指定給一個識別符 (identifier) 來建立。" -#: ../../glossary.rst:1195 +#: ../../glossary.rst:1200 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" msgstr "" "型別別名對於簡化\\ :term:`型別提示 (type hint) ` 很有用。例如: ::" -#: ../../glossary.rst:1202 +#: ../../glossary.rst:1207 msgid "could be made more readable like this::" msgstr "可以寫成這樣,更具有可讀性: ::" -#: ../../glossary.rst:1209 ../../glossary.rst:1223 +#: ../../glossary.rst:1214 ../../glossary.rst:1228 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "請參閱 :mod:`typing` 和 :pep:`484`,有此功能的描述。" -#: ../../glossary.rst:1210 +#: ../../glossary.rst:1215 msgid "type hint" msgstr "type hint(型別提示)" -#: ../../glossary.rst:1212 +#: ../../glossary.rst:1217 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." @@ -2634,7 +2636,7 @@ msgstr "" "一種 :term:`annotation`\\ (註釋),它指定一個變數、一個 class 屬性或一個函式" "的參數或回傳值的預期型別。" -#: ../../glossary.rst:1215 +#: ../../glossary.rst:1220 msgid "" "Type hints are optional and are not enforced by Python but they are useful " "to :term:`static type checkers `. They can also aid " @@ -2644,7 +2646,7 @@ msgstr "" "(static type checkers) `\\ 很有用,並能協助 IDE 完成程式" "碼的補全 (completion) 和重構 (refactoring)。" -#: ../../glossary.rst:1219 +#: ../../glossary.rst:1224 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." @@ -2652,11 +2654,11 @@ msgstr "" "全域變數、class 屬性和函式(不含區域變數)的型別提示,都可以使用 :func:" "`typing.get_type_hints` 來存取。" -#: ../../glossary.rst:1224 +#: ../../glossary.rst:1229 msgid "universal newlines" msgstr "universal newlines(通用換行字元)" -#: ../../glossary.rst:1226 +#: ../../glossary.rst:1231 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " @@ -2669,20 +2671,20 @@ msgstr "" "``'\\r'``。請參閱 :pep:`278` 和 :pep:`3116`,以及用於 :func:`bytes." "splitlines` 的附加用途。" -#: ../../glossary.rst:1231 +#: ../../glossary.rst:1236 msgid "variable annotation" msgstr "variable annotation(變數註釋)" -#: ../../glossary.rst:1233 +#: ../../glossary.rst:1238 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "一個變數或 class 屬性的 :term:`annotation`\\ (註釋)。" -#: ../../glossary.rst:1235 +#: ../../glossary.rst:1240 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "註釋變數或 class 屬性時,賦值是選擇性的: ::" -#: ../../glossary.rst:1240 +#: ../../glossary.rst:1245 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" @@ -2690,11 +2692,11 @@ msgstr "" "變數註釋通常用於\\ :term:`型別提示 (type hint) `:例如,這個變數預" "期會取得 :class:`int`\\ (整數)值: ::" -#: ../../glossary.rst:1246 +#: ../../glossary.rst:1251 msgid "Variable annotation syntax is explained in section :ref:`annassign`." msgstr "變數註釋的語法在\\ :ref:`annassign`\\ 章節有詳細的解釋。" -#: ../../glossary.rst:1248 +#: ../../glossary.rst:1253 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " "this functionality. Also see :ref:`annotations-howto` for best practices on " @@ -2703,11 +2705,11 @@ msgstr "" "請參閱 :term:`function annotation`\\ (函式註釋)、:pep:`484` 和 :pep:`526`," "皆有此功能的描述。關於註釋的最佳實踐方法,另請參閱 :ref:`annotations-howto`。" -#: ../../glossary.rst:1252 +#: ../../glossary.rst:1257 msgid "virtual environment" msgstr "virtual environment(虛擬環境)" -#: ../../glossary.rst:1254 +#: ../../glossary.rst:1259 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " @@ -2718,15 +2720,15 @@ msgstr "" "程式得以安裝和升級 Python 發佈套件,而不會對同一個系統上運行的其他 Python 應" "用程式的行為產生干擾。" -#: ../../glossary.rst:1259 +#: ../../glossary.rst:1264 msgid "See also :mod:`venv`." msgstr "另請參閱 :mod:`venv`。" -#: ../../glossary.rst:1260 +#: ../../glossary.rst:1265 msgid "virtual machine" msgstr "virtual machine(虛擬機器)" -#: ../../glossary.rst:1262 +#: ../../glossary.rst:1267 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." @@ -2734,11 +2736,11 @@ msgstr "" "一部完全由軟體所定義的電腦 (computer)。Python 的虛擬機器會執行由 :term:" "`bytecode`\\ (位元組碼)編譯器所發出的位元組碼。" -#: ../../glossary.rst:1264 +#: ../../glossary.rst:1269 msgid "Zen of Python" msgstr "Zen of Python(Python 之禪)" -#: ../../glossary.rst:1266 +#: ../../glossary.rst:1271 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " @@ -2755,10 +2757,10 @@ msgstr "C-contiguous(C 連續的)" msgid "Fortran contiguous" msgstr "Fortran contiguous(Fortran 連續的)" -#: ../../glossary.rst:757 +#: ../../glossary.rst:761 msgid "magic" msgstr "magic" -#: ../../glossary.rst:1123 +#: ../../glossary.rst:1128 msgid "special" msgstr "special" diff --git a/howto/annotations.po b/howto/annotations.po index 9d94b9c572..05243edcfc 100644 --- a/howto/annotations.po +++ b/howto/annotations.po @@ -122,8 +122,8 @@ msgid "" "annotations will be an empty dict instead." msgstr "" "在 Python 3.10 之前,存取未定義註釋但具有註釋的父類別的類別上的 " -"``__annotations__`` 將傳回父類別的 `` __annotations__``。在 Python 3.10 及更" -"高版本中,子類別的註釋將會是一個空字典。" +"``__annotations__`` 將傳回父類別的 ``__annotations__``。在 Python 3.10 及更高" +"版本中,子類別的註釋將會是一個空字典。" #: ../../howto/annotations.rst:68 msgid "Accessing The Annotations Dict Of An Object In Python 3.9 And Older" @@ -268,7 +268,7 @@ msgid "" msgstr "" "如果 ``o`` 是使用 :func:`functools.update_wrapper`、:func:`functools.wraps` " "或 :func:`functools.partial` 包裝的 callable ,請依據需求,透過存取 ``o." -"__wrapped__`` 或``o.func`` 來疊代解開它,直到找到根解包函式。" +"__wrapped__`` 或 ``o.func`` 來疊代解開它,直到找到根解包函式。" #: ../../howto/annotations.rst:155 msgid "" @@ -331,8 +331,8 @@ msgid "" "If you do assign directly to the ``__annotations__`` member of an object, " "you should always set it to a ``dict`` object." msgstr "" -"如果你直接指派給物件的 `` __annotations__`` 成員,則應始終將其設為 ``dict`` " -"物件。" +"如果你直接指派給物件的 ``__annotations__`` 成員,則應始終將其設為 ``dict`` 物" +"件。" #: ../../howto/annotations.rst:186 msgid "" @@ -412,5 +412,5 @@ msgid "" "This prints ``{'a': \"'str'\"}``. This shouldn't really be considered a " "\"quirk\"; it's mentioned here simply because it might be surprising." msgstr "" -"這會印出 ``{'a': \"'str'\"}``。這不應該被認為是一個「奇異的事」,他在這裡被簡單" -"提及,因為他可能會讓人意想不到。" +"這會印出 ``{'a': \"'str'\"}``。這不應該被認為是一個「奇異的事」,他在這裡被簡" +"單提及,因為他可能會讓人意想不到。" diff --git a/library/contextlib.po b/library/contextlib.po index 8bac829d3b..5902adb1f1 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-11-11 00:03+0000\n" +"POT-Creation-Date: 2023-12-08 16:59+0000\n" "PO-Revision-Date: 2018-05-23 14:41+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -134,9 +134,9 @@ msgstr "" msgid "" "This function is a :term:`decorator` that can be used to define a factory " "function for :keyword:`async with` statement asynchronous context managers, " -"without needing to create a class or separate :meth:`__aenter__` and :meth:" -"`__aexit__` methods. It must be applied to an :term:`asynchronous generator` " -"function." +"without needing to create a class or separate :meth:`~object.__aenter__` " +"and :meth:`~object.__aexit__` methods. It must be applied to an :term:" +"`asynchronous generator` function." msgstr "" #: ../../library/contextlib.rst:113 @@ -555,13 +555,14 @@ msgstr "" #: ../../library/contextlib.rst:619 msgid "" -"The :meth:`close` method is not implemented, :meth:`aclose` must be used " -"instead." +"The :meth:`~ExitStack.close` method is not implemented; :meth:`aclose` must " +"be used instead." msgstr "" #: ../../library/contextlib.rst:624 msgid "" -"Similar to :meth:`enter_context` but expects an asynchronous context manager." +"Similar to :meth:`ExitStack.enter_context` but expects an asynchronous " +"context manager." msgstr "" #: ../../library/contextlib.rst:627 @@ -572,16 +573,16 @@ msgstr "" #: ../../library/contextlib.rst:633 msgid "" -"Similar to :meth:`push` but expects either an asynchronous context manager " -"or a coroutine function." +"Similar to :meth:`ExitStack.push` but expects either an asynchronous context " +"manager or a coroutine function." msgstr "" #: ../../library/contextlib.rst:638 -msgid "Similar to :meth:`callback` but expects a coroutine function." +msgid "Similar to :meth:`ExitStack.callback` but expects a coroutine function." msgstr "" #: ../../library/contextlib.rst:642 -msgid "Similar to :meth:`close` but properly handles awaitables." +msgid "Similar to :meth:`ExitStack.close` but properly handles awaitables." msgstr "" #: ../../library/contextlib.rst:644 diff --git a/library/dis.po b/library/dis.po index b9269f6301..b3fb5b05c3 100644 --- a/library/dis.po +++ b/library/dis.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-06 00:03+0000\n" +"POT-Creation-Date: 2023-12-07 00:03+0000\n" "PO-Revision-Date: 2018-07-27 16:55+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -378,21 +378,22 @@ msgstr "" #: ../../library/dis.rst:326 msgid "" -"The :pep:`626` ``co_lines`` method is used instead of the ``co_firstlineno`` " -"and ``co_lnotab`` attributes of the code object." +"The :pep:`626` ``co_lines`` method is used instead of the :attr:`~codeobject." +"co_firstlineno` and :attr:`~codeobject.co_lnotab` attributes of the code " +"object." msgstr "" -#: ../../library/dis.rst:333 +#: ../../library/dis.rst:334 msgid "" "Detect all offsets in the raw compiled bytecode string *code* which are jump " "targets, and return a list of these offsets." msgstr "" -#: ../../library/dis.rst:339 +#: ../../library/dis.rst:340 msgid "Compute the stack effect of *opcode* with argument *oparg*." msgstr "" -#: ../../library/dis.rst:341 +#: ../../library/dis.rst:342 msgid "" "If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` " "will return the stack effect of jumping. If *jump* is ``False``, it will " @@ -400,122 +401,122 @@ msgid "" "it will return the maximal stack effect of both cases." msgstr "" -#: ../../library/dis.rst:348 +#: ../../library/dis.rst:349 msgid "Added *jump* parameter." msgstr "新增 *jump* 參數。" -#: ../../library/dis.rst:355 +#: ../../library/dis.rst:356 msgid "Python Bytecode Instructions" msgstr "" -#: ../../library/dis.rst:357 +#: ../../library/dis.rst:358 msgid "" "The :func:`get_instructions` function and :class:`Bytecode` class provide " "details of bytecode instructions as :class:`Instruction` instances:" msgstr "" -#: ../../library/dis.rst:362 +#: ../../library/dis.rst:363 msgid "Details for a bytecode operation" msgstr "" -#: ../../library/dis.rst:366 +#: ../../library/dis.rst:367 msgid "" "numeric code for operation, corresponding to the opcode values listed below " "and the bytecode values in the :ref:`opcode_collections`." msgstr "" -#: ../../library/dis.rst:372 +#: ../../library/dis.rst:373 msgid "human readable name for operation" msgstr "" -#: ../../library/dis.rst:377 +#: ../../library/dis.rst:378 msgid "numeric argument to operation (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:382 +#: ../../library/dis.rst:383 msgid "resolved arg value (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:387 +#: ../../library/dis.rst:388 msgid "" "human readable description of operation argument (if any), otherwise an " "empty string." msgstr "" -#: ../../library/dis.rst:393 +#: ../../library/dis.rst:394 msgid "start index of operation within bytecode sequence" msgstr "" -#: ../../library/dis.rst:398 +#: ../../library/dis.rst:399 msgid "line started by this opcode (if any), otherwise ``None``" msgstr "" -#: ../../library/dis.rst:403 +#: ../../library/dis.rst:404 msgid "``True`` if other code jumps to here, otherwise ``False``" msgstr "" -#: ../../library/dis.rst:408 +#: ../../library/dis.rst:409 msgid "" ":class:`dis.Positions` object holding the start and end locations that are " "covered by this instruction." msgstr "" -#: ../../library/dis.rst:415 +#: ../../library/dis.rst:416 msgid "Field ``positions`` is added." msgstr "" -#: ../../library/dis.rst:420 +#: ../../library/dis.rst:421 msgid "" "In case the information is not available, some fields might be ``None``." msgstr "" -#: ../../library/dis.rst:430 +#: ../../library/dis.rst:431 msgid "" "The Python compiler currently generates the following bytecode instructions." msgstr "" -#: ../../library/dis.rst:433 +#: ../../library/dis.rst:434 msgid "**General instructions**" msgstr "" -#: ../../library/dis.rst:435 +#: ../../library/dis.rst:436 msgid "" "In the following, We will refer to the interpreter stack as ``STACK`` and " "describe operations on it as if it was a Python list. The top of the stack " "corresponds to ``STACK[-1]`` in this language." msgstr "" -#: ../../library/dis.rst:441 +#: ../../library/dis.rst:442 msgid "" "Do nothing code. Used as a placeholder by the bytecode optimizer, and to " "generate line tracing events." msgstr "" -#: ../../library/dis.rst:447 +#: ../../library/dis.rst:448 msgid "Removes the top-of-stack item::" msgstr "" -#: ../../library/dis.rst:454 +#: ../../library/dis.rst:455 msgid "" "Removes the top two values from the stack. Equivalent to ``POP_TOP``; " "``POP_TOP``. Used to clean up at the end of loops, hence the name." msgstr "" -#: ../../library/dis.rst:463 +#: ../../library/dis.rst:464 msgid "Implements ``del STACK[-2]``. Used to clean up when a generator exits." msgstr "" -#: ../../library/dis.rst:471 +#: ../../library/dis.rst:472 msgid "" "Push the i-th item to the top of the stack without removing it from its " "original location::" msgstr "" -#: ../../library/dis.rst:482 +#: ../../library/dis.rst:483 msgid "Swap the top of the stack with the i-th element::" msgstr "" -#: ../../library/dis.rst:491 +#: ../../library/dis.rst:492 msgid "" "Rather than being an actual instruction, this opcode is used to mark extra " "space for the interpreter to cache useful data directly in the bytecode " @@ -523,91 +524,91 @@ msgid "" "viewed with ``show_caches=True``." msgstr "" -#: ../../library/dis.rst:496 +#: ../../library/dis.rst:497 msgid "" "Logically, this space is part of the preceding instruction. Many opcodes " "expect to be followed by an exact number of caches, and will instruct the " "interpreter to skip over them at runtime." msgstr "" -#: ../../library/dis.rst:500 +#: ../../library/dis.rst:501 msgid "" "Populated caches can look like arbitrary instructions, so great care should " "be taken when reading or modifying raw, adaptive bytecode containing " "quickened data." msgstr "" -#: ../../library/dis.rst:507 +#: ../../library/dis.rst:508 msgid "**Unary operations**" msgstr "" -#: ../../library/dis.rst:509 +#: ../../library/dis.rst:510 msgid "" "Unary operations take the top of the stack, apply the operation, and push " "the result back on the stack." msgstr "" -#: ../../library/dis.rst:515 +#: ../../library/dis.rst:516 msgid "Implements ``STACK[-1] = -STACK[-1]``." msgstr "" -#: ../../library/dis.rst:520 +#: ../../library/dis.rst:521 msgid "Implements ``STACK[-1] = not STACK[-1]``." msgstr "" -#: ../../library/dis.rst:525 +#: ../../library/dis.rst:526 msgid "Implements ``STACK[-1] = ~STACK[-1]``." msgstr "" -#: ../../library/dis.rst:530 +#: ../../library/dis.rst:531 msgid "Implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:535 +#: ../../library/dis.rst:536 msgid "" "If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " "it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." msgstr "" -#: ../../library/dis.rst:541 +#: ../../library/dis.rst:542 msgid "**Binary and in-place operations**" msgstr "" -#: ../../library/dis.rst:543 +#: ../../library/dis.rst:544 msgid "" "Binary operations remove the top two items from the stack (``STACK[-1]`` and " "``STACK[-2]``). They perform the operation, then put the result back on the " "stack." msgstr "" -#: ../../library/dis.rst:546 +#: ../../library/dis.rst:547 msgid "" "In-place operations are like binary operations, but the operation is done in-" "place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " "(but does not have to be) the original ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:553 +#: ../../library/dis.rst:554 msgid "" "Implements the binary and in-place operators (depending on the value of " "*op*)::" msgstr "" -#: ../../library/dis.rst:565 ../../library/dis.rst:574 -#: ../../library/dis.rst:584 ../../library/dis.rst:592 -#: ../../library/dis.rst:604 ../../library/dis.rst:692 -#: ../../library/dis.rst:702 ../../library/dis.rst:712 -#: ../../library/dis.rst:932 ../../library/dis.rst:943 -#: ../../library/dis.rst:1043 ../../library/dis.rst:1055 -#: ../../library/dis.rst:1067 +#: ../../library/dis.rst:566 ../../library/dis.rst:575 +#: ../../library/dis.rst:585 ../../library/dis.rst:593 +#: ../../library/dis.rst:605 ../../library/dis.rst:693 +#: ../../library/dis.rst:703 ../../library/dis.rst:713 +#: ../../library/dis.rst:933 ../../library/dis.rst:944 +#: ../../library/dis.rst:1044 ../../library/dis.rst:1056 +#: ../../library/dis.rst:1068 msgid "Implements::" msgstr "" -#: ../../library/dis.rst:615 +#: ../../library/dis.rst:616 msgid "**Coroutine opcodes**" msgstr "" -#: ../../library/dis.rst:619 +#: ../../library/dis.rst:620 msgid "" "Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where " "``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a " @@ -615,39 +616,39 @@ msgid "" "resolves ``o.__await__``." msgstr "" -#: ../../library/dis.rst:624 +#: ../../library/dis.rst:625 msgid "" "If the ``where`` operand is nonzero, it indicates where the instruction " "occurs:" msgstr "" -#: ../../library/dis.rst:627 +#: ../../library/dis.rst:628 msgid "``1``: After a call to ``__aenter__``" msgstr "" -#: ../../library/dis.rst:628 +#: ../../library/dis.rst:629 msgid "``2``: After a call to ``__aexit__``" msgstr "" -#: ../../library/dis.rst:632 +#: ../../library/dis.rst:633 msgid "Previously, this instruction did not have an oparg." msgstr "" -#: ../../library/dis.rst:638 +#: ../../library/dis.rst:639 msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." msgstr "" -#: ../../library/dis.rst:641 +#: ../../library/dis.rst:642 msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." msgstr "" -#: ../../library/dis.rst:648 +#: ../../library/dis.rst:649 msgid "" "Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " "stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." msgstr "" -#: ../../library/dis.rst:656 +#: ../../library/dis.rst:657 msgid "" "Terminates an :keyword:`async for` loop. Handles an exception raised when " "awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` " @@ -655,13 +656,13 @@ msgid "" "is not :exc:`StopAsyncIteration`, it is re-raised." msgstr "" -#: ../../library/dis.rst:663 ../../library/dis.rst:768 -#: ../../library/dis.rst:779 +#: ../../library/dis.rst:664 ../../library/dis.rst:769 +#: ../../library/dis.rst:780 msgid "" "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:669 +#: ../../library/dis.rst:670 msgid "" "Handles an exception raised during a :meth:`~generator.throw` or :meth:" "`~generator.close` call through the current frame. If ``STACK[-1]`` is an " @@ -669,35 +670,35 @@ msgid "" "its ``value`` member. Otherwise, re-raise ``STACK[-1]``." msgstr "" -#: ../../library/dis.rst:679 +#: ../../library/dis.rst:680 msgid "" "Resolves ``__aenter__`` and ``__aexit__`` from ``STACK[-1]``. Pushes " "``__aexit__`` and result of ``__aenter__()`` to the stack::" msgstr "" -#: ../../library/dis.rst:688 +#: ../../library/dis.rst:689 msgid "**Miscellaneous opcodes**" msgstr "" -#: ../../library/dis.rst:697 +#: ../../library/dis.rst:698 msgid "Used to implement set comprehensions." msgstr "" -#: ../../library/dis.rst:707 +#: ../../library/dis.rst:708 msgid "Used to implement list comprehensions." msgstr "" -#: ../../library/dis.rst:718 +#: ../../library/dis.rst:719 msgid "Used to implement dict comprehensions." msgstr "" -#: ../../library/dis.rst:721 +#: ../../library/dis.rst:722 msgid "" "Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " "reversed." msgstr "" -#: ../../library/dis.rst:725 +#: ../../library/dis.rst:726 msgid "" "For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:" "`MAP_ADD` instructions, while the added value or key/value pair is popped " @@ -705,29 +706,29 @@ msgid "" "further iterations of the loop." msgstr "" -#: ../../library/dis.rst:733 +#: ../../library/dis.rst:734 msgid "Returns with ``STACK[-1]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:738 +#: ../../library/dis.rst:739 msgid "Returns with ``co_consts[consti]`` to the caller of the function." msgstr "" -#: ../../library/dis.rst:745 +#: ../../library/dis.rst:746 msgid "Yields ``STACK.pop()`` from a :term:`generator`." msgstr "" -#: ../../library/dis.rst:747 +#: ../../library/dis.rst:748 msgid "oparg set to be the stack depth." msgstr "" -#: ../../library/dis.rst:750 +#: ../../library/dis.rst:751 msgid "" "oparg set to be the exception block depth, for efficient closing of " "generators." msgstr "" -#: ../../library/dis.rst:756 +#: ../../library/dis.rst:757 msgid "" "Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " "set up to an empty ``dict``. This opcode is only emitted if a class or " @@ -735,39 +736,39 @@ msgid "" "statically." msgstr "" -#: ../../library/dis.rst:766 +#: ../../library/dis.rst:767 msgid "" "Pops a value from the stack, which is used to restore the exception state." msgstr "" -#: ../../library/dis.rst:773 +#: ../../library/dis.rst:774 msgid "" "Re-raises the exception currently on top of the stack. If oparg is non-zero, " "pops an additional value from the stack which is used to set :attr:`~frame." "f_lasti` of the current frame." msgstr "" -#: ../../library/dis.rst:784 +#: ../../library/dis.rst:785 msgid "" "Pops a value from the stack. Pushes the current exception to the top of the " "stack. Pushes the value originally popped back to the stack. Used in " "exception handlers." msgstr "" -#: ../../library/dis.rst:792 +#: ../../library/dis.rst:793 msgid "" "Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` " "is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " "boolean result of the test." msgstr "" -#: ../../library/dis.rst:800 +#: ../../library/dis.rst:801 msgid "" "Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " "the exception group representing ``STACK[-2]``." msgstr "" -#: ../../library/dis.rst:803 +#: ../../library/dis.rst:804 msgid "" "In case of a match, pops two items from the stack and pushes the non-" "matching subgroup (``None`` in case of full match) followed by the matching " @@ -775,7 +776,7 @@ msgid "" "``None``." msgstr "" -#: ../../library/dis.rst:812 +#: ../../library/dis.rst:813 msgid "" "Calls the function in position 4 on the stack with arguments (type, val, tb) " "representing the exception at the top of the stack. Used to implement the " @@ -783,25 +784,25 @@ msgid "" "occurred in a :keyword:`with` statement." msgstr "" -#: ../../library/dis.rst:819 +#: ../../library/dis.rst:820 msgid "" "The ``__exit__`` function is in position 4 of the stack rather than 7. " "Exception representation on the stack now consist of one, not three, items." msgstr "" -#: ../../library/dis.rst:826 +#: ../../library/dis.rst:827 msgid "" "Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert` " "statement." msgstr "" -#: ../../library/dis.rst:834 +#: ../../library/dis.rst:835 msgid "" "Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " "to construct a class." msgstr "" -#: ../../library/dis.rst:840 +#: ../../library/dis.rst:841 msgid "" "This opcode performs several operations before a with block starts. First, " "it loads :meth:`~object.__exit__` from the context manager and pushes it " @@ -810,11 +811,11 @@ msgid "" "``__enter__()`` method is pushed onto the stack." msgstr "" -#: ../../library/dis.rst:851 +#: ../../library/dis.rst:852 msgid "Perform ``STACK.append(len(STACK[-1]))``." msgstr "" -#: ../../library/dis.rst:858 +#: ../../library/dis.rst:859 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " "more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " @@ -822,7 +823,7 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:868 +#: ../../library/dis.rst:869 msgid "" "If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " "*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " @@ -831,40 +832,40 @@ msgid "" "Otherwise, push ``False``." msgstr "" -#: ../../library/dis.rst:878 +#: ../../library/dis.rst:879 msgid "" "``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " "subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" "class:`tuple` containing the corresponding values. Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:884 ../../library/dis.rst:1511 +#: ../../library/dis.rst:885 ../../library/dis.rst:1512 msgid "" "Previously, this instruction also pushed a boolean value indicating success " "(``True``) or failure (``False``)." msgstr "" -#: ../../library/dis.rst:891 +#: ../../library/dis.rst:892 msgid "" "Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " -"attribute :attr:`!co_names` of the :ref:`code object `. The " -"compiler tries to use :opcode:`STORE_FAST` or :opcode:`STORE_GLOBAL` if " -"possible." +"attribute :attr:`~codeobject.co_names` of the :ref:`code object `. The compiler tries to use :opcode:`STORE_FAST` or :opcode:" +"`STORE_GLOBAL` if possible." msgstr "" -#: ../../library/dis.rst:898 +#: ../../library/dis.rst:899 msgid "" -"Implements ``del name``, where *namei* is the index into :attr:`!co_names` " -"attribute of the :ref:`code object `." +"Implements ``del name``, where *namei* is the index into :attr:`~codeobject." +"co_names` attribute of the :ref:`code object `." msgstr "" -#: ../../library/dis.rst:904 +#: ../../library/dis.rst:905 msgid "" "Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " "stack right-to-left. Require there to be exactly *count* values.::" msgstr "" -#: ../../library/dis.rst:913 +#: ../../library/dis.rst:914 msgid "" "Implements assignment with a starred target: Unpacks an iterable in " "``STACK[-1]`` into individual values, where the total number of values can " @@ -872,11 +873,11 @@ msgid "" "will be a list of all leftover items." msgstr "" -#: ../../library/dis.rst:918 +#: ../../library/dis.rst:919 msgid "The number of values before and after the list value is limited to 255." msgstr "" -#: ../../library/dis.rst:920 +#: ../../library/dis.rst:921 msgid "" "The number of values before the list value is encoded in the argument of the " "opcode. The number of values after the list if any is encoded using an " @@ -885,50 +886,50 @@ msgid "" "list value, the high byte of *counts* the number of values after it." msgstr "" -#: ../../library/dis.rst:926 +#: ../../library/dis.rst:927 msgid "" "The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " "d`` will be stored after execution as ``STACK.extend((a, b, c))``." msgstr "" -#: ../../library/dis.rst:938 +#: ../../library/dis.rst:939 msgid "" -"where *namei* is the index of name in :attr:`!co_names` of the :ref:`code " -"object `." +"where *namei* is the index of name in :attr:`~codeobject.co_names` of the :" +"ref:`code object `." msgstr "" -#: ../../library/dis.rst:948 +#: ../../library/dis.rst:949 msgid "" -"where *namei* is the index of name into :attr:`!co_names` of the :ref:`code " -"object `." +"where *namei* is the index of name into :attr:`~codeobject.co_names` of the :" +"ref:`code object `." msgstr "" -#: ../../library/dis.rst:954 +#: ../../library/dis.rst:955 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" -#: ../../library/dis.rst:959 +#: ../../library/dis.rst:960 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" -#: ../../library/dis.rst:964 +#: ../../library/dis.rst:965 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "" -#: ../../library/dis.rst:969 +#: ../../library/dis.rst:970 msgid "" "Pushes the value associated with ``co_names[namei]`` onto the stack. The " "name is looked up within the locals, then the globals, then the builtins." msgstr "" -#: ../../library/dis.rst:975 +#: ../../library/dis.rst:976 msgid "" "Pushes a reference to the locals dictionary onto the stack. This is used to " "prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" "opcode:`LOAD_FROM_DICT_OR_GLOBALS`." msgstr "" -#: ../../library/dis.rst:984 +#: ../../library/dis.rst:985 msgid "" "Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " "If the name is not found there, looks it up in the globals and then the " @@ -937,69 +938,69 @@ msgid "" "bodies." msgstr "" -#: ../../library/dis.rst:995 +#: ../../library/dis.rst:996 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " "resulting tuple onto the stack.::" msgstr "" -#: ../../library/dis.rst:1005 +#: ../../library/dis.rst:1006 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" -#: ../../library/dis.rst:1010 +#: ../../library/dis.rst:1011 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" -#: ../../library/dis.rst:1015 +#: ../../library/dis.rst:1016 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " "that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " "STACK[-2]: STACK[-1]}``." msgstr "" -#: ../../library/dis.rst:1019 +#: ../../library/dis.rst:1020 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:1026 +#: ../../library/dis.rst:1027 msgid "" "The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " "top element on the stack which contains a tuple of keys, then starting from " "``STACK[-2]``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:1035 +#: ../../library/dis.rst:1036 msgid "" "Concatenates *count* strings from the stack and pushes the resulting string " "onto the stack." msgstr "" -#: ../../library/dis.rst:1048 +#: ../../library/dis.rst:1049 msgid "Used to build lists." msgstr "" -#: ../../library/dis.rst:1060 +#: ../../library/dis.rst:1061 msgid "Used to build sets." msgstr "" -#: ../../library/dis.rst:1072 +#: ../../library/dis.rst:1073 msgid "Used to build dicts." msgstr "" -#: ../../library/dis.rst:1079 +#: ../../library/dis.rst:1080 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1086 +#: ../../library/dis.rst:1087 msgid "" "If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " "``getattr(STACK[-1], co_names[namei>>1])``." msgstr "" -#: ../../library/dis.rst:1089 +#: ../../library/dis.rst:1090 msgid "" "If the low bit of ``namei`` is set, this will attempt to load a method named " "``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " @@ -1010,60 +1011,60 @@ msgid "" "the object returned by the attribute lookup are pushed." msgstr "" -#: ../../library/dis.rst:1097 +#: ../../library/dis.rst:1098 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " "the stack before the attribute or unbound method respectively." msgstr "" -#: ../../library/dis.rst:1104 +#: ../../library/dis.rst:1105 msgid "" "This opcode implements :func:`super`, both in its zero-argument and two-" "argument forms (e.g. ``super().method()``, ``super().attr`` and ``super(cls, " "self).method()``, ``super(cls, self).attr``)." msgstr "" -#: ../../library/dis.rst:1108 +#: ../../library/dis.rst:1109 msgid "" "It pops three values from the stack (from top of stack down): - ``self``: " "the first argument to the current method - ``cls``: the class within which " "the current method was defined - the global ``super``" msgstr "" -#: ../../library/dis.rst:1113 +#: ../../library/dis.rst:1114 msgid "" "With respect to its argument, it works similarly to :opcode:`LOAD_ATTR`, " "except that ``namei`` is shifted left by 2 bits instead of 1." msgstr "" -#: ../../library/dis.rst:1116 +#: ../../library/dis.rst:1117 msgid "" "The low bit of ``namei`` signals to attempt a method load, as with :opcode:" "`LOAD_ATTR`, which results in pushing ``None`` and the loaded method. When " "it is unset a single value is pushed to the stack." msgstr "" -#: ../../library/dis.rst:1120 +#: ../../library/dis.rst:1121 msgid "" "The second-low bit of ``namei``, if set, means that this was a two-argument " "call to :func:`super` (unset means zero-argument)." msgstr "" -#: ../../library/dis.rst:1128 +#: ../../library/dis.rst:1129 msgid "" "Performs a Boolean operation. The operation name can be found in " "``cmp_op[opname]``." msgstr "" -#: ../../library/dis.rst:1134 +#: ../../library/dis.rst:1135 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1141 +#: ../../library/dis.rst:1142 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1148 +#: ../../library/dis.rst:1149 msgid "" "Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " "popped and provide the *fromlist* and *level* arguments of :func:" @@ -1072,68 +1073,68 @@ msgid "" "opcode:`STORE_FAST` instruction modifies the namespace." msgstr "" -#: ../../library/dis.rst:1156 +#: ../../library/dis.rst:1157 msgid "" "Loads the attribute ``co_names[namei]`` from the module found in " "``STACK[-1]``. The resulting object is pushed onto the stack, to be " "subsequently stored by a :opcode:`STORE_FAST` instruction." msgstr "" -#: ../../library/dis.rst:1163 +#: ../../library/dis.rst:1164 msgid "Increments bytecode counter by *delta*." msgstr "" -#: ../../library/dis.rst:1168 +#: ../../library/dis.rst:1169 msgid "Decrements bytecode counter by *delta*. Checks for interrupts." msgstr "" -#: ../../library/dis.rst:1175 +#: ../../library/dis.rst:1176 msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." msgstr "" -#: ../../library/dis.rst:1182 +#: ../../library/dis.rst:1183 msgid "" "If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1185 ../../library/dis.rst:1198 +#: ../../library/dis.rst:1186 ../../library/dis.rst:1199 msgid "" "The oparg is now a relative delta rather than an absolute target. This " "opcode is a pseudo-instruction, replaced in final bytecode by the directed " "versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1190 ../../library/dis.rst:1203 -#: ../../library/dis.rst:1216 ../../library/dis.rst:1230 +#: ../../library/dis.rst:1191 ../../library/dis.rst:1204 +#: ../../library/dis.rst:1217 ../../library/dis.rst:1231 msgid "This is no longer a pseudo-instruction." msgstr "" -#: ../../library/dis.rst:1195 +#: ../../library/dis.rst:1196 msgid "" "If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1208 +#: ../../library/dis.rst:1209 msgid "" "If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " "*delta*. ``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1211 ../../library/dis.rst:1225 +#: ../../library/dis.rst:1212 ../../library/dis.rst:1226 msgid "" "This opcode is a pseudo-instruction, replaced in final bytecode by the " "directed versions (forward/backward)." msgstr "" -#: ../../library/dis.rst:1222 +#: ../../library/dis.rst:1223 msgid "" "If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " "``STACK[-1]`` is popped." msgstr "" -#: ../../library/dis.rst:1235 +#: ../../library/dis.rst:1236 msgid "" "``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " "method. If this yields a new value, push it on the stack (leaving the " @@ -1141,83 +1142,88 @@ msgid "" "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1240 +#: ../../library/dis.rst:1241 msgid "Up until 3.11 the iterator was popped when it was exhausted." msgstr "" -#: ../../library/dis.rst:1245 +#: ../../library/dis.rst:1246 msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1247 +#: ../../library/dis.rst:1248 msgid "" "If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " "before the global variable." msgstr "" -#: ../../library/dis.rst:1253 +#: ../../library/dis.rst:1254 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" -#: ../../library/dis.rst:1255 +#: ../../library/dis.rst:1256 msgid "" "This opcode is now only used in situations where the local variable is " "guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." msgstr "" -#: ../../library/dis.rst:1261 +#: ../../library/dis.rst:1262 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " "raising an :exc:`UnboundLocalError` if the local variable has not been " "initialized." msgstr "" -#: ../../library/dis.rst:1269 +#: ../../library/dis.rst:1270 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " "pushes ``NULL`` onto the stack if the local variable has not been " "initialized) and sets ``co_varnames[var_num]`` to ``NULL``." msgstr "" -#: ../../library/dis.rst:1277 +#: ../../library/dis.rst:1278 msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1282 +#: ../../library/dis.rst:1283 msgid "Deletes local ``co_varnames[var_num]``." msgstr "" -#: ../../library/dis.rst:1287 +#: ../../library/dis.rst:1288 msgid "" "Creates a new cell in slot ``i``. If that slot is nonempty then that value " "is stored into the new cell." msgstr "" -#: ../../library/dis.rst:1295 +#: ../../library/dis.rst:1296 msgid "" "Pushes a reference to the cell contained in slot ``i`` of the \"fast " "locals\" storage. The name of the variable is ``co_fastlocalnames[i]``." msgstr "" -#: ../../library/dis.rst:1298 +#: ../../library/dis.rst:1299 msgid "" "Note that ``LOAD_CLOSURE`` is effectively an alias for ``LOAD_FAST``. It " "exists to keep bytecode a little more readable." msgstr "" -#: ../../library/dis.rst:1301 ../../library/dis.rst:1310 -#: ../../library/dis.rst:1332 ../../library/dis.rst:1343 +#: ../../library/dis.rst:1302 msgid "``i`` is no longer offset by the length of ``co_varnames``." msgstr "" -#: ../../library/dis.rst:1307 +#: ../../library/dis.rst:1308 msgid "" "Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" -#: ../../library/dis.rst:1316 +#: ../../library/dis.rst:1311 ../../library/dis.rst:1333 +#: ../../library/dis.rst:1344 +msgid "" +"``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`." +msgstr "" + +#: ../../library/dis.rst:1317 msgid "" "Pops a mapping off the stack and looks up the name associated with slot " "``i`` of the \"fast locals\" storage in this mapping. If the name is not " @@ -1227,94 +1233,94 @@ msgid "" "scopes ` within class bodies." msgstr "" -#: ../../library/dis.rst:1329 +#: ../../library/dis.rst:1330 msgid "" "Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " "locals\" storage." msgstr "" -#: ../../library/dis.rst:1338 +#: ../../library/dis.rst:1339 msgid "" "Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " "Used by the :keyword:`del` statement." msgstr "" -#: ../../library/dis.rst:1349 +#: ../../library/dis.rst:1350 msgid "" "Copies the ``n`` free variables from the closure into the frame. Removes the " "need for special code on the caller's side when calling closures." msgstr "" -#: ../../library/dis.rst:1358 +#: ../../library/dis.rst:1359 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1361 +#: ../../library/dis.rst:1362 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1362 +#: ../../library/dis.rst:1363 msgid "" "1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1363 +#: ../../library/dis.rst:1364 msgid "" "2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " "``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1369 +#: ../../library/dis.rst:1370 msgid "" "Calls a callable object with the number of arguments specified by ``argc``, " "including the named arguments specified by the preceding :opcode:`KW_NAMES`, " "if any. On the stack are (in ascending order), either:" msgstr "" -#: ../../library/dis.rst:1374 +#: ../../library/dis.rst:1375 msgid "NULL" msgstr "" -#: ../../library/dis.rst:1375 ../../library/dis.rst:1381 +#: ../../library/dis.rst:1376 ../../library/dis.rst:1382 msgid "The callable" msgstr "" -#: ../../library/dis.rst:1376 +#: ../../library/dis.rst:1377 msgid "The positional arguments" msgstr "" -#: ../../library/dis.rst:1377 ../../library/dis.rst:1384 +#: ../../library/dis.rst:1378 ../../library/dis.rst:1385 msgid "The named arguments" msgstr "" -#: ../../library/dis.rst:1379 +#: ../../library/dis.rst:1380 msgid "or:" msgstr "或:" -#: ../../library/dis.rst:1382 +#: ../../library/dis.rst:1383 msgid "``self``" msgstr "``self``" -#: ../../library/dis.rst:1383 +#: ../../library/dis.rst:1384 msgid "The remaining positional arguments" msgstr "" -#: ../../library/dis.rst:1386 +#: ../../library/dis.rst:1387 msgid "" "``argc`` is the total of the positional and named arguments, excluding " "``self`` when a ``NULL`` is not present." msgstr "" -#: ../../library/dis.rst:1389 +#: ../../library/dis.rst:1390 msgid "" "``CALL`` pops all arguments and the callable object off the stack, calls the " "callable object with those arguments, and pushes the return value returned " "by the callable object." msgstr "" -#: ../../library/dis.rst:1398 +#: ../../library/dis.rst:1399 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1326,70 +1332,70 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1413 +#: ../../library/dis.rst:1414 msgid "" "Pushes a ``NULL`` to the stack. Used in the call sequence to match the " "``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." msgstr "" -#: ../../library/dis.rst:1422 +#: ../../library/dis.rst:1423 msgid "" "Prefixes :opcode:`CALL`. Stores a reference to ``co_consts[consti]`` into an " "internal variable for use by :opcode:`CALL`. ``co_consts[consti]`` must be a " "tuple of strings." msgstr "" -#: ../../library/dis.rst:1431 +#: ../../library/dis.rst:1432 msgid "" "Pushes a new function object on the stack. From bottom to top, the consumed " "stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1434 +#: ../../library/dis.rst:1435 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1436 +#: ../../library/dis.rst:1437 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1437 +#: ../../library/dis.rst:1438 msgid "``0x04`` a tuple of strings containing parameters' annotations" msgstr "" -#: ../../library/dis.rst:1438 +#: ../../library/dis.rst:1439 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1439 +#: ../../library/dis.rst:1440 msgid "the code associated with the function (at ``STACK[-1]``)" msgstr "" -#: ../../library/dis.rst:1441 +#: ../../library/dis.rst:1442 msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" msgstr "" -#: ../../library/dis.rst:1444 +#: ../../library/dis.rst:1445 msgid "Qualified name at ``STACK[-1]`` was removed." msgstr "" -#: ../../library/dis.rst:1452 +#: ../../library/dis.rst:1453 msgid "" "Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " "implements::" msgstr "" -#: ../../library/dis.rst:1458 +#: ../../library/dis.rst:1459 msgid "if it is 3, implements::" msgstr "" -#: ../../library/dis.rst:1465 +#: ../../library/dis.rst:1466 msgid "See the :func:`slice` built-in function for more information." msgstr "" -#: ../../library/dis.rst:1470 +#: ../../library/dis.rst:1471 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1397,54 +1403,54 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1478 +#: ../../library/dis.rst:1479 msgid "" "Used for implementing formatted literal strings (f-strings). Pops an " "optional *fmt_spec* from the stack, then a required *value*. *flags* is " "interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1482 +#: ../../library/dis.rst:1483 msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1483 +#: ../../library/dis.rst:1484 msgid "" "``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1485 +#: ../../library/dis.rst:1486 msgid "" "``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1487 +#: ../../library/dis.rst:1488 msgid "" "``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " "it." msgstr "" -#: ../../library/dis.rst:1489 +#: ../../library/dis.rst:1490 msgid "" "``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " "use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1492 +#: ../../library/dis.rst:1493 msgid "" "Formatting is performed using :c:func:`PyObject_Format`. The result is " "pushed on the stack." msgstr "" -#: ../../library/dis.rst:1500 +#: ../../library/dis.rst:1501 msgid "" "``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " "class being matched against, and ``STACK[-3]`` is the match subject. " "*count* is the number of positional sub-patterns." msgstr "" -#: ../../library/dis.rst:1504 +#: ../../library/dis.rst:1505 msgid "" "Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " "instance of ``STACK[-2]`` and has the positional and keyword attributes " @@ -1452,257 +1458,257 @@ msgid "" "Otherwise, push ``None``." msgstr "" -#: ../../library/dis.rst:1518 +#: ../../library/dis.rst:1519 msgid "A no-op. Performs internal tracing, debugging and optimization checks." msgstr "" -#: ../../library/dis.rst:1520 +#: ../../library/dis.rst:1521 msgid "The ``where`` operand marks where the ``RESUME`` occurs:" msgstr "" -#: ../../library/dis.rst:1522 +#: ../../library/dis.rst:1523 msgid "" "``0`` The start of a function, which is neither a generator, coroutine nor " "an async generator" msgstr "" -#: ../../library/dis.rst:1524 +#: ../../library/dis.rst:1525 msgid "``1`` After a ``yield`` expression" msgstr "" -#: ../../library/dis.rst:1525 +#: ../../library/dis.rst:1526 msgid "``2`` After a ``yield from`` expression" msgstr "" -#: ../../library/dis.rst:1526 +#: ../../library/dis.rst:1527 msgid "``3`` After an ``await`` expression" msgstr "" -#: ../../library/dis.rst:1533 +#: ../../library/dis.rst:1534 msgid "" "Create a generator, coroutine, or async generator from the current frame. " "Used as first opcode of in code object for the above mentioned callables. " "Clear the current frame and return the newly created generator." msgstr "" -#: ../../library/dis.rst:1542 +#: ../../library/dis.rst:1543 msgid "" "Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " "from`` and ``await`` statements." msgstr "" -#: ../../library/dis.rst:1545 +#: ../../library/dis.rst:1546 msgid "" "If the call raises :exc:`StopIteration`, pop the top value from the stack, " "push the exception's ``value`` attribute, and increment the bytecode counter " "by *delta*." msgstr "" -#: ../../library/dis.rst:1554 +#: ../../library/dis.rst:1555 msgid "" "This is not really an opcode. It identifies the dividing line between " "opcodes in the range [0,255] which don't use their argument and those that " "do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1558 +#: ../../library/dis.rst:1559 msgid "" "If your application uses pseudo instructions, use the :data:`hasarg` " "collection instead." msgstr "" -#: ../../library/dis.rst:1561 +#: ../../library/dis.rst:1562 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1565 +#: ../../library/dis.rst:1566 msgid "" "Pseudo instructions were added to the :mod:`dis` module, and for them it is " "not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " "their arg." msgstr "" -#: ../../library/dis.rst:1573 +#: ../../library/dis.rst:1574 msgid "" "Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " "argument and sets ``STACK[-1]`` to the result. Used to implement " "functionality that is not performance critical." msgstr "" -#: ../../library/dis.rst:1577 ../../library/dis.rst:1631 +#: ../../library/dis.rst:1578 ../../library/dis.rst:1632 msgid "The operand determines which intrinsic function is called:" msgstr "" -#: ../../library/dis.rst:1580 ../../library/dis.rst:1634 +#: ../../library/dis.rst:1581 ../../library/dis.rst:1635 msgid "Operand" msgstr "" -#: ../../library/dis.rst:1580 ../../library/dis.rst:1634 +#: ../../library/dis.rst:1581 ../../library/dis.rst:1635 msgid "Description" msgstr "" -#: ../../library/dis.rst:1582 +#: ../../library/dis.rst:1583 msgid "``INTRINSIC_1_INVALID``" msgstr "``INTRINSIC_1_INVALID``" -#: ../../library/dis.rst:1582 ../../library/dis.rst:1636 +#: ../../library/dis.rst:1583 ../../library/dis.rst:1637 msgid "Not valid" msgstr "" -#: ../../library/dis.rst:1584 +#: ../../library/dis.rst:1585 msgid "``INTRINSIC_PRINT``" msgstr "``INTRINSIC_PRINT``" -#: ../../library/dis.rst:1584 +#: ../../library/dis.rst:1585 msgid "Prints the argument to standard out. Used in the REPL." msgstr "" -#: ../../library/dis.rst:1587 +#: ../../library/dis.rst:1588 msgid "``INTRINSIC_IMPORT_STAR``" msgstr "``INTRINSIC_IMPORT_STAR``" -#: ../../library/dis.rst:1587 +#: ../../library/dis.rst:1588 msgid "Performs ``import *`` for the named module." msgstr "" -#: ../../library/dis.rst:1590 +#: ../../library/dis.rst:1591 msgid "``INTRINSIC_STOPITERATION_ERROR``" msgstr "``INTRINSIC_STOPITERATION_ERROR``" -#: ../../library/dis.rst:1590 +#: ../../library/dis.rst:1591 msgid "Extracts the return value from a ``StopIteration`` exception." msgstr "" -#: ../../library/dis.rst:1593 +#: ../../library/dis.rst:1594 msgid "``INTRINSIC_ASYNC_GEN_WRAP``" msgstr "``INTRINSIC_ASYNC_GEN_WRAP``" -#: ../../library/dis.rst:1593 +#: ../../library/dis.rst:1594 msgid "Wraps an aync generator value" msgstr "" -#: ../../library/dis.rst:1595 +#: ../../library/dis.rst:1596 msgid "``INTRINSIC_UNARY_POSITIVE``" msgstr "``INTRINSIC_UNARY_POSITIVE``" -#: ../../library/dis.rst:1595 +#: ../../library/dis.rst:1596 msgid "Performs the unary ``+`` operation" msgstr "" -#: ../../library/dis.rst:1598 +#: ../../library/dis.rst:1599 msgid "``INTRINSIC_LIST_TO_TUPLE``" msgstr "``INTRINSIC_LIST_TO_TUPLE``" -#: ../../library/dis.rst:1598 +#: ../../library/dis.rst:1599 msgid "Converts a list to a tuple" msgstr "" -#: ../../library/dis.rst:1600 +#: ../../library/dis.rst:1601 msgid "``INTRINSIC_TYPEVAR``" msgstr "``INTRINSIC_TYPEVAR``" -#: ../../library/dis.rst:1600 +#: ../../library/dis.rst:1601 msgid "Creates a :class:`typing.TypeVar`" msgstr "" -#: ../../library/dis.rst:1602 +#: ../../library/dis.rst:1603 msgid "``INTRINSIC_PARAMSPEC``" msgstr "``INTRINSIC_PARAMSPEC``" -#: ../../library/dis.rst:1602 +#: ../../library/dis.rst:1603 msgid "Creates a :class:`typing.ParamSpec`" msgstr "" -#: ../../library/dis.rst:1605 +#: ../../library/dis.rst:1606 msgid "``INTRINSIC_TYPEVARTUPLE``" msgstr "``INTRINSIC_TYPEVARTUPLE``" -#: ../../library/dis.rst:1605 +#: ../../library/dis.rst:1606 msgid "Creates a :class:`typing.TypeVarTuple`" msgstr "" -#: ../../library/dis.rst:1608 +#: ../../library/dis.rst:1609 msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" msgstr "``INTRINSIC_SUBSCRIPT_GENERIC``" -#: ../../library/dis.rst:1608 +#: ../../library/dis.rst:1609 msgid "Returns :class:`typing.Generic` subscripted with the argument" msgstr "" -#: ../../library/dis.rst:1611 +#: ../../library/dis.rst:1612 msgid "``INTRINSIC_TYPEALIAS``" msgstr "``INTRINSIC_TYPEALIAS``" -#: ../../library/dis.rst:1611 +#: ../../library/dis.rst:1612 msgid "" "Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " "statement. The argument is a tuple of the type alias's name, type " "parameters, and value." msgstr "" -#: ../../library/dis.rst:1623 +#: ../../library/dis.rst:1624 msgid "" "Calls an intrinsic function with two arguments. Used to implement " "functionality that is not performance critical::" msgstr "" -#: ../../library/dis.rst:1636 +#: ../../library/dis.rst:1637 msgid "``INTRINSIC_2_INVALID``" msgstr "``INTRINSIC_2_INVALID``" -#: ../../library/dis.rst:1638 +#: ../../library/dis.rst:1639 msgid "``INTRINSIC_PREP_RERAISE_STAR``" msgstr "``INTRINSIC_PREP_RERAISE_STAR``" -#: ../../library/dis.rst:1638 +#: ../../library/dis.rst:1639 msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." msgstr "" -#: ../../library/dis.rst:1642 +#: ../../library/dis.rst:1643 msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" msgstr "``INTRINSIC_TYPEVAR_WITH_BOUND``" -#: ../../library/dis.rst:1642 +#: ../../library/dis.rst:1643 msgid "Creates a :class:`typing.TypeVar` with a bound." msgstr "" -#: ../../library/dis.rst:1645 +#: ../../library/dis.rst:1646 msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" msgstr "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -#: ../../library/dis.rst:1645 +#: ../../library/dis.rst:1646 msgid "Creates a :class:`typing.TypeVar` with constraints." msgstr "" -#: ../../library/dis.rst:1649 +#: ../../library/dis.rst:1650 msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" msgstr "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -#: ../../library/dis.rst:1649 +#: ../../library/dis.rst:1650 msgid "Sets the ``__type_params__`` attribute of a function." msgstr "" -#: ../../library/dis.rst:1656 +#: ../../library/dis.rst:1657 msgid "**Pseudo-instructions**" msgstr "" -#: ../../library/dis.rst:1658 +#: ../../library/dis.rst:1659 msgid "" "These opcodes do not appear in Python bytecode. They are used by the " "compiler but are replaced by real opcodes or removed before bytecode is " "generated." msgstr "" -#: ../../library/dis.rst:1663 +#: ../../library/dis.rst:1664 msgid "" "Set up an exception handler for the following code block. If an exception " "occurs, the value stack level is restored to its current state and control " "is transferred to the exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1670 +#: ../../library/dis.rst:1671 msgid "" "Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " "instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " @@ -1711,76 +1717,76 @@ msgid "" "exception handler at ``target``." msgstr "" -#: ../../library/dis.rst:1679 +#: ../../library/dis.rst:1680 msgid "" "Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " "from the stack before control is transferred to the exception handler at " "``target``." msgstr "" -#: ../../library/dis.rst:1683 +#: ../../library/dis.rst:1684 msgid "" "This variant is used in :keyword:`with` and :keyword:`async with` " "constructs, which push the return value of the context manager's :meth:" "`~object.__enter__` or :meth:`~object.__aenter__` to the stack." msgstr "" -#: ../../library/dis.rst:1690 +#: ../../library/dis.rst:1691 msgid "" "Marks the end of the code block associated with the last ``SETUP_FINALLY``, " "``SETUP_CLEANUP`` or ``SETUP_WITH``." msgstr "" -#: ../../library/dis.rst:1696 +#: ../../library/dis.rst:1697 msgid "" "Undirected relative jump instructions which are replaced by their directed " "(forward/backward) counterparts by the assembler." msgstr "" -#: ../../library/dis.rst:1701 +#: ../../library/dis.rst:1702 msgid "" "Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " "flag set in the arg." msgstr "" -#: ../../library/dis.rst:1708 +#: ../../library/dis.rst:1709 msgid "Opcode collections" msgstr "" -#: ../../library/dis.rst:1710 +#: ../../library/dis.rst:1711 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" msgstr "" -#: ../../library/dis.rst:1713 +#: ../../library/dis.rst:1714 msgid "" "The collections now contain pseudo instructions and instrumented " "instructions as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` " "and ``>= MIN_INSTRUMENTED_OPCODE``." msgstr "" -#: ../../library/dis.rst:1720 +#: ../../library/dis.rst:1721 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" -#: ../../library/dis.rst:1725 +#: ../../library/dis.rst:1726 msgid "Dictionary mapping operation names to bytecodes." msgstr "" -#: ../../library/dis.rst:1730 +#: ../../library/dis.rst:1731 msgid "Sequence of all compare operation names." msgstr "" -#: ../../library/dis.rst:1735 +#: ../../library/dis.rst:1736 msgid "Sequence of bytecodes that use their argument." msgstr "" -#: ../../library/dis.rst:1742 +#: ../../library/dis.rst:1743 msgid "Sequence of bytecodes that access a constant." msgstr "" -#: ../../library/dis.rst:1747 +#: ../../library/dis.rst:1748 msgid "" "Sequence of bytecodes that access a free variable. 'free' in this context " "refers to names in the current scope that are referenced by inner scopes or " @@ -1788,34 +1794,34 @@ msgid "" "include references to global or builtin scopes." msgstr "" -#: ../../library/dis.rst:1755 +#: ../../library/dis.rst:1756 msgid "Sequence of bytecodes that access an attribute by name." msgstr "" -#: ../../library/dis.rst:1760 +#: ../../library/dis.rst:1761 msgid "Sequence of bytecodes that have a relative jump target." msgstr "" -#: ../../library/dis.rst:1765 +#: ../../library/dis.rst:1766 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "" -#: ../../library/dis.rst:1770 +#: ../../library/dis.rst:1771 msgid "Sequence of bytecodes that access a local variable." msgstr "" -#: ../../library/dis.rst:1775 +#: ../../library/dis.rst:1776 msgid "Sequence of bytecodes of Boolean operations." msgstr "" -#: ../../library/dis.rst:1779 +#: ../../library/dis.rst:1780 msgid "Sequence of bytecodes that set an exception handler." msgstr "" -#: ../../library/dis.rst:1450 +#: ../../library/dis.rst:1451 msgid "built-in function" msgstr "built-in function(內建函式)" -#: ../../library/dis.rst:1450 +#: ../../library/dis.rst:1451 msgid "slice" msgstr "slice(切片)" diff --git a/library/inspect.po b/library/inspect.po index b0e7a49a1d..aef1577489 100644 --- a/library/inspect.po +++ b/library/inspect.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-06 00:03+0000\n" +"POT-Creation-Date: 2023-12-08 16:59+0000\n" "PO-Revision-Date: 2022-10-16 06:59+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -761,9 +761,8 @@ msgstr "" msgid "" "Methods implemented via descriptors that also pass one of the other tests " "return ``False`` from the :func:`ismethoddescriptor` test, simply because " -"the other tests promise more -- you can, e.g., count on having the :ref:" -"`__func__ ` attribute (etc) when an object passes :func:" -"`ismethod`." +"the other tests promise more -- you can, e.g., count on having the :attr:" +"`~method.__func__` attribute (etc) when an object passes :func:`ismethod`." msgstr "" #: ../../library/inspect.rst:501 @@ -1910,8 +1909,8 @@ msgstr "" #: ../../library/inspect.rst:1582 msgid "" -"Python code objects have a ``co_flags`` attribute, which is a bitmap of the " -"following flags:" +"Python code objects have a :attr:`~codeobject.co_flags` attribute, which is " +"a bitmap of the following flags:" msgstr "" #: ../../library/inspect.rst:1587 diff --git a/library/pathlib.po b/library/pathlib.po index ff236ef852..c635055b50 100644 --- a/library/pathlib.po +++ b/library/pathlib.po @@ -6,9 +6,9 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-04-24 00:16+0000\n" -"PO-Revision-Date: 2023-07-09 23:03+0800\n" -"Last-Translator: Matt Wang \n" +"POT-Creation-Date: 2023-12-09 00:03+0000\n" +"PO-Revision-Date: 2023-07-11 01:08+0800\n" +"Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" "Language: zh_TW\n" @@ -191,8 +191,8 @@ msgstr "" "的路徑: ::" #: ../../library/pathlib.rst:168 ../../library/pathlib.rst:180 -#: ../../library/pathlib.rst:739 ../../library/pathlib.rst:749 -#: ../../library/pathlib.rst:759 +#: ../../library/pathlib.rst:742 ../../library/pathlib.rst:752 +#: ../../library/pathlib.rst:762 msgid "*pathsegments* is specified similarly to :class:`PurePath`." msgstr "*pathsegments* 的指定方式與 :class:`PurePath` 類似。" @@ -460,26 +460,30 @@ msgid "" msgstr "" #: ../../library/pathlib.rst:579 +msgid "Accepts an object implementing the :class:`os.PathLike` interface." +msgstr "接受一個有實作 :class:`os.PathLike` 介面的物件。" + +#: ../../library/pathlib.rst:582 msgid "As with other methods, case-sensitivity follows platform defaults::" msgstr "" -#: ../../library/pathlib.rst:586 +#: ../../library/pathlib.rst:589 msgid "" "Set *case_sensitive* to ``True`` or ``False`` to override this behaviour." msgstr "" -#: ../../library/pathlib.rst:588 ../../library/pathlib.rst:931 -#: ../../library/pathlib.rst:1344 +#: ../../library/pathlib.rst:591 ../../library/pathlib.rst:934 +#: ../../library/pathlib.rst:1347 msgid "The *case_sensitive* parameter was added." msgstr "新增 *case_sensitive* 參數。" -#: ../../library/pathlib.rst:594 +#: ../../library/pathlib.rst:597 msgid "" "Compute a version of this path relative to the path represented by *other*. " "If it's impossible, :exc:`ValueError` is raised::" msgstr "" -#: ../../library/pathlib.rst:609 +#: ../../library/pathlib.rst:612 msgid "" "When *walk_up* is False (the default), the path must start with *other*. " "When the argument is True, ``..`` entries may be added to form the relative " @@ -487,7 +491,7 @@ msgid "" "exc:`ValueError` is raised.::" msgstr "" -#: ../../library/pathlib.rst:624 +#: ../../library/pathlib.rst:627 msgid "" "This function is part of :class:`PurePath` and works with strings. It does " "not check or access the underlying file structure. This can impact the " @@ -495,38 +499,38 @@ msgid "" "call :meth:`~Path.resolve` first if necessary to resolve symlinks." msgstr "" -#: ../../library/pathlib.rst:630 +#: ../../library/pathlib.rst:633 msgid "" "The *walk_up* parameter was added (old behavior is the same as " "``walk_up=False``)." msgstr "" -#: ../../library/pathlib.rst:635 +#: ../../library/pathlib.rst:638 msgid "" "Passing additional positional arguments is deprecated; if supplied, they are " "joined with *other*." msgstr "" -#: ../../library/pathlib.rst:640 +#: ../../library/pathlib.rst:643 msgid "" "Return a new path with the :attr:`name` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -#: ../../library/pathlib.rst:657 +#: ../../library/pathlib.rst:660 msgid "" "Return a new path with the :attr:`stem` changed. If the original path " "doesn't have a name, ValueError is raised::" msgstr "" -#: ../../library/pathlib.rst:681 +#: ../../library/pathlib.rst:684 msgid "" "Return a new path with the :attr:`suffix` changed. If the original path " "doesn't have a suffix, the new *suffix* is appended instead. If the " "*suffix* is an empty string, the original suffix is removed::" msgstr "" -#: ../../library/pathlib.rst:698 +#: ../../library/pathlib.rst:701 msgid "" "Create a new path object of the same type by combining the given " "*pathsegments*. This method is called whenever a derivative path is created, " @@ -534,55 +538,55 @@ msgid "" "this method to pass information to derivative paths, for example::" msgstr "" -#: ../../library/pathlib.rst:724 +#: ../../library/pathlib.rst:727 msgid "Concrete paths" msgstr "" -#: ../../library/pathlib.rst:726 +#: ../../library/pathlib.rst:729 msgid "" "Concrete paths are subclasses of the pure path classes. In addition to " "operations provided by the latter, they also provide methods to do system " "calls on path objects. There are three ways to instantiate concrete paths:" msgstr "" -#: ../../library/pathlib.rst:732 +#: ../../library/pathlib.rst:735 msgid "" "A subclass of :class:`PurePath`, this class represents concrete paths of the " "system's path flavour (instantiating it creates either a :class:`PosixPath` " "or a :class:`WindowsPath`)::" msgstr "" -#: ../../library/pathlib.rst:743 +#: ../../library/pathlib.rst:746 msgid "" "A subclass of :class:`Path` and :class:`PurePosixPath`, this class " "represents concrete non-Windows filesystem paths::" msgstr "" -#: ../../library/pathlib.rst:753 +#: ../../library/pathlib.rst:756 msgid "" "A subclass of :class:`Path` and :class:`PureWindowsPath`, this class " "represents concrete Windows filesystem paths::" msgstr "" -#: ../../library/pathlib.rst:761 +#: ../../library/pathlib.rst:764 msgid "" "You can only instantiate the class flavour that corresponds to your system " "(allowing system calls on non-compatible path flavours could lead to bugs or " "failures in your application)::" msgstr "" -#: ../../library/pathlib.rst:781 +#: ../../library/pathlib.rst:784 msgid "Methods" msgstr "" -#: ../../library/pathlib.rst:783 +#: ../../library/pathlib.rst:786 msgid "" "Concrete paths provide the following methods in addition to pure paths " "methods. Many of these methods can raise an :exc:`OSError` if a system call " "fails (for example because the path doesn't exist)." msgstr "" -#: ../../library/pathlib.rst:789 +#: ../../library/pathlib.rst:792 msgid "" ":meth:`~Path.exists()`, :meth:`~Path.is_dir()`, :meth:`~Path.is_file()`, :" "meth:`~Path.is_mount()`, :meth:`~Path.is_symlink()`, :meth:`~Path." @@ -592,79 +596,79 @@ msgid "" "the OS level." msgstr "" -#: ../../library/pathlib.rst:799 +#: ../../library/pathlib.rst:802 msgid "" "Return a new path object representing the current directory (as returned by :" "func:`os.getcwd`)::" msgstr "" -#: ../../library/pathlib.rst:808 +#: ../../library/pathlib.rst:811 msgid "" "Return a new path object representing the user's home directory (as returned " "by :func:`os.path.expanduser` with ``~`` construct). If the home directory " "can't be resolved, :exc:`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:822 +#: ../../library/pathlib.rst:825 msgid "" "Return a :class:`os.stat_result` object containing information about this " "path, like :func:`os.stat`. The result is looked up at each call to this " "method." msgstr "" -#: ../../library/pathlib.rst:825 +#: ../../library/pathlib.rst:828 msgid "" "This method normally follows symlinks; to stat a symlink add the argument " "``follow_symlinks=False``, or use :meth:`~Path.lstat`." msgstr "" -#: ../../library/pathlib.rst:836 ../../library/pathlib.rst:856 -#: ../../library/pathlib.rst:877 +#: ../../library/pathlib.rst:839 ../../library/pathlib.rst:859 +#: ../../library/pathlib.rst:880 msgid "The *follow_symlinks* parameter was added." msgstr "新增 *follow_symlinks* 參數。" -#: ../../library/pathlib.rst:841 +#: ../../library/pathlib.rst:844 msgid "Change the file mode and permissions, like :func:`os.chmod`." msgstr "" -#: ../../library/pathlib.rst:843 +#: ../../library/pathlib.rst:846 msgid "" "This method normally follows symlinks. Some Unix flavours support changing " "permissions on the symlink itself; on these platforms you may add the " "argument ``follow_symlinks=False``, or use :meth:`~Path.lchmod`." msgstr "" -#: ../../library/pathlib.rst:861 +#: ../../library/pathlib.rst:864 msgid "Return ``True`` if the path points to an existing file or directory." msgstr "" -#: ../../library/pathlib.rst:863 +#: ../../library/pathlib.rst:866 msgid "" "This method normally follows symlinks; to check if a symlink exists, add the " "argument ``follow_symlinks=False``." msgstr "" -#: ../../library/pathlib.rst:882 +#: ../../library/pathlib.rst:885 msgid "" "Return a new path with expanded ``~`` and ``~user`` constructs, as returned " "by :meth:`os.path.expanduser`. If a home directory can't be resolved, :exc:" "`RuntimeError` is raised." msgstr "" -#: ../../library/pathlib.rst:897 +#: ../../library/pathlib.rst:900 msgid "" "Glob the given relative *pattern* in the directory represented by this path, " "yielding all matching files (of any kind)::" msgstr "" -#: ../../library/pathlib.rst:905 +#: ../../library/pathlib.rst:908 msgid "" "Patterns are the same as for :mod:`fnmatch`, with the addition of \"``**``\" " "which means \"this directory and all subdirectories, recursively\". In " "other words, it enables recursive globbing::" msgstr "" -#: ../../library/pathlib.rst:916 ../../library/pathlib.rst:1333 +#: ../../library/pathlib.rst:919 ../../library/pathlib.rst:1336 msgid "" "By default, or when the *case_sensitive* keyword-only argument is set to " "``None``, this method matches paths using platform-specific casing rules: " @@ -672,13 +676,13 @@ msgid "" "*case_sensitive* to ``True`` or ``False`` to override this behaviour." msgstr "" -#: ../../library/pathlib.rst:922 +#: ../../library/pathlib.rst:925 msgid "" "Using the \"``**``\" pattern in large directory trees may consume an " "inordinate amount of time." msgstr "" -#: ../../library/pathlib.rst:925 +#: ../../library/pathlib.rst:928 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.glob`` with " "arguments ``self``, ``pattern``." @@ -686,45 +690,45 @@ msgstr "" "引發一個附帶引數 ``self``、``pattern`` 的\\ :ref:`稽核事件 ` " "``pathlib.Path.glob``。" -#: ../../library/pathlib.rst:927 ../../library/pathlib.rst:1340 +#: ../../library/pathlib.rst:930 ../../library/pathlib.rst:1343 msgid "" "Return only directories if *pattern* ends with a pathname components " "separator (:data:`~os.sep` or :data:`~os.altsep`)." msgstr "" -#: ../../library/pathlib.rst:937 +#: ../../library/pathlib.rst:940 msgid "" "Return the name of the group owning the file. :exc:`KeyError` is raised if " "the file's gid isn't found in the system database." msgstr "" -#: ../../library/pathlib.rst:943 +#: ../../library/pathlib.rst:946 msgid "" "Return ``True`` if the path points to a directory (or a symbolic link " "pointing to a directory), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:946 ../../library/pathlib.rst:955 -#: ../../library/pathlib.rst:997 ../../library/pathlib.rst:1006 -#: ../../library/pathlib.rst:1015 ../../library/pathlib.rst:1024 +#: ../../library/pathlib.rst:949 ../../library/pathlib.rst:958 +#: ../../library/pathlib.rst:1000 ../../library/pathlib.rst:1009 +#: ../../library/pathlib.rst:1018 ../../library/pathlib.rst:1027 msgid "" "``False`` is also returned if the path doesn't exist or is a broken symlink; " "other errors (such as permission errors) are propagated." msgstr "" -#: ../../library/pathlib.rst:952 +#: ../../library/pathlib.rst:955 msgid "" "Return ``True`` if the path points to a regular file (or a symbolic link " "pointing to a regular file), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:961 +#: ../../library/pathlib.rst:964 msgid "" "Return ``True`` if the path points to a junction, and ``False`` for any " "other type of file. Currently only Windows supports junctions." msgstr "" -#: ../../library/pathlib.rst:969 +#: ../../library/pathlib.rst:972 msgid "" "Return ``True`` if the path is a :dfn:`mount point`: a point in a file " "system where a different file system has been mounted. On POSIX, the " @@ -736,53 +740,53 @@ msgid "" "mounted filesystem directory." msgstr "" -#: ../../library/pathlib.rst:980 +#: ../../library/pathlib.rst:983 msgid "Windows support was added." msgstr "" -#: ../../library/pathlib.rst:986 +#: ../../library/pathlib.rst:989 msgid "" "Return ``True`` if the path points to a symbolic link, ``False`` otherwise." msgstr "" -#: ../../library/pathlib.rst:988 +#: ../../library/pathlib.rst:991 msgid "" "``False`` is also returned if the path doesn't exist; other errors (such as " "permission errors) are propagated." msgstr "" -#: ../../library/pathlib.rst:994 +#: ../../library/pathlib.rst:997 msgid "" "Return ``True`` if the path points to a Unix socket (or a symbolic link " "pointing to a Unix socket), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:1003 +#: ../../library/pathlib.rst:1006 msgid "" "Return ``True`` if the path points to a FIFO (or a symbolic link pointing to " "a FIFO), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:1012 +#: ../../library/pathlib.rst:1015 msgid "" "Return ``True`` if the path points to a block device (or a symbolic link " "pointing to a block device), ``False`` if it points to another kind of file." msgstr "" -#: ../../library/pathlib.rst:1021 +#: ../../library/pathlib.rst:1024 msgid "" "Return ``True`` if the path points to a character device (or a symbolic link " "pointing to a character device), ``False`` if it points to another kind of " "file." msgstr "" -#: ../../library/pathlib.rst:1030 +#: ../../library/pathlib.rst:1033 msgid "" "When the path points to a directory, yield path objects of the directory " "contents::" msgstr "" -#: ../../library/pathlib.rst:1044 +#: ../../library/pathlib.rst:1047 msgid "" "The children are yielded in arbitrary order, and the special entries ``'.'`` " "and ``'..'`` are not included. If a file is removed from or added to the " @@ -790,20 +794,20 @@ msgid "" "be included is unspecified." msgstr "" -#: ../../library/pathlib.rst:1051 +#: ../../library/pathlib.rst:1054 msgid "" "Generate the file names in a directory tree by walking the tree either top-" "down or bottom-up." msgstr "" -#: ../../library/pathlib.rst:1054 +#: ../../library/pathlib.rst:1057 msgid "" "For each directory in the directory tree rooted at *self* (including *self* " "but excluding '.' and '..'), the method yields a 3-tuple of ``(dirpath, " "dirnames, filenames)``." msgstr "" -#: ../../library/pathlib.rst:1058 +#: ../../library/pathlib.rst:1061 msgid "" "*dirpath* is a :class:`Path` to the directory currently being walked, " "*dirnames* is a list of strings for the names of subdirectories in *dirpath* " @@ -813,7 +817,7 @@ msgid "" "name``. Whether or not the lists are sorted is file system-dependent." msgstr "" -#: ../../library/pathlib.rst:1066 +#: ../../library/pathlib.rst:1069 msgid "" "If the optional argument *top_down* is true (which is the default), the " "triple for a directory is generated before the triples for any of its " @@ -824,7 +828,7 @@ msgid "" "the directory and its subdirectories are walked." msgstr "" -#: ../../library/pathlib.rst:1074 +#: ../../library/pathlib.rst:1077 msgid "" "When *top_down* is true, the caller can modify the *dirnames* list in-place " "(for example, using :keyword:`del` or slice assignment), and :meth:`Path." @@ -837,7 +841,7 @@ msgid "" "generated by the time *dirnames* is yielded to the caller." msgstr "" -#: ../../library/pathlib.rst:1084 +#: ../../library/pathlib.rst:1087 msgid "" "By default, errors from :func:`os.scandir` are ignored. If the optional " "argument *on_error* is specified, it should be a callable; it will be called " @@ -846,7 +850,7 @@ msgid "" "filename is available as the ``filename`` attribute of the exception object." msgstr "" -#: ../../library/pathlib.rst:1090 +#: ../../library/pathlib.rst:1093 msgid "" "By default, :meth:`Path.walk` does not follow symbolic links, and instead " "adds them to the *filenames* list. Set *follow_symlinks* to true to resolve " @@ -855,14 +859,14 @@ msgid "" "(where supported)." msgstr "" -#: ../../library/pathlib.rst:1097 +#: ../../library/pathlib.rst:1100 msgid "" "Be aware that setting *follow_symlinks* to true can lead to infinite " "recursion if a link points to a parent directory of itself. :meth:`Path." "walk` does not keep track of the directories it has already visited." msgstr "" -#: ../../library/pathlib.rst:1102 +#: ../../library/pathlib.rst:1105 msgid "" ":meth:`Path.walk` assumes the directories it walks are not modified during " "execution. For example, if a directory from *dirnames* has been replaced " @@ -871,81 +875,81 @@ msgid "" "*dirnames* as appropriate." msgstr "" -#: ../../library/pathlib.rst:1110 +#: ../../library/pathlib.rst:1113 msgid "" "Unlike :func:`os.walk`, :meth:`Path.walk` lists symlinks to directories in " "*filenames* if *follow_symlinks* is false." msgstr "" -#: ../../library/pathlib.rst:1113 +#: ../../library/pathlib.rst:1116 msgid "" "This example displays the number of bytes used by all files in each " "directory, while ignoring ``__pycache__`` directories::" msgstr "" -#: ../../library/pathlib.rst:1129 +#: ../../library/pathlib.rst:1132 msgid "" "This next example is a simple implementation of :func:`shutil.rmtree`. " "Walking the tree bottom-up is essential as :func:`rmdir` doesn't allow " "deleting a directory before it is empty::" msgstr "" -#: ../../library/pathlib.rst:1146 +#: ../../library/pathlib.rst:1149 msgid "" "Like :meth:`Path.chmod` but, if the path points to a symbolic link, the " "symbolic link's mode is changed rather than its target's." msgstr "" -#: ../../library/pathlib.rst:1152 +#: ../../library/pathlib.rst:1155 msgid "" "Like :meth:`Path.stat` but, if the path points to a symbolic link, return " "the symbolic link's information rather than its target's." msgstr "" -#: ../../library/pathlib.rst:1158 +#: ../../library/pathlib.rst:1161 msgid "" "Create a new directory at this given path. If *mode* is given, it is " "combined with the process' ``umask`` value to determine the file mode and " "access flags. If the path already exists, :exc:`FileExistsError` is raised." msgstr "" -#: ../../library/pathlib.rst:1163 +#: ../../library/pathlib.rst:1166 msgid "" "If *parents* is true, any missing parents of this path are created as " "needed; they are created with the default permissions without taking *mode* " "into account (mimicking the POSIX ``mkdir -p`` command)." msgstr "" -#: ../../library/pathlib.rst:1167 +#: ../../library/pathlib.rst:1170 msgid "" "If *parents* is false (the default), a missing parent raises :exc:" "`FileNotFoundError`." msgstr "" -#: ../../library/pathlib.rst:1170 +#: ../../library/pathlib.rst:1173 msgid "" "If *exist_ok* is false (the default), :exc:`FileExistsError` is raised if " "the target directory already exists." msgstr "" -#: ../../library/pathlib.rst:1173 +#: ../../library/pathlib.rst:1176 msgid "" "If *exist_ok* is true, :exc:`FileExistsError` exceptions will be ignored " "(same behavior as the POSIX ``mkdir -p`` command), but only if the last path " "component is not an existing non-directory file." msgstr "" -#: ../../library/pathlib.rst:1177 +#: ../../library/pathlib.rst:1180 msgid "The *exist_ok* parameter was added." msgstr "新增 *exist_ok* 參數。" -#: ../../library/pathlib.rst:1183 +#: ../../library/pathlib.rst:1186 msgid "" "Open the file pointed to by the path, like the built-in :func:`open` " "function does::" msgstr "" -#: ../../library/pathlib.rst:1195 +#: ../../library/pathlib.rst:1198 msgid "" "Return the name of the user owning the file. :exc:`KeyError` is raised if " "the file's uid isn't found in the system database." @@ -953,27 +957,27 @@ msgstr "" "回傳擁有該檔案的用戶的名稱。如果在系統資料庫中找不到該檔案的 uid ,則會引發 :" "exc:`KeyError`。" -#: ../../library/pathlib.rst:1201 +#: ../../library/pathlib.rst:1204 msgid "Return the binary contents of the pointed-to file as a bytes object::" msgstr "將指向檔案的二進為內容以一個位元組 (bytes) 物件回傳: ::" -#: ../../library/pathlib.rst:1214 +#: ../../library/pathlib.rst:1217 msgid "Return the decoded contents of the pointed-to file as a string::" msgstr "將指向檔案的解碼內容以字串形式回傳: ::" -#: ../../library/pathlib.rst:1222 +#: ../../library/pathlib.rst:1225 msgid "" "The file is opened and then closed. The optional parameters have the same " "meaning as in :func:`open`." msgstr "該檔案被打開並且隨後關閉。選填參數的含義與 :func:`open` 函數中的相同。" -#: ../../library/pathlib.rst:1230 +#: ../../library/pathlib.rst:1233 msgid "" "Return the path to which the symbolic link points (as returned by :func:`os." "readlink`)::" msgstr "回傳符號連結指向的路徑(如 :func:`os.readlink` 的回傳值): ::" -#: ../../library/pathlib.rst:1243 +#: ../../library/pathlib.rst:1246 msgid "" "Rename this file or directory to the given *target*, and return a new Path " "instance pointing to *target*. On Unix, if *target* exists and is a file, " @@ -986,7 +990,7 @@ msgstr "" "限,則會在不顯示訊息的情況下進行取代。在 Windows 系統上,若 *target* 存在,則" "會引發 :exc:`FileExistsError` 錯誤。*target* 可以是字串或另一個路徑物件: ::" -#: ../../library/pathlib.rst:1258 ../../library/pathlib.rst:1274 +#: ../../library/pathlib.rst:1261 ../../library/pathlib.rst:1277 msgid "" "The target path may be absolute or relative. Relative paths are interpreted " "relative to the current working directory, *not* the directory of the Path " @@ -995,17 +999,17 @@ msgstr "" "目標路徑可以是絕對路徑或相對路徑。相對路徑會相對於當前的工作目錄進行解釋," "*not* 相對於路徑物件所在的目錄。" -#: ../../library/pathlib.rst:1262 +#: ../../library/pathlib.rst:1265 msgid "" "It is implemented in terms of :func:`os.rename` and gives the same " "guarantees." msgstr "此功能是使用 :func:`os.rename` 實現的,並提供相同的保證。" -#: ../../library/pathlib.rst:1264 ../../library/pathlib.rst:1278 +#: ../../library/pathlib.rst:1267 ../../library/pathlib.rst:1281 msgid "Added return value, return the new Path instance." msgstr "新增了回傳值,回傳新的路徑 (Path) 物件。" -#: ../../library/pathlib.rst:1270 +#: ../../library/pathlib.rst:1273 msgid "" "Rename this file or directory to the given *target*, and return a new Path " "instance pointing to *target*. If *target* points to an existing file or " @@ -1014,26 +1018,26 @@ msgstr "" "將此檔案或目錄重新命名為給定的 *target* ,並回傳一個指向 *target* 的新路徑物" "件。如果 *target* 指向一個現有的檔案或空目錄,它將被無條件地取代。" -#: ../../library/pathlib.rst:1284 +#: ../../library/pathlib.rst:1287 msgid "" "Make the path absolute, without normalization or resolving symlinks. Returns " "a new path object::" msgstr "" "使路徑成為絕對路徑,不進行標準化或解析符號連結。 回傳一個新的路徑物件: ::" -#: ../../library/pathlib.rst:1296 +#: ../../library/pathlib.rst:1299 msgid "" "Make the path absolute, resolving any symlinks. A new path object is " "returned::" msgstr "將路徑轉換為絕對路徑,解析所有符號連結。回傳一個新的路徑物件: ::" -#: ../../library/pathlib.rst:1305 +#: ../../library/pathlib.rst:1308 msgid "" "\"``..``\" components are also eliminated (this is the only method to do " "so)::" msgstr "同時也會消除 \"``..``\" 的路徑組件(這是唯一的方法): ::" -#: ../../library/pathlib.rst:1311 +#: ../../library/pathlib.rst:1314 msgid "" "If the path doesn't exist and *strict* is ``True``, :exc:`FileNotFoundError` " "is raised. If *strict* is ``False``, the path is resolved as far as " @@ -1046,11 +1050,11 @@ msgstr "" "中,而不檢查其是否存在。 如果在解析過程中遇到無窮迴圈,則引發 :exc:" "`RuntimeError`。" -#: ../../library/pathlib.rst:1317 +#: ../../library/pathlib.rst:1320 msgid "The *strict* parameter was added (pre-3.6 behavior is strict)." msgstr "新增 *strict* 參數(在 3.6 版本之前的行為是嚴格的)。" -#: ../../library/pathlib.rst:1322 +#: ../../library/pathlib.rst:1325 msgid "" "Glob the given relative *pattern* recursively. This is like calling :func:" "`Path.glob` with \"``**/``\" added in front of the *pattern*, where " @@ -1060,7 +1064,7 @@ msgstr "" "\"``**/``\" 並呼叫 :func:`Path.glob`,其中 *patterns* 和 :mod:`fnmatch` 相" "同: ::" -#: ../../library/pathlib.rst:1338 +#: ../../library/pathlib.rst:1341 msgid "" "Raises an :ref:`auditing event ` ``pathlib.Path.rglob`` with " "arguments ``self``, ``pattern``." @@ -1068,11 +1072,11 @@ msgstr "" "引發一個附帶引數 ``self``、``pattern`` 的\\ :ref:`稽核事件 ` " "``pathlib.Path.rglob``。" -#: ../../library/pathlib.rst:1350 +#: ../../library/pathlib.rst:1353 msgid "Remove this directory. The directory must be empty." msgstr "移除此目錄。該目錄必須為空。" -#: ../../library/pathlib.rst:1355 +#: ../../library/pathlib.rst:1358 msgid "" "Return whether this path points to the same file as *other_path*, which can " "be either a Path object, or a string. The semantics are similar to :func:" @@ -1082,13 +1086,13 @@ msgstr "" "物件或字串。其語義類似於 :func:`os.path.samefile` 和 :func:`os.path." "samestat`。" -#: ../../library/pathlib.rst:1359 +#: ../../library/pathlib.rst:1362 msgid "" "An :exc:`OSError` can be raised if either file cannot be accessed for some " "reason." msgstr "若任何一個檔案因為某些原因無法存取,則引發 :exc:`OSError`。" -#: ../../library/pathlib.rst:1376 +#: ../../library/pathlib.rst:1379 msgid "" "Make this path a symbolic link to *target*. Under Windows, " "*target_is_directory* must be true (default ``False``) if the link's target " @@ -1098,21 +1102,21 @@ msgstr "" "*target_is_directory* 應該為 true(預設為 ``False``\\ )。如果在 POSIX 的連結" "目標是資料夾,*target_is_directory* 的數值會被省略。" -#: ../../library/pathlib.rst:1392 +#: ../../library/pathlib.rst:1395 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.symlink`'s." msgstr "引數的順序 (link, target) 和 :func:`os.symlink` 相反。" -#: ../../library/pathlib.rst:1397 +#: ../../library/pathlib.rst:1400 msgid "Make this path a hard link to the same file as *target*." msgstr "使這個路徑為與 *target* 相同檔案的一個硬連結 (hard link)。" -#: ../../library/pathlib.rst:1400 +#: ../../library/pathlib.rst:1403 msgid "" "The order of arguments (link, target) is the reverse of :func:`os.link`'s." msgstr "引數的順序 (link, target) 和 :func:`os.link` 相反。" -#: ../../library/pathlib.rst:1408 +#: ../../library/pathlib.rst:1411 msgid "" "Create a file at this given path. If *mode* is given, it is combined with " "the process' ``umask`` value to determine the file mode and access flags. " @@ -1125,14 +1129,14 @@ msgstr "" "不會失敗(其變更時間會被更新為當下時間),否則 :exc:`FileExistsError` 會被引" "發。" -#: ../../library/pathlib.rst:1417 +#: ../../library/pathlib.rst:1420 msgid "" "Remove this file or symbolic link. If the path points to a directory, use :" "func:`Path.rmdir` instead." msgstr "" "移除這個檔案或符號連結。如果路徑指到資料夾,請改用 :func:`Path.rmdir`。" -#: ../../library/pathlib.rst:1420 +#: ../../library/pathlib.rst:1423 msgid "" "If *missing_ok* is false (the default), :exc:`FileNotFoundError` is raised " "if the path does not exist." @@ -1140,7 +1144,7 @@ msgstr "" "如果 *missing_ok* 是 false(預設值), :exc:`FileNotFoundError` 會在路徑不存" "在時被引發。" -#: ../../library/pathlib.rst:1423 +#: ../../library/pathlib.rst:1426 msgid "" "If *missing_ok* is true, :exc:`FileNotFoundError` exceptions will be ignored " "(same behavior as the POSIX ``rm -f`` command)." @@ -1148,27 +1152,27 @@ msgstr "" "如果 *missing_ok* 為 true,:exc:`FileNotFoundError` 例外會被忽略(行為與 " "POSIX ``rm -f`` 指令相同)。" -#: ../../library/pathlib.rst:1426 +#: ../../library/pathlib.rst:1429 msgid "The *missing_ok* parameter was added." msgstr "新增 *missing_ok* 參數。" -#: ../../library/pathlib.rst:1432 +#: ../../library/pathlib.rst:1435 msgid "" "Open the file pointed to in bytes mode, write *data* to it, and close the " "file::" msgstr "以位元組模式開啟指到的檔案,將 *data* 寫到檔案,並關閉檔案:: :" -#: ../../library/pathlib.rst:1441 +#: ../../library/pathlib.rst:1444 msgid "An existing file of the same name is overwritten." msgstr "一個名稱相同的已存在檔案會被覆寫。" -#: ../../library/pathlib.rst:1448 +#: ../../library/pathlib.rst:1451 msgid "" "Open the file pointed to in text mode, write *data* to it, and close the " "file::" msgstr "以文字模式開啟指到的檔案,將 *data* 寫到檔案,並關閉檔案:: :" -#: ../../library/pathlib.rst:1457 +#: ../../library/pathlib.rst:1460 msgid "" "An existing file of the same name is overwritten. The optional parameters " "have the same meaning as in :func:`open`." @@ -1176,21 +1180,21 @@ msgstr "" "一個已經存在、名稱相同的檔案會被覆寫。可選參數和 :func:`open` 的參數有相同意" "義。" -#: ../../library/pathlib.rst:1462 +#: ../../library/pathlib.rst:1465 msgid "The *newline* parameter was added." msgstr "新增 *newline* 參數。" -#: ../../library/pathlib.rst:1466 +#: ../../library/pathlib.rst:1469 msgid "Correspondence to tools in the :mod:`os` module" msgstr "" -#: ../../library/pathlib.rst:1468 +#: ../../library/pathlib.rst:1471 msgid "" "Below is a table mapping various :mod:`os` functions to their corresponding :" "class:`PurePath`/:class:`Path` equivalent." msgstr "" -#: ../../library/pathlib.rst:1473 +#: ../../library/pathlib.rst:1476 msgid "" "Not all pairs of functions/methods below are equivalent. Some of them, " "despite having some overlapping use-cases, have different semantics. They " @@ -1198,245 +1202,245 @@ msgid "" "relpath` and :meth:`PurePath.relative_to`." msgstr "" -#: ../../library/pathlib.rst:1479 +#: ../../library/pathlib.rst:1482 msgid ":mod:`os` and :mod:`os.path`" msgstr ":mod:`os` 和 :mod:`os.path`" -#: ../../library/pathlib.rst:1479 +#: ../../library/pathlib.rst:1482 msgid ":mod:`pathlib`" msgstr ":mod:`pathlib`" -#: ../../library/pathlib.rst:1481 +#: ../../library/pathlib.rst:1484 msgid ":func:`os.path.abspath`" msgstr ":func:`os.path.abspath`" -#: ../../library/pathlib.rst:1481 +#: ../../library/pathlib.rst:1484 msgid ":meth:`Path.absolute` [#]_" msgstr ":meth:`Path.absolute` [#]_" -#: ../../library/pathlib.rst:1482 +#: ../../library/pathlib.rst:1485 msgid ":func:`os.path.realpath`" msgstr ":func:`os.path.realpath`" -#: ../../library/pathlib.rst:1482 +#: ../../library/pathlib.rst:1485 msgid ":meth:`Path.resolve`" msgstr ":meth:`Path.resolve`" -#: ../../library/pathlib.rst:1483 +#: ../../library/pathlib.rst:1486 msgid ":func:`os.chmod`" msgstr ":func:`os.chmod`" -#: ../../library/pathlib.rst:1483 +#: ../../library/pathlib.rst:1486 msgid ":meth:`Path.chmod`" msgstr ":meth:`Path.chmod`" -#: ../../library/pathlib.rst:1484 +#: ../../library/pathlib.rst:1487 msgid ":func:`os.mkdir`" msgstr ":func:`os.mkdir`" -#: ../../library/pathlib.rst:1484 ../../library/pathlib.rst:1485 +#: ../../library/pathlib.rst:1487 ../../library/pathlib.rst:1488 msgid ":meth:`Path.mkdir`" msgstr ":meth:`Path.mkdir`" -#: ../../library/pathlib.rst:1485 +#: ../../library/pathlib.rst:1488 msgid ":func:`os.makedirs`" msgstr ":func:`os.makedirs`" -#: ../../library/pathlib.rst:1486 +#: ../../library/pathlib.rst:1489 msgid ":func:`os.rename`" msgstr ":func:`os.rename`" -#: ../../library/pathlib.rst:1486 +#: ../../library/pathlib.rst:1489 msgid ":meth:`Path.rename`" msgstr ":meth:`Path.rename`" -#: ../../library/pathlib.rst:1487 +#: ../../library/pathlib.rst:1490 msgid ":func:`os.replace`" msgstr ":func:`os.replace`" -#: ../../library/pathlib.rst:1487 +#: ../../library/pathlib.rst:1490 msgid ":meth:`Path.replace`" msgstr ":meth:`Path.replace`" -#: ../../library/pathlib.rst:1488 +#: ../../library/pathlib.rst:1491 msgid ":func:`os.rmdir`" msgstr ":func:`os.rmdir`" -#: ../../library/pathlib.rst:1488 +#: ../../library/pathlib.rst:1491 msgid ":meth:`Path.rmdir`" msgstr ":meth:`Path.rmdir`" -#: ../../library/pathlib.rst:1489 +#: ../../library/pathlib.rst:1492 msgid ":func:`os.remove`, :func:`os.unlink`" msgstr ":func:`os.remove`、:func:`os.unlink`" -#: ../../library/pathlib.rst:1489 +#: ../../library/pathlib.rst:1492 msgid ":meth:`Path.unlink`" msgstr ":meth:`Path.unlink`" -#: ../../library/pathlib.rst:1490 +#: ../../library/pathlib.rst:1493 msgid ":func:`os.getcwd`" msgstr ":func:`os.getcwd`" -#: ../../library/pathlib.rst:1490 +#: ../../library/pathlib.rst:1493 msgid ":func:`Path.cwd`" msgstr ":func:`Path.cwd`" -#: ../../library/pathlib.rst:1491 +#: ../../library/pathlib.rst:1494 msgid ":func:`os.path.exists`" msgstr ":func:`os.path.exists`" -#: ../../library/pathlib.rst:1491 +#: ../../library/pathlib.rst:1494 msgid ":meth:`Path.exists`" msgstr ":meth:`Path.exists`" -#: ../../library/pathlib.rst:1492 +#: ../../library/pathlib.rst:1495 msgid ":func:`os.path.expanduser`" msgstr ":func:`os.path.expanduser`" -#: ../../library/pathlib.rst:1492 +#: ../../library/pathlib.rst:1495 msgid ":meth:`Path.expanduser` and :meth:`Path.home`" msgstr ":meth:`Path.expanduser` 和 :meth:`Path.home`" -#: ../../library/pathlib.rst:1494 +#: ../../library/pathlib.rst:1497 msgid ":func:`os.listdir`" msgstr ":func:`os.listdir`" -#: ../../library/pathlib.rst:1494 +#: ../../library/pathlib.rst:1497 msgid ":meth:`Path.iterdir`" msgstr ":meth:`Path.iterdir`" -#: ../../library/pathlib.rst:1495 +#: ../../library/pathlib.rst:1498 msgid ":func:`os.walk`" msgstr ":func:`os.walk`" -#: ../../library/pathlib.rst:1495 +#: ../../library/pathlib.rst:1498 msgid ":meth:`Path.walk`" msgstr ":meth:`Path.walk`" -#: ../../library/pathlib.rst:1496 +#: ../../library/pathlib.rst:1499 msgid ":func:`os.path.isdir`" msgstr ":func:`os.path.isdir`" -#: ../../library/pathlib.rst:1496 +#: ../../library/pathlib.rst:1499 msgid ":meth:`Path.is_dir`" msgstr ":meth:`Path.is_dir`" -#: ../../library/pathlib.rst:1497 +#: ../../library/pathlib.rst:1500 msgid ":func:`os.path.isfile`" msgstr ":func:`os.path.isfile`" -#: ../../library/pathlib.rst:1497 +#: ../../library/pathlib.rst:1500 msgid ":meth:`Path.is_file`" msgstr ":meth:`Path.is_file`" -#: ../../library/pathlib.rst:1498 +#: ../../library/pathlib.rst:1501 msgid ":func:`os.path.islink`" msgstr ":func:`os.path.islink`" -#: ../../library/pathlib.rst:1498 +#: ../../library/pathlib.rst:1501 msgid ":meth:`Path.is_symlink`" msgstr ":meth:`Path.is_symlink`" -#: ../../library/pathlib.rst:1499 +#: ../../library/pathlib.rst:1502 msgid ":func:`os.link`" msgstr ":func:`os.link`" -#: ../../library/pathlib.rst:1499 +#: ../../library/pathlib.rst:1502 msgid ":meth:`Path.hardlink_to`" msgstr ":meth:`Path.hardlink_to`" -#: ../../library/pathlib.rst:1500 +#: ../../library/pathlib.rst:1503 msgid ":func:`os.symlink`" msgstr ":func:`os.symlink`" -#: ../../library/pathlib.rst:1500 +#: ../../library/pathlib.rst:1503 msgid ":meth:`Path.symlink_to`" msgstr ":meth:`Path.symlink_to`" -#: ../../library/pathlib.rst:1501 +#: ../../library/pathlib.rst:1504 msgid ":func:`os.readlink`" msgstr ":func:`os.readlink`" -#: ../../library/pathlib.rst:1501 +#: ../../library/pathlib.rst:1504 msgid ":meth:`Path.readlink`" msgstr ":meth:`Path.readlink`" -#: ../../library/pathlib.rst:1502 +#: ../../library/pathlib.rst:1505 msgid ":func:`os.path.relpath`" msgstr ":func:`os.path.relpath`" -#: ../../library/pathlib.rst:1502 +#: ../../library/pathlib.rst:1505 msgid ":meth:`PurePath.relative_to` [#]_" msgstr ":meth:`PurePath.relative_to` [#]_" -#: ../../library/pathlib.rst:1503 +#: ../../library/pathlib.rst:1506 msgid ":func:`os.stat`" msgstr ":func:`os.stat`" -#: ../../library/pathlib.rst:1503 +#: ../../library/pathlib.rst:1506 msgid ":meth:`Path.stat`, :meth:`Path.owner`, :meth:`Path.group`" msgstr ":meth:`Path.stat`、:meth:`Path.owner`、:meth:`Path.group`" -#: ../../library/pathlib.rst:1506 +#: ../../library/pathlib.rst:1509 msgid ":func:`os.path.isabs`" msgstr ":func:`os.path.isabs`" -#: ../../library/pathlib.rst:1506 +#: ../../library/pathlib.rst:1509 msgid ":meth:`PurePath.is_absolute`" msgstr ":meth:`PurePath.is_absolute`" -#: ../../library/pathlib.rst:1507 +#: ../../library/pathlib.rst:1510 msgid ":func:`os.path.join`" msgstr ":func:`os.path.join`" -#: ../../library/pathlib.rst:1507 +#: ../../library/pathlib.rst:1510 msgid ":func:`PurePath.joinpath`" msgstr ":func:`PurePath.joinpath`" -#: ../../library/pathlib.rst:1508 +#: ../../library/pathlib.rst:1511 msgid ":func:`os.path.basename`" msgstr ":func:`os.path.basename`" -#: ../../library/pathlib.rst:1508 +#: ../../library/pathlib.rst:1511 msgid ":attr:`PurePath.name`" msgstr ":attr:`PurePath.name`" -#: ../../library/pathlib.rst:1509 +#: ../../library/pathlib.rst:1512 msgid ":func:`os.path.dirname`" msgstr ":func:`os.path.dirname`" -#: ../../library/pathlib.rst:1509 +#: ../../library/pathlib.rst:1512 msgid ":attr:`PurePath.parent`" msgstr ":attr:`PurePath.parent`" -#: ../../library/pathlib.rst:1510 +#: ../../library/pathlib.rst:1513 msgid ":func:`os.path.samefile`" msgstr ":func:`os.path.samefile`" -#: ../../library/pathlib.rst:1510 +#: ../../library/pathlib.rst:1513 msgid ":meth:`Path.samefile`" msgstr ":meth:`Path.samefile`" -#: ../../library/pathlib.rst:1511 +#: ../../library/pathlib.rst:1514 msgid ":func:`os.path.splitext`" msgstr ":func:`os.path.splitext`" -#: ../../library/pathlib.rst:1511 +#: ../../library/pathlib.rst:1514 msgid ":attr:`PurePath.stem` and :attr:`PurePath.suffix`" msgstr ":attr:`PurePath.stem` 和 :attr:`PurePath.suffix`" -#: ../../library/pathlib.rst:1516 +#: ../../library/pathlib.rst:1519 msgid "Footnotes" msgstr "註解" -#: ../../library/pathlib.rst:1517 +#: ../../library/pathlib.rst:1520 msgid "" ":func:`os.path.abspath` normalizes the resulting path, which may change its " "meaning in the presence of symlinks, while :meth:`Path.absolute` does not." msgstr "" -#: ../../library/pathlib.rst:1518 +#: ../../library/pathlib.rst:1521 msgid "" ":meth:`PurePath.relative_to` requires ``self`` to be the subpath of the " "argument, but :func:`os.path.relpath` does not." diff --git a/library/reprlib.po b/library/reprlib.po index aacdbff87f..b02c56473a 100644 --- a/library/reprlib.po +++ b/library/reprlib.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-17 17:39+0800\n" +"POT-Creation-Date: 2023-12-07 00:03+0000\n" "PO-Revision-Date: 2015-12-09 17:51+0000\n" "Last-Translator: Liang-Bo Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -28,7 +28,7 @@ msgstr "**原始碼:**\\ :source:`Lib/reprlib.py`" #: ../../library/reprlib.rst:13 msgid "" -"The :mod:`reprlib` module provides a means for producing object " +"The :mod:`!reprlib` module provides a means for producing object " "representations with limits on the size of the resulting strings. This is " "used in the Python debugger and may be useful in other contexts as well." msgstr "" @@ -83,53 +83,53 @@ msgstr "" #: ../../library/reprlib.rst:60 msgid "" "In addition to size-limiting tools, the module also provides a decorator for " -"detecting recursive calls to :meth:`__repr__` and substituting a placeholder " -"string instead." +"detecting recursive calls to :meth:`~object.__repr__` and substituting a " +"placeholder string instead." msgstr "" #: ../../library/reprlib.rst:69 msgid "" -"Decorator for :meth:`__repr__` methods to detect recursive calls within the " -"same thread. If a recursive call is made, the *fillvalue* is returned, " -"otherwise, the usual :meth:`__repr__` call is made. For example:" +"Decorator for :meth:`~object.__repr__` methods to detect recursive calls " +"within the same thread. If a recursive call is made, the *fillvalue* is " +"returned, otherwise, the usual :meth:`!__repr__` call is made. For example:" msgstr "" -#: ../../library/reprlib.rst:91 +#: ../../library/reprlib.rst:93 msgid "Repr Objects" msgstr "Repr 物件" -#: ../../library/reprlib.rst:93 +#: ../../library/reprlib.rst:95 msgid "" ":class:`Repr` instances provide several attributes which can be used to " "provide size limits for the representations of different object types, and " "methods which format specific object types." msgstr "" -#: ../../library/reprlib.rst:100 +#: ../../library/reprlib.rst:102 msgid "" "This string is displayed for recursive references. It defaults to ``...``." msgstr "" -#: ../../library/reprlib.rst:108 +#: ../../library/reprlib.rst:110 msgid "" "Depth limit on the creation of recursive representations. The default is " "``6``." msgstr "" -#: ../../library/reprlib.rst:119 +#: ../../library/reprlib.rst:121 msgid "" "Limits on the number of entries represented for the named object type. The " "default is ``4`` for :attr:`maxdict`, ``5`` for :attr:`maxarray`, and ``6`` " "for the others." msgstr "" -#: ../../library/reprlib.rst:126 +#: ../../library/reprlib.rst:128 msgid "" "Maximum number of characters in the representation for an integer. Digits " "are dropped from the middle. The default is ``40``." msgstr "" -#: ../../library/reprlib.rst:132 +#: ../../library/reprlib.rst:134 msgid "" "Limit on the number of characters in the representation of the string. Note " "that the \"normal\" representation of the string is used as the character " @@ -137,39 +137,39 @@ msgid "" "mangled when the representation is shortened. The default is ``30``." msgstr "" -#: ../../library/reprlib.rst:140 +#: ../../library/reprlib.rst:142 msgid "" "This limit is used to control the size of object types for which no specific " "formatting method is available on the :class:`Repr` object. It is applied in " "a similar manner as :attr:`maxstring`. The default is ``20``." msgstr "" -#: ../../library/reprlib.rst:147 +#: ../../library/reprlib.rst:149 msgid "" "If this attribute is set to ``None`` (the default), the output is formatted " "with no line breaks or indentation, like the standard :func:`repr`. For " "example:" msgstr "" -#: ../../library/reprlib.rst:160 +#: ../../library/reprlib.rst:162 msgid "" "If :attr:`~Repr.indent` is set to a string, each recursion level is placed " "on its own line, indented by that string:" msgstr "" -#: ../../library/reprlib.rst:181 +#: ../../library/reprlib.rst:183 msgid "" "Setting :attr:`~Repr.indent` to a positive integer value behaves as if it " "was set to a string with that number of spaces:" msgstr "" -#: ../../library/reprlib.rst:207 +#: ../../library/reprlib.rst:209 msgid "" "The equivalent to the built-in :func:`repr` that uses the formatting imposed " "by the instance." msgstr "" -#: ../../library/reprlib.rst:213 +#: ../../library/reprlib.rst:215 msgid "" "Recursive implementation used by :meth:`.repr`. This uses the type of *obj* " "to determine which formatting method to call, passing it *obj* and *level*. " @@ -178,7 +178,7 @@ msgid "" "call." msgstr "" -#: ../../library/reprlib.rst:222 +#: ../../library/reprlib.rst:224 msgid "" "Formatting methods for specific types are implemented as methods with a name " "based on the type name. In the method name, **TYPE** is replaced by ``'_'." @@ -187,16 +187,16 @@ msgid "" "should call ``self.repr1(subobj, level - 1)``." msgstr "" -#: ../../library/reprlib.rst:232 +#: ../../library/reprlib.rst:234 msgid "Subclassing Repr Objects" msgstr "" -#: ../../library/reprlib.rst:234 +#: ../../library/reprlib.rst:236 msgid "" "The use of dynamic dispatching by :meth:`Repr.repr1` allows subclasses of :" "class:`Repr` to add support for additional built-in object types or to " "modify the handling of types already supported. This example shows how " -"special support for file objects could be added::" +"special support for file objects could be added:" msgstr "" #: ../../library/reprlib.rst:65 diff --git a/library/shelve.po b/library/shelve.po index cc3258444d..b88a4036c5 100644 --- a/library/shelve.po +++ b/library/shelve.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-07-22 00:04+0000\n" +"POT-Creation-Date: 2023-12-08 16:59+0000\n" "PO-Revision-Date: 2018-05-23 16:09+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -195,18 +195,18 @@ msgstr "新增情境管理器的支援。" #: ../../library/shelve.rst:152 msgid "" -"A subclass of :class:`Shelf` which exposes :meth:`first`, :meth:`!next`, :" -"meth:`previous`, :meth:`last` and :meth:`set_location` which are available " -"in the third-party :mod:`bsddb` module from `pybsddb `_ but not in other database modules. The *dict* " -"object passed to the constructor must support those methods. This is " -"generally accomplished by calling one of :func:`bsddb.hashopen`, :func:" -"`bsddb.btopen` or :func:`bsddb.rnopen`. The optional *protocol*, " +"A subclass of :class:`Shelf` which exposes :meth:`!first`, :meth:`!next`, :" +"meth:`!previous`, :meth:`!last` and :meth:`!set_location` methods. These are " +"available in the third-party :mod:`!bsddb` module from `pybsddb `_ but not in other database modules. The " +"*dict* object passed to the constructor must support those methods. This is " +"generally accomplished by calling one of :func:`!bsddb.hashopen`, :func:`!" +"bsddb.btopen` or :func:`!bsddb.rnopen`. The optional *protocol*, " "*writeback*, and *keyencoding* parameters have the same interpretation as " "for the :class:`Shelf` class." msgstr "" -#: ../../library/shelve.rst:165 +#: ../../library/shelve.rst:166 msgid "" "A subclass of :class:`Shelf` which accepts a *filename* instead of a dict-" "like object. The underlying file will be opened using :func:`dbm.open`. By " @@ -216,29 +216,29 @@ msgid "" "same interpretation as for the :class:`Shelf` class." msgstr "" -#: ../../library/shelve.rst:176 +#: ../../library/shelve.rst:177 msgid "Example" msgstr "範例" -#: ../../library/shelve.rst:178 +#: ../../library/shelve.rst:179 msgid "" "To summarize the interface (``key`` is a string, ``data`` is an arbitrary " "object)::" msgstr "" -#: ../../library/shelve.rst:215 +#: ../../library/shelve.rst:216 msgid "Module :mod:`dbm`" msgstr ":mod:`dbm` 模組" -#: ../../library/shelve.rst:215 +#: ../../library/shelve.rst:216 msgid "Generic interface to ``dbm``-style databases." msgstr "" -#: ../../library/shelve.rst:217 +#: ../../library/shelve.rst:218 msgid "Module :mod:`pickle`" msgstr ":mod:`pickle` 模組" -#: ../../library/shelve.rst:218 +#: ../../library/shelve.rst:219 msgid "Object serialization used by :mod:`shelve`." msgstr "" diff --git a/library/string.po b/library/string.po index 349e3c7756..dbc19a3aff 100644 --- a/library/string.po +++ b/library/string.po @@ -670,7 +670,7 @@ msgid "" "digits above 9. In case ``'#'`` is specified, the prefix ``'0x'`` will be " "upper-cased to ``'0X'`` as well." msgstr "" -"十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用大寫字母。如果指定了" +"十六進位格式。輸出以 16 為基數的數字,9 以上的數字使用大寫字母。如果指定了 " "``'#'``,則前綴 ``'0x'`` 也會被轉成大寫的 ``'0X'``。" #: ../../library/string.rst:486 ../../library/string.rst:570 diff --git a/library/typing.po b/library/typing.po index e47675cc14..3f530c1190 100644 --- a/library/typing.po +++ b/library/typing.po @@ -388,7 +388,7 @@ msgid "" msgstr "" "注意這只會透過靜態型別檢查器強制檢查。在 runtime 中,陳述式 (statement) " "``Derived = NewType('Derived', Base)`` 會使 ``Derived`` 成為一個 callable(可" -"呼叫物件),會立即回傳任何你傳遞的引數。這意味著 expression (運算式)" +"呼叫物件),會立即回傳任何你傳遞的引數。這意味著 expression (運算式)\\ " "``Derived(some_value)`` 不會建立一個新的類別或過度引入原有的函式呼叫。" #: ../../library/typing.rst:212 diff --git a/library/wsgiref.po b/library/wsgiref.po index 00003f6b38..53076a1701 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -612,8 +612,8 @@ msgid "" msgstr "" "這個包裝器也可以使用 :mod:`warnings` 模組生成輸出去指示一些可能有疑慮但實際上" "可能不會被 :pep:`3333` 禁止的行為。除非使用 Python 命令列選項或 :mod:" -"`warnings` API,抑制了這些警告,否則這類警告將被寫入到 ``sys.stderr``(*not* " -"``wsgi.errors``,除非它們碰巧是相同的物件)。" +"`warnings` API,抑制了這些警告,否則這類警告將被寫入到 ``sys.stderr``\\ " +"(*not* ``wsgi.errors``,除非它們碰巧是相同的物件)。" #: ../../library/wsgiref.rst:450 msgid ":mod:`wsgiref.handlers` -- server/gateway base classes" @@ -650,7 +650,7 @@ msgid "" "CGI streams and environment." msgstr "" "這個類別是 :class:`BaseCGIHandler` 的子類別將 ``wsgi.run_once`` 設置為 true," -"``wsgi.multithread``設置為 false,並將 ``wsgi.multiprocess`` 設置為 true,並" +"``wsgi.multithread`` 設置為 false,並將 ``wsgi.multiprocess`` 設置為 true,並" "且始終使用 :mod:`sys` 和 :mod:`os` 來獲取所需的 CGI 串流以及環境。" #: ../../library/wsgiref.rst:477 diff --git a/reference/datamodel.po b/reference/datamodel.po index 856acc800b..0df444d185 100644 --- a/reference/datamodel.po +++ b/reference/datamodel.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-06 00:03+0000\n" +"POT-Creation-Date: 2023-12-08 16:59+0000\n" "PO-Revision-Date: 2018-05-23 16:17+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -587,130 +587,130 @@ msgid "" "`calls`) can be applied:" msgstr "" -#: ../../reference/datamodel.rst:523 +#: ../../reference/datamodel.rst:525 msgid "User-defined functions" msgstr "" -#: ../../reference/datamodel.rst:530 +#: ../../reference/datamodel.rst:532 msgid "" "A user-defined function object is created by a function definition (see " "section :ref:`function`). It should be called with an argument list " "containing the same number of items as the function's formal parameter list." msgstr "" -#: ../../reference/datamodel.rst:535 ../../reference/datamodel.rst:928 +#: ../../reference/datamodel.rst:537 ../../reference/datamodel.rst:955 msgid "Special attributes:" msgstr "" -#: ../../reference/datamodel.rst:554 +#: ../../reference/datamodel.rst:556 msgid "Attribute" msgstr "屬性" -#: ../../reference/datamodel.rst:554 +#: ../../reference/datamodel.rst:556 msgid "Meaning" msgstr "" -#: ../../reference/datamodel.rst:556 ../../reference/datamodel.rst:845 -#: ../../reference/datamodel.rst:944 +#: ../../reference/datamodel.rst:558 ../../reference/datamodel.rst:871 +#: ../../reference/datamodel.rst:971 msgid ":attr:`__doc__`" msgstr ":attr:`__doc__`" -#: ../../reference/datamodel.rst:556 +#: ../../reference/datamodel.rst:558 msgid "" "The function's documentation string, or ``None`` if unavailable; not " "inherited by subclasses." msgstr "" -#: ../../reference/datamodel.rst:556 ../../reference/datamodel.rst:561 -#: ../../reference/datamodel.rst:564 ../../reference/datamodel.rst:569 -#: ../../reference/datamodel.rst:573 ../../reference/datamodel.rst:579 -#: ../../reference/datamodel.rst:589 ../../reference/datamodel.rst:600 -#: ../../reference/datamodel.rst:610 ../../reference/datamodel.rst:613 +#: ../../reference/datamodel.rst:558 ../../reference/datamodel.rst:563 +#: ../../reference/datamodel.rst:566 ../../reference/datamodel.rst:571 +#: ../../reference/datamodel.rst:575 ../../reference/datamodel.rst:581 +#: ../../reference/datamodel.rst:591 ../../reference/datamodel.rst:602 +#: ../../reference/datamodel.rst:612 ../../reference/datamodel.rst:615 msgid "Writable" msgstr "" -#: ../../reference/datamodel.rst:561 +#: ../../reference/datamodel.rst:563 msgid ":attr:`~definition.\\ __name__`" msgstr ":attr:`~definition.\\ __name__`" -#: ../../reference/datamodel.rst:561 +#: ../../reference/datamodel.rst:563 msgid "The function's name." msgstr "" -#: ../../reference/datamodel.rst:564 +#: ../../reference/datamodel.rst:566 msgid ":attr:`~definition.\\ __qualname__`" msgstr ":attr:`~definition.\\ __qualname__`" -#: ../../reference/datamodel.rst:564 +#: ../../reference/datamodel.rst:566 msgid "The function's :term:`qualified name`." msgstr "" -#: ../../reference/datamodel.rst:569 ../../reference/datamodel.rst:934 +#: ../../reference/datamodel.rst:571 ../../reference/datamodel.rst:961 msgid ":attr:`__module__`" msgstr ":attr:`__module__`" -#: ../../reference/datamodel.rst:569 +#: ../../reference/datamodel.rst:571 msgid "" "The name of the module the function was defined in, or ``None`` if " "unavailable." msgstr "" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:575 msgid ":attr:`__defaults__`" msgstr ":attr:`__defaults__`" -#: ../../reference/datamodel.rst:573 +#: ../../reference/datamodel.rst:575 msgid "" "A tuple containing default argument values for those arguments that have " "defaults, or ``None`` if no arguments have a default value." msgstr "" -#: ../../reference/datamodel.rst:579 +#: ../../reference/datamodel.rst:581 msgid ":attr:`__code__`" msgstr ":attr:`__code__`" -#: ../../reference/datamodel.rst:579 +#: ../../reference/datamodel.rst:581 msgid "The code object representing the compiled function body." msgstr "" -#: ../../reference/datamodel.rst:582 +#: ../../reference/datamodel.rst:584 msgid ":attr:`__globals__`" msgstr ":attr:`__globals__`" -#: ../../reference/datamodel.rst:582 +#: ../../reference/datamodel.rst:584 msgid "" "A reference to the dictionary that holds the function's global variables --- " "the global namespace of the module in which the function was defined." msgstr "" -#: ../../reference/datamodel.rst:582 ../../reference/datamodel.rst:593 +#: ../../reference/datamodel.rst:584 ../../reference/datamodel.rst:595 msgid "Read-only" msgstr "" -#: ../../reference/datamodel.rst:589 ../../reference/datamodel.rst:937 +#: ../../reference/datamodel.rst:591 ../../reference/datamodel.rst:964 msgid ":attr:`~object.__dict__`" msgstr ":attr:`~object.__dict__`" -#: ../../reference/datamodel.rst:589 +#: ../../reference/datamodel.rst:591 msgid "The namespace supporting arbitrary function attributes." msgstr "" -#: ../../reference/datamodel.rst:593 +#: ../../reference/datamodel.rst:595 msgid ":attr:`__closure__`" msgstr ":attr:`__closure__`" -#: ../../reference/datamodel.rst:593 +#: ../../reference/datamodel.rst:595 msgid "" "``None`` or a tuple of cells that contain bindings for the function's free " "variables. See below for information on the ``cell_contents`` attribute." msgstr "" -#: ../../reference/datamodel.rst:600 ../../reference/datamodel.rst:860 -#: ../../reference/datamodel.rst:951 +#: ../../reference/datamodel.rst:602 ../../reference/datamodel.rst:886 +#: ../../reference/datamodel.rst:978 msgid ":attr:`__annotations__`" msgstr ":attr:`__annotations__`" -#: ../../reference/datamodel.rst:600 +#: ../../reference/datamodel.rst:602 msgid "" "A dict containing annotations of parameters. The keys of the dict are the " "parameter names, and ``'return'`` for the return annotation, if provided. " @@ -718,31 +718,31 @@ msgid "" "howto`." msgstr "" -#: ../../reference/datamodel.rst:610 +#: ../../reference/datamodel.rst:612 msgid ":attr:`__kwdefaults__`" msgstr ":attr:`__kwdefaults__`" -#: ../../reference/datamodel.rst:610 +#: ../../reference/datamodel.rst:612 msgid "A dict containing defaults for keyword-only parameters." msgstr "" -#: ../../reference/datamodel.rst:613 ../../reference/datamodel.rst:956 +#: ../../reference/datamodel.rst:615 ../../reference/datamodel.rst:983 msgid ":attr:`__type_params__`" msgstr ":attr:`__type_params__`" -#: ../../reference/datamodel.rst:613 +#: ../../reference/datamodel.rst:615 msgid "" "A tuple containing the :ref:`type parameters ` of a :ref:" "`generic function `." msgstr "" -#: ../../reference/datamodel.rst:620 +#: ../../reference/datamodel.rst:622 msgid "" "Most of the attributes labelled \"Writable\" check the type of the assigned " "value." msgstr "" -#: ../../reference/datamodel.rst:622 +#: ../../reference/datamodel.rst:624 msgid "" "Function objects also support getting and setting arbitrary attributes, " "which can be used, for example, to attach metadata to functions. Regular " @@ -752,103 +752,126 @@ msgid "" "future.*" msgstr "" -#: ../../reference/datamodel.rst:628 +#: ../../reference/datamodel.rst:630 msgid "" "A cell object has the attribute ``cell_contents``. This can be used to get " "the value of the cell, as well as set the value." msgstr "" -#: ../../reference/datamodel.rst:631 +#: ../../reference/datamodel.rst:633 msgid "" "Additional information about a function's definition can be retrieved from " "its code object; see the description of internal types below. The :data:" "`cell ` type can be accessed in the :mod:`types` module." msgstr "" -#: ../../reference/datamodel.rst:640 +#: ../../reference/datamodel.rst:642 msgid "Instance methods" msgstr "" -#: ../../reference/datamodel.rst:647 +#: ../../reference/datamodel.rst:649 msgid "" "An instance method object combines a class, a class instance and any " "callable object (normally a user-defined function)." msgstr "" -#: ../../reference/datamodel.rst:657 +#: ../../reference/datamodel.rst:659 +msgid "Special read-only attributes:" +msgstr "特殊唯讀屬性:" + +#: ../../reference/datamodel.rst:664 msgid "" -"Special read-only attributes: :attr:`__self__` is the class instance " -"object, :attr:`__func__` is the function object; :attr:`__doc__` is the " -"method's documentation (same as ``__func__.__doc__``); :attr:`~definition." -"__name__` is the method name (same as ``__func__.__name__``); :attr:" -"`__module__` is the name of the module the method was defined in, or " -"``None`` if unavailable." +"Refers to the class instance object to which the method is :ref:`bound " +"`" +msgstr "" + +#: ../../reference/datamodel.rst:668 +msgid "Refers to the original function object" msgstr "" -#: ../../reference/datamodel.rst:663 +#: ../../reference/datamodel.rst:671 +msgid "" +"The method's documentation (same as :attr:`!method.__func__.__doc__`). A :" +"class:`string ` if the original function had a docstring, else ``None``." +msgstr "" + +#: ../../reference/datamodel.rst:676 +msgid "The name of the method (same as :attr:`!method.__func__.__name__`)" +msgstr "" + +#: ../../reference/datamodel.rst:679 +msgid "" +"The name of the module the method was defined in, or ``None`` if unavailable." +msgstr "" + +#: ../../reference/datamodel.rst:682 msgid "" "Methods also support accessing (but not setting) the arbitrary function " -"attributes on the underlying function object." +"attributes on the underlying :ref:`function object `." msgstr "" -#: ../../reference/datamodel.rst:666 +#: ../../reference/datamodel.rst:685 msgid "" "User-defined method objects may be created when getting an attribute of a " "class (perhaps via an instance of that class), if that attribute is a user-" -"defined function object or a class method object." +"defined :ref:`function object ` or a :class:" +"`classmethod` object." msgstr "" -#: ../../reference/datamodel.rst:670 +#: ../../reference/datamodel.rst:692 msgid "" -"When an instance method object is created by retrieving a user-defined " -"function object from a class via one of its instances, its :attr:`__self__` " -"attribute is the instance, and the method object is said to be bound. The " -"new method's :attr:`__func__` attribute is the original function object." +"When an instance method object is created by retrieving a user-defined :ref:" +"`function object ` from a class via one of its " +"instances, its :attr:`~method.__self__` attribute is the instance, and the " +"method object is said to be *bound*. The new method's :attr:`~method." +"__func__` attribute is the original function object." msgstr "" -#: ../../reference/datamodel.rst:676 +#: ../../reference/datamodel.rst:698 msgid "" -"When an instance method object is created by retrieving a class method " -"object from a class or instance, its :attr:`__self__` attribute is the class " -"itself, and its :attr:`__func__` attribute is the function object underlying " -"the class method." +"When an instance method object is created by retrieving a :class:" +"`classmethod` object from a class or instance, its :attr:`~method.__self__` " +"attribute is the class itself, and its :attr:`~method.__func__` attribute is " +"the function object underlying the class method." msgstr "" -#: ../../reference/datamodel.rst:681 +#: ../../reference/datamodel.rst:703 msgid "" "When an instance method object is called, the underlying function (:attr:" -"`__func__`) is called, inserting the class instance (:attr:`__self__`) in " -"front of the argument list. For instance, when :class:`!C` is a class which " -"contains a definition for a function :meth:`!f`, and ``x`` is an instance " -"of :class:`!C`, calling ``x.f(1)`` is equivalent to calling ``C.f(x, 1)``." +"`~method.__func__`) is called, inserting the class instance (:attr:`~method." +"__self__`) in front of the argument list. For instance, when :class:`!C` is " +"a class which contains a definition for a function :meth:`!f`, and ``x`` is " +"an instance of :class:`!C`, calling ``x.f(1)`` is equivalent to calling ``C." +"f(x, 1)``." msgstr "" -#: ../../reference/datamodel.rst:688 +#: ../../reference/datamodel.rst:710 msgid "" -"When an instance method object is derived from a class method object, the " -"\"class instance\" stored in :attr:`__self__` will actually be the class " -"itself, so that calling either ``x.f(1)`` or ``C.f(1)`` is equivalent to " -"calling ``f(C,1)`` where ``f`` is the underlying function." +"When an instance method object is derived from a :class:`classmethod` " +"object, the \"class instance\" stored in :attr:`~method.__self__` will " +"actually be the class itself, so that calling either ``x.f(1)`` or ``C." +"f(1)`` is equivalent to calling ``f(C,1)`` where ``f`` is the underlying " +"function." msgstr "" -#: ../../reference/datamodel.rst:693 +#: ../../reference/datamodel.rst:715 msgid "" -"Note that the transformation from function object to instance method object " -"happens each time the attribute is retrieved from the instance. In some " -"cases, a fruitful optimization is to assign the attribute to a local " -"variable and call that local variable. Also notice that this transformation " -"only happens for user-defined functions; other callable objects (and all non-" -"callable objects) are retrieved without transformation. It is also " -"important to note that user-defined functions which are attributes of a " -"class instance are not converted to bound methods; this *only* happens when " -"the function is an attribute of the class." +"Note that the transformation from :ref:`function object ` to instance method object happens each time the attribute is " +"retrieved from the instance. In some cases, a fruitful optimization is to " +"assign the attribute to a local variable and call that local variable. Also " +"notice that this transformation only happens for user-defined functions; " +"other callable objects (and all non-callable objects) are retrieved without " +"transformation. It is also important to note that user-defined functions " +"which are attributes of a class instance are not converted to bound methods; " +"this *only* happens when the function is an attribute of the class." msgstr "" -#: ../../reference/datamodel.rst:706 +#: ../../reference/datamodel.rst:729 msgid "Generator functions" msgstr "" -#: ../../reference/datamodel.rst:712 +#: ../../reference/datamodel.rst:735 msgid "" "A function or method which uses the :keyword:`yield` statement (see section :" "ref:`yield`) is called a :dfn:`generator function`. Such a function, when " @@ -861,11 +884,11 @@ msgid "" "values to be returned." msgstr "" -#: ../../reference/datamodel.rst:724 +#: ../../reference/datamodel.rst:747 msgid "Coroutine functions" msgstr "" -#: ../../reference/datamodel.rst:729 +#: ../../reference/datamodel.rst:752 msgid "" "A function or method which is defined using :keyword:`async def` is called " "a :dfn:`coroutine function`. Such a function, when called, returns a :term:" @@ -874,11 +897,11 @@ msgid "" "ref:`coroutine-objects` section." msgstr "" -#: ../../reference/datamodel.rst:737 +#: ../../reference/datamodel.rst:760 msgid "Asynchronous generator functions" msgstr "" -#: ../../reference/datamodel.rst:743 +#: ../../reference/datamodel.rst:766 msgid "" "A function or method which is defined using :keyword:`async def` and which " "uses the :keyword:`yield` statement is called a :dfn:`asynchronous generator " @@ -887,7 +910,7 @@ msgid "" "execute the body of the function." msgstr "" -#: ../../reference/datamodel.rst:749 +#: ../../reference/datamodel.rst:772 msgid "" "Calling the asynchronous iterator's :meth:`aiterator.__anext__ ` method will return an :term:`awaitable` which when awaited will " @@ -898,11 +921,11 @@ msgid "" "yielded." msgstr "" -#: ../../reference/datamodel.rst:760 +#: ../../reference/datamodel.rst:783 msgid "Built-in functions" msgstr "" -#: ../../reference/datamodel.rst:767 +#: ../../reference/datamodel.rst:790 msgid "" "A built-in function object is a wrapper around a C function. Examples of " "built-in functions are :func:`len` and :func:`math.sin` (:mod:`math` is a " @@ -914,24 +937,26 @@ msgid "" "module the function was defined in or ``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:778 +#: ../../reference/datamodel.rst:803 msgid "Built-in methods" msgstr "" -#: ../../reference/datamodel.rst:785 +#: ../../reference/datamodel.rst:810 msgid "" "This is really a different disguise of a built-in function, this time " "containing an object passed to the C function as an implicit extra " "argument. An example of a built-in method is ``alist.append()``, assuming " "*alist* is a list object. In this case, the special read-only attribute :" -"attr:`__self__` is set to the object denoted by *alist*." +"attr:`!__self__` is set to the object denoted by *alist*. (The attribute has " +"the same semantics as it does with :attr:`other instance methods `.)" msgstr "" -#: ../../reference/datamodel.rst:793 +#: ../../reference/datamodel.rst:819 msgid "Classes" msgstr "" -#: ../../reference/datamodel.rst:795 +#: ../../reference/datamodel.rst:821 msgid "" "Classes are callable. These objects normally act as factories for new " "instances of themselves, but variations are possible for class types that " @@ -940,21 +965,21 @@ msgid "" "initialize the new instance." msgstr "" -#: ../../reference/datamodel.rst:803 +#: ../../reference/datamodel.rst:829 msgid "Class Instances" msgstr "" -#: ../../reference/datamodel.rst:805 +#: ../../reference/datamodel.rst:831 msgid "" "Instances of arbitrary classes can be made callable by defining a :meth:" "`~object.__call__` method in their class." msgstr "" -#: ../../reference/datamodel.rst:810 +#: ../../reference/datamodel.rst:836 msgid "Modules" msgstr "模組" -#: ../../reference/datamodel.rst:816 +#: ../../reference/datamodel.rst:842 msgid "" "Modules are a basic organizational unit of Python code, and are created by " "the :ref:`import system ` as invoked either by the :keyword:" @@ -968,33 +993,33 @@ msgid "" "needed once the initialization is done)." msgstr "" -#: ../../reference/datamodel.rst:828 +#: ../../reference/datamodel.rst:854 msgid "" "Attribute assignment updates the module's namespace dictionary, e.g., ``m.x " "= 1`` is equivalent to ``m.__dict__[\"x\"] = 1``." msgstr "" -#: ../../reference/datamodel.rst:838 +#: ../../reference/datamodel.rst:864 msgid "Predefined (writable) attributes:" msgstr "" -#: ../../reference/datamodel.rst:841 +#: ../../reference/datamodel.rst:867 msgid ":attr:`__name__`" msgstr ":attr:`__name__`" -#: ../../reference/datamodel.rst:841 +#: ../../reference/datamodel.rst:867 msgid "The module's name." msgstr "" -#: ../../reference/datamodel.rst:844 +#: ../../reference/datamodel.rst:870 msgid "The module's documentation string, or ``None`` if unavailable." msgstr "" -#: ../../reference/datamodel.rst:854 +#: ../../reference/datamodel.rst:880 msgid ":attr:`__file__`" msgstr ":attr:`__file__`" -#: ../../reference/datamodel.rst:848 +#: ../../reference/datamodel.rst:874 msgid "" "The pathname of the file from which the module was loaded, if it was loaded " "from a file. The :attr:`__file__` attribute may be missing for certain types " @@ -1003,20 +1028,20 @@ msgid "" "library, it's the pathname of the shared library file." msgstr "" -#: ../../reference/datamodel.rst:857 +#: ../../reference/datamodel.rst:883 msgid "" "A dictionary containing :term:`variable annotations ` " "collected during module body execution. For best practices on working with :" "attr:`__annotations__`, please see :ref:`annotations-howto`." msgstr "" -#: ../../reference/datamodel.rst:864 +#: ../../reference/datamodel.rst:890 msgid "" "Special read-only attribute: :attr:`~object.__dict__` is the module's " "namespace as a dictionary object." msgstr "" -#: ../../reference/datamodel.rst:869 +#: ../../reference/datamodel.rst:895 msgid "" "Because of the way CPython clears module dictionaries, the module dictionary " "will be cleared when the module falls out of scope even if the dictionary " @@ -1024,11 +1049,11 @@ msgid "" "module around while using its dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:876 +#: ../../reference/datamodel.rst:902 msgid "Custom classes" msgstr "" -#: ../../reference/datamodel.rst:878 +#: ../../reference/datamodel.rst:904 msgid "" "Custom class types are typically created by class definitions (see section :" "ref:`class`). A class has a namespace implemented by a dictionary object. " @@ -1044,77 +1069,77 @@ msgid "" "python.org/download/releases/2.3/mro/." msgstr "" -#: ../../reference/datamodel.rst:902 +#: ../../reference/datamodel.rst:928 msgid "" "When a class attribute reference (for class :class:`!C`, say) would yield a " "class method object, it is transformed into an instance method object whose :" -"attr:`__self__` attribute is :class:`!C`. When it would yield a static " -"method object, it is transformed into the object wrapped by the static " -"method object. See section :ref:`descriptors` for another way in which " -"attributes retrieved from a class may differ from those actually contained " -"in its :attr:`~object.__dict__`." +"attr:`~method.__self__` attribute is :class:`!C`. When it would yield a :" +"class:`staticmethod` object, it is transformed into the object wrapped by " +"the static method object. See section :ref:`descriptors` for another way in " +"which attributes retrieved from a class may differ from those actually " +"contained in its :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:912 +#: ../../reference/datamodel.rst:939 msgid "" "Class attribute assignments update the class's dictionary, never the " "dictionary of a base class." msgstr "" -#: ../../reference/datamodel.rst:917 +#: ../../reference/datamodel.rst:944 msgid "" "A class object can be called (see above) to yield a class instance (see " "below)." msgstr "" -#: ../../reference/datamodel.rst:931 +#: ../../reference/datamodel.rst:958 msgid ":attr:`~definition.__name__`" msgstr ":attr:`~definition.__name__`" -#: ../../reference/datamodel.rst:931 +#: ../../reference/datamodel.rst:958 msgid "The class name." msgstr "" -#: ../../reference/datamodel.rst:934 +#: ../../reference/datamodel.rst:961 msgid "The name of the module in which the class was defined." msgstr "" -#: ../../reference/datamodel.rst:937 +#: ../../reference/datamodel.rst:964 msgid "The dictionary containing the class's namespace." msgstr "" -#: ../../reference/datamodel.rst:941 +#: ../../reference/datamodel.rst:968 msgid ":attr:`~class.__bases__`" msgstr ":attr:`~class.__bases__`" -#: ../../reference/datamodel.rst:940 +#: ../../reference/datamodel.rst:967 msgid "" "A tuple containing the base classes, in the order of their occurrence in the " "base class list." msgstr "" -#: ../../reference/datamodel.rst:944 +#: ../../reference/datamodel.rst:971 msgid "The class's documentation string, or ``None`` if undefined." msgstr "" -#: ../../reference/datamodel.rst:947 +#: ../../reference/datamodel.rst:974 msgid "" "A dictionary containing :term:`variable annotations ` " "collected during class body execution. For best practices on working with :" "attr:`__annotations__`, please see :ref:`annotations-howto`." msgstr "" -#: ../../reference/datamodel.rst:954 +#: ../../reference/datamodel.rst:981 msgid "" "A tuple containing the :ref:`type parameters ` of a :ref:" "`generic class `." msgstr "" -#: ../../reference/datamodel.rst:959 +#: ../../reference/datamodel.rst:986 msgid "Class instances" msgstr "" -#: ../../reference/datamodel.rst:967 +#: ../../reference/datamodel.rst:994 msgid "" "A class instance is created by calling a class object (see above). A class " "instance has a namespace implemented as a dictionary which is the first " @@ -1122,8 +1147,8 @@ msgid "" "found there, and the instance's class has an attribute by that name, the " "search continues with the class attributes. If a class attribute is found " "that is a user-defined function object, it is transformed into an instance " -"method object whose :attr:`__self__` attribute is the instance. Static " -"method and class method objects are also transformed; see above under " +"method object whose :attr:`~method.__self__` attribute is the instance. " +"Static method and class method objects are also transformed; see above under " "\"Classes\". See section :ref:`descriptors` for another way in which " "attributes of a class retrieved via its instances may differ from the " "objects actually stored in the class's :attr:`~object.__dict__`. If no " @@ -1131,7 +1156,7 @@ msgid "" "__getattr__` method, that is called to satisfy the lookup." msgstr "" -#: ../../reference/datamodel.rst:983 +#: ../../reference/datamodel.rst:1010 msgid "" "Attribute assignments and deletions update the instance's dictionary, never " "a class's dictionary. If the class has a :meth:`~object.__setattr__` or :" @@ -1139,23 +1164,23 @@ msgid "" "instance dictionary directly." msgstr "" -#: ../../reference/datamodel.rst:993 +#: ../../reference/datamodel.rst:1020 msgid "" "Class instances can pretend to be numbers, sequences, or mappings if they " "have methods with certain special names. See section :ref:`specialnames`." msgstr "" -#: ../../reference/datamodel.rst:1000 +#: ../../reference/datamodel.rst:1027 msgid "" "Special attributes: :attr:`~object.__dict__` is the attribute dictionary; :" "attr:`~instance.__class__` is the instance's class." msgstr "" -#: ../../reference/datamodel.rst:1005 +#: ../../reference/datamodel.rst:1032 msgid "I/O objects (also known as file objects)" msgstr "" -#: ../../reference/datamodel.rst:1020 +#: ../../reference/datamodel.rst:1047 msgid "" "A :term:`file object` represents an open file. Various shortcuts are " "available to create file objects: the :func:`open` built-in function, and " @@ -1164,7 +1189,7 @@ msgid "" "methods provided by extension modules)." msgstr "" -#: ../../reference/datamodel.rst:1026 +#: ../../reference/datamodel.rst:1053 msgid "" "The objects ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are initialized " "to file objects corresponding to the interpreter's standard input, output " @@ -1172,22 +1197,22 @@ msgid "" "interface defined by the :class:`io.TextIOBase` abstract class." msgstr "" -#: ../../reference/datamodel.rst:1034 +#: ../../reference/datamodel.rst:1061 msgid "Internal types" msgstr "" -#: ../../reference/datamodel.rst:1040 +#: ../../reference/datamodel.rst:1067 msgid "" "A few types used internally by the interpreter are exposed to the user. " "Their definitions may change with future versions of the interpreter, but " "they are mentioned here for completeness." msgstr "" -#: ../../reference/datamodel.rst:1048 +#: ../../reference/datamodel.rst:1075 msgid "Code objects" msgstr "" -#: ../../reference/datamodel.rst:1052 +#: ../../reference/datamodel.rst:1079 msgid "" "Code objects represent *byte-compiled* executable Python code, or :term:" "`bytecode`. The difference between a code object and a function object is " @@ -1199,105 +1224,187 @@ msgid "" "no references (directly or indirectly) to mutable objects." msgstr "" -#: ../../reference/datamodel.rst:1080 +#: ../../reference/datamodel.rst:1108 ../../reference/datamodel.rst:1259 +msgid "Special read-only attributes" +msgstr "" + +#: ../../reference/datamodel.rst:1113 +msgid "The function name" +msgstr "函式名稱" + +#: ../../reference/datamodel.rst:1116 +msgid "The fully qualified function name" +msgstr "" + +#: ../../reference/datamodel.rst:1119 +msgid "" +"The total number of positional :term:`parameters ` (including " +"positional-only parameters and parameters with default values) that the " +"function has" +msgstr "" + +#: ../../reference/datamodel.rst:1124 msgid "" -"Special read-only attributes: :attr:`co_name` gives the function name; :attr:" -"`co_qualname` gives the fully qualified function name; :attr:`co_argcount` " -"is the total number of positional arguments (including positional-only " -"arguments and arguments with default values); :attr:`co_posonlyargcount` is " -"the number of positional-only arguments (including arguments with default " -"values); :attr:`co_kwonlyargcount` is the number of keyword-only arguments " -"(including arguments with default values); :attr:`co_nlocals` is the number " -"of local variables used by the function (including arguments); :attr:" -"`co_varnames` is a tuple containing the names of the local variables " -"(starting with the argument names); :attr:`co_cellvars` is a tuple " -"containing the names of local variables that are referenced by nested " -"functions; :attr:`co_freevars` is a tuple containing the names of free " -"variables; :attr:`co_code` is a string representing the sequence of bytecode " -"instructions; :attr:`co_consts` is a tuple containing the literals used by " -"the bytecode; :attr:`co_names` is a tuple containing the names used by the " -"bytecode; :attr:`co_filename` is the filename from which the code was " -"compiled; :attr:`co_firstlineno` is the first line number of the function; :" -"attr:`co_lnotab` is a string encoding the mapping from bytecode offsets to " -"line numbers (for details see the source code of the interpreter, is " -"deprecated since 3.12 and may be removed in 3.14); :attr:`co_stacksize` is " -"the required stack size; :attr:`co_flags` is an integer encoding a number of " -"flags for the interpreter." +"The number of positional-only :term:`parameters ` (including " +"arguments with default values) that the function has" msgstr "" -#: ../../reference/datamodel.rst:1106 +#: ../../reference/datamodel.rst:1128 msgid "" -"The following flag bits are defined for :attr:`co_flags`: bit ``0x04`` is " -"set if the function uses the ``*arguments`` syntax to accept an arbitrary " -"number of positional arguments; bit ``0x08`` is set if the function uses the " -"``**keywords`` syntax to accept arbitrary keyword arguments; bit ``0x20`` is " -"set if the function is a generator." +"The number of keyword-only :term:`parameters ` (including " +"arguments with default values) that the function has" msgstr "" -#: ../../reference/datamodel.rst:1112 +#: ../../reference/datamodel.rst:1132 +msgid "" +"The number of :ref:`local variables ` used by the function " +"(including parameters)" +msgstr "" + +#: ../../reference/datamodel.rst:1136 +msgid "" +"A :class:`tuple` containing the names of the local variables in the function " +"(starting with the parameter names)" +msgstr "" + +#: ../../reference/datamodel.rst:1140 +msgid "" +"A :class:`tuple` containing the names of :ref:`local variables ` " +"that are referenced by nested functions inside the function" +msgstr "" + +#: ../../reference/datamodel.rst:1144 +msgid "A :class:`tuple` containing the names of free variables in the function" +msgstr "" + +#: ../../reference/datamodel.rst:1147 +msgid "" +"A string representing the sequence of :term:`bytecode` instructions in the " +"function" +msgstr "" + +#: ../../reference/datamodel.rst:1151 +msgid "" +"A :class:`tuple` containing the literals used by the :term:`bytecode` in the " +"function" +msgstr "" + +#: ../../reference/datamodel.rst:1155 +msgid "" +"A :class:`tuple` containing the names used by the :term:`bytecode` in the " +"function" +msgstr "" + +#: ../../reference/datamodel.rst:1159 +msgid "The name of the file from which the code was compiled" +msgstr "" + +#: ../../reference/datamodel.rst:1162 +msgid "The line number of the first line of the function" +msgstr "" + +#: ../../reference/datamodel.rst:1165 +msgid "" +"A string encoding the mapping from :term:`bytecode` offsets to line numbers. " +"For details, see the source code of the interpreter." +msgstr "" + +#: ../../reference/datamodel.rst:1168 +msgid "" +"This attribute of code objects is deprecated, and may be removed in Python " +"3.14." +msgstr "" + +#: ../../reference/datamodel.rst:1173 +msgid "The required stack size of the code object" +msgstr "" + +#: ../../reference/datamodel.rst:1176 +msgid "" +"An :class:`integer ` encoding a number of flags for the interpreter." +msgstr "" + +#: ../../reference/datamodel.rst:1181 +msgid "" +"The following flag bits are defined for :attr:`~codeobject.co_flags`: bit " +"``0x04`` is set if the function uses the ``*arguments`` syntax to accept an " +"arbitrary number of positional arguments; bit ``0x08`` is set if the " +"function uses the ``**keywords`` syntax to accept arbitrary keyword " +"arguments; bit ``0x20`` is set if the function is a generator. See :ref:" +"`inspect-module-co-flags` for details on the semantics of each flags that " +"might be present." +msgstr "" + +#: ../../reference/datamodel.rst:1189 msgid "" "Future feature declarations (``from __future__ import division``) also use " -"bits in :attr:`co_flags` to indicate whether a code object was compiled with " -"a particular feature enabled: bit ``0x2000`` is set if the function was " -"compiled with future division enabled; bits ``0x10`` and ``0x1000`` were " -"used in earlier versions of Python." +"bits in :attr:`~codeobject.co_flags` to indicate whether a code object was " +"compiled with a particular feature enabled: bit ``0x2000`` is set if the " +"function was compiled with future division enabled; bits ``0x10`` and " +"``0x1000`` were used in earlier versions of Python." msgstr "" -#: ../../reference/datamodel.rst:1118 -msgid "Other bits in :attr:`co_flags` are reserved for internal use." +#: ../../reference/datamodel.rst:1195 +msgid "" +"Other bits in :attr:`~codeobject.co_flags` are reserved for internal use." msgstr "" -#: ../../reference/datamodel.rst:1122 +#: ../../reference/datamodel.rst:1199 msgid "" -"If a code object represents a function, the first item in :attr:`co_consts` " -"is the documentation string of the function, or ``None`` if undefined." +"If a code object represents a function, the first item in :attr:`~codeobject." +"co_consts` is the documentation string of the function, or ``None`` if " +"undefined." +msgstr "" + +#: ../../reference/datamodel.rst:1204 +msgid "The :meth:`!co_positions` method" msgstr "" -#: ../../reference/datamodel.rst:1127 +#: ../../reference/datamodel.rst:1208 msgid "" -"Returns an iterable over the source code positions of each bytecode " +"Returns an iterable over the source code positions of each :term:`bytecode` " "instruction in the code object." msgstr "" -#: ../../reference/datamodel.rst:1130 +#: ../../reference/datamodel.rst:1211 msgid "" -"The iterator returns tuples containing the ``(start_line, end_line, " -"start_column, end_column)``. The *i-th* tuple corresponds to the position of " -"the source code that compiled to the *i-th* instruction. Column information " -"is 0-indexed utf-8 byte offsets on the given source line." +"The iterator returns :class:`tuple`\\s containing the ``(start_line, " +"end_line, start_column, end_column)``. The *i-th* tuple corresponds to the " +"position of the source code that compiled to the *i-th* instruction. Column " +"information is 0-indexed utf-8 byte offsets on the given source line." msgstr "" -#: ../../reference/datamodel.rst:1136 +#: ../../reference/datamodel.rst:1217 msgid "" "This positional information can be missing. A non-exhaustive lists of cases " "where this may happen:" msgstr "" -#: ../../reference/datamodel.rst:1139 +#: ../../reference/datamodel.rst:1220 msgid "Running the interpreter with :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1140 +#: ../../reference/datamodel.rst:1221 msgid "" "Loading a pyc file compiled while using :option:`-X` ``no_debug_ranges``." msgstr "" -#: ../../reference/datamodel.rst:1141 +#: ../../reference/datamodel.rst:1222 msgid "Position tuples corresponding to artificial instructions." msgstr "" -#: ../../reference/datamodel.rst:1142 +#: ../../reference/datamodel.rst:1223 msgid "" "Line and column numbers that can't be represented due to implementation " "specific limitations." msgstr "" -#: ../../reference/datamodel.rst:1145 +#: ../../reference/datamodel.rst:1226 msgid "" "When this occurs, some or all of the tuple elements can be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:1151 +#: ../../reference/datamodel.rst:1232 msgid "" "This feature requires storing column positions in code objects which may " "result in a small increase of disk usage of compiled Python files or " @@ -1307,27 +1414,23 @@ msgid "" "environment variable can be used." msgstr "" -#: ../../reference/datamodel.rst:1162 +#: ../../reference/datamodel.rst:1243 msgid "Frame objects" msgstr "" -#: ../../reference/datamodel.rst:1166 +#: ../../reference/datamodel.rst:1247 msgid "" "Frame objects represent execution frames. They may occur in traceback " "objects (see below), and are also passed to registered trace functions." msgstr "" -#: ../../reference/datamodel.rst:1178 -msgid "Special read-only attributes" -msgstr "" - -#: ../../reference/datamodel.rst:1183 +#: ../../reference/datamodel.rst:1264 msgid "" "Points to the previous stack frame (towards the caller), or ``None`` if this " "is the bottom stack frame" msgstr "" -#: ../../reference/datamodel.rst:1187 +#: ../../reference/datamodel.rst:1268 msgid "" "The :ref:`code object ` being executed in this frame. " "Accessing this attribute raises an :ref:`auditing event ` ``object." @@ -1337,53 +1440,53 @@ msgstr "" "這個屬性會引發一個附帶引數 ``obj`` 與 ``\"f_code\"`` 的\\ :ref:`稽核事件 " "` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1192 +#: ../../reference/datamodel.rst:1273 msgid "" "The dictionary used by the frame to look up :ref:`local variables `" msgstr "" -#: ../../reference/datamodel.rst:1196 +#: ../../reference/datamodel.rst:1277 msgid "" "The dictionary used by the frame to look up :ref:`global variables `" msgstr "" -#: ../../reference/datamodel.rst:1200 +#: ../../reference/datamodel.rst:1281 msgid "" "The dictionary used by the frame to look up :ref:`built-in (intrinsic) names " "`" msgstr "" -#: ../../reference/datamodel.rst:1204 +#: ../../reference/datamodel.rst:1285 msgid "" "The \"precise instruction\" of the frame object (this is an index into the :" "term:`bytecode` string of the :ref:`code object `)" msgstr "" -#: ../../reference/datamodel.rst:1215 +#: ../../reference/datamodel.rst:1296 msgid "Special writable attributes" msgstr "特殊可寫屬性" -#: ../../reference/datamodel.rst:1220 +#: ../../reference/datamodel.rst:1301 msgid "" "If not ``None``, this is a function called for various events during code " "execution (this is used by debuggers). Normally an event is triggered for " "each new source line (see :attr:`~frame.f_trace_lines`)." msgstr "" -#: ../../reference/datamodel.rst:1225 +#: ../../reference/datamodel.rst:1306 msgid "" "Set this attribute to :const:`False` to disable triggering a tracing event " "for each source line." msgstr "" -#: ../../reference/datamodel.rst:1229 +#: ../../reference/datamodel.rst:1310 msgid "" "Set this attribute to :const:`True` to allow per-opcode events to be " "requested. Note that this may lead to undefined interpreter behaviour if " "exceptions raised by the trace function escape to the function being traced." msgstr "" -#: ../../reference/datamodel.rst:1235 +#: ../../reference/datamodel.rst:1316 msgid "" "The current line number of the frame -- writing to this from within a trace " "function jumps to the given line (only for the bottom-most frame). A " @@ -1391,15 +1494,15 @@ msgid "" "this attribute." msgstr "" -#: ../../reference/datamodel.rst:1241 +#: ../../reference/datamodel.rst:1322 msgid "Frame object methods" msgstr "" -#: ../../reference/datamodel.rst:1243 +#: ../../reference/datamodel.rst:1324 msgid "Frame objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1247 +#: ../../reference/datamodel.rst:1328 msgid "" "This method clears all references to :ref:`local variables ` held by " "the frame. Also, if the frame belonged to a :term:`generator`, the " @@ -1408,22 +1511,22 @@ msgid "" "and storing its :ref:`traceback ` for later use)." msgstr "" -#: ../../reference/datamodel.rst:1253 +#: ../../reference/datamodel.rst:1334 msgid ":exc:`RuntimeError` is raised if the frame is currently executing." msgstr "" -#: ../../reference/datamodel.rst:1261 +#: ../../reference/datamodel.rst:1342 msgid "Traceback objects" msgstr "" -#: ../../reference/datamodel.rst:1274 +#: ../../reference/datamodel.rst:1355 msgid "" "Traceback objects represent a stack trace of an exception. A traceback " "object is implicitly created when an exception occurs, and may also be " "explicitly created by calling :class:`types.TracebackType`." msgstr "" -#: ../../reference/datamodel.rst:1278 +#: ../../reference/datamodel.rst:1359 msgid "" "For implicitly created tracebacks, when the search for an exception handler " "unwinds the execution stack, at each unwound level a traceback object is " @@ -1433,21 +1536,21 @@ msgid "" "exc_info()``, and as the ``__traceback__`` attribute of the caught exception." msgstr "" -#: ../../reference/datamodel.rst:1286 +#: ../../reference/datamodel.rst:1367 msgid "" "When the program contains no suitable handler, the stack trace is written " "(nicely formatted) to the standard error stream; if the interpreter is " "interactive, it is also made available to the user as ``sys.last_traceback``." msgstr "" -#: ../../reference/datamodel.rst:1291 +#: ../../reference/datamodel.rst:1372 msgid "" "For explicitly created tracebacks, it is up to the creator of the traceback " "to determine how the ``tb_next`` attributes should be linked to form a full " "stack trace." msgstr "" -#: ../../reference/datamodel.rst:1301 +#: ../../reference/datamodel.rst:1382 msgid "" "Special read-only attributes: :attr:`tb_frame` points to the execution frame " "of the current level; :attr:`tb_lineno` gives the line number where the " @@ -1457,7 +1560,7 @@ msgid "" "statement with no matching except clause or with a finally clause." msgstr "" -#: ../../reference/datamodel.rst:1310 +#: ../../reference/datamodel.rst:1391 msgid "" "Accessing ``tb_frame`` raises an :ref:`auditing event ` ``object." "__getattr__`` with arguments ``obj`` and ``\"tb_frame\"``." @@ -1465,41 +1568,41 @@ msgstr "" "存取 ``tb_frame`` 會引發一個附帶引數 ``obj`` 與 ``\"tb_frame\"`` 的\\ :ref:`" "稽核事件 ` ``object.__getattr__``。" -#: ../../reference/datamodel.rst:1316 +#: ../../reference/datamodel.rst:1397 msgid "" "Special writable attribute: :attr:`tb_next` is the next level in the stack " "trace (towards the frame where the exception occurred), or ``None`` if there " "is no next level." msgstr "" -#: ../../reference/datamodel.rst:1320 +#: ../../reference/datamodel.rst:1401 msgid "" "Traceback objects can now be explicitly instantiated from Python code, and " "the ``tb_next`` attribute of existing instances can be updated." msgstr "" -#: ../../reference/datamodel.rst:1326 +#: ../../reference/datamodel.rst:1407 msgid "Slice objects" msgstr "" -#: ../../reference/datamodel.rst:1330 +#: ../../reference/datamodel.rst:1411 msgid "" "Slice objects are used to represent slices for :meth:`~object.__getitem__` " "methods. They are also created by the built-in :func:`slice` function." msgstr "" -#: ../../reference/datamodel.rst:1339 +#: ../../reference/datamodel.rst:1420 msgid "" "Special read-only attributes: :attr:`~slice.start` is the lower bound; :attr:" "`~slice.stop` is the upper bound; :attr:`~slice.step` is the step value; " "each is ``None`` if omitted. These attributes can have any type." msgstr "" -#: ../../reference/datamodel.rst:1343 +#: ../../reference/datamodel.rst:1424 msgid "Slice objects support one method:" msgstr "" -#: ../../reference/datamodel.rst:1347 +#: ../../reference/datamodel.rst:1428 msgid "" "This method takes a single integer argument *length* and computes " "information about the slice that the slice object would describe if applied " @@ -1509,11 +1612,11 @@ msgid "" "a manner consistent with regular slices." msgstr "" -#: ../../reference/datamodel.rst:1356 +#: ../../reference/datamodel.rst:1437 msgid "Static method objects" msgstr "" -#: ../../reference/datamodel.rst:1358 +#: ../../reference/datamodel.rst:1439 msgid "" "Static method objects provide a way of defeating the transformation of " "function objects to method objects described above. A static method object " @@ -1524,11 +1627,11 @@ msgid "" "method objects are created by the built-in :func:`staticmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1368 +#: ../../reference/datamodel.rst:1449 msgid "Class method objects" msgstr "" -#: ../../reference/datamodel.rst:1370 +#: ../../reference/datamodel.rst:1451 msgid "" "A class method object, like a static method object, is a wrapper around " "another object that alters the way in which that object is retrieved from " @@ -1537,11 +1640,11 @@ msgid "" "objects are created by the built-in :func:`classmethod` constructor." msgstr "" -#: ../../reference/datamodel.rst:1380 +#: ../../reference/datamodel.rst:1461 msgid "Special method names" msgstr "" -#: ../../reference/datamodel.rst:1386 +#: ../../reference/datamodel.rst:1467 msgid "" "A class can implement certain operations that are invoked by special syntax " "(such as arithmetic operations or subscripting and slicing) by defining " @@ -1555,7 +1658,7 @@ msgid "" "`TypeError`)." msgstr "" -#: ../../reference/datamodel.rst:1397 +#: ../../reference/datamodel.rst:1478 msgid "" "Setting a special method to ``None`` indicates that the corresponding " "operation is not available. For example, if a class sets :meth:`~object." @@ -1564,7 +1667,7 @@ msgid "" "`~object.__getitem__`). [#]_" msgstr "" -#: ../../reference/datamodel.rst:1403 +#: ../../reference/datamodel.rst:1484 msgid "" "When implementing a class that emulates any built-in type, it is important " "that the emulation only be implemented to the degree that it makes sense for " @@ -1574,11 +1677,11 @@ msgid "" "the W3C's Document Object Model.)" msgstr "" -#: ../../reference/datamodel.rst:1414 +#: ../../reference/datamodel.rst:1495 msgid "Basic customization" msgstr "" -#: ../../reference/datamodel.rst:1420 +#: ../../reference/datamodel.rst:1501 msgid "" "Called to create a new instance of class *cls*. :meth:`__new__` is a static " "method (special-cased so you need not declare it as such) that takes the " @@ -1588,7 +1691,7 @@ msgid "" "new object instance (usually an instance of *cls*)." msgstr "" -#: ../../reference/datamodel.rst:1427 +#: ../../reference/datamodel.rst:1508 msgid "" "Typical implementations create a new instance of the class by invoking the " "superclass's :meth:`__new__` method using ``super().__new__(cls[, ...])`` " @@ -1596,7 +1699,7 @@ msgid "" "necessary before returning it." msgstr "" -#: ../../reference/datamodel.rst:1432 +#: ../../reference/datamodel.rst:1513 msgid "" "If :meth:`__new__` is invoked during object construction and it returns an " "instance of *cls*, then the new instance’s :meth:`__init__` method will be " @@ -1605,13 +1708,13 @@ msgid "" "constructor." msgstr "" -#: ../../reference/datamodel.rst:1437 +#: ../../reference/datamodel.rst:1518 msgid "" "If :meth:`__new__` does not return an instance of *cls*, then the new " "instance's :meth:`__init__` method will not be invoked." msgstr "" -#: ../../reference/datamodel.rst:1440 +#: ../../reference/datamodel.rst:1521 msgid "" ":meth:`__new__` is intended mainly to allow subclasses of immutable types " "(like int, str, or tuple) to customize instance creation. It is also " @@ -1619,7 +1722,7 @@ msgid "" "creation." msgstr "" -#: ../../reference/datamodel.rst:1449 +#: ../../reference/datamodel.rst:1530 msgid "" "Called after the instance has been created (by :meth:`__new__`), but before " "it is returned to the caller. The arguments are those passed to the class " @@ -1629,7 +1732,7 @@ msgid "" "example: ``super().__init__([args...])``." msgstr "" -#: ../../reference/datamodel.rst:1456 +#: ../../reference/datamodel.rst:1537 msgid "" "Because :meth:`__new__` and :meth:`__init__` work together in constructing " "objects (:meth:`__new__` to create it, and :meth:`__init__` to customize " @@ -1637,7 +1740,7 @@ msgid "" "will cause a :exc:`TypeError` to be raised at runtime." msgstr "" -#: ../../reference/datamodel.rst:1469 +#: ../../reference/datamodel.rst:1550 msgid "" "Called when the instance is about to be destroyed. This is also called a " "finalizer or (improperly) a destructor. If a base class has a :meth:" @@ -1646,7 +1749,7 @@ msgid "" "instance." msgstr "" -#: ../../reference/datamodel.rst:1475 +#: ../../reference/datamodel.rst:1556 msgid "" "It is possible (though not recommended!) for the :meth:`__del__` method to " "postpone destruction of the instance by creating a new reference to it. " @@ -1656,20 +1759,20 @@ msgid "" "it once." msgstr "" -#: ../../reference/datamodel.rst:1482 +#: ../../reference/datamodel.rst:1563 msgid "" "It is not guaranteed that :meth:`__del__` methods are called for objects " "that still exist when the interpreter exits." msgstr "" -#: ../../reference/datamodel.rst:1487 +#: ../../reference/datamodel.rst:1568 msgid "" "``del x`` doesn't directly call ``x.__del__()`` --- the former decrements " "the reference count for ``x`` by one, and the latter is only called when " "``x``'s reference count reaches zero." msgstr "" -#: ../../reference/datamodel.rst:1492 +#: ../../reference/datamodel.rst:1573 msgid "" "It is possible for a reference cycle to prevent the reference count of an " "object from going to zero. In this case, the cycle will be later detected " @@ -1680,18 +1783,18 @@ msgid "" "caught in the traceback." msgstr "" -#: ../../reference/datamodel.rst:1502 +#: ../../reference/datamodel.rst:1583 msgid "Documentation for the :mod:`gc` module." msgstr "" -#: ../../reference/datamodel.rst:1506 +#: ../../reference/datamodel.rst:1587 msgid "" "Due to the precarious circumstances under which :meth:`__del__` methods are " "invoked, exceptions that occur during their execution are ignored, and a " "warning is printed to ``sys.stderr`` instead. In particular:" msgstr "" -#: ../../reference/datamodel.rst:1510 +#: ../../reference/datamodel.rst:1591 msgid "" ":meth:`__del__` can be invoked when arbitrary code is being executed, " "including from any arbitrary thread. If :meth:`__del__` needs to take a " @@ -1700,7 +1803,7 @@ msgid "" "`__del__`." msgstr "" -#: ../../reference/datamodel.rst:1516 +#: ../../reference/datamodel.rst:1597 msgid "" ":meth:`__del__` can be executed during interpreter shutdown. As a " "consequence, the global variables it needs to access (including other " @@ -1711,7 +1814,7 @@ msgid "" "still available at the time when the :meth:`__del__` method is called." msgstr "" -#: ../../reference/datamodel.rst:1531 +#: ../../reference/datamodel.rst:1612 msgid "" "Called by the :func:`repr` built-in function to compute the \"official\" " "string representation of an object. If at all possible, this should look " @@ -1723,13 +1826,13 @@ msgid "" "an \"informal\" string representation of instances of that class is required." msgstr "" -#: ../../reference/datamodel.rst:1540 +#: ../../reference/datamodel.rst:1621 msgid "" "This is typically used for debugging, so it is important that the " "representation is information-rich and unambiguous." msgstr "" -#: ../../reference/datamodel.rst:1551 +#: ../../reference/datamodel.rst:1632 msgid "" "Called by :func:`str(object) ` and the built-in functions :func:" "`format` and :func:`print` to compute the \"informal\" or nicely printable " @@ -1737,26 +1840,26 @@ msgid "" "` object." msgstr "" -#: ../../reference/datamodel.rst:1556 +#: ../../reference/datamodel.rst:1637 msgid "" "This method differs from :meth:`object.__repr__` in that there is no " "expectation that :meth:`__str__` return a valid Python expression: a more " "convenient or concise representation can be used." msgstr "" -#: ../../reference/datamodel.rst:1560 +#: ../../reference/datamodel.rst:1641 msgid "" "The default implementation defined by the built-in type :class:`object` " "calls :meth:`object.__repr__`." msgstr "" -#: ../../reference/datamodel.rst:1570 +#: ../../reference/datamodel.rst:1651 msgid "" "Called by :ref:`bytes ` to compute a byte-string representation " "of an object. This should return a :class:`bytes` object." msgstr "" -#: ../../reference/datamodel.rst:1581 +#: ../../reference/datamodel.rst:1662 msgid "" "Called by the :func:`format` built-in function, and by extension, evaluation " "of :ref:`formatted string literals ` and the :meth:`str.format` " @@ -1768,28 +1871,28 @@ msgid "" "formatting option syntax." msgstr "" -#: ../../reference/datamodel.rst:1591 +#: ../../reference/datamodel.rst:1672 msgid "" "See :ref:`formatspec` for a description of the standard formatting syntax." msgstr "" -#: ../../reference/datamodel.rst:1593 +#: ../../reference/datamodel.rst:1674 msgid "The return value must be a string object." msgstr "" -#: ../../reference/datamodel.rst:1595 +#: ../../reference/datamodel.rst:1676 msgid "" "The __format__ method of ``object`` itself raises a :exc:`TypeError` if " "passed any non-empty string." msgstr "" -#: ../../reference/datamodel.rst:1599 +#: ../../reference/datamodel.rst:1680 msgid "" "``object.__format__(x, '')`` is now equivalent to ``str(x)`` rather than " "``format(str(x), '')``." msgstr "" -#: ../../reference/datamodel.rst:1615 +#: ../../reference/datamodel.rst:1696 msgid "" "These are the so-called \"rich comparison\" methods. The correspondence " "between operator symbols and method names is as follows: ``x.__hash__``." msgstr "" -#: ../../reference/datamodel.rst:1704 +#: ../../reference/datamodel.rst:1785 msgid "" "If a class that does not override :meth:`__eq__` wishes to suppress hash " "support, it should include ``__hash__ = None`` in the class definition. A " @@ -1908,7 +2011,7 @@ msgid "" "``isinstance(obj, collections.abc.Hashable)`` call." msgstr "" -#: ../../reference/datamodel.rst:1713 +#: ../../reference/datamodel.rst:1794 msgid "" "By default, the :meth:`__hash__` values of str and bytes objects are " "\"salted\" with an unpredictable random value. Although they remain " @@ -1916,7 +2019,7 @@ msgid "" "between repeated invocations of Python." msgstr "" -#: ../../reference/datamodel.rst:1718 +#: ../../reference/datamodel.rst:1799 msgid "" "This is intended to provide protection against a denial-of-service caused by " "carefully chosen inputs that exploit the worst case performance of a dict " @@ -1924,22 +2027,22 @@ msgid "" "ocert-2011-003.html for details." msgstr "" -#: ../../reference/datamodel.rst:1723 +#: ../../reference/datamodel.rst:1804 msgid "" "Changing hash values affects the iteration order of sets. Python has never " "made guarantees about this ordering (and it typically varies between 32-bit " "and 64-bit builds)." msgstr "" -#: ../../reference/datamodel.rst:1727 +#: ../../reference/datamodel.rst:1808 msgid "See also :envvar:`PYTHONHASHSEED`." msgstr "另請參閱 :envvar:`PYTHONHASHSEED`\\ 。" -#: ../../reference/datamodel.rst:1729 +#: ../../reference/datamodel.rst:1810 msgid "Hash randomization is enabled by default." msgstr "" -#: ../../reference/datamodel.rst:1737 +#: ../../reference/datamodel.rst:1818 msgid "" "Called to implement truth value testing and the built-in operation " "``bool()``; should return ``False`` or ``True``. When this method is not " @@ -1948,18 +2051,18 @@ msgid "" "meth:`!__len__` nor :meth:`!__bool__`, all its instances are considered true." msgstr "" -#: ../../reference/datamodel.rst:1748 +#: ../../reference/datamodel.rst:1829 msgid "Customizing attribute access" msgstr "" -#: ../../reference/datamodel.rst:1750 +#: ../../reference/datamodel.rst:1831 msgid "" "The following methods can be defined to customize the meaning of attribute " "access (use of, assignment to, or deletion of ``x.name``) for class " "instances." msgstr "" -#: ../../reference/datamodel.rst:1758 +#: ../../reference/datamodel.rst:1839 msgid "" "Called when the default attribute access fails with an :exc:`AttributeError` " "(either :meth:`__getattribute__` raises an :exc:`AttributeError` because " @@ -1969,7 +2072,7 @@ msgid "" "attribute value or raise an :exc:`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1765 +#: ../../reference/datamodel.rst:1846 msgid "" "Note that if the attribute is found through the normal mechanism, :meth:" "`__getattr__` is not called. (This is an intentional asymmetry between :" @@ -1982,7 +2085,7 @@ msgid "" "actually get total control over attribute access." msgstr "" -#: ../../reference/datamodel.rst:1778 +#: ../../reference/datamodel.rst:1859 msgid "" "Called unconditionally to implement attribute accesses for instances of the " "class. If the class also defines :meth:`__getattr__`, the latter will not be " @@ -1994,14 +2097,14 @@ msgid "" "example, ``object.__getattribute__(self, name)``." msgstr "" -#: ../../reference/datamodel.rst:1789 +#: ../../reference/datamodel.rst:1870 msgid "" "This method may still be bypassed when looking up special methods as the " "result of implicit invocation via language syntax or built-in functions. " "See :ref:`special-lookup`." msgstr "" -#: ../../reference/datamodel.rst:1793 +#: ../../reference/datamodel.rst:1874 msgid "" "Raises an :ref:`auditing event ` ``object.__getattr__`` with " "arguments ``obj``, ``name``." @@ -2009,27 +2112,27 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__getattr__``。" -#: ../../reference/datamodel.rst:1795 +#: ../../reference/datamodel.rst:1876 msgid "" "For certain sensitive attribute accesses, raises an :ref:`auditing event " "` ``object.__getattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1802 +#: ../../reference/datamodel.rst:1883 msgid "" "Called when an attribute assignment is attempted. This is called instead of " "the normal mechanism (i.e. store the value in the instance dictionary). " "*name* is the attribute name, *value* is the value to be assigned to it." msgstr "" -#: ../../reference/datamodel.rst:1806 +#: ../../reference/datamodel.rst:1887 msgid "" "If :meth:`__setattr__` wants to assign to an instance attribute, it should " "call the base class method with the same name, for example, ``object." "__setattr__(self, name, value)``." msgstr "" -#: ../../reference/datamodel.rst:1810 +#: ../../reference/datamodel.rst:1891 msgid "" "Raises an :ref:`auditing event ` ``object.__setattr__`` with " "arguments ``obj``, ``name``, ``value``." @@ -2037,21 +2140,21 @@ msgstr "" "引發一個附帶引數 ``obj``、``name``、``value`` 的\\ :ref:`稽核事件 " "` ``object.__setattr__``。" -#: ../../reference/datamodel.rst:1812 +#: ../../reference/datamodel.rst:1893 msgid "" "For certain sensitive attribute assignments, raises an :ref:`auditing event " "` ``object.__setattr__`` with arguments ``obj``, ``name``, " "``value``." msgstr "" -#: ../../reference/datamodel.rst:1819 +#: ../../reference/datamodel.rst:1900 msgid "" "Like :meth:`__setattr__` but for attribute deletion instead of assignment. " "This should only be implemented if ``del obj.name`` is meaningful for the " "object." msgstr "" -#: ../../reference/datamodel.rst:1822 +#: ../../reference/datamodel.rst:1903 msgid "" "Raises an :ref:`auditing event ` ``object.__delattr__`` with " "arguments ``obj``, ``name``." @@ -2059,23 +2162,23 @@ msgstr "" "引發一個附帶引數 ``obj``、``name`` 的\\ :ref:`稽核事件 ` ``object." "__delattr__``。" -#: ../../reference/datamodel.rst:1824 +#: ../../reference/datamodel.rst:1905 msgid "" "For certain sensitive attribute deletions, raises an :ref:`auditing event " "` ``object.__delattr__`` with arguments ``obj`` and ``name``." msgstr "" -#: ../../reference/datamodel.rst:1831 +#: ../../reference/datamodel.rst:1912 msgid "" "Called when :func:`dir` is called on the object. A sequence must be " "returned. :func:`dir` converts the returned sequence to a list and sorts it." msgstr "" -#: ../../reference/datamodel.rst:1836 +#: ../../reference/datamodel.rst:1917 msgid "Customizing module attribute access" msgstr "" -#: ../../reference/datamodel.rst:1843 +#: ../../reference/datamodel.rst:1924 msgid "" "Special names ``__getattr__`` and ``__dir__`` can be also used to customize " "access to module attributes. The ``__getattr__`` function at the module " @@ -2087,21 +2190,21 @@ msgid "" "with the attribute name and the result is returned." msgstr "" -#: ../../reference/datamodel.rst:1852 +#: ../../reference/datamodel.rst:1933 msgid "" "The ``__dir__`` function should accept no arguments, and return a sequence " "of strings that represents the names accessible on module. If present, this " "function overrides the standard :func:`dir` search on a module." msgstr "" -#: ../../reference/datamodel.rst:1856 +#: ../../reference/datamodel.rst:1937 msgid "" "For a more fine grained customization of the module behavior (setting " "attributes, properties, etc.), one can set the ``__class__`` attribute of a " "module object to a subclass of :class:`types.ModuleType`. For example::" msgstr "" -#: ../../reference/datamodel.rst:1874 +#: ../../reference/datamodel.rst:1955 msgid "" "Defining module ``__getattr__`` and setting module ``__class__`` only affect " "lookups made using the attribute access syntax -- directly accessing the " @@ -2109,27 +2212,27 @@ msgid "" "module's globals dictionary) is unaffected." msgstr "" -#: ../../reference/datamodel.rst:1879 +#: ../../reference/datamodel.rst:1960 msgid "``__class__`` module attribute is now writable." msgstr "" -#: ../../reference/datamodel.rst:1882 +#: ../../reference/datamodel.rst:1963 msgid "``__getattr__`` and ``__dir__`` module attributes." msgstr "" -#: ../../reference/datamodel.rst:1887 +#: ../../reference/datamodel.rst:1968 msgid ":pep:`562` - Module __getattr__ and __dir__" msgstr ":pep:`562` - 模組 __getattr__ 和 __dir__" -#: ../../reference/datamodel.rst:1888 +#: ../../reference/datamodel.rst:1969 msgid "Describes the ``__getattr__`` and ``__dir__`` functions on modules." msgstr "" -#: ../../reference/datamodel.rst:1894 +#: ../../reference/datamodel.rst:1975 msgid "Implementing Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1896 +#: ../../reference/datamodel.rst:1977 msgid "" "The following methods only apply when an instance of the class containing " "the method (a so-called *descriptor* class) appears in an *owner* class (the " @@ -2139,7 +2242,7 @@ msgid "" "the owner class' :attr:`~object.__dict__`." msgstr "" -#: ../../reference/datamodel.rst:1906 +#: ../../reference/datamodel.rst:1987 msgid "" "Called to get the attribute of the owner class (class attribute access) or " "of an instance of that class (instance attribute access). The optional " @@ -2148,13 +2251,13 @@ msgid "" "accessed through the *owner*." msgstr "" -#: ../../reference/datamodel.rst:1912 +#: ../../reference/datamodel.rst:1993 msgid "" "This method should return the computed attribute value or raise an :exc:" "`AttributeError` exception." msgstr "" -#: ../../reference/datamodel.rst:1915 +#: ../../reference/datamodel.rst:1996 msgid "" ":PEP:`252` specifies that :meth:`__get__` is callable with one or two " "arguments. Python's own built-in descriptors support this specification; " @@ -2164,31 +2267,31 @@ msgid "" "not." msgstr "" -#: ../../reference/datamodel.rst:1924 +#: ../../reference/datamodel.rst:2005 msgid "" "Called to set the attribute on an instance *instance* of the owner class to " "a new value, *value*." msgstr "" -#: ../../reference/datamodel.rst:1927 +#: ../../reference/datamodel.rst:2008 msgid "" "Note, adding :meth:`__set__` or :meth:`__delete__` changes the kind of " "descriptor to a \"data descriptor\". See :ref:`descriptor-invocation` for " "more details." msgstr "" -#: ../../reference/datamodel.rst:1933 +#: ../../reference/datamodel.rst:2014 msgid "" "Called to delete the attribute on an instance *instance* of the owner class." msgstr "" -#: ../../reference/datamodel.rst:1935 +#: ../../reference/datamodel.rst:2016 msgid "" "Instances of descriptors may also have the :attr:`!__objclass__` attribute " "present:" msgstr "" -#: ../../reference/datamodel.rst:1940 +#: ../../reference/datamodel.rst:2021 msgid "" "The attribute :attr:`!__objclass__` is interpreted by the :mod:`inspect` " "module as specifying the class where this object was defined (setting this " @@ -2199,11 +2302,11 @@ msgid "" "are implemented in C)." msgstr "" -#: ../../reference/datamodel.rst:1951 +#: ../../reference/datamodel.rst:2032 msgid "Invoking Descriptors" msgstr "" -#: ../../reference/datamodel.rst:1953 +#: ../../reference/datamodel.rst:2034 msgid "" "In general, a descriptor is an object attribute with \"binding behavior\", " "one whose attribute access has been overridden by methods in the descriptor " @@ -2212,7 +2315,7 @@ msgid "" "is said to be a descriptor." msgstr "" -#: ../../reference/datamodel.rst:1959 +#: ../../reference/datamodel.rst:2040 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -2220,7 +2323,7 @@ msgid "" "continuing through the base classes of ``type(a)`` excluding metaclasses." msgstr "" -#: ../../reference/datamodel.rst:1964 +#: ../../reference/datamodel.rst:2045 msgid "" "However, if the looked-up value is an object defining one of the descriptor " "methods, then Python may override the default behavior and invoke the " @@ -2228,54 +2331,54 @@ msgid "" "depends on which descriptor methods were defined and how they were called." msgstr "" -#: ../../reference/datamodel.rst:1969 +#: ../../reference/datamodel.rst:2050 msgid "" "The starting point for descriptor invocation is a binding, ``a.x``. How the " "arguments are assembled depends on ``a``:" msgstr "" -#: ../../reference/datamodel.rst:1974 +#: ../../reference/datamodel.rst:2055 msgid "Direct Call" msgstr "" -#: ../../reference/datamodel.rst:1973 +#: ../../reference/datamodel.rst:2054 msgid "" "The simplest and least common call is when user code directly invokes a " "descriptor method: ``x.__get__(a)``." msgstr "" -#: ../../reference/datamodel.rst:1978 +#: ../../reference/datamodel.rst:2059 msgid "Instance Binding" msgstr "" -#: ../../reference/datamodel.rst:1977 +#: ../../reference/datamodel.rst:2058 msgid "" "If binding to an object instance, ``a.x`` is transformed into the call: " "``type(a).__dict__['x'].__get__(a, type(a))``." msgstr "" -#: ../../reference/datamodel.rst:1982 +#: ../../reference/datamodel.rst:2063 msgid "Class Binding" msgstr "" -#: ../../reference/datamodel.rst:1981 +#: ../../reference/datamodel.rst:2062 msgid "" "If binding to a class, ``A.x`` is transformed into the call: ``A." "__dict__['x'].__get__(None, A)``." msgstr "" -#: ../../reference/datamodel.rst:1988 +#: ../../reference/datamodel.rst:2069 msgid "Super Binding" msgstr "" -#: ../../reference/datamodel.rst:1985 +#: ../../reference/datamodel.rst:2066 msgid "" "A dotted lookup such as ``super(A, a).x`` searches ``a.__class__.__mro__`` " "for a base class ``B`` following ``A`` and then returns ``B.__dict__['x']." "__get__(a, A)``. If not a descriptor, ``x`` is returned unchanged." msgstr "" -#: ../../reference/datamodel.rst:2022 +#: ../../reference/datamodel.rst:2103 msgid "" "For instance bindings, the precedence of descriptor invocation depends on " "which descriptor methods are defined. A descriptor can define any " @@ -2293,7 +2396,7 @@ msgid "" "instances." msgstr "" -#: ../../reference/datamodel.rst:2037 +#: ../../reference/datamodel.rst:2118 msgid "" "Python methods (including those decorated with :func:`@staticmethod " "` and :func:`@classmethod `) are implemented as " @@ -2302,30 +2405,30 @@ msgid "" "from other instances of the same class." msgstr "" -#: ../../reference/datamodel.rst:2043 +#: ../../reference/datamodel.rst:2124 msgid "" "The :func:`property` function is implemented as a data descriptor. " "Accordingly, instances cannot override the behavior of a property." msgstr "" -#: ../../reference/datamodel.rst:2050 +#: ../../reference/datamodel.rst:2131 msgid "__slots__" msgstr "__slots__" -#: ../../reference/datamodel.rst:2052 +#: ../../reference/datamodel.rst:2133 msgid "" "*__slots__* allow us to explicitly declare data members (like properties) " "and deny the creation of :attr:`~object.__dict__` and *__weakref__* (unless " "explicitly declared in *__slots__* or available in a parent.)" msgstr "" -#: ../../reference/datamodel.rst:2056 +#: ../../reference/datamodel.rst:2137 msgid "" "The space saved over using :attr:`~object.__dict__` can be significant. " "Attribute lookup speed can be significantly improved as well." msgstr "" -#: ../../reference/datamodel.rst:2061 +#: ../../reference/datamodel.rst:2142 msgid "" "This class variable can be assigned a string, iterable, or sequence of " "strings with variable names used by instances. *__slots__* reserves space " @@ -2333,18 +2436,18 @@ msgid "" "`~object.__dict__` and *__weakref__* for each instance." msgstr "" -#: ../../reference/datamodel.rst:2070 +#: ../../reference/datamodel.rst:2151 msgid "Notes on using *__slots__*:" msgstr "" -#: ../../reference/datamodel.rst:2072 +#: ../../reference/datamodel.rst:2153 msgid "" "When inheriting from a class without *__slots__*, the :attr:`~object." "__dict__` and *__weakref__* attribute of the instances will always be " "accessible." msgstr "" -#: ../../reference/datamodel.rst:2076 +#: ../../reference/datamodel.rst:2157 msgid "" "Without a :attr:`~object.__dict__` variable, instances cannot be assigned " "new variables not listed in the *__slots__* definition. Attempts to assign " @@ -2353,7 +2456,7 @@ msgid "" "sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2083 +#: ../../reference/datamodel.rst:2164 msgid "" "Without a *__weakref__* variable for each instance, classes defining " "*__slots__* do not support :mod:`weak references ` to its " @@ -2361,7 +2464,7 @@ msgid "" "to the sequence of strings in the *__slots__* declaration." msgstr "" -#: ../../reference/datamodel.rst:2089 +#: ../../reference/datamodel.rst:2170 msgid "" "*__slots__* are implemented at the class level by creating :ref:`descriptors " "` for each variable name. As a result, class attributes cannot " @@ -2369,7 +2472,7 @@ msgid "" "otherwise, the class attribute would overwrite the descriptor assignment." msgstr "" -#: ../../reference/datamodel.rst:2095 +#: ../../reference/datamodel.rst:2176 msgid "" "The action of a *__slots__* declaration is not limited to the class where it " "is defined. *__slots__* declared in parents are available in child classes. " @@ -2378,7 +2481,7 @@ msgid "" "names of any *additional* slots)." msgstr "" -#: ../../reference/datamodel.rst:2101 +#: ../../reference/datamodel.rst:2182 msgid "" "If a class defines a slot also defined in a base class, the instance " "variable defined by the base class slot is inaccessible (except by " @@ -2387,7 +2490,7 @@ msgid "" "prevent this." msgstr "" -#: ../../reference/datamodel.rst:2106 +#: ../../reference/datamodel.rst:2187 msgid "" ":exc:`TypeError` will be raised if nonempty *__slots__* are defined for a " "class derived from a :c:member:`\"variable-length\" built-in type " @@ -2395,11 +2498,11 @@ msgid "" "`tuple`." msgstr "" -#: ../../reference/datamodel.rst:2111 +#: ../../reference/datamodel.rst:2192 msgid "Any non-string :term:`iterable` may be assigned to *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2113 +#: ../../reference/datamodel.rst:2194 msgid "" "If a :class:`dictionary ` is used to assign *__slots__*, the " "dictionary keys will be used as the slot names. The values of the dictionary " @@ -2407,13 +2510,13 @@ msgid "" "func:`inspect.getdoc` and displayed in the output of :func:`help`." msgstr "" -#: ../../reference/datamodel.rst:2118 +#: ../../reference/datamodel.rst:2199 msgid "" ":attr:`~instance.__class__` assignment works only if both classes have the " "same *__slots__*." msgstr "" -#: ../../reference/datamodel.rst:2121 +#: ../../reference/datamodel.rst:2202 msgid "" ":ref:`Multiple inheritance ` with multiple slotted parent " "classes can be used, but only one parent is allowed to have attributes " @@ -2421,18 +2524,18 @@ msgid "" "raise :exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:2127 +#: ../../reference/datamodel.rst:2208 msgid "" "If an :term:`iterator` is used for *__slots__* then a :term:`descriptor` is " "created for each of the iterator's values. However, the *__slots__* " "attribute will be an empty iterator." msgstr "" -#: ../../reference/datamodel.rst:2135 +#: ../../reference/datamodel.rst:2216 msgid "Customizing class creation" msgstr "" -#: ../../reference/datamodel.rst:2137 +#: ../../reference/datamodel.rst:2218 msgid "" "Whenever a class inherits from another class, :meth:`~object." "__init_subclass__` is called on the parent class. This way, it is possible " @@ -2442,14 +2545,14 @@ msgid "" "future subclasses of the class defining the method." msgstr "" -#: ../../reference/datamodel.rst:2146 +#: ../../reference/datamodel.rst:2227 msgid "" "This method is called whenever the containing class is subclassed. *cls* is " "then the new subclass. If defined as a normal instance method, this method " "is implicitly converted to a class method." msgstr "" -#: ../../reference/datamodel.rst:2150 +#: ../../reference/datamodel.rst:2231 msgid "" "Keyword arguments which are given to a new class are passed to the parent's " "class ``__init_subclass__``. For compatibility with other classes using " @@ -2457,13 +2560,13 @@ msgid "" "pass the others over to the base class, as in::" msgstr "" -#: ../../reference/datamodel.rst:2164 +#: ../../reference/datamodel.rst:2245 msgid "" "The default implementation ``object.__init_subclass__`` does nothing, but " "raises an error if it is called with any arguments." msgstr "" -#: ../../reference/datamodel.rst:2169 +#: ../../reference/datamodel.rst:2250 msgid "" "The metaclass hint ``metaclass`` is consumed by the rest of the type " "machinery, and is never passed to ``__init_subclass__`` implementations. The " @@ -2471,41 +2574,41 @@ msgid "" "``type(cls)``." msgstr "" -#: ../../reference/datamodel.rst:2177 +#: ../../reference/datamodel.rst:2258 msgid "" "When a class is created, :meth:`type.__new__` scans the class variables and " "makes callbacks to those with a :meth:`~object.__set_name__` hook." msgstr "" -#: ../../reference/datamodel.rst:2182 +#: ../../reference/datamodel.rst:2263 msgid "" "Automatically called at the time the owning class *owner* is created. The " "object has been assigned to *name* in that class::" msgstr "" -#: ../../reference/datamodel.rst:2188 +#: ../../reference/datamodel.rst:2269 msgid "" "If the class variable is assigned after the class is created, :meth:" "`__set_name__` will not be called automatically. If needed, :meth:" "`__set_name__` can be called directly::" msgstr "" -#: ../../reference/datamodel.rst:2199 +#: ../../reference/datamodel.rst:2280 msgid "See :ref:`class-object-creation` for more details." msgstr "更多細節請見 :ref:`class-object-creation`\\ 。" -#: ../../reference/datamodel.rst:2207 +#: ../../reference/datamodel.rst:2288 msgid "Metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2214 +#: ../../reference/datamodel.rst:2295 msgid "" "By default, classes are constructed using :func:`type`. The class body is " "executed in a new namespace and the class name is bound locally to the " "result of ``type(name, bases, namespace)``." msgstr "" -#: ../../reference/datamodel.rst:2218 +#: ../../reference/datamodel.rst:2299 msgid "" "The class creation process can be customized by passing the ``metaclass`` " "keyword argument in the class definition line, or by inheriting from an " @@ -2513,41 +2616,41 @@ msgid "" "both ``MyClass`` and ``MySubclass`` are instances of ``Meta``::" msgstr "" -#: ../../reference/datamodel.rst:2232 +#: ../../reference/datamodel.rst:2313 msgid "" "Any other keyword arguments that are specified in the class definition are " "passed through to all metaclass operations described below." msgstr "" -#: ../../reference/datamodel.rst:2235 +#: ../../reference/datamodel.rst:2316 msgid "When a class definition is executed, the following steps occur:" msgstr "" -#: ../../reference/datamodel.rst:2237 +#: ../../reference/datamodel.rst:2318 msgid "MRO entries are resolved;" msgstr "" -#: ../../reference/datamodel.rst:2238 +#: ../../reference/datamodel.rst:2319 msgid "the appropriate metaclass is determined;" msgstr "" -#: ../../reference/datamodel.rst:2239 +#: ../../reference/datamodel.rst:2320 msgid "the class namespace is prepared;" msgstr "" -#: ../../reference/datamodel.rst:2240 +#: ../../reference/datamodel.rst:2321 msgid "the class body is executed;" msgstr "" -#: ../../reference/datamodel.rst:2241 +#: ../../reference/datamodel.rst:2322 msgid "the class object is created." msgstr "" -#: ../../reference/datamodel.rst:2245 +#: ../../reference/datamodel.rst:2326 msgid "Resolving MRO entries" msgstr "" -#: ../../reference/datamodel.rst:2249 +#: ../../reference/datamodel.rst:2330 msgid "" "If a base that appears in a class definition is not an instance of :class:" "`type`, then an :meth:`!__mro_entries__` method is searched on the base. If " @@ -2559,59 +2662,59 @@ msgid "" "is ignored." msgstr "" -#: ../../reference/datamodel.rst:2261 +#: ../../reference/datamodel.rst:2342 msgid ":func:`types.resolve_bases`" msgstr "" -#: ../../reference/datamodel.rst:2261 +#: ../../reference/datamodel.rst:2342 msgid "Dynamically resolve bases that are not instances of :class:`type`." msgstr "" -#: ../../reference/datamodel.rst:2265 +#: ../../reference/datamodel.rst:2346 msgid ":func:`types.get_original_bases`" msgstr "" -#: ../../reference/datamodel.rst:2264 +#: ../../reference/datamodel.rst:2345 msgid "" "Retrieve a class's \"original bases\" prior to modifications by :meth:" "`~object.__mro_entries__`." msgstr "" -#: ../../reference/datamodel.rst:2267 +#: ../../reference/datamodel.rst:2348 msgid ":pep:`560`" msgstr "" -#: ../../reference/datamodel.rst:2268 +#: ../../reference/datamodel.rst:2349 msgid "Core support for typing module and generic types." msgstr "" -#: ../../reference/datamodel.rst:2272 +#: ../../reference/datamodel.rst:2353 msgid "Determining the appropriate metaclass" msgstr "" -#: ../../reference/datamodel.rst:2276 +#: ../../reference/datamodel.rst:2357 msgid "" "The appropriate metaclass for a class definition is determined as follows:" msgstr "" -#: ../../reference/datamodel.rst:2278 +#: ../../reference/datamodel.rst:2359 msgid "" "if no bases and no explicit metaclass are given, then :func:`type` is used;" msgstr "" -#: ../../reference/datamodel.rst:2279 +#: ../../reference/datamodel.rst:2360 msgid "" "if an explicit metaclass is given and it is *not* an instance of :func:" "`type`, then it is used directly as the metaclass;" msgstr "" -#: ../../reference/datamodel.rst:2281 +#: ../../reference/datamodel.rst:2362 msgid "" "if an instance of :func:`type` is given as the explicit metaclass, or bases " "are defined, then the most derived metaclass is used." msgstr "" -#: ../../reference/datamodel.rst:2284 +#: ../../reference/datamodel.rst:2365 msgid "" "The most derived metaclass is selected from the explicitly specified " "metaclass (if any) and the metaclasses (i.e. ``type(cls)``) of all specified " @@ -2620,11 +2723,11 @@ msgid "" "that criterion, then the class definition will fail with ``TypeError``." msgstr "" -#: ../../reference/datamodel.rst:2294 +#: ../../reference/datamodel.rst:2375 msgid "Preparing the class namespace" msgstr "" -#: ../../reference/datamodel.rst:2299 +#: ../../reference/datamodel.rst:2380 msgid "" "Once the appropriate metaclass has been identified, then the class namespace " "is prepared. If the metaclass has a ``__prepare__`` attribute, it is called " @@ -2636,25 +2739,25 @@ msgid "" "copied into a new ``dict``." msgstr "" -#: ../../reference/datamodel.rst:2308 +#: ../../reference/datamodel.rst:2389 msgid "" "If the metaclass has no ``__prepare__`` attribute, then the class namespace " "is initialised as an empty ordered mapping." msgstr "" -#: ../../reference/datamodel.rst:2313 +#: ../../reference/datamodel.rst:2394 msgid ":pep:`3115` - Metaclasses in Python 3000" msgstr "" -#: ../../reference/datamodel.rst:2314 +#: ../../reference/datamodel.rst:2395 msgid "Introduced the ``__prepare__`` namespace hook" msgstr "" -#: ../../reference/datamodel.rst:2318 +#: ../../reference/datamodel.rst:2399 msgid "Executing the class body" msgstr "" -#: ../../reference/datamodel.rst:2323 +#: ../../reference/datamodel.rst:2404 msgid "" "The class body is executed (approximately) as ``exec(body, globals(), " "namespace)``. The key difference from a normal call to :func:`exec` is that " @@ -2663,7 +2766,7 @@ msgid "" "inside a function." msgstr "" -#: ../../reference/datamodel.rst:2329 +#: ../../reference/datamodel.rst:2410 msgid "" "However, even when the class definition occurs inside the function, methods " "defined inside the class still cannot see names defined at the class scope. " @@ -2672,11 +2775,11 @@ msgid "" "reference described in the next section." msgstr "" -#: ../../reference/datamodel.rst:2338 +#: ../../reference/datamodel.rst:2419 msgid "Creating the class object" msgstr "" -#: ../../reference/datamodel.rst:2345 +#: ../../reference/datamodel.rst:2426 msgid "" "Once the class namespace has been populated by executing the class body, the " "class object is created by calling ``metaclass(name, bases, namespace, " @@ -2684,7 +2787,7 @@ msgid "" "to ``__prepare__``)." msgstr "" -#: ../../reference/datamodel.rst:2350 +#: ../../reference/datamodel.rst:2431 msgid "" "This class object is the one that will be referenced by the zero-argument " "form of :func:`super`. ``__class__`` is an implicit closure reference " @@ -2695,7 +2798,7 @@ msgid "" "is identified based on the first argument passed to the method." msgstr "" -#: ../../reference/datamodel.rst:2360 +#: ../../reference/datamodel.rst:2441 msgid "" "In CPython 3.6 and later, the ``__class__`` cell is passed to the metaclass " "as a ``__classcell__`` entry in the class namespace. If present, this must " @@ -2704,39 +2807,39 @@ msgid "" "in Python 3.8." msgstr "" -#: ../../reference/datamodel.rst:2366 +#: ../../reference/datamodel.rst:2447 msgid "" "When using the default metaclass :class:`type`, or any metaclass that " "ultimately calls ``type.__new__``, the following additional customization " "steps are invoked after creating the class object:" msgstr "" -#: ../../reference/datamodel.rst:2370 +#: ../../reference/datamodel.rst:2451 msgid "" "The ``type.__new__`` method collects all of the attributes in the class " "namespace that define a :meth:`~object.__set_name__` method;" msgstr "" -#: ../../reference/datamodel.rst:2372 +#: ../../reference/datamodel.rst:2453 msgid "" "Those ``__set_name__`` methods are called with the class being defined and " "the assigned name of that particular attribute;" msgstr "" -#: ../../reference/datamodel.rst:2374 +#: ../../reference/datamodel.rst:2455 msgid "" "The :meth:`~object.__init_subclass__` hook is called on the immediate parent " "of the new class in its method resolution order." msgstr "" -#: ../../reference/datamodel.rst:2377 +#: ../../reference/datamodel.rst:2458 msgid "" "After the class object is created, it is passed to the class decorators " "included in the class definition (if any) and the resulting object is bound " "in the local namespace as the defined class." msgstr "" -#: ../../reference/datamodel.rst:2381 +#: ../../reference/datamodel.rst:2462 msgid "" "When a new class is created by ``type.__new__``, the object provided as the " "namespace parameter is copied to a new ordered mapping and the original " @@ -2744,19 +2847,19 @@ msgid "" "becomes the :attr:`~object.__dict__` attribute of the class object." msgstr "" -#: ../../reference/datamodel.rst:2388 +#: ../../reference/datamodel.rst:2469 msgid ":pep:`3135` - New super" msgstr "" -#: ../../reference/datamodel.rst:2389 +#: ../../reference/datamodel.rst:2470 msgid "Describes the implicit ``__class__`` closure reference" msgstr "" -#: ../../reference/datamodel.rst:2393 +#: ../../reference/datamodel.rst:2474 msgid "Uses for metaclasses" msgstr "" -#: ../../reference/datamodel.rst:2395 +#: ../../reference/datamodel.rst:2476 msgid "" "The potential uses for metaclasses are boundless. Some ideas that have been " "explored include enum, logging, interface checking, automatic delegation, " @@ -2764,17 +2867,17 @@ msgid "" "locking/synchronization." msgstr "" -#: ../../reference/datamodel.rst:2402 +#: ../../reference/datamodel.rst:2483 msgid "Customizing instance and subclass checks" msgstr "" -#: ../../reference/datamodel.rst:2404 +#: ../../reference/datamodel.rst:2485 msgid "" "The following methods are used to override the default behavior of the :func:" "`isinstance` and :func:`issubclass` built-in functions." msgstr "" -#: ../../reference/datamodel.rst:2407 +#: ../../reference/datamodel.rst:2488 msgid "" "In particular, the metaclass :class:`abc.ABCMeta` implements these methods " "in order to allow the addition of Abstract Base Classes (ABCs) as \"virtual " @@ -2782,21 +2885,21 @@ msgid "" "other ABCs." msgstr "" -#: ../../reference/datamodel.rst:2414 +#: ../../reference/datamodel.rst:2495 msgid "" "Return true if *instance* should be considered a (direct or indirect) " "instance of *class*. If defined, called to implement ``isinstance(instance, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2421 +#: ../../reference/datamodel.rst:2502 msgid "" "Return true if *subclass* should be considered a (direct or indirect) " "subclass of *class*. If defined, called to implement ``issubclass(subclass, " "class)``." msgstr "" -#: ../../reference/datamodel.rst:2426 +#: ../../reference/datamodel.rst:2507 msgid "" "Note that these methods are looked up on the type (metaclass) of a class. " "They cannot be defined as class methods in the actual class. This is " @@ -2804,11 +2907,11 @@ msgid "" "only in this case the instance is itself a class." msgstr "" -#: ../../reference/datamodel.rst:2437 +#: ../../reference/datamodel.rst:2518 msgid ":pep:`3119` - Introducing Abstract Base Classes" msgstr "" -#: ../../reference/datamodel.rst:2434 +#: ../../reference/datamodel.rst:2515 msgid "" "Includes the specification for customizing :func:`isinstance` and :func:" "`issubclass` behavior through :meth:`~class.__instancecheck__` and :meth:" @@ -2817,11 +2920,11 @@ msgid "" "language." msgstr "" -#: ../../reference/datamodel.rst:2442 +#: ../../reference/datamodel.rst:2523 msgid "Emulating generic types" msgstr "" -#: ../../reference/datamodel.rst:2444 +#: ../../reference/datamodel.rst:2525 msgid "" "When using :term:`type annotations`, it is often useful to " "*parameterize* a :term:`generic type` using Python's square-brackets " @@ -2829,65 +2932,65 @@ msgid "" "a :class:`list` in which all the elements are of type :class:`int`." msgstr "" -#: ../../reference/datamodel.rst:2452 +#: ../../reference/datamodel.rst:2533 msgid ":pep:`484` - Type Hints" msgstr "" -#: ../../reference/datamodel.rst:2452 +#: ../../reference/datamodel.rst:2533 msgid "Introducing Python's framework for type annotations" msgstr "" -#: ../../reference/datamodel.rst:2455 +#: ../../reference/datamodel.rst:2536 msgid ":ref:`Generic Alias Types`" msgstr "" -#: ../../reference/datamodel.rst:2455 +#: ../../reference/datamodel.rst:2536 msgid "Documentation for objects representing parameterized generic classes" msgstr "" -#: ../../reference/datamodel.rst:2458 +#: ../../reference/datamodel.rst:2539 msgid "" ":ref:`Generics`, :ref:`user-defined generics` and :" "class:`typing.Generic`" msgstr "" -#: ../../reference/datamodel.rst:2458 +#: ../../reference/datamodel.rst:2539 msgid "" "Documentation on how to implement generic classes that can be parameterized " "at runtime and understood by static type-checkers." msgstr "" -#: ../../reference/datamodel.rst:2461 +#: ../../reference/datamodel.rst:2542 msgid "" "A class can *generally* only be parameterized if it defines the special " "class method ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2466 +#: ../../reference/datamodel.rst:2547 msgid "" "Return an object representing the specialization of a generic class by type " "arguments found in *key*." msgstr "" -#: ../../reference/datamodel.rst:2469 +#: ../../reference/datamodel.rst:2550 msgid "" "When defined on a class, ``__class_getitem__()`` is automatically a class " "method. As such, there is no need for it to be decorated with :func:" "`@classmethod` when it is defined." msgstr "" -#: ../../reference/datamodel.rst:2475 +#: ../../reference/datamodel.rst:2556 msgid "The purpose of *__class_getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2477 +#: ../../reference/datamodel.rst:2558 msgid "" "The purpose of :meth:`~object.__class_getitem__` is to allow runtime " "parameterization of standard-library generic classes in order to more easily " "apply :term:`type hints` to these classes." msgstr "" -#: ../../reference/datamodel.rst:2481 +#: ../../reference/datamodel.rst:2562 msgid "" "To implement custom generic classes that can be parameterized at runtime and " "understood by static type-checkers, users should either inherit from a " @@ -2896,7 +2999,7 @@ msgid "" "own implementation of ``__class_getitem__()``." msgstr "" -#: ../../reference/datamodel.rst:2487 +#: ../../reference/datamodel.rst:2568 msgid "" "Custom implementations of :meth:`~object.__class_getitem__` on classes " "defined outside of the standard library may not be understood by third-party " @@ -2904,11 +3007,11 @@ msgid "" "purposes other than type hinting is discouraged." msgstr "" -#: ../../reference/datamodel.rst:2497 +#: ../../reference/datamodel.rst:2578 msgid "*__class_getitem__* versus *__getitem__*" msgstr "" -#: ../../reference/datamodel.rst:2499 +#: ../../reference/datamodel.rst:2580 msgid "" "Usually, the :ref:`subscription` of an object using square " "brackets will call the :meth:`~object.__getitem__` instance method defined " @@ -2918,14 +3021,14 @@ msgid "" "genericalias>` object if it is properly defined." msgstr "" -#: ../../reference/datamodel.rst:2506 +#: ../../reference/datamodel.rst:2587 msgid "" "Presented with the :term:`expression` ``obj[x]``, the Python interpreter " "follows something like the following process to decide whether :meth:" "`~object.__getitem__` or :meth:`~object.__class_getitem__` should be called::" msgstr "" -#: ../../reference/datamodel.rst:2534 +#: ../../reference/datamodel.rst:2615 msgid "" "In Python, all classes are themselves instances of other classes. The class " "of a class is known as that class's :term:`metaclass`, and most classes have " @@ -2935,40 +3038,40 @@ msgid "" "__class_getitem__` being called::" msgstr "" -#: ../../reference/datamodel.rst:2553 +#: ../../reference/datamodel.rst:2634 msgid "" "However, if a class has a custom metaclass that defines :meth:`~object." "__getitem__`, subscribing the class may result in different behaviour. An " "example of this can be found in the :mod:`enum` module::" msgstr "" -#: ../../reference/datamodel.rst:2578 +#: ../../reference/datamodel.rst:2659 msgid ":pep:`560` - Core Support for typing module and generic types" msgstr "" -#: ../../reference/datamodel.rst:2577 +#: ../../reference/datamodel.rst:2658 msgid "" "Introducing :meth:`~object.__class_getitem__`, and outlining when a :ref:" "`subscription` results in ``__class_getitem__()`` being " "called instead of :meth:`~object.__getitem__`" msgstr "" -#: ../../reference/datamodel.rst:2585 +#: ../../reference/datamodel.rst:2666 msgid "Emulating callable objects" msgstr "" -#: ../../reference/datamodel.rst:2592 +#: ../../reference/datamodel.rst:2673 msgid "" "Called when the instance is \"called\" as a function; if this method is " "defined, ``x(arg1, arg2, ...)`` roughly translates to ``type(x).__call__(x, " "arg1, ...)``." msgstr "" -#: ../../reference/datamodel.rst:2599 +#: ../../reference/datamodel.rst:2680 msgid "Emulating container types" msgstr "" -#: ../../reference/datamodel.rst:2601 +#: ../../reference/datamodel.rst:2682 msgid "" "The following methods can be defined to implement container objects. " "Containers usually are :term:`sequences ` (such as :class:`lists " @@ -3004,7 +3107,7 @@ msgid "" "should iterate through the values." msgstr "" -#: ../../reference/datamodel.rst:2642 +#: ../../reference/datamodel.rst:2723 msgid "" "Called to implement the built-in function :func:`len`. Should return the " "length of the object, an integer ``>=`` 0. Also, an object that doesn't " @@ -3012,7 +3115,7 @@ msgid "" "returns zero is considered to be false in a Boolean context." msgstr "" -#: ../../reference/datamodel.rst:2649 +#: ../../reference/datamodel.rst:2730 msgid "" "In CPython, the length is required to be at most :data:`sys.maxsize`. If the " "length is larger than :data:`!sys.maxsize` some features (such as :func:" @@ -3021,7 +3124,7 @@ msgid "" "`~object.__bool__` method." msgstr "" -#: ../../reference/datamodel.rst:2658 +#: ../../reference/datamodel.rst:2739 msgid "" "Called to implement :func:`operator.length_hint`. Should return an estimated " "length for the object (which may be greater or less than the actual length). " @@ -3031,20 +3134,20 @@ msgid "" "never required for correctness." msgstr "" -#: ../../reference/datamodel.rst:2672 +#: ../../reference/datamodel.rst:2753 msgid "" "Slicing is done exclusively with the following three methods. A call like ::" msgstr "" -#: ../../reference/datamodel.rst:2676 +#: ../../reference/datamodel.rst:2757 msgid "is translated to ::" msgstr "" -#: ../../reference/datamodel.rst:2680 +#: ../../reference/datamodel.rst:2761 msgid "and so forth. Missing slice items are always filled in with ``None``." msgstr "" -#: ../../reference/datamodel.rst:2685 +#: ../../reference/datamodel.rst:2766 msgid "" "Called to implement evaluation of ``self[key]``. For :term:`sequence` types, " "the accepted keys should be integers and slice objects. Note that the " @@ -3057,20 +3160,20 @@ msgid "" "`KeyError` should be raised." msgstr "" -#: ../../reference/datamodel.rst:2697 +#: ../../reference/datamodel.rst:2778 msgid "" ":keyword:`for` loops expect that an :exc:`IndexError` will be raised for " "illegal indexes to allow proper detection of the end of the sequence." msgstr "" -#: ../../reference/datamodel.rst:2702 +#: ../../reference/datamodel.rst:2783 msgid "" "When :ref:`subscripting` a *class*, the special class method :" "meth:`~object.__class_getitem__` may be called instead of ``__getitem__()``. " "See :ref:`classgetitem-versus-getitem` for more details." msgstr "" -#: ../../reference/datamodel.rst:2710 +#: ../../reference/datamodel.rst:2791 msgid "" "Called to implement assignment to ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3079,7 +3182,7 @@ msgid "" "for improper *key* values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2719 +#: ../../reference/datamodel.rst:2800 msgid "" "Called to implement deletion of ``self[key]``. Same note as for :meth:" "`__getitem__`. This should only be implemented for mappings if the objects " @@ -3088,13 +3191,13 @@ msgid "" "values as for the :meth:`__getitem__` method." msgstr "" -#: ../../reference/datamodel.rst:2728 +#: ../../reference/datamodel.rst:2809 msgid "" "Called by :class:`dict`\\ .\\ :meth:`__getitem__` to implement ``self[key]`` " "for dict subclasses when key is not in the dictionary." msgstr "" -#: ../../reference/datamodel.rst:2734 +#: ../../reference/datamodel.rst:2815 msgid "" "This method is called when an :term:`iterator` is required for a container. " "This method should return a new iterator object that can iterate over all " @@ -3102,14 +3205,14 @@ msgid "" "of the container." msgstr "" -#: ../../reference/datamodel.rst:2742 +#: ../../reference/datamodel.rst:2823 msgid "" "Called (if present) by the :func:`reversed` built-in to implement reverse " "iteration. It should return a new iterator object that iterates over all " "the objects in the container in reverse order." msgstr "" -#: ../../reference/datamodel.rst:2746 +#: ../../reference/datamodel.rst:2827 msgid "" "If the :meth:`__reversed__` method is not provided, the :func:`reversed` " "built-in will fall back to using the sequence protocol (:meth:`__len__` and :" @@ -3118,7 +3221,7 @@ msgid "" "more efficient than the one provided by :func:`reversed`." msgstr "" -#: ../../reference/datamodel.rst:2753 +#: ../../reference/datamodel.rst:2834 msgid "" "The membership test operators (:keyword:`in` and :keyword:`not in`) are " "normally implemented as an iteration through a container. However, container " @@ -3126,14 +3229,14 @@ msgid "" "implementation, which also does not require the object be iterable." msgstr "" -#: ../../reference/datamodel.rst:2760 +#: ../../reference/datamodel.rst:2841 msgid "" "Called to implement membership test operators. Should return true if *item* " "is in *self*, false otherwise. For mapping objects, this should consider " "the keys of the mapping rather than the values or the key-item pairs." msgstr "" -#: ../../reference/datamodel.rst:2764 +#: ../../reference/datamodel.rst:2845 msgid "" "For objects that don't define :meth:`__contains__`, the membership test " "first tries iteration via :meth:`__iter__`, then the old sequence iteration " @@ -3141,11 +3244,11 @@ msgid "" "reference `." msgstr "" -#: ../../reference/datamodel.rst:2773 +#: ../../reference/datamodel.rst:2854 msgid "Emulating numeric types" msgstr "" -#: ../../reference/datamodel.rst:2775 +#: ../../reference/datamodel.rst:2856 msgid "" "The following methods can be defined to emulate numeric objects. Methods " "corresponding to operations that are not supported by the particular kind of " @@ -3153,7 +3256,7 @@ msgid "" "should be left undefined." msgstr "" -#: ../../reference/datamodel.rst:2801 +#: ../../reference/datamodel.rst:2882 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3167,13 +3270,13 @@ msgid "" "function is to be supported." msgstr "" -#: ../../reference/datamodel.rst:2812 +#: ../../reference/datamodel.rst:2893 msgid "" "If one of those methods does not support the operation with the supplied " "arguments, it should return ``NotImplemented``." msgstr "" -#: ../../reference/datamodel.rst:2835 +#: ../../reference/datamodel.rst:2916 msgid "" "These methods are called to implement the binary arithmetic operations " "(``+``, ``-``, ``*``, ``@``, ``/``, ``//``, ``%``, :func:`divmod`, :func:" @@ -3186,13 +3289,13 @@ msgid "" "*NotImplemented*." msgstr "" -#: ../../reference/datamodel.rst:2847 +#: ../../reference/datamodel.rst:2928 msgid "" "Note that ternary :func:`pow` will not try calling :meth:`__rpow__` (the " "coercion rules would become too complicated)." msgstr "" -#: ../../reference/datamodel.rst:2852 +#: ../../reference/datamodel.rst:2933 msgid "" "If the right operand's type is a subclass of the left operand's type and " "that subclass provides a different implementation of the reflected method " @@ -3201,7 +3304,7 @@ msgid "" "ancestors' operations." msgstr "" -#: ../../reference/datamodel.rst:2873 +#: ../../reference/datamodel.rst:2954 msgid "" "These methods are called to implement the augmented arithmetic assignments " "(``+=``, ``-=``, ``*=``, ``@=``, ``/=``, ``//=``, ``%=``, ``**=``, ``<<=``, " @@ -3217,19 +3320,19 @@ msgid "" "fact part of the data model." msgstr "" -#: ../../reference/datamodel.rst:2894 +#: ../../reference/datamodel.rst:2975 msgid "" "Called to implement the unary arithmetic operations (``-``, ``+``, :func:" "`abs` and ``~``)." msgstr "" -#: ../../reference/datamodel.rst:2907 +#: ../../reference/datamodel.rst:2988 msgid "" "Called to implement the built-in functions :func:`complex`, :func:`int` and :" "func:`float`. Should return a value of the appropriate type." msgstr "" -#: ../../reference/datamodel.rst:2914 +#: ../../reference/datamodel.rst:2995 msgid "" "Called to implement :func:`operator.index`, and whenever Python needs to " "losslessly convert the numeric object to an integer object (such as in " @@ -3238,14 +3341,14 @@ msgid "" "integer type. Must return an integer." msgstr "" -#: ../../reference/datamodel.rst:2920 +#: ../../reference/datamodel.rst:3001 msgid "" "If :meth:`__int__`, :meth:`__float__` and :meth:`__complex__` are not " "defined then corresponding built-in functions :func:`int`, :func:`float` " "and :func:`complex` fall back to :meth:`__index__`." msgstr "" -#: ../../reference/datamodel.rst:2932 +#: ../../reference/datamodel.rst:3013 msgid "" "Called to implement the built-in function :func:`round` and :mod:`math` " "functions :func:`~math.trunc`, :func:`~math.floor` and :func:`~math.ceil`. " @@ -3254,21 +3357,21 @@ msgid "" "(typically an :class:`int`)." msgstr "" -#: ../../reference/datamodel.rst:2938 +#: ../../reference/datamodel.rst:3019 msgid "" "The built-in function :func:`int` falls back to :meth:`__trunc__` if " "neither :meth:`__int__` nor :meth:`__index__` is defined." msgstr "" -#: ../../reference/datamodel.rst:2941 +#: ../../reference/datamodel.rst:3022 msgid "The delegation of :func:`int` to :meth:`__trunc__` is deprecated." msgstr "" -#: ../../reference/datamodel.rst:2948 +#: ../../reference/datamodel.rst:3029 msgid "With Statement Context Managers" msgstr "" -#: ../../reference/datamodel.rst:2950 +#: ../../reference/datamodel.rst:3031 msgid "" "A :dfn:`context manager` is an object that defines the runtime context to be " "established when executing a :keyword:`with` statement. The context manager " @@ -3278,32 +3381,32 @@ msgid "" "can also be used by directly invoking their methods." msgstr "" -#: ../../reference/datamodel.rst:2961 +#: ../../reference/datamodel.rst:3042 msgid "" "Typical uses of context managers include saving and restoring various kinds " "of global state, locking and unlocking resources, closing opened files, etc." msgstr "" -#: ../../reference/datamodel.rst:2964 +#: ../../reference/datamodel.rst:3045 msgid "" "For more information on context managers, see :ref:`typecontextmanager`." msgstr "" -#: ../../reference/datamodel.rst:2969 +#: ../../reference/datamodel.rst:3050 msgid "" "Enter the runtime context related to this object. The :keyword:`with` " "statement will bind this method's return value to the target(s) specified in " "the :keyword:`!as` clause of the statement, if any." msgstr "" -#: ../../reference/datamodel.rst:2976 +#: ../../reference/datamodel.rst:3057 msgid "" "Exit the runtime context related to this object. The parameters describe the " "exception that caused the context to be exited. If the context was exited " "without an exception, all three arguments will be :const:`None`." msgstr "" -#: ../../reference/datamodel.rst:2980 +#: ../../reference/datamodel.rst:3061 msgid "" "If an exception is supplied, and the method wishes to suppress the exception " "(i.e., prevent it from being propagated), it should return a true value. " @@ -3311,27 +3414,27 @@ msgid "" "method." msgstr "" -#: ../../reference/datamodel.rst:2984 +#: ../../reference/datamodel.rst:3065 msgid "" "Note that :meth:`~object.__exit__` methods should not reraise the passed-in " "exception; this is the caller's responsibility." msgstr "" -#: ../../reference/datamodel.rst:2991 +#: ../../reference/datamodel.rst:3072 msgid ":pep:`343` - The \"with\" statement" msgstr "" -#: ../../reference/datamodel.rst:2991 +#: ../../reference/datamodel.rst:3072 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:2998 +#: ../../reference/datamodel.rst:3079 msgid "Customizing positional arguments in class pattern matching" msgstr "" -#: ../../reference/datamodel.rst:3000 +#: ../../reference/datamodel.rst:3081 msgid "" "When using a class name in a pattern, positional arguments in the pattern " "are not allowed by default, i.e. ``case MyClass(x, y)`` is typically invalid " @@ -3339,7 +3442,7 @@ msgid "" "pattern, the class needs to define a *__match_args__* attribute." msgstr "" -#: ../../reference/datamodel.rst:3007 +#: ../../reference/datamodel.rst:3088 msgid "" "This class variable can be assigned a tuple of strings. When this class is " "used in a class pattern with positional arguments, each positional argument " @@ -3348,7 +3451,7 @@ msgid "" "to setting it to ``()``." msgstr "" -#: ../../reference/datamodel.rst:3013 +#: ../../reference/datamodel.rst:3094 msgid "" "For example, if ``MyClass.__match_args__`` is ``(\"left\", \"center\", " "\"right\")`` that means that ``case MyClass(x, y)`` is equivalent to ``case " @@ -3358,19 +3461,19 @@ msgid "" "exc:`TypeError`." msgstr "" -#: ../../reference/datamodel.rst:3023 +#: ../../reference/datamodel.rst:3104 msgid ":pep:`634` - Structural Pattern Matching" msgstr "" -#: ../../reference/datamodel.rst:3024 +#: ../../reference/datamodel.rst:3105 msgid "The specification for the Python ``match`` statement." msgstr "" -#: ../../reference/datamodel.rst:3030 +#: ../../reference/datamodel.rst:3111 msgid "Emulating buffer types" msgstr "" -#: ../../reference/datamodel.rst:3032 +#: ../../reference/datamodel.rst:3113 msgid "" "The :ref:`buffer protocol ` provides a way for Python objects " "to expose efficient access to a low-level memory array. This protocol is " @@ -3378,13 +3481,13 @@ msgid "" "and third-party libraries may define additional buffer types." msgstr "" -#: ../../reference/datamodel.rst:3037 +#: ../../reference/datamodel.rst:3118 msgid "" "While buffer types are usually implemented in C, it is also possible to " "implement the protocol in Python." msgstr "" -#: ../../reference/datamodel.rst:3042 +#: ../../reference/datamodel.rst:3123 msgid "" "Called when a buffer is requested from *self* (for example, by the :class:" "`memoryview` constructor). The *flags* argument is an integer representing " @@ -3394,7 +3497,7 @@ msgid "" "`memoryview` object." msgstr "" -#: ../../reference/datamodel.rst:3051 +#: ../../reference/datamodel.rst:3132 msgid "" "Called when a buffer is no longer needed. The *buffer* argument is a :class:" "`memoryview` object that was previously returned by :meth:`~object." @@ -3403,28 +3506,28 @@ msgid "" "to perform any cleanup are not required to implement this method." msgstr "" -#: ../../reference/datamodel.rst:3063 +#: ../../reference/datamodel.rst:3144 msgid ":pep:`688` - Making the buffer protocol accessible in Python" msgstr "" -#: ../../reference/datamodel.rst:3063 +#: ../../reference/datamodel.rst:3144 msgid "" "Introduces the Python ``__buffer__`` and ``__release_buffer__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3065 +#: ../../reference/datamodel.rst:3146 msgid ":class:`collections.abc.Buffer`" msgstr "" -#: ../../reference/datamodel.rst:3066 +#: ../../reference/datamodel.rst:3147 msgid "ABC for buffer types." msgstr "" -#: ../../reference/datamodel.rst:3071 +#: ../../reference/datamodel.rst:3152 msgid "Special method lookup" msgstr "" -#: ../../reference/datamodel.rst:3073 +#: ../../reference/datamodel.rst:3154 msgid "" "For custom classes, implicit invocations of special methods are only " "guaranteed to work correctly if defined on an object's type, not in the " @@ -3432,7 +3535,7 @@ msgid "" "following code raises an exception::" msgstr "" -#: ../../reference/datamodel.rst:3088 +#: ../../reference/datamodel.rst:3169 msgid "" "The rationale behind this behaviour lies with a number of special methods " "such as :meth:`~object.__hash__` and :meth:`~object.__repr__` that are " @@ -3441,21 +3544,21 @@ msgid "" "invoked on the type object itself::" msgstr "" -#: ../../reference/datamodel.rst:3102 +#: ../../reference/datamodel.rst:3183 msgid "" "Incorrectly attempting to invoke an unbound method of a class in this way is " "sometimes referred to as 'metaclass confusion', and is avoided by bypassing " "the instance when looking up special methods::" msgstr "" -#: ../../reference/datamodel.rst:3111 +#: ../../reference/datamodel.rst:3192 msgid "" "In addition to bypassing any instance attributes in the interest of " "correctness, implicit special method lookup generally also bypasses the :" "meth:`~object.__getattribute__` method even of the object's metaclass::" msgstr "" -#: ../../reference/datamodel.rst:3137 +#: ../../reference/datamodel.rst:3218 msgid "" "Bypassing the :meth:`~object.__getattribute__` machinery in this fashion " "provides significant scope for speed optimisations within the interpreter, " @@ -3464,36 +3567,36 @@ msgid "" "consistently invoked by the interpreter)." msgstr "" -#: ../../reference/datamodel.rst:3148 +#: ../../reference/datamodel.rst:3229 msgid "Coroutines" msgstr "協程" -#: ../../reference/datamodel.rst:3152 +#: ../../reference/datamodel.rst:3233 msgid "Awaitable Objects" msgstr "" -#: ../../reference/datamodel.rst:3154 +#: ../../reference/datamodel.rst:3235 msgid "" "An :term:`awaitable` object generally implements an :meth:`~object." "__await__` method. :term:`Coroutine objects ` returned from :" "keyword:`async def` functions are awaitable." msgstr "" -#: ../../reference/datamodel.rst:3160 +#: ../../reference/datamodel.rst:3241 msgid "" "The :term:`generator iterator` objects returned from generators decorated " "with :func:`types.coroutine` are also awaitable, but they do not implement :" "meth:`~object.__await__`." msgstr "" -#: ../../reference/datamodel.rst:3166 +#: ../../reference/datamodel.rst:3247 msgid "" "Must return an :term:`iterator`. Should be used to implement :term:" "`awaitable` objects. For instance, :class:`asyncio.Future` implements this " "method to be compatible with the :keyword:`await` expression." msgstr "" -#: ../../reference/datamodel.rst:3172 +#: ../../reference/datamodel.rst:3253 msgid "" "The language doesn't place any restriction on the type or value of the " "objects yielded by the iterator returned by ``__await__``, as this is " @@ -3501,15 +3604,15 @@ msgid "" "g. :mod:`asyncio`) that will be managing the :term:`awaitable` object." msgstr "" -#: ../../reference/datamodel.rst:3180 +#: ../../reference/datamodel.rst:3261 msgid ":pep:`492` for additional information about awaitable objects." msgstr "" -#: ../../reference/datamodel.rst:3186 +#: ../../reference/datamodel.rst:3267 msgid "Coroutine Objects" msgstr "" -#: ../../reference/datamodel.rst:3188 +#: ../../reference/datamodel.rst:3269 msgid "" ":term:`Coroutine objects ` are :term:`awaitable` objects. A " "coroutine's execution can be controlled by calling :meth:`~object.__await__` " @@ -3520,18 +3623,18 @@ msgid "" "should not directly raise unhandled :exc:`StopIteration` exceptions." msgstr "" -#: ../../reference/datamodel.rst:3196 +#: ../../reference/datamodel.rst:3277 msgid "" "Coroutines also have the methods listed below, which are analogous to those " "of generators (see :ref:`generator-methods`). However, unlike generators, " "coroutines do not directly support iteration." msgstr "" -#: ../../reference/datamodel.rst:3200 +#: ../../reference/datamodel.rst:3281 msgid "It is a :exc:`RuntimeError` to await on a coroutine more than once." msgstr "" -#: ../../reference/datamodel.rst:3206 +#: ../../reference/datamodel.rst:3287 msgid "" "Starts or resumes execution of the coroutine. If *value* is ``None``, this " "is equivalent to advancing the iterator returned by :meth:`~object." @@ -3542,7 +3645,7 @@ msgid "" "value, described above." msgstr "" -#: ../../reference/datamodel.rst:3217 +#: ../../reference/datamodel.rst:3298 msgid "" "Raises the specified exception in the coroutine. This method delegates to " "the :meth:`~generator.throw` method of the iterator that caused the " @@ -3553,13 +3656,13 @@ msgid "" "not caught in the coroutine, it propagates back to the caller." msgstr "" -#: ../../reference/datamodel.rst:3228 +#: ../../reference/datamodel.rst:3309 msgid "" "The second signature \\(type\\[, value\\[, traceback\\]\\]\\) is deprecated " "and may be removed in a future version of Python." msgstr "" -#: ../../reference/datamodel.rst:3233 +#: ../../reference/datamodel.rst:3314 msgid "" "Causes the coroutine to clean itself up and exit. If the coroutine is " "suspended, this method first delegates to the :meth:`~generator.close` " @@ -3569,99 +3672,99 @@ msgid "" "is marked as having finished executing, even if it was never started." msgstr "" -#: ../../reference/datamodel.rst:3241 +#: ../../reference/datamodel.rst:3322 msgid "" "Coroutine objects are automatically closed using the above process when they " "are about to be destroyed." msgstr "" -#: ../../reference/datamodel.rst:3247 +#: ../../reference/datamodel.rst:3328 msgid "Asynchronous Iterators" msgstr "" -#: ../../reference/datamodel.rst:3249 +#: ../../reference/datamodel.rst:3330 msgid "" "An *asynchronous iterator* can call asynchronous code in its ``__anext__`` " "method." msgstr "" -#: ../../reference/datamodel.rst:3252 +#: ../../reference/datamodel.rst:3333 msgid "" "Asynchronous iterators can be used in an :keyword:`async for` statement." msgstr "" -#: ../../reference/datamodel.rst:3256 +#: ../../reference/datamodel.rst:3337 msgid "Must return an *asynchronous iterator* object." msgstr "" -#: ../../reference/datamodel.rst:3260 +#: ../../reference/datamodel.rst:3341 msgid "" "Must return an *awaitable* resulting in a next value of the iterator. " "Should raise a :exc:`StopAsyncIteration` error when the iteration is over." msgstr "" -#: ../../reference/datamodel.rst:3263 +#: ../../reference/datamodel.rst:3344 msgid "An example of an asynchronous iterable object::" msgstr "" -#: ../../reference/datamodel.rst:3280 +#: ../../reference/datamodel.rst:3361 msgid "" "Prior to Python 3.7, :meth:`~object.__aiter__` could return an *awaitable* " "that would resolve to an :term:`asynchronous iterator `." msgstr "" -#: ../../reference/datamodel.rst:3285 +#: ../../reference/datamodel.rst:3366 msgid "" "Starting with Python 3.7, :meth:`~object.__aiter__` must return an " "asynchronous iterator object. Returning anything else will result in a :exc:" "`TypeError` error." msgstr "" -#: ../../reference/datamodel.rst:3293 +#: ../../reference/datamodel.rst:3374 msgid "Asynchronous Context Managers" msgstr "" -#: ../../reference/datamodel.rst:3295 +#: ../../reference/datamodel.rst:3376 msgid "" "An *asynchronous context manager* is a *context manager* that is able to " "suspend execution in its ``__aenter__`` and ``__aexit__`` methods." msgstr "" -#: ../../reference/datamodel.rst:3298 +#: ../../reference/datamodel.rst:3379 msgid "" "Asynchronous context managers can be used in an :keyword:`async with` " "statement." msgstr "" -#: ../../reference/datamodel.rst:3302 +#: ../../reference/datamodel.rst:3383 msgid "" "Semantically similar to :meth:`~object.__enter__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3307 +#: ../../reference/datamodel.rst:3388 msgid "" "Semantically similar to :meth:`~object.__exit__`, the only difference being " "that it must return an *awaitable*." msgstr "" -#: ../../reference/datamodel.rst:3310 +#: ../../reference/datamodel.rst:3391 msgid "An example of an asynchronous context manager class::" msgstr "" -#: ../../reference/datamodel.rst:3323 +#: ../../reference/datamodel.rst:3404 msgid "Footnotes" msgstr "註解" -#: ../../reference/datamodel.rst:3324 +#: ../../reference/datamodel.rst:3405 msgid "" "It *is* possible in some cases to change an object's type, under certain " "controlled conditions. It generally isn't a good idea though, since it can " "lead to some very strange behaviour if it is handled incorrectly." msgstr "" -#: ../../reference/datamodel.rst:3328 +#: ../../reference/datamodel.rst:3409 msgid "" "The :meth:`~object.__hash__`, :meth:`~object.__iter__`, :meth:`~object." "__reversed__`, and :meth:`~object.__contains__` methods have special " @@ -3669,7 +3772,7 @@ msgid "" "by relying on the behavior that ``None`` is not callable." msgstr "" -#: ../../reference/datamodel.rst:3334 +#: ../../reference/datamodel.rst:3415 msgid "" "\"Does not support\" here means that the class has no such method, or the " "method returns ``NotImplemented``. Do not set the method to ``None`` if you " @@ -3677,7 +3780,7 @@ msgid "" "instead have the opposite effect of explicitly *blocking* such fallback." msgstr "" -#: ../../reference/datamodel.rst:3340 +#: ../../reference/datamodel.rst:3421 msgid "" "For operands of the same type, it is assumed that if the non-reflected " "method -- such as :meth:`~object.__add__` -- fails then the overall " @@ -3694,13 +3797,13 @@ msgstr "" #: ../../reference/datamodel.rst:420 ../../reference/datamodel.rst:440 #: ../../reference/datamodel.rst:448 ../../reference/datamodel.rst:459 #: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:512 -#: ../../reference/datamodel.rst:525 ../../reference/datamodel.rst:642 -#: ../../reference/datamodel.rst:762 ../../reference/datamodel.rst:780 -#: ../../reference/datamodel.rst:812 ../../reference/datamodel.rst:893 -#: ../../reference/datamodel.rst:961 ../../reference/datamodel.rst:988 -#: ../../reference/datamodel.rst:1050 ../../reference/datamodel.rst:1104 -#: ../../reference/datamodel.rst:1164 ../../reference/datamodel.rst:1263 -#: ../../reference/datamodel.rst:1654 ../../reference/datamodel.rst:2668 +#: ../../reference/datamodel.rst:527 ../../reference/datamodel.rst:644 +#: ../../reference/datamodel.rst:785 ../../reference/datamodel.rst:805 +#: ../../reference/datamodel.rst:838 ../../reference/datamodel.rst:919 +#: ../../reference/datamodel.rst:988 ../../reference/datamodel.rst:1015 +#: ../../reference/datamodel.rst:1077 ../../reference/datamodel.rst:1179 +#: ../../reference/datamodel.rst:1245 ../../reference/datamodel.rst:1344 +#: ../../reference/datamodel.rst:1735 ../../reference/datamodel.rst:2749 msgid "object" msgstr "object(物件)" @@ -3710,14 +3813,14 @@ msgstr "data(資料)" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:292 #: ../../reference/datamodel.rst:336 ../../reference/datamodel.rst:420 -#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:762 -#: ../../reference/datamodel.rst:1007 ../../reference/datamodel.rst:1328 -#: ../../reference/datamodel.rst:1568 ../../reference/datamodel.rst:1573 -#: ../../reference/datamodel.rst:1654 ../../reference/datamodel.rst:2209 -#: ../../reference/datamodel.rst:2638 ../../reference/datamodel.rst:2796 -#: ../../reference/datamodel.rst:2831 ../../reference/datamodel.rst:2845 -#: ../../reference/datamodel.rst:2892 ../../reference/datamodel.rst:2902 -#: ../../reference/datamodel.rst:2930 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:785 +#: ../../reference/datamodel.rst:1034 ../../reference/datamodel.rst:1409 +#: ../../reference/datamodel.rst:1649 ../../reference/datamodel.rst:1654 +#: ../../reference/datamodel.rst:1735 ../../reference/datamodel.rst:2290 +#: ../../reference/datamodel.rst:2719 ../../reference/datamodel.rst:2877 +#: ../../reference/datamodel.rst:2912 ../../reference/datamodel.rst:2926 +#: ../../reference/datamodel.rst:2973 ../../reference/datamodel.rst:2983 +#: ../../reference/datamodel.rst:3011 msgid "built-in function" msgstr "built-in function(內建函式)" @@ -3726,7 +3829,7 @@ msgid "id" msgstr "id" #: ../../reference/datamodel.rst:23 ../../reference/datamodel.rst:122 -#: ../../reference/datamodel.rst:2209 +#: ../../reference/datamodel.rst:2290 msgid "type" msgstr "type(型別)" @@ -3762,7 +3865,7 @@ msgstr "reference counting(參照計數)" msgid "unreachable object" msgstr "unreachable object(不可達物件)" -#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:893 +#: ../../reference/datamodel.rst:95 ../../reference/datamodel.rst:919 msgid "container" msgstr "container(容器)" @@ -3776,24 +3879,24 @@ msgstr "extension(擴充)" #: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:393 #: ../../reference/datamodel.rst:394 ../../reference/datamodel.rst:495 -#: ../../reference/datamodel.rst:812 ../../reference/datamodel.rst:831 -#: ../../reference/datamodel.rst:1007 +#: ../../reference/datamodel.rst:838 ../../reference/datamodel.rst:857 +#: ../../reference/datamodel.rst:1034 msgid "module" msgstr "module(模組)" #: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:261 -#: ../../reference/datamodel.rst:762 +#: ../../reference/datamodel.rst:785 msgid "C" msgstr "C" #: ../../reference/datamodel.rst:122 ../../reference/datamodel.rst:261 -#: ../../reference/datamodel.rst:762 +#: ../../reference/datamodel.rst:785 msgid "language" msgstr "language(語言)" -#: ../../reference/datamodel.rst:135 ../../reference/datamodel.rst:893 -#: ../../reference/datamodel.rst:910 ../../reference/datamodel.rst:961 -#: ../../reference/datamodel.rst:981 +#: ../../reference/datamodel.rst:135 ../../reference/datamodel.rst:919 +#: ../../reference/datamodel.rst:937 ../../reference/datamodel.rst:988 +#: ../../reference/datamodel.rst:1008 msgid "attribute" msgstr "attribute(屬性)" @@ -3813,7 +3916,7 @@ msgstr "..." msgid "ellipsis literal" msgstr "ellipsis literal(刪節號)" -#: ../../reference/datamodel.rst:192 ../../reference/datamodel.rst:988 +#: ../../reference/datamodel.rst:192 ../../reference/datamodel.rst:1015 msgid "numeric" msgstr "numeric(數值)" @@ -3850,16 +3953,16 @@ msgstr "number(數字)" msgid "Java" msgstr "Java" -#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:2902 +#: ../../reference/datamodel.rst:279 ../../reference/datamodel.rst:2983 msgid "complex" msgstr "complex(複數)" #: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:420 -#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2638 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:2719 msgid "len" msgstr "len" -#: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:988 +#: ../../reference/datamodel.rst:292 ../../reference/datamodel.rst:1015 msgid "sequence" msgstr "sequence(序列)" @@ -3888,8 +3991,8 @@ msgstr "immutable sequence(不可變序列)" msgid "immutable" msgstr "immutable(不可變)" -#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1543 -#: ../../reference/datamodel.rst:1573 +#: ../../reference/datamodel.rst:332 ../../reference/datamodel.rst:1624 +#: ../../reference/datamodel.rst:1654 msgid "string" msgstr "string(字串)" @@ -3925,7 +4028,7 @@ msgstr "singleton(單例)" msgid "empty" msgstr "empty(空的)" -#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1568 +#: ../../reference/datamodel.rst:369 ../../reference/datamodel.rst:1649 msgid "bytes" msgstr "bytes(位元組)" @@ -3941,14 +4044,14 @@ msgstr "mutable sequence(可變序列)" msgid "mutable" msgstr "mutable(可變的)" -#: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:910 -#: ../../reference/datamodel.rst:981 +#: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:937 +#: ../../reference/datamodel.rst:1008 msgid "assignment" msgstr "assignment(賦值)" -#: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:812 -#: ../../reference/datamodel.rst:1295 ../../reference/datamodel.rst:1464 -#: ../../reference/datamodel.rst:2957 +#: ../../reference/datamodel.rst:381 ../../reference/datamodel.rst:838 +#: ../../reference/datamodel.rst:1376 ../../reference/datamodel.rst:1545 +#: ../../reference/datamodel.rst:3038 msgid "statement" msgstr "statement(陳述式)" @@ -3980,12 +4083,12 @@ msgstr "set(集合)" msgid "frozenset" msgstr "frozenset(凍結集合)" -#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:988 +#: ../../reference/datamodel.rst:459 ../../reference/datamodel.rst:1015 msgid "mapping" msgstr "mapping(對映)" -#: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:893 -#: ../../reference/datamodel.rst:1654 +#: ../../reference/datamodel.rst:476 ../../reference/datamodel.rst:919 +#: ../../reference/datamodel.rst:1735 msgid "dictionary" msgstr "dictionary(字典)" @@ -4001,14 +4104,14 @@ msgstr "dbm.gnu" msgid "callable" msgstr "callable(可呼叫物件)" -#: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:525 -#: ../../reference/datamodel.rst:708 ../../reference/datamodel.rst:726 -#: ../../reference/datamodel.rst:739 ../../reference/datamodel.rst:762 +#: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:527 +#: ../../reference/datamodel.rst:731 ../../reference/datamodel.rst:749 +#: ../../reference/datamodel.rst:762 ../../reference/datamodel.rst:785 msgid "function" msgstr "function (函式)" -#: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:893 -#: ../../reference/datamodel.rst:915 ../../reference/datamodel.rst:2590 +#: ../../reference/datamodel.rst:512 ../../reference/datamodel.rst:919 +#: ../../reference/datamodel.rst:942 ../../reference/datamodel.rst:2671 msgid "call" msgstr "call(呼叫)" @@ -4020,619 +4123,619 @@ msgstr "invocation(調用)" msgid "argument" msgstr "argument(引數)" -#: ../../reference/datamodel.rst:525 ../../reference/datamodel.rst:642 +#: ../../reference/datamodel.rst:527 ../../reference/datamodel.rst:644 msgid "user-defined" msgstr "user-defined(使用者定義)" -#: ../../reference/datamodel.rst:525 +#: ../../reference/datamodel.rst:527 msgid "user-defined function" msgstr "user-defined function(使用者定義函式)" -#: ../../reference/datamodel.rst:539 +#: ../../reference/datamodel.rst:541 msgid "__doc__ (function attribute)" msgstr "__doc__ (函式屬性)" -#: ../../reference/datamodel.rst:539 +#: ../../reference/datamodel.rst:541 msgid "__name__ (function attribute)" msgstr "__name__ (函式屬性)" -#: ../../reference/datamodel.rst:539 +#: ../../reference/datamodel.rst:541 msgid "__module__ (function attribute)" msgstr "__module__ (函式屬性)" -#: ../../reference/datamodel.rst:539 +#: ../../reference/datamodel.rst:541 msgid "__dict__ (function attribute)" msgstr "__dict__ (函式屬性)" -#: ../../reference/datamodel.rst:539 +#: ../../reference/datamodel.rst:541 msgid "__defaults__ (function attribute)" msgstr "__defaults__ (函式屬性)" -#: ../../reference/datamodel.rst:539 +#: ../../reference/datamodel.rst:541 msgid "__closure__ (function attribute)" msgstr "__closure__ (函式屬性)" -#: ../../reference/datamodel.rst:539 +#: ../../reference/datamodel.rst:541 msgid "__code__ (function attribute)" msgstr "__code__ (函式屬性)" -#: ../../reference/datamodel.rst:539 +#: ../../reference/datamodel.rst:541 msgid "__globals__ (function attribute)" msgstr "__globals__ (函式屬性)" -#: ../../reference/datamodel.rst:539 +#: ../../reference/datamodel.rst:541 msgid "__annotations__ (function attribute)" msgstr "__annotations__ (函式屬性)" -#: ../../reference/datamodel.rst:539 +#: ../../reference/datamodel.rst:541 msgid "__kwdefaults__ (function attribute)" msgstr "__kwdefaults__ (函式屬性)" -#: ../../reference/datamodel.rst:539 +#: ../../reference/datamodel.rst:541 msgid "__type_params__ (function attribute)" msgstr "__type_params__ (函式屬性)" -#: ../../reference/datamodel.rst:539 +#: ../../reference/datamodel.rst:541 msgid "global" msgstr "global(全域)" -#: ../../reference/datamodel.rst:539 ../../reference/datamodel.rst:831 +#: ../../reference/datamodel.rst:541 ../../reference/datamodel.rst:857 msgid "namespace" msgstr "namespace(命名空間)" -#: ../../reference/datamodel.rst:642 ../../reference/datamodel.rst:780 +#: ../../reference/datamodel.rst:644 ../../reference/datamodel.rst:805 msgid "method" msgstr "method(方法)" -#: ../../reference/datamodel.rst:642 +#: ../../reference/datamodel.rst:644 msgid "user-defined method" msgstr "user-defined method(使用者定義方法)" -#: ../../reference/datamodel.rst:650 +#: ../../reference/datamodel.rst:652 msgid "__func__ (method attribute)" msgstr "__func__ (方法屬性)" -#: ../../reference/datamodel.rst:650 +#: ../../reference/datamodel.rst:652 msgid "__self__ (method attribute)" msgstr "__self__ (方法屬性)" -#: ../../reference/datamodel.rst:650 +#: ../../reference/datamodel.rst:652 msgid "__doc__ (method attribute)" msgstr "__doc__ (方法屬性)" -#: ../../reference/datamodel.rst:650 +#: ../../reference/datamodel.rst:652 msgid "__name__ (method attribute)" msgstr "__name__ (方法屬性)" -#: ../../reference/datamodel.rst:650 +#: ../../reference/datamodel.rst:652 msgid "__module__ (method attribute)" msgstr "__module__ (方法屬性)" -#: ../../reference/datamodel.rst:708 ../../reference/datamodel.rst:1104 +#: ../../reference/datamodel.rst:731 ../../reference/datamodel.rst:1179 msgid "generator" msgstr "generator(產生器)" -#: ../../reference/datamodel.rst:708 +#: ../../reference/datamodel.rst:731 msgid "iterator" msgstr "itorator(疊代器)" -#: ../../reference/datamodel.rst:726 ../../reference/datamodel.rst:3144 +#: ../../reference/datamodel.rst:749 ../../reference/datamodel.rst:3225 msgid "coroutine" msgstr "coroutine(協程)" -#: ../../reference/datamodel.rst:739 +#: ../../reference/datamodel.rst:762 msgid "asynchronous generator" msgstr "asynchronous generator(非同步產生器)" -#: ../../reference/datamodel.rst:739 +#: ../../reference/datamodel.rst:762 msgid "asynchronous iterator" msgstr "asynchronous iterator(非同步疊代器)" -#: ../../reference/datamodel.rst:780 +#: ../../reference/datamodel.rst:805 msgid "built-in method" msgstr "built-in method(內建方法)" -#: ../../reference/datamodel.rst:780 +#: ../../reference/datamodel.rst:805 msgid "built-in" msgstr "built-in(內建)" -#: ../../reference/datamodel.rst:812 +#: ../../reference/datamodel.rst:838 msgid "import" msgstr "import(引入)" -#: ../../reference/datamodel.rst:831 +#: ../../reference/datamodel.rst:857 msgid "__name__ (module attribute)" msgstr "__name__ (模組屬性)" -#: ../../reference/datamodel.rst:831 +#: ../../reference/datamodel.rst:857 msgid "__doc__ (module attribute)" msgstr "__doc__ (模組屬性)" -#: ../../reference/datamodel.rst:831 +#: ../../reference/datamodel.rst:857 msgid "__file__ (module attribute)" msgstr "__file__ (模組屬性)" -#: ../../reference/datamodel.rst:831 +#: ../../reference/datamodel.rst:857 msgid "__annotations__ (module attribute)" msgstr "__annotations__ (模組屬性)" -#: ../../reference/datamodel.rst:862 +#: ../../reference/datamodel.rst:888 msgid "__dict__ (module attribute)" msgstr "__dict__ (模組屬性)" -#: ../../reference/datamodel.rst:893 ../../reference/datamodel.rst:910 -#: ../../reference/datamodel.rst:961 ../../reference/datamodel.rst:1447 -#: ../../reference/datamodel.rst:2320 +#: ../../reference/datamodel.rst:919 ../../reference/datamodel.rst:937 +#: ../../reference/datamodel.rst:988 ../../reference/datamodel.rst:1528 +#: ../../reference/datamodel.rst:2401 msgid "class" msgstr "class(類別)" -#: ../../reference/datamodel.rst:893 ../../reference/datamodel.rst:961 -#: ../../reference/datamodel.rst:981 +#: ../../reference/datamodel.rst:919 ../../reference/datamodel.rst:988 +#: ../../reference/datamodel.rst:1008 msgid "class instance" msgstr "class instance(類別實例)" -#: ../../reference/datamodel.rst:893 ../../reference/datamodel.rst:961 -#: ../../reference/datamodel.rst:2590 +#: ../../reference/datamodel.rst:919 ../../reference/datamodel.rst:988 +#: ../../reference/datamodel.rst:2671 msgid "instance" msgstr "instance(實例)" -#: ../../reference/datamodel.rst:893 ../../reference/datamodel.rst:915 +#: ../../reference/datamodel.rst:919 ../../reference/datamodel.rst:942 msgid "class object" msgstr "class object(類別物件)" -#: ../../reference/datamodel.rst:919 +#: ../../reference/datamodel.rst:946 msgid "__name__ (class attribute)" msgstr "__name__ (類別屬性)" -#: ../../reference/datamodel.rst:919 +#: ../../reference/datamodel.rst:946 msgid "__module__ (class attribute)" msgstr "__module__ (類別屬性)" -#: ../../reference/datamodel.rst:919 +#: ../../reference/datamodel.rst:946 msgid "__dict__ (class attribute)" msgstr "__dict__ (類別屬性)" -#: ../../reference/datamodel.rst:919 +#: ../../reference/datamodel.rst:946 msgid "__bases__ (class attribute)" msgstr "__bases__ (類別屬性)" -#: ../../reference/datamodel.rst:919 +#: ../../reference/datamodel.rst:946 msgid "__doc__ (class attribute)" msgstr "__doc__ (類別屬性)" -#: ../../reference/datamodel.rst:919 +#: ../../reference/datamodel.rst:946 msgid "__annotations__ (class attribute)" msgstr "__annotations__ (類別屬性)" -#: ../../reference/datamodel.rst:919 +#: ../../reference/datamodel.rst:946 msgid "__type_params__ (class attribute)" msgstr "__type_params__ (類別屬性)" -#: ../../reference/datamodel.rst:996 +#: ../../reference/datamodel.rst:1023 msgid "__dict__ (instance attribute)" msgstr "__dict__ (實例屬性)" -#: ../../reference/datamodel.rst:996 +#: ../../reference/datamodel.rst:1023 msgid "__class__ (instance attribute)" msgstr "__class__ (實例屬性)" -#: ../../reference/datamodel.rst:1007 +#: ../../reference/datamodel.rst:1034 msgid "open" msgstr "open" -#: ../../reference/datamodel.rst:1007 +#: ../../reference/datamodel.rst:1034 msgid "io" msgstr "io" -#: ../../reference/datamodel.rst:1007 +#: ../../reference/datamodel.rst:1034 msgid "popen() (in module os)" msgstr "popen() (於 os 模組中)" -#: ../../reference/datamodel.rst:1007 +#: ../../reference/datamodel.rst:1034 msgid "makefile() (socket method)" msgstr "makefile() (socket 方法)" -#: ../../reference/datamodel.rst:1007 +#: ../../reference/datamodel.rst:1034 msgid "sys.stdin" msgstr "sys.stdin" -#: ../../reference/datamodel.rst:1007 +#: ../../reference/datamodel.rst:1034 msgid "sys.stdout" msgstr "sys.stdout" -#: ../../reference/datamodel.rst:1007 +#: ../../reference/datamodel.rst:1034 msgid "sys.stderr" msgstr "sys.stderr" -#: ../../reference/datamodel.rst:1007 +#: ../../reference/datamodel.rst:1034 msgid "stdio" msgstr "stdio" -#: ../../reference/datamodel.rst:1007 +#: ../../reference/datamodel.rst:1034 msgid "stdin (in module sys)" msgstr "stdin (sys 模組中)" -#: ../../reference/datamodel.rst:1007 +#: ../../reference/datamodel.rst:1034 msgid "stdout (in module sys)" msgstr "stdout (sys 模組中)" -#: ../../reference/datamodel.rst:1007 +#: ../../reference/datamodel.rst:1034 msgid "stderr (in module sys)" msgstr "stderr (sys 模組中)" -#: ../../reference/datamodel.rst:1036 +#: ../../reference/datamodel.rst:1063 msgid "internal type" msgstr "internal type(內部型別)" -#: ../../reference/datamodel.rst:1036 +#: ../../reference/datamodel.rst:1063 msgid "types, internal" msgstr "types(型別), internal(內部)" -#: ../../reference/datamodel.rst:1050 +#: ../../reference/datamodel.rst:1077 msgid "bytecode" msgstr "bytecode(位元組碼)" -#: ../../reference/datamodel.rst:1050 +#: ../../reference/datamodel.rst:1077 msgid "code" msgstr "code(程式碼)" -#: ../../reference/datamodel.rst:1050 +#: ../../reference/datamodel.rst:1077 msgid "code object" msgstr "code object(程式碼物件)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_argcount (code object attribute)" msgstr "co_argcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_posonlyargcount (code object attribute)" msgstr "co_posonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_kwonlyargcount (code object attribute)" msgstr "co_kwonlyargcount (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_code (code object attribute)" msgstr "co_code (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_consts (code object attribute)" msgstr "co_consts (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_filename (code object attribute)" msgstr "co_filename (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_firstlineno (code object attribute)" msgstr "co_firstlineno (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_flags (code object attribute)" msgstr "co_flags (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_lnotab (code object attribute)" msgstr "co_lnotab (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_name (code object attribute)" msgstr "co_name (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_names (code object attribute)" msgstr "co_names (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_nlocals (code object attribute)" msgstr "co_nlocals (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_stacksize (code object attribute)" msgstr "co_stacksize (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_varnames (code object attribute)" msgstr "co_varnames (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_cellvars (code object attribute)" msgstr "co_cellvars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_freevars (code object attribute)" msgstr "co_freevars (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1061 +#: ../../reference/datamodel.rst:1088 msgid "co_qualname (code object attribute)" msgstr "co_qualname (程式碼物件屬性)" -#: ../../reference/datamodel.rst:1120 +#: ../../reference/datamodel.rst:1197 msgid "documentation string" msgstr "documentation string(文件字串)" -#: ../../reference/datamodel.rst:1164 +#: ../../reference/datamodel.rst:1245 msgid "frame" msgstr "frame" -#: ../../reference/datamodel.rst:1169 +#: ../../reference/datamodel.rst:1250 msgid "f_back (frame attribute)" msgstr "f_back (frame 屬性)" -#: ../../reference/datamodel.rst:1169 +#: ../../reference/datamodel.rst:1250 msgid "f_code (frame attribute)" msgstr "f_code (frame 屬性)" -#: ../../reference/datamodel.rst:1169 +#: ../../reference/datamodel.rst:1250 msgid "f_globals (frame attribute)" msgstr "f_globals (frame 屬性)" -#: ../../reference/datamodel.rst:1169 +#: ../../reference/datamodel.rst:1250 msgid "f_locals (frame attribute)" msgstr "f_locals (frame 屬性)" -#: ../../reference/datamodel.rst:1169 +#: ../../reference/datamodel.rst:1250 msgid "f_lasti (frame attribute)" msgstr "f_lasti (frame 屬性)" -#: ../../reference/datamodel.rst:1169 +#: ../../reference/datamodel.rst:1250 msgid "f_builtins (frame attribute)" msgstr "f_builtins (frame 屬性)" -#: ../../reference/datamodel.rst:1208 +#: ../../reference/datamodel.rst:1289 msgid "f_trace (frame attribute)" msgstr "f_trace (frame 屬性)" -#: ../../reference/datamodel.rst:1208 +#: ../../reference/datamodel.rst:1289 msgid "f_trace_lines (frame attribute)" msgstr "f_trace_lines (frame 屬性)" -#: ../../reference/datamodel.rst:1208 +#: ../../reference/datamodel.rst:1289 msgid "f_trace_opcodes (frame attribute)" msgstr "f_trace_opcodes (frame 屬性)" -#: ../../reference/datamodel.rst:1208 +#: ../../reference/datamodel.rst:1289 msgid "f_lineno (frame attribute)" msgstr "f_lineno (frame 屬性)" -#: ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1344 msgid "traceback" msgstr "traceback" -#: ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1344 msgid "stack" msgstr "stack(堆疊)" -#: ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1344 msgid "trace" msgstr "trace(追蹤)" -#: ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1344 msgid "exception" msgstr "exception(例外)" -#: ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1344 msgid "handler" msgstr "handler(處理器)" -#: ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1344 msgid "execution" msgstr "execution(執行)" -#: ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1344 msgid "exc_info (in module sys)" msgstr "exc_info (sys 模組中)" -#: ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1344 msgid "last_traceback (in module sys)" msgstr "last_traceback (sys 模組中)" -#: ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1344 msgid "sys.exc_info" msgstr "sys.exc_info" -#: ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1344 msgid "sys.exception" msgstr "sys.exception" -#: ../../reference/datamodel.rst:1263 +#: ../../reference/datamodel.rst:1344 msgid "sys.last_traceback" msgstr "sys.last_traceback" -#: ../../reference/datamodel.rst:1295 +#: ../../reference/datamodel.rst:1376 msgid "tb_frame (traceback attribute)" msgstr "tb_frame (traceback 屬性)" -#: ../../reference/datamodel.rst:1295 +#: ../../reference/datamodel.rst:1376 msgid "tb_lineno (traceback attribute)" msgstr "tb_lineno (traceback 屬性)" -#: ../../reference/datamodel.rst:1295 +#: ../../reference/datamodel.rst:1376 msgid "tb_lasti (traceback attribute)" msgstr "tb_lasti (traceback 屬性)" -#: ../../reference/datamodel.rst:1295 +#: ../../reference/datamodel.rst:1376 msgid "try" msgstr "try" -#: ../../reference/datamodel.rst:1313 +#: ../../reference/datamodel.rst:1394 msgid "tb_next (traceback attribute)" msgstr "tb_next (traceback 屬性)" -#: ../../reference/datamodel.rst:1328 ../../reference/datamodel.rst:2668 +#: ../../reference/datamodel.rst:1409 ../../reference/datamodel.rst:2749 msgid "slice" msgstr "slice(切片)" -#: ../../reference/datamodel.rst:1334 +#: ../../reference/datamodel.rst:1415 msgid "start (slice object attribute)" msgstr "start (slice 物件屬性)" -#: ../../reference/datamodel.rst:1334 +#: ../../reference/datamodel.rst:1415 msgid "stop (slice object attribute)" msgstr "stop (slice 物件屬性)" -#: ../../reference/datamodel.rst:1334 +#: ../../reference/datamodel.rst:1415 msgid "step (slice object attribute)" msgstr "step (slice 物件屬性)" -#: ../../reference/datamodel.rst:1382 +#: ../../reference/datamodel.rst:1463 msgid "operator" msgstr "operator(運算子)" -#: ../../reference/datamodel.rst:1382 +#: ../../reference/datamodel.rst:1463 msgid "overloading" msgstr "overloading(多載)" -#: ../../reference/datamodel.rst:1382 +#: ../../reference/datamodel.rst:1463 msgid "__getitem__() (mapping object method)" msgstr "__getitem__() (對映物件方法)" -#: ../../reference/datamodel.rst:1418 +#: ../../reference/datamodel.rst:1499 msgid "subclassing" msgstr "subclassing(子類別化)" -#: ../../reference/datamodel.rst:1418 +#: ../../reference/datamodel.rst:1499 msgid "immutable types" msgstr "immutable types(不可變型別)" -#: ../../reference/datamodel.rst:1447 +#: ../../reference/datamodel.rst:1528 msgid "constructor" msgstr "constructor(建構函式)" -#: ../../reference/datamodel.rst:1464 +#: ../../reference/datamodel.rst:1545 msgid "destructor" msgstr "destructor(解構函式)" -#: ../../reference/datamodel.rst:1464 +#: ../../reference/datamodel.rst:1545 msgid "finalizer" msgstr "finalizer(終結函式)" -#: ../../reference/datamodel.rst:1464 +#: ../../reference/datamodel.rst:1545 msgid "del" msgstr "del" -#: ../../reference/datamodel.rst:1526 +#: ../../reference/datamodel.rst:1607 msgid "repr() (built-in function)" msgstr "repr() (內建函式)" -#: ../../reference/datamodel.rst:1526 +#: ../../reference/datamodel.rst:1607 msgid "__repr__() (object method)" msgstr "__repr__() (物件方法)" -#: ../../reference/datamodel.rst:1543 +#: ../../reference/datamodel.rst:1624 msgid "__str__() (object method)" msgstr "__str__() (物件方法)" -#: ../../reference/datamodel.rst:1543 +#: ../../reference/datamodel.rst:1624 msgid "format() (built-in function)" msgstr "format() (內建函式)" -#: ../../reference/datamodel.rst:1543 +#: ../../reference/datamodel.rst:1624 msgid "print() (built-in function)" msgstr "print() (內建函式)" -#: ../../reference/datamodel.rst:1573 +#: ../../reference/datamodel.rst:1654 msgid "__format__() (object method)" msgstr "__format__() (物件方法)" -#: ../../reference/datamodel.rst:1573 +#: ../../reference/datamodel.rst:1654 msgid "conversion" msgstr "conversion" -#: ../../reference/datamodel.rst:1573 +#: ../../reference/datamodel.rst:1654 msgid "print" msgstr "print" -#: ../../reference/datamodel.rst:1612 +#: ../../reference/datamodel.rst:1693 msgid "comparisons" msgstr "comparison(比較)" -#: ../../reference/datamodel.rst:1654 +#: ../../reference/datamodel.rst:1735 msgid "hash" msgstr "hash(雜湊)" -#: ../../reference/datamodel.rst:1735 +#: ../../reference/datamodel.rst:1816 msgid "__len__() (mapping object method)" msgstr "__len__() (對映物件方法)" -#: ../../reference/datamodel.rst:1838 +#: ../../reference/datamodel.rst:1919 msgid "__getattr__ (module attribute)" msgstr "__getattr__ (模組屬性)" -#: ../../reference/datamodel.rst:1838 +#: ../../reference/datamodel.rst:1919 msgid "__dir__ (module attribute)" msgstr "__dir__ (模組屬性)" -#: ../../reference/datamodel.rst:1838 +#: ../../reference/datamodel.rst:1919 msgid "__class__ (module attribute)" msgstr "__class__ (模組屬性)" -#: ../../reference/datamodel.rst:2209 +#: ../../reference/datamodel.rst:2290 msgid "metaclass" msgstr "metaclass(元類別)" -#: ../../reference/datamodel.rst:2209 +#: ../../reference/datamodel.rst:2290 msgid "= (equals)" msgstr "= (等於)" -#: ../../reference/datamodel.rst:2209 +#: ../../reference/datamodel.rst:2290 msgid "class definition" msgstr "class definition(類別定義)" -#: ../../reference/datamodel.rst:2273 +#: ../../reference/datamodel.rst:2354 msgid "metaclass hint" msgstr "metaclass hint(元類別提示)" -#: ../../reference/datamodel.rst:2296 +#: ../../reference/datamodel.rst:2377 msgid "__prepare__ (metaclass method)" msgstr "__prepare__ (元類別方法)" -#: ../../reference/datamodel.rst:2320 +#: ../../reference/datamodel.rst:2401 msgid "body" msgstr "body" -#: ../../reference/datamodel.rst:2340 +#: ../../reference/datamodel.rst:2421 msgid "__class__ (method cell)" msgstr "__class__ (方法 cell)" -#: ../../reference/datamodel.rst:2340 +#: ../../reference/datamodel.rst:2421 msgid "__classcell__ (class namespace entry)" msgstr "__classcell__ (類別命名空間項目)" -#: ../../reference/datamodel.rst:2638 +#: ../../reference/datamodel.rst:2719 msgid "__bool__() (object method)" msgstr "__bool__() (物件方法)" -#: ../../reference/datamodel.rst:2796 ../../reference/datamodel.rst:2831 +#: ../../reference/datamodel.rst:2877 ../../reference/datamodel.rst:2912 msgid "divmod" msgstr "divmod" -#: ../../reference/datamodel.rst:2796 ../../reference/datamodel.rst:2831 -#: ../../reference/datamodel.rst:2845 +#: ../../reference/datamodel.rst:2877 ../../reference/datamodel.rst:2912 +#: ../../reference/datamodel.rst:2926 msgid "pow" msgstr "pow" -#: ../../reference/datamodel.rst:2892 +#: ../../reference/datamodel.rst:2973 msgid "abs" msgstr "abs" -#: ../../reference/datamodel.rst:2902 +#: ../../reference/datamodel.rst:2983 msgid "int" msgstr "int" -#: ../../reference/datamodel.rst:2902 +#: ../../reference/datamodel.rst:2983 msgid "float" msgstr "float" -#: ../../reference/datamodel.rst:2930 +#: ../../reference/datamodel.rst:3011 msgid "round" msgstr "round" -#: ../../reference/datamodel.rst:2957 +#: ../../reference/datamodel.rst:3038 msgid "with" msgstr "with" -#: ../../reference/datamodel.rst:2957 +#: ../../reference/datamodel.rst:3038 msgid "context manager" msgstr "context manager(情境管理器)" diff --git a/tutorial/classes.po b/tutorial/classes.po index a00a286b46..348127e3fa 100644 --- a/tutorial/classes.po +++ b/tutorial/classes.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-09-02 00:03+0000\n" +"POT-Creation-Date: 2023-12-08 16:59+0000\n" "PO-Revision-Date: 2022-12-26 23:12+0800\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1130,18 +1130,21 @@ msgstr "" #: ../../tutorial/classes.rst:772 msgid "" -"Instance method objects have attributes, too: ``m.__self__`` is the instance " -"object with the method :meth:`!m`, and ``m.__func__`` is the function object " -"corresponding to the method." +":ref:`Instance method objects ` have attributes, too: :" +"attr:`m.__self__ ` is the instance object with the method :" +"meth:`!m`, and :attr:`m.__func__ ` is the :ref:`function " +"object ` corresponding to the method." msgstr "" -"實例的 method 物件也具有屬性:``m.__self__`` 就是帶有 method :meth:`!m` 的實" -"例物件,而 ``m.__func__`` 則是該 method 所對應的函式物件。" +":ref:`實例的 method 物件 `\\ 也具有屬性::attr:`m.__self__ " +"` 就是帶有 method :meth:`!m` 的實例物件,而 :attr:`m." +"__func__ ` 則是該 method 所對應的\\ :ref:`函式物件 `。" -#: ../../tutorial/classes.rst:780 +#: ../../tutorial/classes.rst:782 msgid "Iterators" msgstr "疊代器 (Iterator)" -#: ../../tutorial/classes.rst:782 +#: ../../tutorial/classes.rst:784 msgid "" "By now you have probably noticed that most container objects can be looped " "over using a :keyword:`for` statement::" @@ -1151,7 +1154,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:796 +#: ../../tutorial/classes.rst:798 msgid "" "This style of access is clear, concise, and convenient. The use of " "iterators pervades and unifies Python. Behind the scenes, the :keyword:" @@ -1173,7 +1176,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:821 +#: ../../tutorial/classes.rst:823 msgid "" "Having seen the mechanics behind the iterator protocol, it is easy to add " "iterator behavior to your classes. Define an :meth:`~container.__iter__` " @@ -1188,11 +1191,11 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:858 +#: ../../tutorial/classes.rst:860 msgid "Generators" msgstr "產生器 (Generator)" -#: ../../tutorial/classes.rst:860 +#: ../../tutorial/classes.rst:862 msgid "" ":term:`Generators ` are a simple and powerful tool for creating " "iterators. They are written like regular functions but use the :keyword:" @@ -1208,7 +1211,7 @@ msgstr "" "\n" "::" -#: ../../tutorial/classes.rst:881 +#: ../../tutorial/classes.rst:883 msgid "" "Anything that can be done with generators can also be done with class-based " "iterators as described in the previous section. What makes generators so " @@ -1219,7 +1222,7 @@ msgstr "" "描述。而讓產生器的程式碼更為精簡的原因是,:meth:`~iterator.__iter__` 和 :" "meth:`~generator.__next__` method 會自動被建立。" -#: ../../tutorial/classes.rst:886 +#: ../../tutorial/classes.rst:888 msgid "" "Another key feature is that the local variables and execution state are " "automatically saved between calls. This made the function easier to write " @@ -1230,7 +1233,7 @@ msgstr "" "函式比使用 ``self.index`` 和 ``self.data`` 這種實例變數的方式更容易編寫且更為" "清晰。" -#: ../../tutorial/classes.rst:891 +#: ../../tutorial/classes.rst:893 msgid "" "In addition to automatic method creation and saving program state, when " "generators terminate, they automatically raise :exc:`StopIteration`. In " @@ -1240,11 +1243,11 @@ msgstr "" "除了會自動建立 method 和儲存程式狀態,當產生器終止時,它們還會自動引發 :exc:" "`StopIteration`。這些特性結合在一起,使建立疊代器能與編寫常規函式一樣容易。" -#: ../../tutorial/classes.rst:900 +#: ../../tutorial/classes.rst:902 msgid "Generator Expressions" msgstr "產生器運算式" -#: ../../tutorial/classes.rst:902 +#: ../../tutorial/classes.rst:904 msgid "" "Some simple generators can be coded succinctly as expressions using a syntax " "similar to list comprehensions but with parentheses instead of square " @@ -1259,18 +1262,18 @@ msgstr "" "產生器定義相比,程式碼較精簡但功能較少,也比等效的 list comprehension 更為節" "省記憶體。" -#: ../../tutorial/classes.rst:909 +#: ../../tutorial/classes.rst:911 msgid "Examples::" msgstr "" "例如:\n" "\n" "::" -#: ../../tutorial/classes.rst:930 +#: ../../tutorial/classes.rst:932 msgid "Footnotes" msgstr "註解" -#: ../../tutorial/classes.rst:931 +#: ../../tutorial/classes.rst:933 msgid "" "Except for one thing. Module objects have a secret read-only attribute " "called :attr:`~object.__dict__` which returns the dictionary used to " diff --git a/whatsnew/2.6.po b/whatsnew/2.6.po index c9699bd110..70e04585d0 100644 --- a/whatsnew/2.6.po +++ b/whatsnew/2.6.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-04 00:03+0000\n" +"POT-Creation-Date: 2023-12-08 16:59+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -1812,10 +1812,10 @@ msgstr "" #: ../../whatsnew/2.6.rst:1679 msgid "" "Instance method objects have new attributes for the object and function " -"comprising the method; the new synonym for :attr:`!im_self` is :ref:" -"`__self__ `, and :attr:`!im_func` is also available as :" -"ref:`__func__ `. The old names are still supported in " -"Python 2.6, but are gone in 3.0." +"comprising the method; the new synonym for :attr:`!im_self` is :attr:" +"`~method.__self__`, and :attr:`!im_func` is also available as :attr:`~method." +"__func__`. The old names are still supported in Python 2.6, but are gone in " +"3.0." msgstr "" #: ../../whatsnew/2.6.rst:1685 diff --git a/whatsnew/2.7.po b/whatsnew/2.7.po index 6686fb3543..6437863533 100644 --- a/whatsnew/2.7.po +++ b/whatsnew/2.7.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-04 00:03+0000\n" +"POT-Creation-Date: 2023-12-08 16:59+0000\n" "PO-Revision-Date: 2018-05-23 16:20+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -875,20 +875,21 @@ msgstr "" #: ../../whatsnew/2.7.rst:861 msgid "" -"When using ``@classmethod`` and ``@staticmethod`` to wrap methods as class " -"or static methods, the wrapper object now exposes the wrapped function as " -"their :ref:`__func__ ` attribute. (Contributed by Amaury " -"Forgeot d'Arc, after a suggestion by George Sakkis; :issue:`5982`.)" +"When using :class:`@classmethod ` and :class:`@staticmethod " +"` to wrap methods as class or static methods, the wrapper " +"object now exposes the wrapped function as their :attr:`~method.__func__` " +"attribute. (Contributed by Amaury Forgeot d'Arc, after a suggestion by " +"George Sakkis; :issue:`5982`.)" msgstr "" -#: ../../whatsnew/2.7.rst:868 ../../whatsnew/2.7.rst:2464 +#: ../../whatsnew/2.7.rst:869 ../../whatsnew/2.7.rst:2465 msgid "" "When a restricted set of attributes were set using ``__slots__``, deleting " "an unset attribute would not raise :exc:`AttributeError` as you would " "expect. Fixed by Benjamin Peterson; :issue:`7604`.)" msgstr "" -#: ../../whatsnew/2.7.rst:872 +#: ../../whatsnew/2.7.rst:873 msgid "" "Two new encodings are now supported: \"cp720\", used primarily for Arabic " "text; and \"cp858\", a variant of CP 850 that adds the euro symbol. (CP720 " @@ -896,7 +897,7 @@ msgid "" "`1616979`; CP858 contributed by Tim Hatch in :issue:`8016`.)" msgstr "" -#: ../../whatsnew/2.7.rst:878 +#: ../../whatsnew/2.7.rst:879 msgid "" "The :class:`file` object will now set the :attr:`filename` attribute on the :" "exc:`IOError` exception when trying to open a directory on POSIX platforms " @@ -905,7 +906,7 @@ msgid "" "to catch and report the error (fixed by Stefan Krah; :issue:`5677`)." msgstr "" -#: ../../whatsnew/2.7.rst:885 +#: ../../whatsnew/2.7.rst:886 msgid "" "The Python tokenizer now translates line endings itself, so the :func:" "`compile` built-in function now accepts code using any line-ending " @@ -913,7 +914,7 @@ msgid "" "newline." msgstr "" -#: ../../whatsnew/2.7.rst:890 +#: ../../whatsnew/2.7.rst:891 msgid "" "Extra parentheses in function definitions are illegal in Python 3.x, meaning " "that you get a syntax error from ``def f((x)): pass``. In Python3-warning " @@ -921,25 +922,25 @@ msgid "" "Lingard; :issue:`7362`.)" msgstr "" -#: ../../whatsnew/2.7.rst:895 +#: ../../whatsnew/2.7.rst:896 msgid "" "It's now possible to create weak references to old-style class objects. New-" "style classes were always weak-referenceable. (Fixed by Antoine Pitrou; :" "issue:`8268`.)" msgstr "" -#: ../../whatsnew/2.7.rst:899 +#: ../../whatsnew/2.7.rst:900 msgid "" "When a module object is garbage-collected, the module's dictionary is now " "only cleared if no one else is holding a reference to the dictionary (:issue:" "`7140`)." msgstr "" -#: ../../whatsnew/2.7.rst:908 +#: ../../whatsnew/2.7.rst:909 msgid "Interpreter Changes" msgstr "" -#: ../../whatsnew/2.7.rst:910 +#: ../../whatsnew/2.7.rst:911 msgid "" "A new environment variable, :envvar:`PYTHONWARNINGS`, allows controlling " "warnings. It should be set to a string containing warning settings, " @@ -947,7 +948,7 @@ msgid "" "(Contributed by Brian Curtin; :issue:`7301`.)" msgstr "" -#: ../../whatsnew/2.7.rst:916 +#: ../../whatsnew/2.7.rst:917 msgid "" "For example, the following setting will print warnings every time they " "occur, but turn warnings from the :mod:`Cookie` module into an error. (The " @@ -955,22 +956,22 @@ msgid "" "systems and shells.)" msgstr "" -#: ../../whatsnew/2.7.rst:929 +#: ../../whatsnew/2.7.rst:930 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/2.7.rst:931 +#: ../../whatsnew/2.7.rst:932 msgid "Several performance enhancements have been added:" msgstr "" -#: ../../whatsnew/2.7.rst:933 +#: ../../whatsnew/2.7.rst:934 msgid "" "A new opcode was added to perform the initial setup for :keyword:`with` " "statements, looking up the :meth:`~object.__enter__` and :meth:`~object." "__exit__` methods. (Contributed by Benjamin Peterson.)" msgstr "" -#: ../../whatsnew/2.7.rst:937 +#: ../../whatsnew/2.7.rst:938 msgid "" "The garbage collector now performs better for one common usage pattern: when " "many objects are being allocated without deallocating any of them. This " @@ -983,7 +984,7 @@ msgid "" "implemented by Antoine Pitrou; :issue:`4074`.)" msgstr "" -#: ../../whatsnew/2.7.rst:948 +#: ../../whatsnew/2.7.rst:949 msgid "" "The garbage collector tries to avoid tracking simple containers which can't " "be part of a cycle. In Python 2.7, this is now true for tuples and dicts " @@ -994,7 +995,7 @@ msgid "" "Pitrou; :issue:`4688`.)" msgstr "" -#: ../../whatsnew/2.7.rst:957 +#: ../../whatsnew/2.7.rst:958 msgid "" "Long integers are now stored internally either in base ``2**15`` or in base " "``2**30``, the base being determined at build time. Previously, they were " @@ -1006,7 +1007,7 @@ msgid "" "override this default." msgstr "" -#: ../../whatsnew/2.7.rst:966 +#: ../../whatsnew/2.7.rst:967 msgid "" "Apart from the performance improvements this change should be invisible to " "end users, with one exception: for testing and debugging purposes there's a " @@ -1015,18 +1016,18 @@ msgid "" "of the C type used to store each digit::" msgstr "" -#: ../../whatsnew/2.7.rst:977 +#: ../../whatsnew/2.7.rst:978 msgid "(Contributed by Mark Dickinson; :issue:`4258`.)" msgstr "(由 Mark Dickinson 貢獻;:issue:`4258`。)" -#: ../../whatsnew/2.7.rst:979 +#: ../../whatsnew/2.7.rst:980 msgid "" "Another set of changes made long objects a few bytes smaller: 2 bytes " "smaller on 32-bit systems and 6 bytes on 64-bit. (Contributed by Mark " "Dickinson; :issue:`5260`.)" msgstr "" -#: ../../whatsnew/2.7.rst:983 +#: ../../whatsnew/2.7.rst:984 msgid "" "The division algorithm for long integers has been made faster by tightening " "the inner loop, doing shifts instead of multiplications, and fixing an " @@ -1036,7 +1037,7 @@ msgid "" "faster (initial patch by Gregory Smith; :issue:`1087418`)." msgstr "" -#: ../../whatsnew/2.7.rst:992 +#: ../../whatsnew/2.7.rst:993 msgid "" "The implementation of ``%`` checks for the left-side operand being a Python " "string and special-cases it; this results in a 1--3% performance increase " @@ -1044,21 +1045,21 @@ msgid "" "libraries. (Implemented by Collin Winter; :issue:`5176`.)" msgstr "" -#: ../../whatsnew/2.7.rst:998 +#: ../../whatsnew/2.7.rst:999 msgid "" "List comprehensions with an ``if`` condition are compiled into faster " "bytecode. (Patch by Antoine Pitrou, back-ported to 2.7 by Jeffrey Yasskin; :" "issue:`4715`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1002 +#: ../../whatsnew/2.7.rst:1003 msgid "" "Converting an integer or long integer to a decimal string was made faster by " "special-casing base 10 instead of using a generalized conversion function " "that supports arbitrary bases. (Patch by Gawain Bolton; :issue:`6713`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1007 +#: ../../whatsnew/2.7.rst:1008 msgid "" "The :meth:`split`, :meth:`replace`, :meth:`rindex`, :meth:`rpartition`, and :" "meth:`rsplit` methods of string-like types (strings, Unicode strings, and :" @@ -1067,24 +1068,24 @@ msgid "" "10. (Added by Florent Xicluna; :issue:`7462` and :issue:`7622`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1014 +#: ../../whatsnew/2.7.rst:1015 msgid "" "The :mod:`pickle` and :mod:`cPickle` modules now automatically intern the " "strings used for attribute names, reducing memory usage of the objects " "resulting from unpickling. (Contributed by Jake McGuire; :issue:`5084`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1019 +#: ../../whatsnew/2.7.rst:1020 msgid "" "The :mod:`cPickle` module now special-cases dictionaries, nearly halving the " "time required to pickle them. (Contributed by Collin Winter; :issue:`5670`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1026 +#: ../../whatsnew/2.7.rst:1027 msgid "New and Improved Modules" msgstr "" -#: ../../whatsnew/2.7.rst:1028 +#: ../../whatsnew/2.7.rst:1029 msgid "" "As in every release, Python's standard library received a number of " "enhancements and bug fixes. Here's a partial list of the most notable " @@ -1093,7 +1094,7 @@ msgid "" "the Subversion logs for all the details." msgstr "" -#: ../../whatsnew/2.7.rst:1034 +#: ../../whatsnew/2.7.rst:1035 msgid "" "The :mod:`bdb` module's base debugging class :class:`~bdb.Bdb` gained a " "feature for skipping modules. The constructor now takes an iterable " @@ -1103,14 +1104,14 @@ msgid "" "`5142`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1042 +#: ../../whatsnew/2.7.rst:1043 msgid "" "The :mod:`binascii` module now supports the buffer API, so it can be used " "with :class:`memoryview` instances and other similar buffer objects. " "(Backported from 3.x by Florent Xicluna; :issue:`7703`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1046 +#: ../../whatsnew/2.7.rst:1047 msgid "" "Updated module: the :mod:`bsddb` module has been updated from 4.7.2devel9 to " "version 4.8.4 of `the pybsddb package ``, ``>=``) between fractions and " "complex numbers now raise a :exc:`TypeError`. This fixes an oversight, " "making the :class:`~fractions.Fraction` match the other numeric types." msgstr "" -#: ../../whatsnew/2.7.rst:1259 +#: ../../whatsnew/2.7.rst:1260 msgid "" "New class: :class:`~ftplib.FTP_TLS` in the :mod:`ftplib` module provides " "secure FTP connections using TLS encapsulation of authentication as well as " @@ -1346,14 +1347,14 @@ msgid "" "issue:`2054`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1265 +#: ../../whatsnew/2.7.rst:1266 msgid "" "The :meth:`~ftplib.FTP.storbinary` method for binary uploads can now restart " "uploads thanks to an added *rest* parameter (patch by Pablo Mouzo; :issue:" "`6845`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1269 +#: ../../whatsnew/2.7.rst:1270 msgid "" "New class decorator: :func:`~functools.total_ordering` in the :mod:" "`functools` module takes a class that defines an :meth:`__eq__` method and " @@ -1363,7 +1364,7 @@ msgid "" "define ordered classes. (Added by Raymond Hettinger; :issue:`5479`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1277 +#: ../../whatsnew/2.7.rst:1278 msgid "" "New function: :func:`~functools.cmp_to_key` will take an old-style " "comparison function that expects two arguments and return a new callable " @@ -1373,14 +1374,14 @@ msgid "" "Hettinger.)" msgstr "" -#: ../../whatsnew/2.7.rst:1284 +#: ../../whatsnew/2.7.rst:1285 msgid "" "New function: the :mod:`gc` module's :func:`~gc.is_tracked` returns true if " "a given instance is tracked by the garbage collector, false otherwise. " "(Contributed by Antoine Pitrou; :issue:`4688`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1288 +#: ../../whatsnew/2.7.rst:1289 msgid "" "The :mod:`gzip` module's :class:`~gzip.GzipFile` now supports the context " "management protocol, so you can write ``with gzip.GzipFile(...) as f:`` " @@ -1392,14 +1393,14 @@ msgid "" "(Contributed by Jacques Frechet; :issue:`4272`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1298 +#: ../../whatsnew/2.7.rst:1299 msgid "" "Files in gzip format can be padded with trailing zero bytes; the :mod:`gzip` " "module will now consume these trailing bytes. (Fixed by Tadek Pietraszek " "and Brian Curtin; :issue:`2846`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1302 +#: ../../whatsnew/2.7.rst:1303 msgid "" "New attribute: the :mod:`hashlib` module now has an :attr:`~hashlib.hashlib." "algorithms` attribute containing a tuple naming the supported algorithms. In " @@ -1407,14 +1408,14 @@ msgid "" "'sha256', 'sha384', 'sha512')``. (Contributed by Carl Chenet; :issue:`7418`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1308 +#: ../../whatsnew/2.7.rst:1309 msgid "" "The default :class:`~httplib.HTTPResponse` class used by the :mod:`httplib` " "module now supports buffering, resulting in much faster reading of HTTP " "responses. (Contributed by Kristján Valur Jónsson; :issue:`4879`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1312 +#: ../../whatsnew/2.7.rst:1313 msgid "" "The :class:`~httplib.HTTPConnection` and :class:`~httplib.HTTPSConnection` " "classes now support a *source_address* parameter, a ``(host, port)`` 2-tuple " @@ -1422,7 +1423,7 @@ msgid "" "by Eldon Ziegler; :issue:`3972`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1317 +#: ../../whatsnew/2.7.rst:1318 msgid "" "The :mod:`ihooks` module now supports relative imports. Note that :mod:" "`ihooks` is an older module for customizing imports, superseded by the :mod:" @@ -1430,13 +1431,13 @@ msgid "" "Schemenauer.)" msgstr "" -#: ../../whatsnew/2.7.rst:1324 +#: ../../whatsnew/2.7.rst:1325 msgid "" "The :mod:`imaplib` module now supports IPv6 addresses. (Contributed by Derek " "Morr; :issue:`1655`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1327 +#: ../../whatsnew/2.7.rst:1328 msgid "" "New function: the :mod:`inspect` module's :func:`~inspect.getcallargs` takes " "a callable and its positional and keyword arguments, and figures out which " @@ -1444,11 +1445,11 @@ msgid "" "dictionary mapping argument names to their values. For example::" msgstr "" -#: ../../whatsnew/2.7.rst:1345 +#: ../../whatsnew/2.7.rst:1346 msgid "Contributed by George Sakkis; :issue:`3135`." msgstr "" -#: ../../whatsnew/2.7.rst:1347 +#: ../../whatsnew/2.7.rst:1348 msgid "" "Updated module: The :mod:`io` library has been upgraded to the version " "shipped with Python 3.1. For 3.1, the I/O library was entirely rewritten in " @@ -1456,14 +1457,14 @@ msgid "" "original Python version was renamed to the :mod:`_pyio` module." msgstr "" -#: ../../whatsnew/2.7.rst:1352 +#: ../../whatsnew/2.7.rst:1353 msgid "" "One minor resulting change: the :class:`io.TextIOBase` class now has an :" "attr:`errors` attribute giving the error setting used for encoding and " "decoding errors (one of ``'strict'``, ``'replace'``, ``'ignore'``)." msgstr "" -#: ../../whatsnew/2.7.rst:1357 +#: ../../whatsnew/2.7.rst:1358 msgid "" "The :class:`io.FileIO` class now raises an :exc:`OSError` when passed an " "invalid file descriptor. (Implemented by Benjamin Peterson; :issue:" @@ -1472,14 +1473,14 @@ msgid "" "file. (Fixed by Pascal Chambon; :issue:`6939`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1363 +#: ../../whatsnew/2.7.rst:1364 msgid "" "New function: ``itertools.compress(data, selectors)`` takes two iterators. " "Elements of *data* are returned if the corresponding value in *selectors* is " "true::" msgstr "" -#: ../../whatsnew/2.7.rst:1372 +#: ../../whatsnew/2.7.rst:1373 msgid "" "New function: ``itertools.combinations_with_replacement(iter, r)`` returns " "all the possible *r*-length combinations of elements from the iterable " @@ -1487,13 +1488,13 @@ msgid "" "repeated in the generated combinations::" msgstr "" -#: ../../whatsnew/2.7.rst:1381 +#: ../../whatsnew/2.7.rst:1382 msgid "" "Note that elements are treated as unique depending on their position in the " "input, not their actual values." msgstr "" -#: ../../whatsnew/2.7.rst:1384 +#: ../../whatsnew/2.7.rst:1385 msgid "" "The :func:`itertools.count` function now has a *step* argument that allows " "incrementing by values other than 1. :func:`~itertools.count` also now " @@ -1502,7 +1503,7 @@ msgid "" "issue:`5032`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1390 +#: ../../whatsnew/2.7.rst:1391 msgid "" ":func:`itertools.combinations` and :func:`itertools.product` previously " "raised :exc:`ValueError` for values of *r* larger than the input iterable. " @@ -1510,14 +1511,14 @@ msgid "" "iterator. (Fixed by Raymond Hettinger; :issue:`4816`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1395 +#: ../../whatsnew/2.7.rst:1396 msgid "" "Updated module: The :mod:`json` module was upgraded to version 2.0.9 of the " "simplejson package, which includes a C extension that makes encoding and " "decoding faster. (Contributed by Bob Ippolito; :issue:`4136`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1400 +#: ../../whatsnew/2.7.rst:1401 msgid "" "To support the new :class:`collections.OrderedDict` type, :func:`json.load` " "now has an optional *object_pairs_hook* parameter that will be called with " @@ -1525,7 +1526,7 @@ msgid "" "Hettinger; :issue:`5381`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1405 +#: ../../whatsnew/2.7.rst:1406 msgid "" "The :mod:`mailbox` module's :class:`~mailbox.Maildir` class now records the " "timestamp on the directories it reads, and only re-reads them if the " @@ -1534,7 +1535,7 @@ msgid "" "Pitrou; :issue:`1607951`, :issue:`6896`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1411 +#: ../../whatsnew/2.7.rst:1412 msgid "" "New functions: the :mod:`math` module gained :func:`~math.erf` and :func:" "`~math.erfc` for the error function and the complementary error function, :" @@ -1545,7 +1546,7 @@ msgid "" "`3366`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1419 +#: ../../whatsnew/2.7.rst:1420 msgid "" "The :mod:`multiprocessing` module's :class:`Manager*` classes can now be " "passed a callable that will be called whenever a subprocess is started, " @@ -1553,7 +1554,7 @@ msgid "" "(Contributed by lekma; :issue:`5585`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1425 +#: ../../whatsnew/2.7.rst:1426 msgid "" "The :class:`~multiprocessing.Pool` class, which controls a pool of worker " "processes, now has an optional *maxtasksperchild* parameter. Worker " @@ -1563,13 +1564,13 @@ msgid "" "worker to become very large. (Contributed by Charles Cazabon; :issue:`6963`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1433 +#: ../../whatsnew/2.7.rst:1434 msgid "" "The :mod:`nntplib` module now supports IPv6 addresses. (Contributed by Derek " "Morr; :issue:`1664`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1436 +#: ../../whatsnew/2.7.rst:1437 msgid "" "New functions: the :mod:`os` module wraps the following POSIX system calls: :" "func:`~os.getresgid` and :func:`~os.getresuid`, which return the real, " @@ -1580,14 +1581,14 @@ msgid "" "`6508`. Support for initgroups added by Jean-Paul Calderone; :issue:`7333`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1446 +#: ../../whatsnew/2.7.rst:1447 msgid "" "The :func:`os.fork` function now re-initializes the import lock in the child " "process; this fixes problems on Solaris when :func:`~os.fork` is called from " "a thread. (Fixed by Zsolt Cserna; :issue:`7242`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1450 +#: ../../whatsnew/2.7.rst:1451 msgid "" "In the :mod:`os.path` module, the :func:`~os.path.normpath` and :func:`~os." "path.abspath` functions now preserve Unicode; if their input path is a " @@ -1596,21 +1597,21 @@ msgid "" "fixed by Ezio Melotti in :issue:`3426`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1456 +#: ../../whatsnew/2.7.rst:1457 msgid "" "The :mod:`pydoc` module now has help for the various symbols that Python " "uses. You can now do ``help('<<')`` or ``help('@')``, for example. " "(Contributed by David Laban; :issue:`4739`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1460 +#: ../../whatsnew/2.7.rst:1461 msgid "" "The :mod:`re` module's :func:`~re.split`, :func:`~re.sub`, and :func:`~re." "subn` now accept an optional *flags* argument, for consistency with the " "other functions in the module. (Added by Gregory P. Smith.)" msgstr "" -#: ../../whatsnew/2.7.rst:1464 +#: ../../whatsnew/2.7.rst:1465 msgid "" "New function: :func:`~runpy.run_path` in the :mod:`runpy` module will " "execute the code at a provided *path* argument. *path* can be the path of a " @@ -1625,7 +1626,7 @@ msgid "" "processes an explicit path name. (Added by Nick Coghlan; :issue:`6816`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1478 +#: ../../whatsnew/2.7.rst:1479 msgid "" "New function: in the :mod:`shutil` module, :func:`~shutil.make_archive` " "takes a filename, archive type (zip or tar-format), and a directory path, " @@ -1633,7 +1634,7 @@ msgid "" "Ziadé.)" msgstr "" -#: ../../whatsnew/2.7.rst:1483 +#: ../../whatsnew/2.7.rst:1484 msgid "" ":mod:`shutil`'s :func:`~shutil.copyfile` and :func:`~shutil.copytree` " "functions now raise a :exc:`~shutil.SpecialFileError` exception when asked " @@ -1642,7 +1643,7 @@ msgid "" "indefinitely. (Fixed by Antoine Pitrou; :issue:`3002`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1489 +#: ../../whatsnew/2.7.rst:1490 msgid "" "The :mod:`signal` module no longer re-installs the signal handler unless " "this is truly necessary, which fixes a bug that could make it impossible to " @@ -1650,7 +1651,7 @@ msgid "" "`8354`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1494 +#: ../../whatsnew/2.7.rst:1495 msgid "" "New functions: in the :mod:`site` module, three new functions return various " "site- and user-specific paths. :func:`~site.getsitepackages` returns a list " @@ -1661,7 +1662,7 @@ msgid "" "store data. (Contributed by Tarek Ziadé; :issue:`6693`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1505 +#: ../../whatsnew/2.7.rst:1506 msgid "" "The :mod:`site` module now reports exceptions occurring when the :mod:" "`sitecustomize` module is imported, and will no longer catch and swallow " @@ -1669,14 +1670,14 @@ msgid "" "`3137`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1510 +#: ../../whatsnew/2.7.rst:1511 msgid "" "The :func:`~socket.create_connection` function gained a *source_address* " "parameter, a ``(host, port)`` 2-tuple giving the source address that will be " "used for the connection. (Contributed by Eldon Ziegler; :issue:`3972`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1515 +#: ../../whatsnew/2.7.rst:1516 msgid "" "The :meth:`~socket.socket.recv_into` and :meth:`~socket.socket." "recvfrom_into` methods will now write into objects that support the buffer " @@ -1684,7 +1685,7 @@ msgid "" "(Implemented by Antoine Pitrou; :issue:`8104`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1520 +#: ../../whatsnew/2.7.rst:1521 msgid "" "The :mod:`SocketServer` module's :class:`~SocketServer.TCPServer` class now " "supports socket timeouts and disabling the Nagle algorithm. The :attr:" @@ -1699,7 +1700,7 @@ msgid "" "Jónsson; :issue:`6192` and :issue:`6267`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1532 +#: ../../whatsnew/2.7.rst:1533 msgid "" "Updated module: the :mod:`sqlite3` module has been updated to version 2.6.0 " "of the `pysqlite package `__. Version " @@ -1710,7 +1711,7 @@ msgid "" "Häring.)" msgstr "" -#: ../../whatsnew/2.7.rst:1539 +#: ../../whatsnew/2.7.rst:1540 msgid "" "The :mod:`ssl` module's :class:`~ssl.SSLSocket` objects now support the " "buffer API, which fixed a test suite failure (fix by Antoine Pitrou; :issue:" @@ -1719,7 +1720,7 @@ msgid "" "that trigger an SSL renegotiation (fix by Antoine Pitrou; :issue:`8222`)." msgstr "" -#: ../../whatsnew/2.7.rst:1546 +#: ../../whatsnew/2.7.rst:1547 msgid "" "The :func:`ssl.wrap_socket` constructor function now takes a *ciphers* " "argument that's a string listing the encryption algorithms to be allowed; " @@ -1728,7 +1729,7 @@ msgid "" "Pitrou; :issue:`8322`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1553 +#: ../../whatsnew/2.7.rst:1554 msgid "" "Another change makes the extension load all of OpenSSL's ciphers and digest " "algorithms so that they're all available. Some SSL certificates couldn't be " @@ -1736,7 +1737,7 @@ msgid "" "Kosata, and fixed by Antoine Pitrou; :issue:`8484`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1559 +#: ../../whatsnew/2.7.rst:1560 msgid "" "The version of OpenSSL being used is now available as the module attributes :" "const:`ssl.OPENSSL_VERSION` (a string), :const:`ssl.OPENSSL_VERSION_INFO` (a " @@ -1744,7 +1745,7 @@ msgid "" "Antoine Pitrou; :issue:`8321`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1565 +#: ../../whatsnew/2.7.rst:1566 msgid "" "The :mod:`struct` module will no longer silently ignore overflow errors when " "a value is too large for a particular integer format code (one of " @@ -1755,7 +1756,7 @@ msgid "" "(Changed by Mark Dickinson; :issue:`8300`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1574 +#: ../../whatsnew/2.7.rst:1575 msgid "" "New function: the :mod:`subprocess` module's :func:`~subprocess." "check_output` runs a command with a specified set of arguments and returns " @@ -1763,18 +1764,18 @@ msgid "" "raises a :exc:`~subprocess.CalledProcessError` exception otherwise." msgstr "" -#: ../../whatsnew/2.7.rst:1589 +#: ../../whatsnew/2.7.rst:1590 msgid "(Contributed by Gregory P. Smith.)" msgstr "(由 Gregory P. Smith 所貢獻。)" -#: ../../whatsnew/2.7.rst:1591 +#: ../../whatsnew/2.7.rst:1592 msgid "" "The :mod:`subprocess` module will now retry its internal system calls on " "receiving an :const:`EINTR` signal. (Reported by several people; final " "patch by Gregory P. Smith in :issue:`1068268`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1595 +#: ../../whatsnew/2.7.rst:1596 msgid "" "New function: :func:`~symtable.Symbol.is_declared_global` in the :mod:" "`symtable` module returns true for variables that are explicitly declared to " @@ -1782,21 +1783,21 @@ msgid "" "Hylton.)" msgstr "" -#: ../../whatsnew/2.7.rst:1600 ../../whatsnew/2.7.rst:2498 +#: ../../whatsnew/2.7.rst:1601 ../../whatsnew/2.7.rst:2499 msgid "" "The :mod:`syslog` module will now use the value of ``sys.argv[0]`` as the " "identifier instead of the previous default value of ``'python'``. (Changed " "by Sean Reifschneider; :issue:`8451`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1604 +#: ../../whatsnew/2.7.rst:1605 msgid "" "The ``sys.version_info`` value is now a named tuple, with attributes named :" "attr:`major`, :attr:`minor`, :attr:`micro`, :attr:`releaselevel`, and :attr:" "`serial`. (Contributed by Ross Light; :issue:`4285`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1609 +#: ../../whatsnew/2.7.rst:1610 msgid "" ":func:`sys.getwindowsversion` also returns a named tuple, with attributes " "named :attr:`major`, :attr:`minor`, :attr:`build`, :attr:`platform`, :attr:" @@ -1805,7 +1806,7 @@ msgid "" "issue:`7766`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1615 ../../whatsnew/2.7.rst:2502 +#: ../../whatsnew/2.7.rst:1616 ../../whatsnew/2.7.rst:2503 msgid "" "The :mod:`tarfile` module's default error handling has changed, to no longer " "suppress fatal errors. The default error level was previously 0, which " @@ -1815,7 +1816,7 @@ msgid "" "there's an error. (Changed by Lars Gustäbel; :issue:`7357`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1623 +#: ../../whatsnew/2.7.rst:1624 msgid "" ":mod:`tarfile` now supports filtering the :class:`~tarfile.TarInfo` objects " "being added to a tar file. When you call :meth:`~tarfile.TarFile.add`, you " @@ -1829,7 +1830,7 @@ msgid "" "issue:`7232`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1635 +#: ../../whatsnew/2.7.rst:1636 msgid "" "The :meth:`~threading.Event.wait` method of the :class:`threading.Event` " "class now returns the internal flag on exit. This means the method will " @@ -1839,7 +1840,7 @@ msgid "" "Tim Lesher; :issue:`1674032`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1642 +#: ../../whatsnew/2.7.rst:1643 msgid "" "The Unicode database provided by the :mod:`unicodedata` module is now used " "internally to determine which characters are numeric, whitespace, or " @@ -1849,7 +1850,7 @@ msgid "" "Florent Xicluna; :issue:`8024`)." msgstr "" -#: ../../whatsnew/2.7.rst:1650 ../../whatsnew/2.7.rst:2510 +#: ../../whatsnew/2.7.rst:1651 ../../whatsnew/2.7.rst:2511 msgid "" "The :mod:`urlparse` module's :func:`~urlparse.urlsplit` now handles unknown " "URL schemes in a fashion compliant with :rfc:`3986`: if the URL is of the " @@ -1859,23 +1860,23 @@ msgid "" "For example, Python 2.6.4 or 2.5 will return the following:" msgstr "" -#: ../../whatsnew/2.7.rst:1665 ../../whatsnew/2.7.rst:2525 +#: ../../whatsnew/2.7.rst:1666 ../../whatsnew/2.7.rst:2526 msgid "Python 2.7 (and Python 2.6.5) will return:" msgstr "" -#: ../../whatsnew/2.7.rst:1674 ../../whatsnew/2.7.rst:2534 +#: ../../whatsnew/2.7.rst:1675 ../../whatsnew/2.7.rst:2535 msgid "" "(Python 2.7 actually produces slightly different output, since it returns a " "named tuple instead of a standard tuple.)" msgstr "" -#: ../../whatsnew/2.7.rst:1677 +#: ../../whatsnew/2.7.rst:1678 msgid "" "The :mod:`urlparse` module also supports IPv6 literal addresses as defined " "by :rfc:`2732` (contributed by Senthil Kumaran; :issue:`2987`)." msgstr "" -#: ../../whatsnew/2.7.rst:1687 +#: ../../whatsnew/2.7.rst:1688 msgid "" "New class: the :class:`~weakref.WeakSet` class in the :mod:`weakref` module " "is a set that only holds weak references to its elements; elements will be " @@ -1884,7 +1885,7 @@ msgid "" "Michael Foord.)" msgstr "" -#: ../../whatsnew/2.7.rst:1693 ../../whatsnew/2.7.rst:2488 +#: ../../whatsnew/2.7.rst:1694 ../../whatsnew/2.7.rst:2489 msgid "" "The ElementTree library, :mod:`xml.etree`, no longer escapes ampersands and " "angle brackets when outputting an XML processing instruction (which looks " @@ -1892,7 +1893,7 @@ msgid "" "````). (Patch by Neil Muller; :issue:`2746`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1699 +#: ../../whatsnew/2.7.rst:1700 msgid "" "The XML-RPC client and server, provided by the :mod:`xmlrpclib` and :mod:" "`SimpleXMLRPCServer` modules, have improved performance by supporting " @@ -1903,14 +1904,14 @@ msgid "" "(Contributed by Kristján Valur Jónsson; :issue:`6267`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1708 +#: ../../whatsnew/2.7.rst:1709 msgid "" "The :mod:`zipfile` module's :class:`~zipfile.ZipFile` now supports the " "context management protocol, so you can write ``with zipfile.ZipFile(...) as " "f:``. (Contributed by Brian Curtin; :issue:`5511`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1712 +#: ../../whatsnew/2.7.rst:1713 msgid "" ":mod:`zipfile` now also supports archiving empty directories and extracts " "them correctly. (Fixed by Kuba Wieczorek; :issue:`4710`.) Reading files out " @@ -1919,14 +1920,14 @@ msgid "" "Aides; :issue:`7610`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1718 +#: ../../whatsnew/2.7.rst:1719 msgid "" "The :func:`~zipfile.is_zipfile` function now accepts a file object, in " "addition to the path names accepted in earlier versions. (Contributed by " "Gabriel Genellina; :issue:`4756`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1722 +#: ../../whatsnew/2.7.rst:1723 msgid "" "The :meth:`~zipfile.ZipFile.writestr` method now has an optional " "*compress_type* parameter that lets you override the default compression " @@ -1934,11 +1935,11 @@ msgid "" "by Ronald Oussoren; :issue:`6003`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1735 +#: ../../whatsnew/2.7.rst:1736 msgid "New module: importlib" msgstr "" -#: ../../whatsnew/2.7.rst:1737 +#: ../../whatsnew/2.7.rst:1738 msgid "" "Python 3.1 includes the :mod:`importlib` package, a re-implementation of the " "logic underlying Python's :keyword:`import` statement. :mod:`importlib` is " @@ -1949,7 +1950,7 @@ msgid "" "import_module`." msgstr "" -#: ../../whatsnew/2.7.rst:1745 +#: ../../whatsnew/2.7.rst:1746 msgid "" "``import_module(name, package=None)`` imports a module. *name* is a string " "containing the module or package's name. It's possible to do relative " @@ -1960,24 +1961,24 @@ msgid "" "imported module into ``sys.modules`` and returns the module object." msgstr "" -#: ../../whatsnew/2.7.rst:1754 +#: ../../whatsnew/2.7.rst:1755 msgid "Here are some examples::" msgstr "" "以下是一些範例:\n" "\n" "::" -#: ../../whatsnew/2.7.rst:1765 +#: ../../whatsnew/2.7.rst:1766 msgid "" ":mod:`importlib` was implemented by Brett Cannon and introduced in Python " "3.1." msgstr "" -#: ../../whatsnew/2.7.rst:1770 +#: ../../whatsnew/2.7.rst:1771 msgid "New module: sysconfig" msgstr "" -#: ../../whatsnew/2.7.rst:1772 +#: ../../whatsnew/2.7.rst:1773 msgid "" "The :mod:`sysconfig` module has been pulled out of the Distutils package, " "becoming a new top-level module in its own right. :mod:`sysconfig` provides " @@ -1986,42 +1987,42 @@ msgid "" "running from its source directory." msgstr "" -#: ../../whatsnew/2.7.rst:1779 +#: ../../whatsnew/2.7.rst:1780 msgid "Some of the functions in the module are:" msgstr "" -#: ../../whatsnew/2.7.rst:1781 +#: ../../whatsnew/2.7.rst:1782 msgid "" ":func:`~sysconfig.get_config_var` returns variables from Python's Makefile " "and the :file:`pyconfig.h` file." msgstr "" -#: ../../whatsnew/2.7.rst:1783 +#: ../../whatsnew/2.7.rst:1784 msgid "" ":func:`~sysconfig.get_config_vars` returns a dictionary containing all of " "the configuration variables." msgstr "" -#: ../../whatsnew/2.7.rst:1785 +#: ../../whatsnew/2.7.rst:1786 msgid "" ":func:`~sysconfig.get_path` returns the configured path for a particular " "type of module: the standard library, site-specific modules, platform-" "specific modules, etc." msgstr "" -#: ../../whatsnew/2.7.rst:1788 +#: ../../whatsnew/2.7.rst:1789 msgid "" ":func:`~sysconfig.is_python_build` returns true if you're running a binary " "from a Python source tree, and false otherwise." msgstr "" -#: ../../whatsnew/2.7.rst:1791 +#: ../../whatsnew/2.7.rst:1792 msgid "" "Consult the :mod:`sysconfig` documentation for more details and for a " "complete list of functions." msgstr "" -#: ../../whatsnew/2.7.rst:1794 +#: ../../whatsnew/2.7.rst:1795 msgid "" "The Distutils package and :mod:`sysconfig` are now maintained by Tarek " "Ziadé, who has also started a Distutils2 package (source repository at " @@ -2029,11 +2030,11 @@ msgid "" "of Distutils." msgstr "" -#: ../../whatsnew/2.7.rst:1801 +#: ../../whatsnew/2.7.rst:1802 msgid "ttk: Themed Widgets for Tk" msgstr "" -#: ../../whatsnew/2.7.rst:1803 +#: ../../whatsnew/2.7.rst:1804 msgid "" "Tcl/Tk 8.5 includes a set of themed widgets that re-implement basic Tk " "widgets but have a more customizable appearance and can therefore more " @@ -2042,7 +2043,7 @@ msgid "" "added to Tcl/Tck release 8.5." msgstr "" -#: ../../whatsnew/2.7.rst:1809 +#: ../../whatsnew/2.7.rst:1810 msgid "" "To learn more, read the :mod:`ttk` module documentation. You may also wish " "to read the Tcl/Tk manual page describing the Ttk theme engine, available at " @@ -2051,7 +2052,7 @@ msgid "" "wikis/Screenshots.wiki." msgstr "" -#: ../../whatsnew/2.7.rst:1816 +#: ../../whatsnew/2.7.rst:1817 msgid "" "The :mod:`ttk` module was written by Guilherme Polo and added in :issue:" "`2983`. An alternate version called ``Tile.py``, written by Martin Franklin " @@ -2059,11 +2060,11 @@ msgid "" "but the authors argued that Guilherme Polo's work was more comprehensive." msgstr "" -#: ../../whatsnew/2.7.rst:1826 +#: ../../whatsnew/2.7.rst:1827 msgid "Updated module: unittest" msgstr "" -#: ../../whatsnew/2.7.rst:1828 +#: ../../whatsnew/2.7.rst:1829 msgid "" "The :mod:`unittest` module was greatly enhanced; many new features were " "added. Most of these features were implemented by Michael Foord, unless " @@ -2072,7 +2073,7 @@ msgid "" "`unittest2` package, from https://pypi.org/project/unittest2." msgstr "" -#: ../../whatsnew/2.7.rst:1835 +#: ../../whatsnew/2.7.rst:1836 msgid "" "When used from the command line, the module can automatically discover " "tests. It's not as fancy as `py.test `__ or `nose " @@ -2082,17 +2083,17 @@ msgid "" "files named ``test*.py``::" msgstr "" -#: ../../whatsnew/2.7.rst:1844 +#: ../../whatsnew/2.7.rst:1845 msgid "" "Consult the :mod:`unittest` module documentation for more details. " "(Developed in :issue:`6001`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1847 +#: ../../whatsnew/2.7.rst:1848 msgid "The :func:`~unittest.main` function supports some other new options:" msgstr "" -#: ../../whatsnew/2.7.rst:1849 +#: ../../whatsnew/2.7.rst:1850 msgid "" ":option:`-b ` or :option:`!--buffer` will buffer the standard " "output and standard error streams during each test. If the test passes, any " @@ -2100,7 +2101,7 @@ msgid "" "displayed." msgstr "" -#: ../../whatsnew/2.7.rst:1854 +#: ../../whatsnew/2.7.rst:1855 msgid "" ":option:`-c ` or :option:`!--catch` will cause the control-C " "interrupt to be handled more gracefully. Instead of interrupting the test " @@ -2109,7 +2110,7 @@ msgid "" "impatient, a second press of control-C will cause an immediate interruption." msgstr "" -#: ../../whatsnew/2.7.rst:1861 +#: ../../whatsnew/2.7.rst:1862 msgid "" "This control-C handler tries to avoid causing problems when the code being " "tested or the tests being run have defined a signal handler of their own, by " @@ -2119,7 +2120,7 @@ msgid "" "disabled." msgstr "" -#: ../../whatsnew/2.7.rst:1868 +#: ../../whatsnew/2.7.rst:1869 msgid "" ":option:`-f ` or :option:`!--failfast` makes test execution " "stop immediately when a test fails instead of continuing to execute further " @@ -2127,20 +2128,20 @@ msgid "" "`8074`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1873 +#: ../../whatsnew/2.7.rst:1874 msgid "" "The progress messages now show 'x' for expected failures and 'u' for " "unexpected successes when run in verbose mode. (Contributed by Benjamin " "Peterson.)" msgstr "" -#: ../../whatsnew/2.7.rst:1877 +#: ../../whatsnew/2.7.rst:1878 msgid "" "Test cases can raise the :exc:`~unittest.SkipTest` exception to skip a test " "(:issue:`1034053`)." msgstr "" -#: ../../whatsnew/2.7.rst:1880 +#: ../../whatsnew/2.7.rst:1881 msgid "" "The error messages for :meth:`~unittest.TestCase.assertEqual`, :meth:" "`~unittest.TestCase.assertTrue`, and :meth:`~unittest.TestCase.assertFalse` " @@ -2151,18 +2152,18 @@ msgid "" "`5663`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1887 +#: ../../whatsnew/2.7.rst:1888 msgid "" "The :meth:`~unittest.TestCase.assertRaises` method now returns a context " "handler when called without providing a callable object to run. For " "example, you can write this::" msgstr "" -#: ../../whatsnew/2.7.rst:1894 +#: ../../whatsnew/2.7.rst:1895 msgid "(Implemented by Antoine Pitrou; :issue:`4444`.)" msgstr "(由 Antoine Pitrou 實作;:issue:`4444`。)" -#: ../../whatsnew/2.7.rst:1898 +#: ../../whatsnew/2.7.rst:1899 msgid "" "Module- and class-level setup and teardown fixtures are now supported. " "Modules can contain :func:`~unittest.setUpModule` and :func:`~unittest." @@ -2173,7 +2174,7 @@ msgid "" "case in a different module or class." msgstr "" -#: ../../whatsnew/2.7.rst:1906 +#: ../../whatsnew/2.7.rst:1907 msgid "" "The methods :meth:`~unittest.TestCase.addCleanup` and :meth:`~unittest." "TestCase.doCleanups` were added. :meth:`~unittest.TestCase.addCleanup` lets " @@ -2183,7 +2184,7 @@ msgid "" "simpler resource allocation and deallocation during tests (:issue:`5679`)." msgstr "" -#: ../../whatsnew/2.7.rst:1914 +#: ../../whatsnew/2.7.rst:1915 msgid "" "A number of new methods were added that provide more specialized tests. " "Many of these methods were written by Google engineers for use in their test " @@ -2191,21 +2192,21 @@ msgid "" "Python's version of :mod:`unittest`." msgstr "" -#: ../../whatsnew/2.7.rst:1919 +#: ../../whatsnew/2.7.rst:1920 msgid "" ":meth:`~unittest.TestCase.assertIsNone` and :meth:`~unittest.TestCase." "assertIsNotNone` take one expression and verify that the result is or is not " "``None``." msgstr "" -#: ../../whatsnew/2.7.rst:1922 +#: ../../whatsnew/2.7.rst:1923 msgid "" ":meth:`~unittest.TestCase.assertIs` and :meth:`~unittest.TestCase." "assertIsNot` take two values and check whether the two values evaluate to " "the same object or not. (Added by Michael Foord; :issue:`2578`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1926 +#: ../../whatsnew/2.7.rst:1927 msgid "" ":meth:`~unittest.TestCase.assertIsInstance` and :meth:`~unittest.TestCase." "assertNotIsInstance` check whether the resulting object is an instance of a " @@ -2213,14 +2214,14 @@ msgid "" "issue:`7031`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1931 +#: ../../whatsnew/2.7.rst:1932 msgid "" ":meth:`~unittest.TestCase.assertGreater`, :meth:`~unittest.TestCase." "assertGreaterEqual`, :meth:`~unittest.TestCase.assertLess`, and :meth:" "`~unittest.TestCase.assertLessEqual` compare two quantities." msgstr "" -#: ../../whatsnew/2.7.rst:1935 +#: ../../whatsnew/2.7.rst:1936 msgid "" ":meth:`~unittest.TestCase.assertMultiLineEqual` compares two strings, and if " "they're not equal, displays a helpful comparison that highlights the " @@ -2228,7 +2229,7 @@ msgid "" "Unicode strings are compared with :meth:`~unittest.TestCase.assertEqual`." msgstr "" -#: ../../whatsnew/2.7.rst:1940 +#: ../../whatsnew/2.7.rst:1941 msgid "" ":meth:`~unittest.TestCase.assertRegexpMatches` and :meth:`~unittest.TestCase." "assertNotRegexpMatches` checks whether the first argument is a string " @@ -2236,32 +2237,32 @@ msgid "" "argument (:issue:`8038`)." msgstr "" -#: ../../whatsnew/2.7.rst:1945 +#: ../../whatsnew/2.7.rst:1946 msgid "" ":meth:`~unittest.TestCase.assertRaisesRegexp` checks whether a particular " "exception is raised, and then also checks that the string representation of " "the exception matches the provided regular expression." msgstr "" -#: ../../whatsnew/2.7.rst:1949 +#: ../../whatsnew/2.7.rst:1950 msgid "" ":meth:`~unittest.TestCase.assertIn` and :meth:`~unittest.TestCase." "assertNotIn` tests whether *first* is or is not in *second*." msgstr "" -#: ../../whatsnew/2.7.rst:1952 +#: ../../whatsnew/2.7.rst:1953 msgid "" ":meth:`~unittest.TestCase.assertItemsEqual` tests whether two provided " "sequences contain the same elements." msgstr "" -#: ../../whatsnew/2.7.rst:1955 +#: ../../whatsnew/2.7.rst:1956 msgid "" ":meth:`~unittest.TestCase.assertSetEqual` compares whether two sets are " "equal, and only reports the differences between the sets in case of error." msgstr "" -#: ../../whatsnew/2.7.rst:1958 +#: ../../whatsnew/2.7.rst:1959 msgid "" "Similarly, :meth:`~unittest.TestCase.assertListEqual` and :meth:`~unittest." "TestCase.assertTupleEqual` compare the specified types and explain any " @@ -2272,7 +2273,7 @@ msgid "" "both sequences are of a particular type." msgstr "" -#: ../../whatsnew/2.7.rst:1966 +#: ../../whatsnew/2.7.rst:1967 msgid "" ":meth:`~unittest.TestCase.assertDictEqual` compares two dictionaries and " "reports the differences; it's now used by default when you compare two " @@ -2281,7 +2282,7 @@ msgid "" "in *first* are found in *second*." msgstr "" -#: ../../whatsnew/2.7.rst:1971 +#: ../../whatsnew/2.7.rst:1972 msgid "" ":meth:`~unittest.TestCase.assertAlmostEqual` and :meth:`~unittest.TestCase." "assertNotAlmostEqual` test whether *first* and *second* are approximately " @@ -2290,14 +2291,14 @@ msgid "" "require the difference to be smaller than a supplied *delta* value." msgstr "" -#: ../../whatsnew/2.7.rst:1977 +#: ../../whatsnew/2.7.rst:1978 msgid "" ":meth:`~unittest.TestLoader.loadTestsFromName` properly honors the :attr:" "`~unittest.TestLoader.suiteClass` attribute of the :class:`~unittest." "TestLoader`. (Fixed by Mark Roddy; :issue:`6866`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1981 +#: ../../whatsnew/2.7.rst:1982 msgid "" "A new hook lets you extend the :meth:`~unittest.TestCase.assertEqual` method " "to handle new data types. The :meth:`~unittest.TestCase." @@ -2309,7 +2310,7 @@ msgid "" "sequence comparison methods do." msgstr "" -#: ../../whatsnew/2.7.rst:1990 +#: ../../whatsnew/2.7.rst:1991 msgid "" ":func:`unittest.main` now takes an optional ``exit`` argument. If false, :" "func:`~unittest.main` doesn't call :func:`sys.exit`, allowing :func:" @@ -2317,7 +2318,7 @@ msgid "" "by J. Pablo Fernández; :issue:`3379`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1995 +#: ../../whatsnew/2.7.rst:1996 msgid "" ":class:`~unittest.TestResult` has new :meth:`~unittest.TestResult." "startTestRun` and :meth:`~unittest.TestResult.stopTestRun` methods that are " @@ -2325,7 +2326,7 @@ msgid "" "Collins; :issue:`5728`.)" msgstr "" -#: ../../whatsnew/2.7.rst:1999 +#: ../../whatsnew/2.7.rst:2000 msgid "" "With all these changes, the :file:`unittest.py` was becoming awkwardly " "large, so the module was turned into a package and the code split into " @@ -2333,7 +2334,7 @@ msgid "" "imported or used." msgstr "" -#: ../../whatsnew/2.7.rst:2007 +#: ../../whatsnew/2.7.rst:2008 msgid "" "https://web.archive.org/web/20210619163128/http://www.voidspace.org.uk/" "python/articles/unittest2.shtml" @@ -2341,37 +2342,37 @@ msgstr "" "https://web.archive.org/web/20210619163128/http://www.voidspace.org.uk/" "python/articles/unittest2.shtml" -#: ../../whatsnew/2.7.rst:2007 +#: ../../whatsnew/2.7.rst:2008 msgid "" "Describes the new features, how to use them, and the rationale for various " "design decisions. (By Michael Foord.)" msgstr "" -#: ../../whatsnew/2.7.rst:2013 +#: ../../whatsnew/2.7.rst:2014 msgid "Updated module: ElementTree 1.3" msgstr "" -#: ../../whatsnew/2.7.rst:2015 +#: ../../whatsnew/2.7.rst:2016 msgid "" "The version of the ElementTree library included with Python was updated to " "version 1.3. Some of the new features are:" msgstr "" -#: ../../whatsnew/2.7.rst:2018 +#: ../../whatsnew/2.7.rst:2019 msgid "" "The various parsing functions now take a *parser* keyword argument giving " "an :class:`~xml.etree.ElementTree.XMLParser` instance that will be used. " "This makes it possible to override the file's internal encoding::" msgstr "" -#: ../../whatsnew/2.7.rst:2025 +#: ../../whatsnew/2.7.rst:2026 msgid "" "Errors in parsing XML now raise a :exc:`ParseError` exception, whose " "instances have a :attr:`position` attribute containing a (*line*, *column*) " "tuple giving the location of the problem." msgstr "" -#: ../../whatsnew/2.7.rst:2029 +#: ../../whatsnew/2.7.rst:2030 msgid "" "ElementTree's code for converting trees to a string has been significantly " "reworked, making it roughly twice as fast in many cases. The :meth:" @@ -2385,7 +2386,7 @@ msgid "" "to do more extensive rearrangement to remove a single element." msgstr "" -#: ../../whatsnew/2.7.rst:2041 +#: ../../whatsnew/2.7.rst:2042 msgid "" "Namespace handling has also been improved. All ``xmlns:`` " "declarations are now output on the root element, not scattered throughout " @@ -2395,7 +2396,7 @@ msgid "" "the true/false *xml_declaration* parameter to suppress the XML declaration." msgstr "" -#: ../../whatsnew/2.7.rst:2049 +#: ../../whatsnew/2.7.rst:2050 msgid "" "New :class:`~xml.etree.ElementTree.Element` method: :meth:`~xml.etree." "ElementTree.Element.extend` appends the items from a sequence to the " @@ -2403,7 +2404,7 @@ msgid "" "to move children from one element to another::" msgstr "" -#: ../../whatsnew/2.7.rst:2066 +#: ../../whatsnew/2.7.rst:2067 msgid "" "New :class:`Element` method: :meth:`~xml.etree.ElementTree.Element.iter` " "yields the children of the element as a generator. It's also possible to " @@ -2412,13 +2413,13 @@ msgid "" "`getchildren` which constructs and returns a list of children." msgstr "" -#: ../../whatsnew/2.7.rst:2073 +#: ../../whatsnew/2.7.rst:2074 msgid "" "New :class:`Element` method: :meth:`~xml.etree.ElementTree.Element.itertext` " "yields all chunks of text that are descendants of the element. For example::" msgstr "" -#: ../../whatsnew/2.7.rst:2084 +#: ../../whatsnew/2.7.rst:2085 msgid "" "Deprecated: using an element as a Boolean (i.e., ``if elem:``) would return " "true if the element had any children, or false if there were no children. " @@ -2428,7 +2429,7 @@ msgid "" "number of children, or ``elem is not None``." msgstr "" -#: ../../whatsnew/2.7.rst:2092 +#: ../../whatsnew/2.7.rst:2093 msgid "" "Fredrik Lundh develops ElementTree and produced the 1.3 version; you can " "read his article describing 1.3 at https://web.archive.org/" @@ -2437,15 +2438,15 @@ msgid "" "python-dev and in :issue:`6472`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2102 +#: ../../whatsnew/2.7.rst:2103 msgid "Build and C API Changes" msgstr "" -#: ../../whatsnew/2.7.rst:2104 +#: ../../whatsnew/2.7.rst:2105 msgid "Changes to Python's build process and to the C API include:" msgstr "" -#: ../../whatsnew/2.7.rst:2106 +#: ../../whatsnew/2.7.rst:2107 msgid "" "The latest release of the GNU Debugger, GDB 7, can be `scripted using Python " "`_; discussed in :issue:`5753`, and fixed by " "Antoine Pitrou." msgstr "" -#: ../../whatsnew/2.7.rst:2181 +#: ../../whatsnew/2.7.rst:2182 msgid "" "New macros: the Python header files now define the following macros: :c:" "macro:`Py_ISALNUM`, :c:macro:`Py_ISALPHA`, :c:macro:`Py_ISDIGIT`, :c:macro:" @@ -2564,7 +2565,7 @@ msgid "" "Eric Smith; :issue:`5793`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2199 +#: ../../whatsnew/2.7.rst:2200 msgid "" "Removed function: :c:func:`!PyEval_CallObject` is now only available as a " "macro. A function version was being kept around to preserve ABI linking " @@ -2572,7 +2573,7 @@ msgid "" "(Removed by Antoine Pitrou; :issue:`8276`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2204 +#: ../../whatsnew/2.7.rst:2205 msgid "" "New format codes: the :c:func:`!PyString_FromFormat`, :c:func:`!" "PyString_FromFormatV`, and :c:func:`PyErr_Format` functions now accept " @@ -2580,7 +2581,7 @@ msgid "" "types. (Contributed by Mark Dickinson; :issue:`7228`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2210 +#: ../../whatsnew/2.7.rst:2211 msgid "" "The complicated interaction between threads and process forking has been " "changed. Previously, the child process created by :func:`os.fork` might " @@ -2592,7 +2593,7 @@ msgid "" "replicated, and the child process would no longer be able to perform imports." msgstr "" -#: ../../whatsnew/2.7.rst:2220 +#: ../../whatsnew/2.7.rst:2221 msgid "" "Python 2.7 acquires the import lock before performing an :func:`os.fork`, " "and will also clean up any locks created using the :mod:`threading` module. " @@ -2600,38 +2601,38 @@ msgid "" "themselves, will not benefit from this clean-up." msgstr "" -#: ../../whatsnew/2.7.rst:2226 +#: ../../whatsnew/2.7.rst:2227 msgid "(Fixed by Thomas Wouters; :issue:`1590864`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2228 +#: ../../whatsnew/2.7.rst:2229 msgid "" "The :c:func:`Py_Finalize` function now calls the internal :func:`threading." "_shutdown` function; this prevents some exceptions from being raised when an " "interpreter shuts down. (Patch by Adam Olsen; :issue:`1722344`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2233 +#: ../../whatsnew/2.7.rst:2234 msgid "" "When using the :c:type:`PyMemberDef` structure to define attributes of a " "type, Python will no longer let you try to delete or set a :c:macro:" "`T_STRING_INPLACE` attribute." msgstr "" -#: ../../whatsnew/2.7.rst:2239 +#: ../../whatsnew/2.7.rst:2240 msgid "" "Global symbols defined by the :mod:`ctypes` module are now prefixed with " "``Py``, or with ``_ctypes``. (Implemented by Thomas Heller; :issue:`3102`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2243 +#: ../../whatsnew/2.7.rst:2244 msgid "" "New configure option: the :option:`!--with-system-expat` switch allows " "building the :mod:`pyexpat` module to use the system Expat library. " "(Contributed by Arfrever Frehtes Taifersar Arahesis; :issue:`7609`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2247 +#: ../../whatsnew/2.7.rst:2248 msgid "" "New configure option: the :option:`!--with-valgrind` option will now disable " "the pymalloc allocator, which is difficult for the Valgrind memory-error " @@ -2640,14 +2641,14 @@ msgid "" "issue:`2422`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2254 +#: ../../whatsnew/2.7.rst:2255 msgid "" "New configure option: you can now supply an empty string to :option:`!--with-" "dbmliborder=` in order to disable all of the various DBM modules. (Added by " "Arfrever Frehtes Taifersar Arahesis; :issue:`6491`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2259 +#: ../../whatsnew/2.7.rst:2260 msgid "" "The :program:`configure` script now checks for floating-point rounding bugs " "on certain 32-bit Intel chips and defines a :c:macro:`X87_DOUBLE_ROUNDING` " @@ -2656,30 +2657,30 @@ msgid "" "`2937`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2265 +#: ../../whatsnew/2.7.rst:2266 msgid "" ":program:`configure` also now sets a :envvar:`LDCXXSHARED` Makefile variable " "for supporting C++ linking. (Contributed by Arfrever Frehtes Taifersar " "Arahesis; :issue:`1222585`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2269 +#: ../../whatsnew/2.7.rst:2270 msgid "" "The build process now creates the necessary files for pkg-config support. " "(Contributed by Clinton Roy; :issue:`3585`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2272 +#: ../../whatsnew/2.7.rst:2273 msgid "" "The build process now supports Subversion 1.7. (Contributed by Arfrever " "Frehtes Taifersar Arahesis; :issue:`6094`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2279 +#: ../../whatsnew/2.7.rst:2280 msgid "Capsules" msgstr "" -#: ../../whatsnew/2.7.rst:2281 +#: ../../whatsnew/2.7.rst:2282 msgid "" "Python 3.1 adds a new C datatype, :c:type:`PyCapsule`, for providing a C API " "to an extension module. A capsule is essentially the holder of a C ``void " @@ -2691,7 +2692,7 @@ msgid "" "module's various API functions." msgstr "" -#: ../../whatsnew/2.7.rst:2290 +#: ../../whatsnew/2.7.rst:2291 msgid "" "There is an existing data type already used for this, :c:type:`!PyCObject`, " "but it doesn't provide type safety. Evil code written in pure Python could " @@ -2701,7 +2702,7 @@ msgid "" "name:" msgstr "" -#: ../../whatsnew/2.7.rst:2308 +#: ../../whatsnew/2.7.rst:2309 msgid "" "You are assured that ``vtable`` points to whatever you're expecting. If a " "different capsule was passed in, :c:func:`PyCapsule_IsValid` would detect " @@ -2709,7 +2710,7 @@ msgid "" "more information on using these objects." msgstr "" -#: ../../whatsnew/2.7.rst:2313 +#: ../../whatsnew/2.7.rst:2314 msgid "" "Python 2.7 now uses capsules internally to provide various extension-module " "APIs, but the :c:func:`!PyCObject_AsVoidPtr` was modified to handle " @@ -2718,17 +2719,17 @@ msgid "" "exc:`PendingDeprecationWarning`, which is silent by default." msgstr "" -#: ../../whatsnew/2.7.rst:2320 +#: ../../whatsnew/2.7.rst:2321 msgid "" "Implemented in Python 3.1 and backported to 2.7 by Larry Hastings; discussed " "in :issue:`5630`." msgstr "" -#: ../../whatsnew/2.7.rst:2327 +#: ../../whatsnew/2.7.rst:2328 msgid "Port-Specific Changes: Windows" msgstr "" -#: ../../whatsnew/2.7.rst:2329 +#: ../../whatsnew/2.7.rst:2330 msgid "" "The :mod:`msvcrt` module now contains some constants from the :file:" "`crtassem.h` header file: :data:`CRT_ASSEMBLY_VERSION`, :data:" @@ -2736,7 +2737,7 @@ msgid "" "(Contributed by David Cournapeau; :issue:`4365`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2336 +#: ../../whatsnew/2.7.rst:2337 msgid "" "The :mod:`_winreg` module for accessing the registry now implements the :" "func:`~_winreg.CreateKeyEx` and :func:`~_winreg.DeleteKeyEx` functions, " @@ -2746,14 +2747,14 @@ msgid "" "tested and documented. (Implemented by Brian Curtin: :issue:`7347`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2344 +#: ../../whatsnew/2.7.rst:2345 msgid "" "The new :c:func:`_beginthreadex` API is used to start threads, and the " "native thread-local storage functions are now used. (Contributed by Kristján " "Valur Jónsson; :issue:`3582`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2348 +#: ../../whatsnew/2.7.rst:2349 msgid "" "The :func:`os.kill` function now works on Windows. The signal value can be " "the constants :const:`CTRL_C_EVENT`, :const:`CTRL_BREAK_EVENT`, or any " @@ -2763,23 +2764,23 @@ msgid "" "`1220212`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2355 +#: ../../whatsnew/2.7.rst:2356 msgid "" "The :func:`os.listdir` function now correctly fails for an empty path. " "(Fixed by Hirokazu Yamamoto; :issue:`5913`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2358 +#: ../../whatsnew/2.7.rst:2359 msgid "" "The :mod:`mimelib` module will now read the MIME database from the Windows " "registry when initializing. (Patch by Gabriel Genellina; :issue:`4969`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2365 +#: ../../whatsnew/2.7.rst:2366 msgid "Port-Specific Changes: Mac OS X" msgstr "" -#: ../../whatsnew/2.7.rst:2367 +#: ../../whatsnew/2.7.rst:2368 msgid "" "The path ``/Library/Python/2.7/site-packages`` is now appended to ``sys." "path``, in order to share added packages between the system installation and " @@ -2787,7 +2788,7 @@ msgid "" "issue:`4865`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2374 +#: ../../whatsnew/2.7.rst:2375 msgid "" "As of 2.7.13, this change was removed. ``/Library/Python/2.7/site-" "packages``, the site-packages directory used by the Apple-supplied system " @@ -2799,11 +2800,11 @@ msgid "" "Pythons. (:issue:`28440`)" msgstr "" -#: ../../whatsnew/2.7.rst:2385 +#: ../../whatsnew/2.7.rst:2386 msgid "Port-Specific Changes: FreeBSD" msgstr "" -#: ../../whatsnew/2.7.rst:2387 +#: ../../whatsnew/2.7.rst:2388 msgid "" "FreeBSD 7.1's :const:`SO_SETFIB` constant, used with the :func:`~socket." "socket` methods :func:`~socket.socket.getsockopt`/:func:`~socket.socket." @@ -2811,11 +2812,11 @@ msgid "" "mod:`socket` module. (Added by Kyle VanderBeek; :issue:`8235`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2393 +#: ../../whatsnew/2.7.rst:2394 msgid "Other Changes and Fixes" msgstr "" -#: ../../whatsnew/2.7.rst:2395 +#: ../../whatsnew/2.7.rst:2396 msgid "" "Two benchmark scripts, :file:`iobench` and :file:`ccbench`, were added to " "the :file:`Tools` directory. :file:`iobench` measures the speed of the " @@ -2825,23 +2826,23 @@ msgid "" "bandwidth when performing several tasks using a varying number of threads." msgstr "" -#: ../../whatsnew/2.7.rst:2403 +#: ../../whatsnew/2.7.rst:2404 msgid "" "The :file:`Tools/i18n/msgfmt.py` script now understands plural forms in :" "file:`.po` files. (Fixed by Martin von Löwis; :issue:`5464`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2407 +#: ../../whatsnew/2.7.rst:2408 msgid "" "When importing a module from a :file:`.pyc` or :file:`.pyo` file with an " -"existing :file:`.py` counterpart, the :attr:`co_filename` attributes of the " -"resulting code objects are overwritten when the original filename is " -"obsolete. This can happen if the file has been renamed, moved, or is " -"accessed through different paths. (Patch by Ziga Seilnacht and Jean-Paul " -"Calderone; :issue:`1180193`.)" +"existing :file:`.py` counterpart, the :attr:`~codeobject.co_filename` " +"attributes of the resulting code objects are overwritten when the original " +"filename is obsolete. This can happen if the file has been renamed, moved, " +"or is accessed through different paths. (Patch by Ziga Seilnacht and Jean-" +"Paul Calderone; :issue:`1180193`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2414 +#: ../../whatsnew/2.7.rst:2415 msgid "" "The :file:`regrtest.py` script now takes a :option:`!--randseed=` switch " "that takes an integer that will be used as the random seed for the :option:" @@ -2849,7 +2850,7 @@ msgid "" "also reports the seed that was used (Added by Collin Winter.)" msgstr "" -#: ../../whatsnew/2.7.rst:2420 +#: ../../whatsnew/2.7.rst:2421 msgid "" "Another :file:`regrtest.py` switch is :option:`!-j`, which takes an integer " "specifying how many tests run in parallel. This allows reducing the total " @@ -2860,31 +2861,31 @@ msgid "" "they fail. (Added by Antoine Pitrou; :issue:`7312`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2429 +#: ../../whatsnew/2.7.rst:2430 msgid "" "When executed as a script, the :file:`py_compile.py` module now accepts " "``'-'`` as an argument, which will read standard input for the list of " "filenames to be compiled. (Contributed by Piotr Ożarowski; :issue:`8233`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2437 +#: ../../whatsnew/2.7.rst:2438 msgid "Porting to Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2439 +#: ../../whatsnew/2.7.rst:2440 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code:" msgstr "" -#: ../../whatsnew/2.7.rst:2442 +#: ../../whatsnew/2.7.rst:2443 msgid "" "The :func:`range` function processes its arguments more consistently; it " "will now call :meth:`__int__` on non-float, non-integer arguments that are " "supplied to it. (Fixed by Alexander Belopolsky; :issue:`1533`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2447 +#: ../../whatsnew/2.7.rst:2448 msgid "" "The string :meth:`format` method changed the default precision used for " "floating-point and complex numbers from 6 decimal places to 12, which " @@ -2892,7 +2893,7 @@ msgid "" "`5920`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2452 +#: ../../whatsnew/2.7.rst:2453 msgid "" "Because of an optimization for the :keyword:`with` statement, the special " "methods :meth:`~object.__enter__` and :meth:`~object.__exit__` must belong " @@ -2901,7 +2902,7 @@ msgid "" "C extension types. (:issue:`6101`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2458 +#: ../../whatsnew/2.7.rst:2459 msgid "" "Due to a bug in Python 2.6, the *exc_value* parameter to :meth:`~object." "__exit__` methods was often the string representation of the exception, not " @@ -2909,11 +2910,11 @@ msgid "" "expected. (Fixed by Florent Xicluna; :issue:`7853`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2468 +#: ../../whatsnew/2.7.rst:2469 msgid "In the standard library:" msgstr "" -#: ../../whatsnew/2.7.rst:2470 +#: ../../whatsnew/2.7.rst:2471 msgid "" "Operations with :class:`~datetime.datetime` instances that resulted in a " "year falling outside the supported range didn't always raise :exc:" @@ -2922,7 +2923,7 @@ msgid "" "Alexander Belopolsky; :issue:`7150`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2476 +#: ../../whatsnew/2.7.rst:2477 msgid "" "When using :class:`~decimal.Decimal` instances with a string's :meth:" "`format` method, the default alignment was previously left-alignment. This " @@ -2930,7 +2931,7 @@ msgid "" "programs. (Changed by Mark Dickinson; :issue:`6857`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2482 +#: ../../whatsnew/2.7.rst:2483 msgid "" "Comparisons involving a signaling NaN value (or ``sNAN``) now signal :const:" "`~decimal.InvalidOperation` instead of silently returning a true or false " @@ -2938,36 +2939,36 @@ msgid "" "are now hashable. (Fixed by Mark Dickinson; :issue:`7279`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2494 +#: ../../whatsnew/2.7.rst:2495 msgid "" "The :meth:`~StringIO.StringIO.readline` method of :class:`~StringIO." "StringIO` objects now does nothing when a negative length is requested, as " "other file-like objects do. (:issue:`7348`)." msgstr "" -#: ../../whatsnew/2.7.rst:2537 +#: ../../whatsnew/2.7.rst:2538 msgid "For C extensions:" msgstr "" -#: ../../whatsnew/2.7.rst:2539 +#: ../../whatsnew/2.7.rst:2540 msgid "" "C extensions that use integer format codes with the ``PyArg_Parse*`` family " "of functions will now raise a :exc:`TypeError` exception instead of " "triggering a :exc:`DeprecationWarning` (:issue:`5080`)." msgstr "" -#: ../../whatsnew/2.7.rst:2543 +#: ../../whatsnew/2.7.rst:2544 msgid "" "Use the new :c:func:`PyOS_string_to_double` function instead of the old :c:" "func:`!PyOS_ascii_strtod` and :c:func:`!PyOS_ascii_atof` functions, which " "are now deprecated." msgstr "" -#: ../../whatsnew/2.7.rst:2547 +#: ../../whatsnew/2.7.rst:2548 msgid "For applications that embed Python:" msgstr "" -#: ../../whatsnew/2.7.rst:2549 +#: ../../whatsnew/2.7.rst:2550 msgid "" "The :c:func:`PySys_SetArgvEx` function was added, letting applications close " "a security hole when the existing :c:func:`PySys_SetArgv` function was " @@ -2976,11 +2977,11 @@ msgid "" "with *updatepath* set to false." msgstr "" -#: ../../whatsnew/2.7.rst:2562 +#: ../../whatsnew/2.7.rst:2563 msgid "New Features Added to Python 2.7 Maintenance Releases" msgstr "" -#: ../../whatsnew/2.7.rst:2564 +#: ../../whatsnew/2.7.rst:2565 msgid "" "New features may be added to Python 2.7 maintenance releases when the " "situation genuinely calls for it. Any such additions must go through the " @@ -2989,25 +2990,25 @@ msgid "" "Python 3, or else by publishing it on the Python Package Index." msgstr "" -#: ../../whatsnew/2.7.rst:2570 +#: ../../whatsnew/2.7.rst:2571 msgid "" "In addition to the specific proposals listed below, there is a general " "exemption allowing new ``-3`` warnings to be added in any Python 2.7 " "maintenance release." msgstr "" -#: ../../whatsnew/2.7.rst:2576 +#: ../../whatsnew/2.7.rst:2577 msgid "Two new environment variables for debug mode" msgstr "" -#: ../../whatsnew/2.7.rst:2578 +#: ../../whatsnew/2.7.rst:2579 msgid "" "In debug mode, the ``[xxx refs]`` statistic is not written by default, the :" "envvar:`PYTHONSHOWREFCOUNT` environment variable now must also be set. " "(Contributed by Victor Stinner; :issue:`31733`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2582 +#: ../../whatsnew/2.7.rst:2583 msgid "" "When Python is compiled with ``COUNT_ALLOC`` defined, allocation counts are " "no longer dumped by default anymore: the :envvar:`PYTHONSHOWALLOCCOUNT` " @@ -3016,11 +3017,11 @@ msgid "" "issue:`31692`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2591 +#: ../../whatsnew/2.7.rst:2592 msgid "PEP 434: IDLE Enhancement Exception for All Branches" msgstr "" -#: ../../whatsnew/2.7.rst:2593 +#: ../../whatsnew/2.7.rst:2594 msgid "" ":pep:`434` describes a general exemption for changes made to the IDLE " "development environment shipped along with Python. This exemption makes it " @@ -3028,62 +3029,62 @@ msgid "" "experience across all supported versions of Python 2 and 3." msgstr "" -#: ../../whatsnew/2.7.rst:2598 +#: ../../whatsnew/2.7.rst:2599 msgid "" "For details of any IDLE changes, refer to the NEWS file for the specific " "release." msgstr "" -#: ../../whatsnew/2.7.rst:2603 +#: ../../whatsnew/2.7.rst:2604 msgid "PEP 466: Network Security Enhancements for Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2605 +#: ../../whatsnew/2.7.rst:2606 msgid "" ":pep:`466` describes a number of network security enhancement proposals that " "have been approved for inclusion in Python 2.7 maintenance releases, with " "the first of those changes appearing in the Python 2.7.7 release." msgstr "" -#: ../../whatsnew/2.7.rst:2609 +#: ../../whatsnew/2.7.rst:2610 msgid ":pep:`466` related features added in Python 2.7.7:" msgstr "" -#: ../../whatsnew/2.7.rst:2611 +#: ../../whatsnew/2.7.rst:2612 msgid "" ":func:`hmac.compare_digest` was backported from Python 3 to make a timing " "attack resistant comparison operation available to Python 2 applications. " "(Contributed by Alex Gaynor; :issue:`21306`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2615 +#: ../../whatsnew/2.7.rst:2616 msgid "" "OpenSSL 1.0.1g was upgraded in the official Windows installers published on " "python.org. (Contributed by Zachary Ware; :issue:`21462`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2618 +#: ../../whatsnew/2.7.rst:2619 msgid ":pep:`466` related features added in Python 2.7.8:" msgstr "" -#: ../../whatsnew/2.7.rst:2620 +#: ../../whatsnew/2.7.rst:2621 msgid "" ":func:`hashlib.pbkdf2_hmac` was backported from Python 3 to make a hashing " "algorithm suitable for secure password storage broadly available to Python 2 " "applications. (Contributed by Alex Gaynor; :issue:`21304`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2624 +#: ../../whatsnew/2.7.rst:2625 msgid "" "OpenSSL 1.0.1h was upgraded for the official Windows installers published on " "python.org. (contributed by Zachary Ware in :issue:`21671` for CVE-2014-0224)" msgstr "" -#: ../../whatsnew/2.7.rst:2627 +#: ../../whatsnew/2.7.rst:2628 msgid ":pep:`466` related features added in Python 2.7.9:" msgstr "" -#: ../../whatsnew/2.7.rst:2629 +#: ../../whatsnew/2.7.rst:2630 msgid "" "Most of Python 3.4's :mod:`ssl` module was backported. This means :mod:`ssl` " "now supports Server Name Indication, TLS1.x settings, access to the platform " @@ -3091,20 +3092,20 @@ msgid "" "(Contributed by Alex Gaynor and David Reid; :issue:`21308`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2634 +#: ../../whatsnew/2.7.rst:2635 msgid "" "Refer to the \"Version added: 2.7.9\" notes in the module documentation for " "specific details." msgstr "" -#: ../../whatsnew/2.7.rst:2637 +#: ../../whatsnew/2.7.rst:2638 msgid "" ":func:`os.urandom` was changed to cache a file descriptor to ``/dev/" "urandom`` instead of reopening ``/dev/urandom`` on every call. (Contributed " "by Alex Gaynor; :issue:`21305`.)" msgstr "" -#: ../../whatsnew/2.7.rst:2641 +#: ../../whatsnew/2.7.rst:2642 msgid "" ":data:`hashlib.algorithms_guaranteed` and :data:`hashlib." "algorithms_available` were backported from Python 3 to make it easier for " @@ -3112,22 +3113,22 @@ msgid "" "(Contributed by Alex Gaynor in :issue:`21307`)" msgstr "" -#: ../../whatsnew/2.7.rst:2648 +#: ../../whatsnew/2.7.rst:2649 msgid "PEP 477: Backport ensurepip (PEP 453) to Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2650 +#: ../../whatsnew/2.7.rst:2651 msgid "" ":pep:`477` approves the inclusion of the :pep:`453` ensurepip module and the " "improved documentation that was enabled by it in the Python 2.7 maintenance " "releases, appearing first in the Python 2.7.9 release." msgstr "" -#: ../../whatsnew/2.7.rst:2656 +#: ../../whatsnew/2.7.rst:2657 msgid "Bootstrapping pip By Default" msgstr "" -#: ../../whatsnew/2.7.rst:2658 +#: ../../whatsnew/2.7.rst:2659 msgid "" "The new :mod:`ensurepip` module (defined in :pep:`453`) provides a standard " "cross-platform mechanism to bootstrap the pip installer into Python " @@ -3137,14 +3138,14 @@ msgid "" "the release candidate." msgstr "" -#: ../../whatsnew/2.7.rst:2665 +#: ../../whatsnew/2.7.rst:2666 msgid "" "By default, the commands ``pip``, ``pipX`` and ``pipX.Y`` will be installed " "on all platforms (where X.Y stands for the version of the Python " "installation), along with the ``pip`` Python package and its dependencies." msgstr "" -#: ../../whatsnew/2.7.rst:2669 +#: ../../whatsnew/2.7.rst:2670 msgid "" "For CPython :ref:`source builds on POSIX systems `, " "the ``make install`` and ``make altinstall`` commands do not bootstrap " @@ -3152,7 +3153,7 @@ msgid "" "options, and overridden through Makefile options." msgstr "" -#: ../../whatsnew/2.7.rst:2674 +#: ../../whatsnew/2.7.rst:2675 msgid "" "On Windows and Mac OS X, the CPython installers now default to installing " "``pip`` along with CPython itself (users may opt out of installing it during " @@ -3162,7 +3163,7 @@ msgid "" "Windows as ``py -m pip``." msgstr "" -#: ../../whatsnew/2.7.rst:2681 +#: ../../whatsnew/2.7.rst:2682 msgid "" "As `discussed in the PEP`__, platform packagers may choose not to install " "these commands by default, as long as, when invoked, they provide clear and " @@ -3170,11 +3171,11 @@ msgid "" "system package manager)." msgstr "" -#: ../../whatsnew/2.7.rst:2690 +#: ../../whatsnew/2.7.rst:2691 msgid "Documentation Changes" msgstr "" -#: ../../whatsnew/2.7.rst:2692 +#: ../../whatsnew/2.7.rst:2693 msgid "" "As part of this change, the :ref:`installing-index` and :ref:`distributing-" "index` sections of the documentation have been completely redesigned as " @@ -3184,29 +3185,29 @@ msgid "" "of the individual projects." msgstr "" -#: ../../whatsnew/2.7.rst:2700 +#: ../../whatsnew/2.7.rst:2701 msgid "" "However, as this migration is currently still incomplete, the legacy " "versions of those guides remaining available as :ref:`install-index` and :" "ref:`setuptools-index`." msgstr "" -#: ../../whatsnew/2.7.rst:2707 +#: ../../whatsnew/2.7.rst:2708 msgid ":pep:`453` -- Explicit bootstrapping of pip in Python installations" msgstr "" -#: ../../whatsnew/2.7.rst:2707 +#: ../../whatsnew/2.7.rst:2708 msgid "" "PEP written by Donald Stufft and Nick Coghlan, implemented by Donald Stufft, " "Nick Coghlan, Martin von Löwis and Ned Deily." msgstr "" -#: ../../whatsnew/2.7.rst:2711 +#: ../../whatsnew/2.7.rst:2712 msgid "" "PEP 476: Enabling certificate verification by default for stdlib http clients" msgstr "" -#: ../../whatsnew/2.7.rst:2713 +#: ../../whatsnew/2.7.rst:2714 msgid "" ":pep:`476` updated :mod:`httplib` and modules which use it, such as :mod:" "`urllib2` and :mod:`xmlrpclib`, to now verify that the server presents a " @@ -3216,17 +3217,17 @@ msgid "" "in the Python 2.7.9 release." msgstr "" -#: ../../whatsnew/2.7.rst:2720 +#: ../../whatsnew/2.7.rst:2721 msgid "" "For applications which require the old previous behavior, they can pass an " "alternate context::" msgstr "" -#: ../../whatsnew/2.7.rst:2737 +#: ../../whatsnew/2.7.rst:2738 msgid "PEP 493: HTTPS verification migration tools for Python 2.7" msgstr "" -#: ../../whatsnew/2.7.rst:2739 +#: ../../whatsnew/2.7.rst:2740 msgid "" ":pep:`493` provides additional migration tools to support a more incremental " "infrastructure upgrade process for environments containing applications and " @@ -3235,14 +3236,14 @@ msgid "" "were made in the Python 2.7.12 release." msgstr "" -#: ../../whatsnew/2.7.rst:2745 +#: ../../whatsnew/2.7.rst:2746 msgid "" "These tools are intended for use in cases where affected applications and " "services can't be modified to explicitly pass a more permissive SSL context " "when establishing the connection." msgstr "" -#: ../../whatsnew/2.7.rst:2749 +#: ../../whatsnew/2.7.rst:2750 msgid "" "For applications and services which can't be modified at all, the new " "``PYTHONHTTPSVERIFY`` environment variable may be set to ``0`` to revert an " @@ -3250,18 +3251,18 @@ msgid "" "2.7.8 and earlier." msgstr "" -#: ../../whatsnew/2.7.rst:2754 +#: ../../whatsnew/2.7.rst:2755 msgid "" "For cases where the connection establishment code can't be modified, but the " "overall application can be, the new :func:`ssl._https_verify_certificates` " "function can be used to adjust the default behaviour at runtime." msgstr "" -#: ../../whatsnew/2.7.rst:2760 +#: ../../whatsnew/2.7.rst:2761 msgid "New ``make regen-all`` build target" msgstr "" -#: ../../whatsnew/2.7.rst:2762 +#: ../../whatsnew/2.7.rst:2763 msgid "" "To simplify cross-compilation, and to ensure that CPython can reliably be " "compiled without requiring an existing version of Python to already be " @@ -3269,43 +3270,43 @@ msgid "" "recompile generated files based on file modification times." msgstr "" -#: ../../whatsnew/2.7.rst:2767 +#: ../../whatsnew/2.7.rst:2768 msgid "" "Instead, a new ``make regen-all`` command has been added to force " "regeneration of these files when desired (e.g. after an initial version of " "Python has already been built based on the pregenerated versions)." msgstr "" -#: ../../whatsnew/2.7.rst:2771 +#: ../../whatsnew/2.7.rst:2772 msgid "" "More selective regeneration targets are also defined - see :source:`Makefile." "pre.in` for details." msgstr "" -#: ../../whatsnew/2.7.rst:2774 ../../whatsnew/2.7.rst:2787 +#: ../../whatsnew/2.7.rst:2775 ../../whatsnew/2.7.rst:2788 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" msgstr "(由 Victor Stinner 於 :issue:`23404` 中貢獻。)" -#: ../../whatsnew/2.7.rst:2780 +#: ../../whatsnew/2.7.rst:2781 msgid "Removal of ``make touch`` build target" msgstr "" -#: ../../whatsnew/2.7.rst:2782 +#: ../../whatsnew/2.7.rst:2783 msgid "" "The ``make touch`` build target previously used to request implicit " "regeneration of generated files by updating their modification times has " "been removed." msgstr "" -#: ../../whatsnew/2.7.rst:2785 +#: ../../whatsnew/2.7.rst:2786 msgid "It has been replaced by the new ``make regen-all`` target." msgstr "" -#: ../../whatsnew/2.7.rst:2796 +#: ../../whatsnew/2.7.rst:2797 msgid "Acknowledgements" msgstr "致謝" -#: ../../whatsnew/2.7.rst:2798 +#: ../../whatsnew/2.7.rst:2799 msgid "" "The author would like to thank the following people for offering " "suggestions, corrections and assistance with various drafts of this article: " diff --git a/whatsnew/3.10.po b/whatsnew/3.10.po index d87e8dbae5..dd93dcbf24 100644 --- a/whatsnew/3.10.po +++ b/whatsnew/3.10.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-06 00:03+0000\n" +"POT-Creation-Date: 2023-12-07 00:03+0000\n" "PO-Revision-Date: 2023-06-26 03:02+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -125,7 +125,7 @@ msgstr ":pep:`624`,刪除 Py_UNICODE 編碼器 API" msgid ":pep:`597`, Add optional EncodingWarning" msgstr ":pep:`597`,新增可選的 EncodingWarning" -#: ../../whatsnew/3.10.rst:92 ../../whatsnew/3.10.rst:2043 +#: ../../whatsnew/3.10.rst:92 ../../whatsnew/3.10.rst:2044 msgid "New Features" msgstr "新功能" @@ -393,18 +393,18 @@ msgstr "影格 (frame) 物件的 :attr:`~frame.f_lineno` 屬性總會包含預 #: ../../whatsnew/3.10.rst:405 msgid "" -"The ``co_lnotab`` attribute of code objects is deprecated and will be " -"removed in 3.12. Code that needs to convert from offset to line number " -"should use the new ``co_lines()`` method instead." +"The :attr:`~codeobject.co_lnotab` attribute of code objects is deprecated " +"and will be removed in 3.12. Code that needs to convert from offset to line " +"number should use the new ``co_lines()`` method instead." msgstr "" -"程式碼物件的 ``co_lnotab`` 屬性已棄用,並將在 3.12 中刪除。需要從偏移量轉換為" -"列號的程式碼應使用新的 ``co_lines()`` 方法。" +"程式碼物件的 :attr:`~codeobject.co_lnotab` 屬性已棄用,並將在 3.12 中刪除。需" +"要從偏移量轉換為列號的程式碼應使用新的 ``co_lines()`` 方法。" -#: ../../whatsnew/3.10.rst:409 +#: ../../whatsnew/3.10.rst:410 msgid "PEP 634: Structural Pattern Matching" msgstr "PEP 634:結構模式匹配" -#: ../../whatsnew/3.10.rst:411 +#: ../../whatsnew/3.10.rst:412 msgid "" "Structural pattern matching has been added in the form of a *match " "statement* and *case statements* of patterns with associated actions. " @@ -418,15 +418,15 @@ msgstr "" "(primitive data types) 以及類別實例組成。模式匹配使程式能夠從複雜的資料型別中" "提取資訊,在資料結構上進行分支,並根據不同形式的資料應用特定的操作。" -#: ../../whatsnew/3.10.rst:419 +#: ../../whatsnew/3.10.rst:420 msgid "Syntax and operations" msgstr "語法和操作" -#: ../../whatsnew/3.10.rst:421 +#: ../../whatsnew/3.10.rst:422 msgid "The generic syntax of pattern matching is::" msgstr "模式匹配的通用語法是:" -#: ../../whatsnew/3.10.rst:433 +#: ../../whatsnew/3.10.rst:434 msgid "" "A match statement takes an expression and compares its value to successive " "patterns given as one or more case blocks. Specifically, pattern matching " @@ -435,25 +435,25 @@ msgstr "" "match 陳述式採用一個運算式,並將其值與作為一個或多個 case 區塊給出的連續模式" "進行比較。具體來說,模式匹配是透過以下方式進行操作:" -#: ../../whatsnew/3.10.rst:437 +#: ../../whatsnew/3.10.rst:438 msgid "using data with type and shape (the ``subject``)" msgstr "使用具有型態 (type) 和特徵 (shape) 的資料 (主語 ``subject``)" -#: ../../whatsnew/3.10.rst:438 +#: ../../whatsnew/3.10.rst:439 msgid "evaluating the ``subject`` in the ``match`` statement" msgstr "``match`` 陳述式中 ``subject`` 的求值 (evaluating)" -#: ../../whatsnew/3.10.rst:439 +#: ../../whatsnew/3.10.rst:440 msgid "" "comparing the subject with each pattern in a ``case`` statement from top to " "bottom until a match is confirmed." msgstr "從上到下將主語與 ``case`` 陳述式中的每個模式進行比較,直到確認匹配。" -#: ../../whatsnew/3.10.rst:441 +#: ../../whatsnew/3.10.rst:442 msgid "executing the action associated with the pattern of the confirmed match" msgstr "執行與已確認匹配模式對應的操作" -#: ../../whatsnew/3.10.rst:443 +#: ../../whatsnew/3.10.rst:444 msgid "" "If an exact match is not confirmed, the last case, a wildcard ``_``, if " "provided, will be used as the matching case. If an exact match is not " @@ -464,11 +464,11 @@ msgstr "" "到的情況。如未有任何匹配且不存在萬用字元的 case,則整個 match 區塊會是個無操" "作 (no-op)。" -#: ../../whatsnew/3.10.rst:449 +#: ../../whatsnew/3.10.rst:450 msgid "Declarative approach" msgstr "宣告式方法 (Declarative approach)" -#: ../../whatsnew/3.10.rst:451 +#: ../../whatsnew/3.10.rst:452 msgid "" "Readers may be aware of pattern matching through the simple example of " "matching a subject (data object) to a literal (pattern) with the switch " @@ -480,7 +480,7 @@ msgstr "" "式將主語(資料物件)與字面值 (literal)(模式)進行匹配的簡單範例來了解模式匹" "配。 switch 語句通常用於將物件/運算式與包含字面值的 case 陳述式進行比較。" -#: ../../whatsnew/3.10.rst:457 +#: ../../whatsnew/3.10.rst:458 msgid "" "More powerful examples of pattern matching can be found in languages such as " "Scala and Elixir. With structural pattern matching, the approach is " @@ -490,7 +490,7 @@ msgstr "" "更強大的模式匹配範例可以在 Scala 和 Elixir 等語言中找到。對於結構模式匹配,該" "方法是「宣告式的 (declarative)」,並且明確地說明了資料匹配的條件(模式)。" -#: ../../whatsnew/3.10.rst:461 +#: ../../whatsnew/3.10.rst:462 msgid "" "While an \"imperative\" series of instructions using nested \"if\" " "statements could be used to accomplish something similar to structural " @@ -507,11 +507,11 @@ msgstr "" "模式匹配可以用其最簡單的形式達成,將變數與 case 陳述式中的字面值進行比較,但" "它對 Python 的真正價值在於它對主語的型態和特徵的處理。" -#: ../../whatsnew/3.10.rst:470 +#: ../../whatsnew/3.10.rst:471 msgid "Simple pattern: match to a literal" msgstr "簡單模式:與字面值匹配" -#: ../../whatsnew/3.10.rst:472 +#: ../../whatsnew/3.10.rst:473 msgid "" "Let's look at this example as pattern matching in its simplest form: a " "value, the subject, being matched to several literals, the patterns. In the " @@ -523,7 +523,7 @@ msgstr "" "配。在下面的範例中,``status`` 是匹配陳述式的主語。這些模式是每個 case 陳述" "式,其中文字表示請求狀態程式碼。與案例相關的操作在匹配後執行:" -#: ../../whatsnew/3.10.rst:489 +#: ../../whatsnew/3.10.rst:490 msgid "" "If the above function is passed a ``status`` of 418, \"I'm a teapot\" is " "returned. If the above function is passed a ``status`` of 500, the case " @@ -537,22 +537,22 @@ msgstr "" "傳 \"Something's wrong with the internet\"。請注意最後一個區塊:變數名稱 " "``_`` 充當 *萬用字元* 並確保主語始終匹配。``_`` 的使用是可選的。" -#: ../../whatsnew/3.10.rst:496 +#: ../../whatsnew/3.10.rst:497 msgid "" "You can combine several literals in a single pattern using ``|`` (\"or\")::" msgstr "你可以使用 ``|`` (\"or\") 將多個字面值組合在一個模式中:" -#: ../../whatsnew/3.10.rst:502 +#: ../../whatsnew/3.10.rst:503 msgid "Behavior without the wildcard" msgstr "沒有萬用字元 (wildcard) 的行為" -#: ../../whatsnew/3.10.rst:504 +#: ../../whatsnew/3.10.rst:505 msgid "" "If we modify the above example by removing the last case block, the example " "becomes::" msgstr "如果我們透過刪除最後一個 case 區塊來修改上面的範例,則範例將變為:" -#: ../../whatsnew/3.10.rst:516 +#: ../../whatsnew/3.10.rst:517 msgid "" "Without the use of ``_`` in a case statement, a match may not exist. If no " "match exists, the behavior is a no-op. For example, if ``status`` of 500 is " @@ -561,11 +561,11 @@ msgstr "" "如果在 case 陳述式中不使用 ``_``,則可能不存在匹配項目。如果不存在匹配項目," "則該行為是無操作 (no-op)。例如,如果 ``status`` 為 500,則不會有任何操作。" -#: ../../whatsnew/3.10.rst:521 +#: ../../whatsnew/3.10.rst:522 msgid "Patterns with a literal and variable" msgstr "具有字面值和變數的模式" -#: ../../whatsnew/3.10.rst:523 +#: ../../whatsnew/3.10.rst:524 msgid "" "Patterns can look like unpacking assignments, and a pattern may be used to " "bind variables. In this example, a data point can be unpacked to its x-" @@ -574,7 +574,7 @@ msgstr "" "模式看起來就像解包賦值 (unpacking assignment),並且模式可用於繫結 (bind) 變" "數。在此範例中,可以將資料點解包為其 x 坐標和 y 坐標:" -#: ../../whatsnew/3.10.rst:540 +#: ../../whatsnew/3.10.rst:541 msgid "" "The first pattern has two literals, ``(0, 0)``, and may be thought of as an " "extension of the literal pattern shown above. The next two patterns combine " @@ -587,11 +587,11 @@ msgstr "" "(``point``)的值。第四個模式捕獲兩個值,這使得它在概念上類似於解包賦值 " "``(x, y) = point``。" -#: ../../whatsnew/3.10.rst:547 +#: ../../whatsnew/3.10.rst:548 msgid "Patterns and classes" msgstr "模式和類別" -#: ../../whatsnew/3.10.rst:549 +#: ../../whatsnew/3.10.rst:550 msgid "" "If you are using classes to structure your data, you can use as a pattern " "the class name followed by an argument list resembling a constructor. This " @@ -600,11 +600,11 @@ msgstr "" "如果你使用類別來建構資料,則可以用類別名稱與後面的引數列表組合成的建構函式作" "為模式。該模式能夠將類別屬性捕獲到變數中:" -#: ../../whatsnew/3.10.rst:571 +#: ../../whatsnew/3.10.rst:572 msgid "Patterns with positional parameters" msgstr "具有位置參數的模式" -#: ../../whatsnew/3.10.rst:573 +#: ../../whatsnew/3.10.rst:574 msgid "" "You can use positional parameters with some builtin classes that provide an " "ordering for their attributes (e.g. dataclasses). You can also define a " @@ -618,11 +618,11 @@ msgstr "" "置。如果它被設定為 (\"x\", \"y\"),則以下模式都是等效的(且都將 ``y`` 屬性繫" "結到 ``var`` 變數):" -#: ../../whatsnew/3.10.rst:585 +#: ../../whatsnew/3.10.rst:586 msgid "Nested patterns" msgstr "巢狀模式" -#: ../../whatsnew/3.10.rst:587 +#: ../../whatsnew/3.10.rst:588 msgid "" "Patterns can be arbitrarily nested. For example, if our data is a short " "list of points, it could be matched like this::" @@ -630,11 +630,11 @@ msgstr "" "模式可以任意巢套。例如,如果我們的資料是一個簡短的座標點列表,則可以這樣匹" "配:" -#: ../../whatsnew/3.10.rst:603 +#: ../../whatsnew/3.10.rst:604 msgid "Complex patterns and the wildcard" msgstr "複雜模式和萬用字元" -#: ../../whatsnew/3.10.rst:605 +#: ../../whatsnew/3.10.rst:606 msgid "" "To this point, the examples have used ``_`` alone in the last case " "statement. A wildcard can be used in more complex patterns, such as " @@ -643,7 +643,7 @@ msgstr "" "到目前為止,範例在最後一個 case 陳述式中單獨使用了 ``_``。萬用字元可以用在更" "複雜的模式中,像是 ``('error', code, _)``。例如" -#: ../../whatsnew/3.10.rst:615 +#: ../../whatsnew/3.10.rst:616 msgid "" "In the above case, ``test_variable`` will match for ('error', code, 100) and " "('error', code, 800)." @@ -651,11 +651,11 @@ msgstr "" "在上述情況下,值像是 ('error', code, 100) 和 ('error', code, 800) 的 " "``test_variable`` 將會成功匹配。" -#: ../../whatsnew/3.10.rst:619 +#: ../../whatsnew/3.10.rst:620 msgid "Guard" msgstr "Guard" -#: ../../whatsnew/3.10.rst:621 +#: ../../whatsnew/3.10.rst:622 msgid "" "We can add an ``if`` clause to a pattern, known as a \"guard\". If the " "guard is false, ``match`` goes on to try the next case block. Note that " @@ -665,15 +665,15 @@ msgstr "" "則 ``match`` 會繼續嘗試下一個 case 區塊。請注意,值的捕獲發生在 guard 的求值 " "(evaluate) 之前:" -#: ../../whatsnew/3.10.rst:632 +#: ../../whatsnew/3.10.rst:633 msgid "Other Key Features" msgstr "其他主要功能" -#: ../../whatsnew/3.10.rst:634 +#: ../../whatsnew/3.10.rst:635 msgid "Several other key features:" msgstr "其他幾個主要功能:" -#: ../../whatsnew/3.10.rst:636 +#: ../../whatsnew/3.10.rst:637 msgid "" "Like unpacking assignments, tuple and list patterns have exactly the same " "meaning and actually match arbitrary sequences. Technically, the subject " @@ -685,7 +685,7 @@ msgstr "" "列。從技術上來說,主語必須是一個序列。因此,一個重要的例外是模式不會去匹配疊" "代器。另外,為了防止常常出錯,序列模式也不會去匹配字串。" -#: ../../whatsnew/3.10.rst:642 +#: ../../whatsnew/3.10.rst:643 msgid "" "Sequence patterns support wildcards: ``[x, y, *rest]`` and ``(x, y, *rest)`` " "work similar to wildcards in unpacking assignments. The name after ``*`` " @@ -696,7 +696,7 @@ msgstr "" "用字元類似。 ``*`` 後面的名稱也可能是 ``_``,因此 ``(x, y, *_)`` 會匹配至少兩" "個項目的序列,且不繫結其餘項目。" -#: ../../whatsnew/3.10.rst:647 +#: ../../whatsnew/3.10.rst:648 msgid "" "Mapping patterns: ``{\"bandwidth\": b, \"latency\": l}`` captures the " "``\"bandwidth\"`` and ``\"latency\"`` values from a dict. Unlike sequence " @@ -707,11 +707,11 @@ msgstr "" "``\"bandwidth\"`` 和 ``\"latency\"`` 值。與序列模式不同,額外的鍵將被忽略。也" "支援萬用字元 ``**rest``。(但是 ``**_`` 是多餘的,所以是不允許的。)" -#: ../../whatsnew/3.10.rst:652 +#: ../../whatsnew/3.10.rst:653 msgid "Subpatterns may be captured using the ``as`` keyword::" msgstr "可以使用 ``as`` 關鍵字捕獲子模式:" -#: ../../whatsnew/3.10.rst:656 +#: ../../whatsnew/3.10.rst:657 msgid "" "This binds x1, y1, x2, y2 like you would expect without the ``as`` clause, " "and p2 to the entire second item of the subject." @@ -719,7 +719,7 @@ msgstr "" "這將繫結 x1、y1、x2、y2,如同沒有 ``as`` 子句的情況下所預期的,並將 p2 繫結到" "主語的整個第二項目。" -#: ../../whatsnew/3.10.rst:659 +#: ../../whatsnew/3.10.rst:660 msgid "" "Most literals are compared by equality. However, the singletons ``True``, " "``False`` and ``None`` are compared by identity." @@ -727,7 +727,7 @@ msgstr "" "大多數字面值都是通過相等進行比較的。然而,單例 ``True``、``False`` 和 " "``None`` 是按標識值 (identity) 來進行比較的。" -#: ../../whatsnew/3.10.rst:662 +#: ../../whatsnew/3.10.rst:663 msgid "" "Named constants may be used in patterns. These named constants must be " "dotted names to prevent the constant from being interpreted as a capture " @@ -736,7 +736,7 @@ msgstr "" "附名常數 (named constant) 可以在模式中使用。這些附名常數必須有帶有點的名稱 " "(dotted name),以防止常數被直譯為捕獲的變數:" -#: ../../whatsnew/3.10.rst:681 +#: ../../whatsnew/3.10.rst:682 msgid "" "For the full specification see :pep:`634`. Motivation and rationale are in :" "pep:`635`, and a longer tutorial is in :pep:`636`." @@ -744,11 +744,11 @@ msgstr "" "有關完整規範,請參閱 :pep:`634`。動機和基本原理位於 :pep:`635` 中,較完整的教" "學位於 :pep:`636` 中。" -#: ../../whatsnew/3.10.rst:688 +#: ../../whatsnew/3.10.rst:689 msgid "Optional ``EncodingWarning`` and ``encoding=\"locale\"`` option" msgstr "可選的 ``EncodingWarning`` 和 ``encoding=\"locale\"`` 選項" -#: ../../whatsnew/3.10.rst:690 +#: ../../whatsnew/3.10.rst:691 msgid "" "The default encoding of :class:`TextIOWrapper` and :func:`open` is platform " "and locale dependent. Since UTF-8 is used on most Unix platforms, omitting " @@ -759,7 +759,7 @@ msgstr "" "多數 Unix 平台都使用 UTF-8,因此在打開 UTF-8 檔案(例如 JSON、YAML、TOML、" "Markdown)時省略 ``encoding`` 選項是個常見的 bug,例如:" -#: ../../whatsnew/3.10.rst:699 +#: ../../whatsnew/3.10.rst:700 msgid "" "To find this type of bug, an optional ``EncodingWarning`` is added. It is " "emitted when :data:`sys.flags.warn_default_encoding ` is true and " @@ -769,7 +769,7 @@ msgstr "" "warn_default_encoding ` 為 true 且使用特定於語言環境的預設編碼時," "會發出該信號。" -#: ../../whatsnew/3.10.rst:703 +#: ../../whatsnew/3.10.rst:704 msgid "" "``-X warn_default_encoding`` option and :envvar:`PYTHONWARNDEFAULTENCODING` " "are added to enable the warning." @@ -777,25 +777,25 @@ msgstr "" "新增 ``-X warn_default_encoding`` 選項和 :envvar:`PYTHONWARNDEFAULTENCODING` " "來啟用警告。" -#: ../../whatsnew/3.10.rst:706 +#: ../../whatsnew/3.10.rst:707 msgid "See :ref:`io-text-encoding` for more information." msgstr "更多資訊請見 :ref:`io-text-encoding`\\ 。" -#: ../../whatsnew/3.10.rst:711 +#: ../../whatsnew/3.10.rst:712 msgid "New Features Related to Type Hints" msgstr "與型別提示相關的新功能" -#: ../../whatsnew/3.10.rst:713 +#: ../../whatsnew/3.10.rst:714 msgid "" "This section covers major changes affecting :pep:`484` type hints and the :" "mod:`typing` module." msgstr "本節介紹影響 :pep:`484` 型別提示和 :mod:`typing` 模組的主要更改。" -#: ../../whatsnew/3.10.rst:718 +#: ../../whatsnew/3.10.rst:719 msgid "PEP 604: New Type Union Operator" msgstr "PEP 604:新型聯集運算子" -#: ../../whatsnew/3.10.rst:720 +#: ../../whatsnew/3.10.rst:721 msgid "" "A new type union operator was introduced which enables the syntax ``X | Y``. " "This provides a cleaner way of expressing 'either type X or type Y' instead " @@ -805,7 +805,7 @@ msgstr "" "別提示中更清晰的方式來表達「型別 X 或型別 Y」,來取代使用 :data:`typing." "Union`。" -#: ../../whatsnew/3.10.rst:724 +#: ../../whatsnew/3.10.rst:725 msgid "" "In previous versions of Python, to apply a type hint for functions accepting " "arguments of multiple types, :data:`typing.Union` was used::" @@ -813,22 +813,22 @@ msgstr "" "在以前版本的 Python 中,要使用接受多種型別參數之型別提示的函式,要使用 :data:" "`typing.Union`:" -#: ../../whatsnew/3.10.rst:731 +#: ../../whatsnew/3.10.rst:732 msgid "Type hints can now be written in a more succinct manner::" msgstr "現在可以用更簡潔的方式編寫型別提示:" -#: ../../whatsnew/3.10.rst:737 +#: ../../whatsnew/3.10.rst:738 msgid "" "This new syntax is also accepted as the second argument to :func:" "`isinstance` and :func:`issubclass`::" msgstr "" "這種新語法也接受作為 :func:`isinstance` 和 :func:`issubclass` 的第二個引數:" -#: ../../whatsnew/3.10.rst:743 +#: ../../whatsnew/3.10.rst:744 msgid "See :ref:`types-union` and :pep:`604` for more details." msgstr "更多資訊請見 :ref:`types-union` 與 :pep:`604`\\ 。" -#: ../../whatsnew/3.10.rst:745 +#: ../../whatsnew/3.10.rst:746 msgid "" "(Contributed by Maggie Moss and Philippe Prados in :issue:`41428`, with " "additions by Yurii Karabas and Serhiy Storchaka in :issue:`44490`.)" @@ -836,11 +836,11 @@ msgstr "" "(由 Maggie Moss 和 Philippe Prados 在 :issue:`41428` 中貢獻,由 Yurii " "Karabas 和 Serhiy Storchaka 在 :issue:`44490` 中補充。)" -#: ../../whatsnew/3.10.rst:750 +#: ../../whatsnew/3.10.rst:751 msgid "PEP 612: Parameter Specification Variables" msgstr "PEP 612:參數規範變數" -#: ../../whatsnew/3.10.rst:752 +#: ../../whatsnew/3.10.rst:753 msgid "" "Two new options to improve the information provided to static type checkers " "for :pep:`484`\\ 's ``Callable`` have been added to the :mod:`typing` module." @@ -848,7 +848,7 @@ msgstr "" ":mod:`typing` 模組中新增了兩個新選項,用於改進為 :pep:`484` ``Callable`` 的靜" "態型別檢查器 (static type checker) 所提供的資訊。" -#: ../../whatsnew/3.10.rst:755 +#: ../../whatsnew/3.10.rst:756 msgid "" "The first is the parameter specification variable. They are used to forward " "the parameter types of one callable to another callable -- a pattern " @@ -861,7 +861,7 @@ msgstr "" "用範例可以在 :class:`typing.ParamSpec` 中找到。在過去是沒有簡單的方法可以如此" "精確地來為參數型別的依賴關係做型別註釋。" -#: ../../whatsnew/3.10.rst:761 +#: ../../whatsnew/3.10.rst:762 msgid "" "The second option is the new ``Concatenate`` operator. It's used in " "conjunction with parameter specification variables to type annotate a higher " @@ -872,7 +872,7 @@ msgstr "" "階、會新增或刪除另一個可呼叫物件參數的可呼叫物件進行型別註釋。使用範例可以" "在 :class:`typing.Concatenate` 中找到。" -#: ../../whatsnew/3.10.rst:766 +#: ../../whatsnew/3.10.rst:767 msgid "" "See :class:`typing.Callable`, :class:`typing.ParamSpec`, :class:`typing." "Concatenate`, :class:`typing.ParamSpecArgs`, :class:`typing." @@ -882,7 +882,7 @@ msgstr "" "Concatenate`、:class:`typing.ParamSpecArgs`、:class:`typing.ParamSpecKwargs` " "和 :pep:`612` 以了解更多詳情。" -#: ../../whatsnew/3.10.rst:770 +#: ../../whatsnew/3.10.rst:771 msgid "" "(Contributed by Ken Jin in :issue:`41559`, with minor enhancements by Jelle " "Zijlstra in :issue:`43783`. PEP written by Mark Mendoza.)" @@ -890,11 +890,11 @@ msgstr "" "(由 Ken Jin 在 :issue:`41559` 中貢獻、Jelle Zijlstra 在 :issue:`43783` 中進" "行了小幅改進。PEP 由 Mark Mendoza 編寫。)" -#: ../../whatsnew/3.10.rst:775 +#: ../../whatsnew/3.10.rst:776 msgid "PEP 613: TypeAlias" msgstr "PEP 613:型別別名 (TypeAlias)" -#: ../../whatsnew/3.10.rst:777 +#: ../../whatsnew/3.10.rst:778 msgid "" ":pep:`484` introduced the concept of type aliases, only requiring them to be " "top-level unannotated assignments. This simplicity sometimes made it " @@ -906,7 +906,7 @@ msgstr "" "賦值 (top-level unannotated assignments)。這種簡單性有時使型別檢查器難以區分" "型別別名和普通賦值,尤其是在涉及傳遞參照 (reference) 或無效型別時。比較如下:" -#: ../../whatsnew/3.10.rst:785 +#: ../../whatsnew/3.10.rst:786 msgid "" "Now the :mod:`typing` module has a special value :data:`TypeAlias` which " "lets you declare type aliases more explicitly::" @@ -914,19 +914,19 @@ msgstr "" "現在 :mod:`typing` 模組有一個特殊值 :data:`TypeAlias`,它可以讓你更明確地宣告" "型別別名:" -#: ../../whatsnew/3.10.rst:791 +#: ../../whatsnew/3.10.rst:792 msgid "See :pep:`613` for more details." msgstr "更多資訊請見 :pep:`613`\\ 。" -#: ../../whatsnew/3.10.rst:793 +#: ../../whatsnew/3.10.rst:794 msgid "(Contributed by Mikhail Golubev in :issue:`41923`.)" msgstr "(由 Mikhail Golubev 在 :issue:`41923` 中貢獻。)" -#: ../../whatsnew/3.10.rst:796 +#: ../../whatsnew/3.10.rst:797 msgid "PEP 647: User-Defined Type Guards" msgstr "PEP 647:使用者定義的型別防護" -#: ../../whatsnew/3.10.rst:798 +#: ../../whatsnew/3.10.rst:799 msgid "" ":data:`TypeGuard` has been added to the :mod:`typing` module to annotate " "type guard functions and improve information provided to static type " @@ -937,7 +937,7 @@ msgstr "" "護函式並改進在型別窄縮 (type narrowing) 期間提供給靜態型別檢查器的資訊。有關" "更多資訊,請參閱 :data:`TypeGuard` 的文件和 :pep:`647`。" -#: ../../whatsnew/3.10.rst:803 +#: ../../whatsnew/3.10.rst:804 msgid "" "(Contributed by Ken Jin and Guido van Rossum in :issue:`43766`. PEP written " "by Eric Traut.)" @@ -945,11 +945,11 @@ msgstr "" "(由 Ken Jin 和 Guido van Rossum 在 :issue:`43766` 中貢獻。PEP 由 Eric Traut " "編寫。)" -#: ../../whatsnew/3.10.rst:807 +#: ../../whatsnew/3.10.rst:808 msgid "Other Language Changes" msgstr "其他語言更動" -#: ../../whatsnew/3.10.rst:809 +#: ../../whatsnew/3.10.rst:810 msgid "" "The :class:`int` type has a new method :meth:`int.bit_count`, returning the " "number of ones in the binary expansion of a given integer, also known as the " @@ -959,7 +959,7 @@ msgstr "" "式中 1 的數量,也稱為總體計數 (population count)。(由 Niklas Fiekas 在 :" "issue:`29882` 中貢獻。)" -#: ../../whatsnew/3.10.rst:813 +#: ../../whatsnew/3.10.rst:814 msgid "" "The views returned by :meth:`dict.keys`, :meth:`dict.values` and :meth:`dict." "items` now all have a ``mapping`` attribute that gives a :class:`types." @@ -971,7 +971,7 @@ msgstr "" "MappingProxyType` 包裝原始的字典物件。(由 Dennis Sweeney 在 :issue:`40890` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:818 +#: ../../whatsnew/3.10.rst:819 msgid "" ":pep:`618`: The :func:`zip` function now has an optional ``strict`` flag, " "used to require that all the iterables have an equal length." @@ -979,7 +979,7 @@ msgstr "" ":pep:`618`::func:`zip` 函式現在有一個可選的 ``strict`` 旗標,用於要求所有可" "疊代物件具有相同的長度。" -#: ../../whatsnew/3.10.rst:821 +#: ../../whatsnew/3.10.rst:822 msgid "" "Builtin and extension functions that take integer arguments no longer " "accept :class:`~decimal.Decimal`\\ s, :class:`~fractions.Fraction`\\ s and " @@ -992,7 +992,7 @@ msgstr "" "meth:`~object.__int__` 方法,但沒有 :meth:`~object.__index__` 方法)。(由 " "Serhiy Storchaka 在 :issue:`37999` 中貢獻。)" -#: ../../whatsnew/3.10.rst:828 +#: ../../whatsnew/3.10.rst:829 msgid "" "If :func:`object.__ipow__` returns :const:`NotImplemented`, the operator " "will correctly fall back to :func:`object.__pow__` and :func:`object." @@ -1002,7 +1002,7 @@ msgstr "" "正確回退到 :func:`object.__pow__` 和 :func:`object.__rpow__` 。(由 Alex " "Shkop 在 :issue:`38302` 中貢獻。)" -#: ../../whatsnew/3.10.rst:832 +#: ../../whatsnew/3.10.rst:833 msgid "" "Assignment expressions can now be used unparenthesized within set literals " "and set comprehensions, as well as in sequence indexes (but not slices)." @@ -1010,7 +1010,7 @@ msgstr "" "現在可以在集合字面值 (set literals) 和集合綜合運算 (set comprehensions) 以及" "序列索引(但不能是切片)中使用不帶括號的賦值運算式 (assignment expressions)。" -#: ../../whatsnew/3.10.rst:835 +#: ../../whatsnew/3.10.rst:836 msgid "" "Functions have a new ``__builtins__`` attribute which is used to look for " "builtin symbols when a function is executed, instead of looking into " @@ -1023,7 +1023,7 @@ msgstr "" "存在,則屬性會以此做初始化,否則從當前內建物件 (builtins) 初始化。(由 Mark " "Shannon 在 :issue:`42990` 中貢獻。)" -#: ../../whatsnew/3.10.rst:841 +#: ../../whatsnew/3.10.rst:842 msgid "" "Two new builtin functions -- :func:`aiter` and :func:`anext` have been added " "to provide asynchronous counterparts to :func:`iter` and :func:`next`, " @@ -1034,7 +1034,7 @@ msgstr "" "func:`next` 提供非同步的對應函式。(由 Joshua Bronson、Daniel Pope 和 Justin " "Wang 在 :issue:`31861` 中貢獻。)" -#: ../../whatsnew/3.10.rst:846 +#: ../../whatsnew/3.10.rst:847 msgid "" "Static methods (:func:`@staticmethod `) and class methods (:" "func:`@classmethod `) now inherit the method attributes " @@ -1049,7 +1049,7 @@ msgstr "" "的 ``__wrapped__`` 屬性。此外,靜態方法現在可以像是常規函式般呼叫。(由 " "Victor Stinner 在 :issue:`43682` 中貢獻。)" -#: ../../whatsnew/3.10.rst:853 +#: ../../whatsnew/3.10.rst:854 msgid "" "Annotations for complex targets (everything beside ``simple name`` targets " "defined by :pep:`526`) no longer cause any runtime effects with ``from " @@ -1060,7 +1060,7 @@ msgstr "" "使用 ``from __future__ import comments`` 造成任何執行環境 (runtime) 影響。" "(由 Batuhan Taskaya 在 :issue:`42737` 中貢獻。)" -#: ../../whatsnew/3.10.rst:857 +#: ../../whatsnew/3.10.rst:858 msgid "" "Class and module objects now lazy-create empty annotations dicts on demand. " "The annotations dicts are stored in the object’s ``__dict__`` for backwards " @@ -1073,7 +1073,7 @@ msgstr "" "改進了 ``__annotations__`` 使用方式的最佳實踐方法;有關更多資訊,請參閱 :ref:" "`annotations-howto`。(由 Larry Hastings 在 :issue:`43901` 中貢獻。)" -#: ../../whatsnew/3.10.rst:864 +#: ../../whatsnew/3.10.rst:865 msgid "" "Annotations consist of ``yield``, ``yield from``, ``await`` or named " "expressions are now forbidden under ``from __future__ import annotations`` " @@ -1084,7 +1084,7 @@ msgstr "" "__future__ import comments`` 下被禁止,因為它們有些不預期的行為。(由 " "Batuhan Taskaya 在 :issue:`42725` 中貢獻。)" -#: ../../whatsnew/3.10.rst:869 +#: ../../whatsnew/3.10.rst:870 msgid "" "Usage of unbound variables, ``super()`` and other expressions that might " "alter the processing of symbol table as annotations are now rendered " @@ -1095,7 +1095,7 @@ msgstr "" "(symbol table) 的運算式,現在在 ``from __future__ import comments`` 下變得無" "效。(由 Batuhan Taskaya 在 :issue:`42725` 中貢獻。)" -#: ../../whatsnew/3.10.rst:874 +#: ../../whatsnew/3.10.rst:875 msgid "" "Hashes of NaN values of both :class:`float` type and :class:`decimal." "Decimal` type now depend on object identity. Formerly, they always hashed to " @@ -1110,7 +1110,7 @@ msgstr "" "collision),可能導致潛在的二次方執行環境行為 (quadratic runtime behavior)。" "(由 Raymond Hettinger 在 :issue:`43475` 中貢獻。)" -#: ../../whatsnew/3.10.rst:881 +#: ../../whatsnew/3.10.rst:882 msgid "" "A :exc:`SyntaxError` (instead of a :exc:`NameError`) will be raised when " "deleting the :const:`__debug__` constant. (Contributed by Donghee Na in :" @@ -1119,7 +1119,7 @@ msgstr "" "刪除 :const:`__debug__` 常數時將引發 :exc:`SyntaxError` (而不是 :exc:" "`NameError`)。(由 Donghee Na 在 :issue:`45000` 中貢獻。)" -#: ../../whatsnew/3.10.rst:884 +#: ../../whatsnew/3.10.rst:885 msgid "" ":exc:`SyntaxError` exceptions now have ``end_lineno`` and ``end_offset`` " "attributes. They will be ``None`` if not determined. (Contributed by Pablo " @@ -1128,23 +1128,23 @@ msgstr "" ":exc:`SyntaxError` 例外現在具有 ``end_lineno`` 和 ``end_offset`` 屬性。如果未" "被決定,它們將會是 ``None``。(由 Pablo Galindo 在 :issue:`43914` 中貢獻。)" -#: ../../whatsnew/3.10.rst:889 +#: ../../whatsnew/3.10.rst:890 msgid "New Modules" msgstr "新模組" -#: ../../whatsnew/3.10.rst:891 +#: ../../whatsnew/3.10.rst:892 msgid "None." msgstr "無。" -#: ../../whatsnew/3.10.rst:895 +#: ../../whatsnew/3.10.rst:896 msgid "Improved Modules" msgstr "改進的模組" -#: ../../whatsnew/3.10.rst:898 +#: ../../whatsnew/3.10.rst:899 msgid "asyncio" msgstr "asyncio" -#: ../../whatsnew/3.10.rst:900 +#: ../../whatsnew/3.10.rst:901 msgid "" "Add missing :meth:`~asyncio.events.AbstractEventLoop." "connect_accepted_socket` method. (Contributed by Alex Grönholm in :issue:" @@ -1153,11 +1153,11 @@ msgstr "" "新增缺少的 :meth:`~asyncio.events.AbstractEventLoop.connect_accepted_socket` " "方法。(由 Alex Grönholm 在 :issue:`41332` 中貢獻。)" -#: ../../whatsnew/3.10.rst:905 +#: ../../whatsnew/3.10.rst:906 msgid "argparse" msgstr "argparse" -#: ../../whatsnew/3.10.rst:907 +#: ../../whatsnew/3.10.rst:908 msgid "" "Misleading phrase \"optional arguments\" was replaced with \"options\" in " "argparse help. Some tests might require adaptation if they rely on exact " @@ -1167,11 +1167,11 @@ msgstr "" "(options)」。某些依賴於精確輸出匹配的測試可能需要進行調整。(由 Raymond " "Hettinger 在 :issue:`9694` 中貢獻。)" -#: ../../whatsnew/3.10.rst:911 +#: ../../whatsnew/3.10.rst:912 msgid "array" msgstr "array" -#: ../../whatsnew/3.10.rst:913 +#: ../../whatsnew/3.10.rst:914 msgid "" "The :meth:`~array.array.index` method of :class:`array.array` now has " "optional *start* and *stop* parameters. (Contributed by Anders Lorentsen and " @@ -1181,11 +1181,11 @@ msgstr "" "*start* 和 *stop* 參數。(由 Anders Lorentsen 和 Zackery Spytz 在 :issue:" "`31956` 中貢獻。)" -#: ../../whatsnew/3.10.rst:918 +#: ../../whatsnew/3.10.rst:919 msgid "asynchat, asyncore, smtpd" msgstr "asynchat, asyncore, smtpd" -#: ../../whatsnew/3.10.rst:919 +#: ../../whatsnew/3.10.rst:920 msgid "" "These modules have been marked as deprecated in their module documentation " "since Python 3.6. An import-time :class:`DeprecationWarning` has now been " @@ -1194,11 +1194,11 @@ msgstr "" "自 Python 3.6 起,這些模組在其文件中被標記為已棄用。引入時的 :class:" "`DeprecationWarning` 現已新增到這三個模組中。" -#: ../../whatsnew/3.10.rst:924 +#: ../../whatsnew/3.10.rst:925 msgid "base64" msgstr "base64" -#: ../../whatsnew/3.10.rst:926 +#: ../../whatsnew/3.10.rst:927 msgid "" "Add :func:`base64.b32hexencode` and :func:`base64.b32hexdecode` to support " "the Base32 Encoding with Extended Hex Alphabet." @@ -1206,11 +1206,11 @@ msgstr "" "新增 :func:`base64.b32hexencode` 和 :func:`base64.b32hexdecode` 以支援擴充十" "六進位字母的 Base32 編碼 (Base32 Encoding with Extended Hex Alphabet)。" -#: ../../whatsnew/3.10.rst:930 +#: ../../whatsnew/3.10.rst:931 msgid "bdb" msgstr "bdb" -#: ../../whatsnew/3.10.rst:932 +#: ../../whatsnew/3.10.rst:933 msgid "" "Add :meth:`~bdb.Breakpoint.clearBreakpoints` to reset all set breakpoints. " "(Contributed by Irit Katriel in :issue:`24160`.)" @@ -1218,11 +1218,11 @@ msgstr "" "新增 :meth:`~bdb.Breakpoint.clearBreakpoints` 來重置所有設定的斷點。(由 " "Irit Katriel 在 :issue:`24160` 中貢獻。)" -#: ../../whatsnew/3.10.rst:936 +#: ../../whatsnew/3.10.rst:937 msgid "bisect" msgstr "bisect" -#: ../../whatsnew/3.10.rst:938 +#: ../../whatsnew/3.10.rst:939 msgid "" "Added the possibility of providing a *key* function to the APIs in the :mod:" "`bisect` module. (Contributed by Raymond Hettinger in :issue:`4356`.)" @@ -1230,11 +1230,11 @@ msgstr "" "新增向 :mod:`bisect` 模組 API 提供 *key* 函式的可能性。(由 Raymond " "Hettinger 在 :issue:`4356` 中貢獻。)" -#: ../../whatsnew/3.10.rst:942 +#: ../../whatsnew/3.10.rst:943 msgid "codecs" msgstr "codecs" -#: ../../whatsnew/3.10.rst:944 +#: ../../whatsnew/3.10.rst:945 msgid "" "Add a :func:`codecs.unregister` function to unregister a codec search " "function. (Contributed by Hai Shi in :issue:`41842`.)" @@ -1242,11 +1242,11 @@ msgstr "" "新增 :func:`codecs.unregister` 函式來取消註冊 (unregister) 一個編解碼器的搜索" "功能。 (Hai Shi 在 :issue:`41842` 中貢獻。)" -#: ../../whatsnew/3.10.rst:948 +#: ../../whatsnew/3.10.rst:949 msgid "collections.abc" msgstr "collections.abc" -#: ../../whatsnew/3.10.rst:950 +#: ../../whatsnew/3.10.rst:951 msgid "" "The ``__args__`` of the :ref:`parameterized generic ` " "for :class:`collections.abc.Callable` are now consistent with :data:`typing." @@ -1272,11 +1272,11 @@ msgstr "" "Callable` 參數化可能會引發 :exc:`TypeError`,而在 Python 3.9 中該參數可能會無" "引發例外地傳遞。(由 Ken Jin 在 :issue:`42195` 中貢獻。)" -#: ../../whatsnew/3.10.rst:963 +#: ../../whatsnew/3.10.rst:964 msgid "contextlib" msgstr "contextlib" -#: ../../whatsnew/3.10.rst:965 +#: ../../whatsnew/3.10.rst:966 msgid "" "Add a :func:`contextlib.aclosing` context manager to safely close async " "generators and objects representing asynchronously released resources. " @@ -1286,7 +1286,7 @@ msgstr "" "步釋放資源的物件。(由 Joongi Kim 和 John Belmonte 在 :issue:`41229` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:969 +#: ../../whatsnew/3.10.rst:970 msgid "" "Add asynchronous context manager support to :func:`contextlib.nullcontext`. " "(Contributed by Tom Gringauz in :issue:`41543`.)" @@ -1294,7 +1294,7 @@ msgstr "" "向 :func:`contextlib.nullcontext` 新增非同步情境管理器支援。(由 Tom " "Gringauz 在 :issue:`41543` 中貢獻。)" -#: ../../whatsnew/3.10.rst:972 +#: ../../whatsnew/3.10.rst:973 msgid "" "Add :class:`AsyncContextDecorator`, for supporting usage of async context " "managers as decorators." @@ -1302,11 +1302,11 @@ msgstr "" "新增 :class:`AsyncContextDecorator`,用於支援將非同步情境管理器作為裝飾器使" "用。" -#: ../../whatsnew/3.10.rst:976 +#: ../../whatsnew/3.10.rst:977 msgid "curses" msgstr "curses" -#: ../../whatsnew/3.10.rst:978 +#: ../../whatsnew/3.10.rst:979 msgid "" "The extended color functions added in ncurses 6.1 will be used transparently " "by :func:`curses.color_content`, :func:`curses.init_color`, :func:`curses." @@ -1321,7 +1321,7 @@ msgstr "" "ncurses 函式庫是否支援擴充顏色。 (由 Jeffrey Kintscher 和 Hans Petter " "Jansson 在 :issue:`36982` 中貢獻。)" -#: ../../whatsnew/3.10.rst:985 +#: ../../whatsnew/3.10.rst:986 msgid "" "The ``BUTTON5_*`` constants are now exposed in the :mod:`curses` module if " "they are provided by the underlying curses library. (Contributed by Zackery " @@ -1330,15 +1330,15 @@ msgstr "" "如果 ``BUTTON5_*`` 常數是由底層 :mod:`curses` 函式庫提供的,那麼它們現在會在 " "curses 模組中公開。(由 Zackery Spytz 在 :issue:`39273` 中貢獻。)" -#: ../../whatsnew/3.10.rst:990 +#: ../../whatsnew/3.10.rst:991 msgid "dataclasses" msgstr "dataclasses" -#: ../../whatsnew/3.10.rst:993 +#: ../../whatsnew/3.10.rst:994 msgid "__slots__" msgstr "__slots__" -#: ../../whatsnew/3.10.rst:995 +#: ../../whatsnew/3.10.rst:996 msgid "" "Added ``slots`` parameter in :func:`dataclasses.dataclass` decorator. " "(Contributed by Yurii Karabas in :issue:`42269`)" @@ -1346,11 +1346,11 @@ msgstr "" "在 :func:`dataclasses.dataclass` 裝飾器中新增了 ``slots`` 參數。(由 Yurii " "Karabas 在 :issue:`42269` 中貢獻)" -#: ../../whatsnew/3.10.rst:999 +#: ../../whatsnew/3.10.rst:1000 msgid "Keyword-only fields" msgstr "僅限關鍵字欄位 (Keyword-only fields)" -#: ../../whatsnew/3.10.rst:1001 +#: ../../whatsnew/3.10.rst:1002 msgid "" "dataclasses now supports fields that are keyword-only in the generated " "__init__ method. There are a number of ways of specifying keyword-only " @@ -1359,21 +1359,21 @@ msgstr "" "dataclasses 現在支援在產生的 __init__ 方法中包含僅限關鍵字的欄位。有多種方法" "可以指定僅限關鍵字欄位。" -#: ../../whatsnew/3.10.rst:1005 +#: ../../whatsnew/3.10.rst:1006 msgid "You can say that every field is keyword-only:" msgstr "你可以說每個欄位都是關鍵字:" -#: ../../whatsnew/3.10.rst:1016 +#: ../../whatsnew/3.10.rst:1017 msgid "" "Both ``name`` and ``birthday`` are keyword-only parameters to the generated " "__init__ method." msgstr "``name`` 和 ``birthday`` 都是產生的 __init__ 方法的僅限關鍵字參數。" -#: ../../whatsnew/3.10.rst:1019 +#: ../../whatsnew/3.10.rst:1020 msgid "You can specify keyword-only on a per-field basis:" msgstr "你可以在每個欄位的基礎上指定僅限關鍵字:" -#: ../../whatsnew/3.10.rst:1030 +#: ../../whatsnew/3.10.rst:1031 msgid "" "Here only ``birthday`` is keyword-only. If you set ``kw_only`` on " "individual fields, be aware that there are rules about re-ordering fields " @@ -1384,7 +1384,7 @@ msgstr "" "意,由於僅限關鍵字欄位需要遵循非僅限關鍵字欄位,因此會有欄位重新排序的相關規" "則。詳細資訊請參閱完整的 dataclasses 文件。" -#: ../../whatsnew/3.10.rst:1035 +#: ../../whatsnew/3.10.rst:1036 msgid "" "You can also specify that all fields following a KW_ONLY marker are keyword-" "only. This will probably be the most common usage:" @@ -1392,7 +1392,7 @@ msgstr "" "你還可以指定 KW_ONLY 標記後面的所有欄位均為僅限關鍵字欄位。這可能是最常見的用" "法:" -#: ../../whatsnew/3.10.rst:1050 +#: ../../whatsnew/3.10.rst:1051 msgid "" "Here, ``z`` and ``t`` are keyword-only parameters, while ``x`` and ``y`` are " "not. (Contributed by Eric V. Smith in :issue:`43532`.)" @@ -1400,11 +1400,11 @@ msgstr "" "這裡的 ``z`` 和 ``t`` 是僅限關鍵字參數,而 ``x`` 和 ``y`` 則不是。(由 Eric " "V. Smith 在 :issue:`43532` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1057 +#: ../../whatsnew/3.10.rst:1058 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.10.rst:1059 +#: ../../whatsnew/3.10.rst:1060 msgid "" "The entire ``distutils`` package is deprecated, to be removed in Python " "3.12. Its functionality for specifying package builds has already been " @@ -1423,7 +1423,7 @@ msgstr "" "遷移任何其他地方的計畫,且使用其他功能的應用程式應該開始規劃如何取得程式碼的" "私有副本。請參閱 :pep:`632` 的討論。" -#: ../../whatsnew/3.10.rst:1069 +#: ../../whatsnew/3.10.rst:1070 msgid "" "The ``bdist_wininst`` command deprecated in Python 3.8 has been removed. The " "``bdist_wheel`` command is now recommended to distribute binary packages on " @@ -1433,12 +1433,12 @@ msgstr "" "``bdist_wheel`` 命令來在 Windows 上發布二進位套件。(由 Victor Stinner 在 :" "issue:`42802` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1075 +#: ../../whatsnew/3.10.rst:1076 msgid "doctest" msgstr "doctest" -#: ../../whatsnew/3.10.rst:1077 ../../whatsnew/3.10.rst:1212 -#: ../../whatsnew/3.10.rst:1239 ../../whatsnew/3.10.rst:1338 +#: ../../whatsnew/3.10.rst:1078 ../../whatsnew/3.10.rst:1213 +#: ../../whatsnew/3.10.rst:1240 ../../whatsnew/3.10.rst:1339 msgid "" "When a module does not define ``__loader__``, fall back to ``__spec__." "loader``. (Contributed by Brett Cannon in :issue:`42133`.)" @@ -1446,11 +1446,11 @@ msgstr "" "當模組未定義 ``__loader__`` 時,回退到 ``__spec__.loader`` 。(由 Brett " "Cannon 在 :issue:`42133` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1081 +#: ../../whatsnew/3.10.rst:1082 msgid "encodings" msgstr "encodings" -#: ../../whatsnew/3.10.rst:1083 +#: ../../whatsnew/3.10.rst:1084 msgid "" ":func:`encodings.normalize_encoding` now ignores non-ASCII characters. " "(Contributed by Hai Shi in :issue:`39337`.)" @@ -1458,11 +1458,11 @@ msgstr "" ":func:`encodings.normalize_encoding` 現在會忽略非 ASCII 字元。(Hai Shi 在 :" "issue:`39337` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1087 +#: ../../whatsnew/3.10.rst:1088 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.10.rst:1089 +#: ../../whatsnew/3.10.rst:1090 msgid "" ":class:`Enum` :func:`__repr__` now returns ``enum_name.member_name`` and :" "func:`__str__` now returns ``member_name``. Stdlib enums available as " @@ -1474,7 +1474,7 @@ msgstr "" "``module_name.member_name`` 的 :func:`repr`。(由 Ethan Furman 在 :issue:" "`40066` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1094 +#: ../../whatsnew/3.10.rst:1095 msgid "" "Add :class:`enum.StrEnum` for enums where all members are strings. " "(Contributed by Ethan Furman in :issue:`41816`.)" @@ -1482,11 +1482,11 @@ msgstr "" "新增 :class:`enum.StrEnum`,為所有成員都是字串的列舉。(由 Ethan Furman 在 :" "issue:`41816` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1098 +#: ../../whatsnew/3.10.rst:1099 msgid "fileinput" msgstr "fileinput" -#: ../../whatsnew/3.10.rst:1100 +#: ../../whatsnew/3.10.rst:1101 msgid "" "Add *encoding* and *errors* parameters in :func:`fileinput.input` and :class:" "`fileinput.FileInput`. (Contributed by Inada Naoki in :issue:`43712`.)" @@ -1494,7 +1494,7 @@ msgstr "" "在 :func:`fileinput.input` 和 :class:`fileinput.FileInput` 中新增 *encoding* " "和 *errors* 參數。(由 Inada Naoki 在 :issue:`43712` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1104 +#: ../../whatsnew/3.10.rst:1105 msgid "" ":func:`fileinput.hook_compressed` now returns :class:`TextIOWrapper` object " "when *mode* is \"r\" and file is compressed, like uncompressed files. " @@ -1504,11 +1504,11 @@ msgstr "" "會回傳 :class:`TextIOWrapper` 物件(和未壓縮檔案一樣)。(由 Inada Naoki 在 :" "issue:`5758` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1109 +#: ../../whatsnew/3.10.rst:1110 msgid "faulthandler" msgstr "faulthandler" -#: ../../whatsnew/3.10.rst:1111 +#: ../../whatsnew/3.10.rst:1112 msgid "" "The :mod:`faulthandler` module now detects if a fatal error occurs during a " "garbage collector collection. (Contributed by Victor Stinner in :issue:" @@ -1517,11 +1517,11 @@ msgstr "" ":mod:`faulthandler` 模組現在可以檢測垃圾收集器 (garbage collector) 在收集期間" "是否發生嚴重錯誤。(由 Victor Stinner 在 :issue:`44466` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1116 +#: ../../whatsnew/3.10.rst:1117 msgid "gc" msgstr "gc" -#: ../../whatsnew/3.10.rst:1118 +#: ../../whatsnew/3.10.rst:1119 msgid "" "Add audit hooks for :func:`gc.get_objects`, :func:`gc.get_referrers` and :" "func:`gc.get_referents`. (Contributed by Pablo Galindo in :issue:`43439`.)" @@ -1530,11 +1530,11 @@ msgstr "" "get_referents` 新增稽核掛鉤 (audit hooks)。(由 Pablo Galindo 在 :issue:" "`43439` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1122 +#: ../../whatsnew/3.10.rst:1123 msgid "glob" msgstr "glob" -#: ../../whatsnew/3.10.rst:1124 +#: ../../whatsnew/3.10.rst:1125 msgid "" "Add the *root_dir* and *dir_fd* parameters in :func:`~glob.glob` and :func:" "`~glob.iglob` which allow to specify the root directory for searching. " @@ -1543,11 +1543,11 @@ msgstr "" "在 :func:`~glob.glob` 和 :func:`~glob.iglob` 中新增 *root_dir* 和 *dir_fd* 參" "數,允許指定搜索的根目錄。(由 Serhiy Storchaka 在 :issue:`38144` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1129 +#: ../../whatsnew/3.10.rst:1130 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.10.rst:1131 +#: ../../whatsnew/3.10.rst:1132 msgid "" "The hashlib module requires OpenSSL 1.1.1 or newer. (Contributed by " "Christian Heimes in :pep:`644` and :issue:`43669`.)" @@ -1555,7 +1555,7 @@ msgstr "" "hashlib 模組需要 OpenSSL 1.1.1 或更高版本。(由 Christian Heimes 在 :pep:" "`644` 和 :issue:`43669` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1134 +#: ../../whatsnew/3.10.rst:1135 msgid "" "The hashlib module has preliminary support for OpenSSL 3.0.0. (Contributed " "by Christian Heimes in :issue:`38820` and other issues.)" @@ -1563,7 +1563,7 @@ msgstr "" "hashlib 模組初步支援 OpenSSL 3.0.0。(由 Christian Heimes 在 :issue:`38820` " "和其他問題中貢獻。)" -#: ../../whatsnew/3.10.rst:1137 +#: ../../whatsnew/3.10.rst:1138 msgid "" "The pure-Python fallback of :func:`~hashlib.pbkdf2_hmac` is deprecated. In " "the future PBKDF2-HMAC will only be available when Python has been built " @@ -1573,11 +1573,11 @@ msgstr "" "支援的建置 Python 中才能夠使用 PBKDF2-HMAC。(由 Christian Heimes 在 :issue:" "`43880` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1143 +#: ../../whatsnew/3.10.rst:1144 msgid "hmac" msgstr "hmac" -#: ../../whatsnew/3.10.rst:1145 +#: ../../whatsnew/3.10.rst:1146 msgid "" "The hmac module now uses OpenSSL's HMAC implementation internally. " "(Contributed by Christian Heimes in :issue:`40645`.)" @@ -1585,11 +1585,11 @@ msgstr "" "hmac 模組現在在內部使用 OpenSSL 的 HMAC 實作。 (由 Christian Heimes 在 :" "issue:`40645` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1149 +#: ../../whatsnew/3.10.rst:1150 msgid "IDLE and idlelib" msgstr "IDLE 和 idlelib" -#: ../../whatsnew/3.10.rst:1151 +#: ../../whatsnew/3.10.rst:1152 msgid "" "Make IDLE invoke :func:`sys.excepthook` (when started without '-n'). User " "hooks were previously ignored. (Contributed by Ken Hilton in :issue:" @@ -1599,7 +1599,7 @@ msgstr "" "掛鉤 (user hooks) 在以前是被忽略的。(由 Ken Hilton 在 :issue:`43008` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1155 +#: ../../whatsnew/3.10.rst:1156 msgid "" "Rearrange the settings dialog. Split the General tab into Windows and Shell/" "Ed tabs. Move help sources, which extend the Help menu, to the Extensions " @@ -1615,11 +1615,11 @@ msgstr "" "獻。)將縮排空間設定從 Font 分頁移至新的 Windows 分頁。(由 Mark Roseman 和 " "Terry Jan Reedy 在 :issue:`33962` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1163 +#: ../../whatsnew/3.10.rst:1164 msgid "The changes above were backported to a 3.9 maintenance release." msgstr "上述更改已向後移植到 3.9 維護版本。" -#: ../../whatsnew/3.10.rst:1165 +#: ../../whatsnew/3.10.rst:1166 msgid "" "Add a Shell sidebar. Move the primary prompt ('>>>') to the sidebar. Add " "secondary prompts ('...') to the sidebar. Left click and optional drag " @@ -1635,7 +1635,7 @@ msgstr "" "prompts)」的情境選單,這會將側邊欄中提示字元與所選文字並排,此選項也會出現在" "文字的情境選單上。(由 Tal Einat 在 :issue:`37903` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1174 +#: ../../whatsnew/3.10.rst:1175 msgid "" "Use spaces instead of tabs to indent interactive code. This makes " "interactive code entries 'look right'. Making this feasible was a major " @@ -1646,7 +1646,7 @@ msgstr "" "起來正確」。新增 shell 側邊欄的主要動機是實現這一點。(由 Terry Jan Reedy " "在 :issue:`37892` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1179 +#: ../../whatsnew/3.10.rst:1180 msgid "" "Highlight the new :ref:`soft keywords ` :keyword:`match`, :" "keyword:`case `, and :keyword:`_ ` in pattern-" @@ -1659,11 +1659,11 @@ msgstr "" "`。然而這種突顯並不完美,並且在某些罕見的情況下會出錯,包" "括 ``case`` 模式中的一些 ``_``。(由 Tal Einat 在 :issue:`44010` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1185 +#: ../../whatsnew/3.10.rst:1186 msgid "New in 3.10 maintenance releases." msgstr "3.10 維護版本中的新增功能。" -#: ../../whatsnew/3.10.rst:1187 +#: ../../whatsnew/3.10.rst:1188 msgid "" "Apply syntax highlighting to ``.pyi`` files. (Contributed by Alex Waygood " "and Terry Jan Reedy in :issue:`45447`.)" @@ -1671,7 +1671,7 @@ msgstr "" "將語法突顯 (syntax highlighting) 應用於 ``.pyi`` 檔案。(由 Alex Waygood 和 " "Terry Jan Reedy 在 :issue:`45447` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1190 +#: ../../whatsnew/3.10.rst:1191 msgid "" "Include prompts when saving Shell with inputs and outputs. (Contributed by " "Terry Jan Reedy in :gh:`95191`.)" @@ -1679,11 +1679,11 @@ msgstr "" "保存帶有輸入和輸出的 Shell 時,會包含提示字元。(由 Terry Jan Reedy 在 :gh:" "`95191` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1194 +#: ../../whatsnew/3.10.rst:1195 msgid "importlib.metadata" msgstr "importlib.metadata" -#: ../../whatsnew/3.10.rst:1196 +#: ../../whatsnew/3.10.rst:1197 msgid "" "Feature parity with ``importlib_metadata`` 4.6 (`history `_)." @@ -1691,7 +1691,7 @@ msgstr "" "與 ``importlib_metadata`` 4.6 功能相同(`歷史 `_)。" -#: ../../whatsnew/3.10.rst:1199 +#: ../../whatsnew/3.10.rst:1200 msgid "" ":ref:`importlib.metadata entry points ` now provide a nicer " "experience for selecting entry points by group and name through a new :class:" @@ -1702,7 +1702,7 @@ msgstr "" "`importlib.metadata.EntryPoints` 類別提供了以群組和名稱選擇入口點的更好體驗。" "有關棄用與用法的更多資訊,請參閱文件中的相容性說明。" -#: ../../whatsnew/3.10.rst:1205 +#: ../../whatsnew/3.10.rst:1206 msgid "" "Added :func:`importlib.metadata.packages_distributions` for resolving top-" "level Python modules and packages to their :class:`importlib.metadata." @@ -1711,11 +1711,11 @@ msgstr "" "新增了 :func:`importlib.metadata.packages_distributions` 用於將頂階 Python 模" "組和套件解析出 :class:`importlib.metadata.Distribution`。" -#: ../../whatsnew/3.10.rst:1210 +#: ../../whatsnew/3.10.rst:1211 msgid "inspect" msgstr "inspect" -#: ../../whatsnew/3.10.rst:1215 +#: ../../whatsnew/3.10.rst:1216 msgid "" "Add :func:`inspect.get_annotations`, which safely computes the annotations " "defined on an object. It works around the quirks of accessing the " @@ -1743,11 +1743,11 @@ msgstr "" "著 :func:`inspect.signature` 和 :func:`inspect.Signature.from_callable` 現在" "也可以取消字串化註釋。(由 Larry Hastings 在 :issue:`43817` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1231 +#: ../../whatsnew/3.10.rst:1232 msgid "itertools" msgstr "itertools" -#: ../../whatsnew/3.10.rst:1233 +#: ../../whatsnew/3.10.rst:1234 msgid "" "Add :func:`itertools.pairwise()`. (Contributed by Raymond Hettinger in :" "issue:`38200`.)" @@ -1755,15 +1755,15 @@ msgstr "" "新增 :func:`itertools.pairwise()`。(由 Raymond Hettinger 在 :issue:`38200` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1237 +#: ../../whatsnew/3.10.rst:1238 msgid "linecache" msgstr "linecache" -#: ../../whatsnew/3.10.rst:1243 +#: ../../whatsnew/3.10.rst:1244 msgid "os" msgstr "os" -#: ../../whatsnew/3.10.rst:1245 +#: ../../whatsnew/3.10.rst:1246 msgid "" "Add :func:`os.cpu_count()` support for VxWorks RTOS. (Contributed by Peixing " "Xin in :issue:`41440`.)" @@ -1771,7 +1771,7 @@ msgstr "" "為 VxWorks RTOS 新增 :func:`os.cpu_count()` 支援。(由 Peixing Xin 在 :issue:" "`41440` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1248 +#: ../../whatsnew/3.10.rst:1249 msgid "" "Add a new function :func:`os.eventfd` and related helpers to wrap the " "``eventfd2`` syscall on Linux. (Contributed by Christian Heimes in :issue:" @@ -1780,7 +1780,7 @@ msgstr "" "新增函式 :func:`os.eventfd` 和相關幫助程式來包裝 Linux 上的 ``eventfd2`` 系統" "呼叫。 (由 Christian Heimes 在 :issue:`41001` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1252 +#: ../../whatsnew/3.10.rst:1253 msgid "" "Add :func:`os.splice()` that allows to move data between two file " "descriptors without copying between kernel address space and user address " @@ -1792,7 +1792,7 @@ msgstr "" "address space) 之間進行複製,其中檔案描述器之一必須是個 pipe。(由 Pablo " "Galindo 在 :issue:`41625` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1257 +#: ../../whatsnew/3.10.rst:1258 msgid "" "Add :const:`~os.O_EVTONLY`, :const:`~os.O_FSYNC`, :const:`~os.O_SYMLINK` " "and :const:`~os.O_NOFOLLOW_ANY` for macOS. (Contributed by Donghee Na in :" @@ -1802,11 +1802,11 @@ msgstr "" "O_SYMLINK` 和 :const:`~os.O_NOFOLLOW_ANY`。(由 Donghee Na 在 :issue:`43106` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1262 +#: ../../whatsnew/3.10.rst:1263 msgid "os.path" msgstr "os.path" -#: ../../whatsnew/3.10.rst:1264 +#: ../../whatsnew/3.10.rst:1265 msgid "" ":func:`os.path.realpath` now accepts a *strict* keyword-only argument. When " "set to ``True``, :exc:`OSError` is raised if a path doesn't exist or a " @@ -1816,11 +1816,11 @@ msgstr "" "``True`` 時,如果路徑不存在或遇到符號鏈接循環 (symlink loop),則會引發 :exc:" "`OSError`。(由 Barney Gale 在 :issue:`43757` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1270 +#: ../../whatsnew/3.10.rst:1271 msgid "pathlib" msgstr "pathlib" -#: ../../whatsnew/3.10.rst:1272 +#: ../../whatsnew/3.10.rst:1273 msgid "" "Add slice support to :attr:`PurePath.parents `. " "(Contributed by Joshua Cannon in :issue:`35498`.)" @@ -1828,7 +1828,7 @@ msgstr "" "新增 :attr:`PurePath.parents ` 對於切片的支援。 " "(由 Joshua Cannon 在 :issue:`35498` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1275 +#: ../../whatsnew/3.10.rst:1276 msgid "" "Add negative indexing support to :attr:`PurePath.parents `. (Contributed by Yaroslav Pankovych in :issue:`21041`.)" @@ -1836,7 +1836,7 @@ msgstr "" "向 :attr:`PurePath.parents ` 新增負索引支援。(由 " "Yaroslav Pankovych 在 :issue:`21041` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1279 +#: ../../whatsnew/3.10.rst:1280 msgid "" "Add :meth:`Path.hardlink_to ` method that " "supersedes :meth:`~pathlib.Path.link_to`. The new method has the same " @@ -1847,7 +1847,7 @@ msgstr "" "Path.hardlink_to>` 方法。新方法與 :meth:`~pathlib.Path.symlink_to` 具有相同的" "引數順序。(由 Barney Gale 在 :issue:`39950` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1284 +#: ../../whatsnew/3.10.rst:1285 msgid "" ":meth:`pathlib.Path.stat` and :meth:`~pathlib.Path.chmod` now accept a " "*follow_symlinks* keyword-only argument for consistency with corresponding " @@ -1858,11 +1858,11 @@ msgstr "" "*follow_symlinks* 僅限關鍵字引數,以與 :mod:`os` 模組中的相應函式保持一致。" "(由 Barney Gale 在 :issue:`39906` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1290 +#: ../../whatsnew/3.10.rst:1291 msgid "platform" msgstr "platform" -#: ../../whatsnew/3.10.rst:1292 +#: ../../whatsnew/3.10.rst:1293 msgid "" "Add :func:`platform.freedesktop_os_release()` to retrieve operation system " "identification from `freedesktop.org os-release `\\ 包含已棄用功能的列表。(由 Christian Heimes 在 :issue:`43880` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1373 +#: ../../whatsnew/3.10.rst:1374 msgid "" "The ssl module now has more secure default settings. Ciphers without forward " "secrecy or SHA-1 MAC are disabled by default. Security level 2 prohibits " @@ -2034,7 +2034,7 @@ msgstr "" "`~ssl.SSLContext` 預設為最低協議版本 TLS 1.2。設定基於 Hynek Schlawack 的研" "究。 (由 Christian Heimes 在 :issue:`43998` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1380 +#: ../../whatsnew/3.10.rst:1381 msgid "" "The deprecated protocols SSL 3.0, TLS 1.0, and TLS 1.1 are no longer " "officially supported. Python does not block them actively. However OpenSSL " @@ -2045,7 +2045,7 @@ msgstr "" "們。然而,OpenSSL 建置選項、發行版配置、發行商補丁和密碼套件可能會阻止交握的" "成功。" -#: ../../whatsnew/3.10.rst:1385 +#: ../../whatsnew/3.10.rst:1386 msgid "" "Add a *timeout* parameter to the :func:`ssl.get_server_certificate` " "function. (Contributed by Zackery Spytz in :issue:`31870`.)" @@ -2053,7 +2053,7 @@ msgstr "" "向 :func:`ssl.get_server_certificate` 函式新增 *timeout* 參數。(由 Zackery " "Spytz 在 :issue:`31870` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1388 +#: ../../whatsnew/3.10.rst:1389 msgid "" "The ssl module uses heap-types and multi-phase initialization. (Contributed " "by Christian Heimes in :issue:`42333`.)" @@ -2061,7 +2061,7 @@ msgstr "" "ssl 模組使用堆疊類型 (heap-types) 和多階段初始化 (multi-phase " "initialization)。(由 Christian Heimes 在 :issue:`42333` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1391 +#: ../../whatsnew/3.10.rst:1392 msgid "" "A new verify flag :const:`~ssl.VERIFY_X509_PARTIAL_CHAIN` has been added. " "(Contributed by l0x in :issue:`40849`.)" @@ -2069,11 +2069,11 @@ msgstr "" "新增驗證旗標 :const:`~ssl.VERIFY_X509_PARTIAL_CHAIN`。(由 l0x 在 :issue:" "`40849` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1395 +#: ../../whatsnew/3.10.rst:1396 msgid "sqlite3" msgstr "sqlite3" -#: ../../whatsnew/3.10.rst:1397 +#: ../../whatsnew/3.10.rst:1398 msgid "" "Add audit events for :func:`~sqlite3.connect/handle`, :meth:`~sqlite3." "Connection.enable_load_extension`, and :meth:`~sqlite3.Connection." @@ -2083,11 +2083,11 @@ msgstr "" "enable_load_extension` 和 :meth:`~sqlite3.Connection.load_extension` 的稽核事" "件。(由 Erlend E. Aasland 在 :issue:`43762` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1403 +#: ../../whatsnew/3.10.rst:1404 msgid "sys" msgstr "sys" -#: ../../whatsnew/3.10.rst:1405 +#: ../../whatsnew/3.10.rst:1406 msgid "" "Add :data:`sys.orig_argv` attribute: the list of the original command line " "arguments passed to the Python executable. (Contributed by Victor Stinner " @@ -2096,7 +2096,7 @@ msgstr "" "新增 :data:`sys.orig_argv` 屬性:傳遞給 Python 可執行檔案的原始命令列引數列" "表。(由 Victor Stinner 在 :issue:`23427` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1409 +#: ../../whatsnew/3.10.rst:1410 msgid "" "Add :data:`sys.stdlib_module_names`, containing the list of the standard " "library module names. (Contributed by Victor Stinner in :issue:`42955`.)" @@ -2104,11 +2104,11 @@ msgstr "" "新增 :data:`sys.stdlib_module_names`,其中包含標準函式庫模組的名稱列表。 " "(由 Victor Stinner 在 :issue:`42955` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1414 +#: ../../whatsnew/3.10.rst:1415 msgid "_thread" msgstr "_thread" -#: ../../whatsnew/3.10.rst:1416 +#: ../../whatsnew/3.10.rst:1417 msgid "" ":func:`_thread.interrupt_main` now takes an optional signal number to " "simulate (the default is still :const:`signal.SIGINT`). (Contributed by " @@ -2118,11 +2118,11 @@ msgstr "" "然是 :const:`signal.SIGINT`)。 (由 Antoine Pitrou 在 :issue:`43356` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1421 +#: ../../whatsnew/3.10.rst:1422 msgid "threading" msgstr "threading" -#: ../../whatsnew/3.10.rst:1423 +#: ../../whatsnew/3.10.rst:1424 msgid "" "Add :func:`threading.gettrace` and :func:`threading.getprofile` to retrieve " "the functions set by :func:`threading.settrace` and :func:`threading." @@ -2132,7 +2132,7 @@ msgstr "" "func:`threading.settrace` 和 :func:`threading.setprofile` 設定的函式。(由 " "Mario Corchero 在 :issue:`42251` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1428 +#: ../../whatsnew/3.10.rst:1429 msgid "" "Add :data:`threading.__excepthook__` to allow retrieving the original value " "of :func:`threading.excepthook` in case it is set to a broken or a different " @@ -2142,11 +2142,11 @@ msgstr "" "excepthook` 的原始值,以防它被設定為損壞或不同的值。(由 Mario Corchero 在 :" "issue:`42308` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1434 +#: ../../whatsnew/3.10.rst:1435 msgid "traceback" msgstr "traceback" -#: ../../whatsnew/3.10.rst:1436 +#: ../../whatsnew/3.10.rst:1437 msgid "" "The :func:`~traceback.format_exception`, :func:`~traceback." "format_exception_only`, and :func:`~traceback.print_exception` functions can " @@ -2158,11 +2158,11 @@ msgstr "" "外物件作為僅限位置引數。(由 Zackery Spytz 和 Matthias Bussonnier 在 :issue:" "`26389` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1443 +#: ../../whatsnew/3.10.rst:1444 msgid "types" msgstr "types" -#: ../../whatsnew/3.10.rst:1445 +#: ../../whatsnew/3.10.rst:1446 msgid "" "Reintroduce the :data:`types.EllipsisType`, :data:`types.NoneType` and :data:" "`types.NotImplementedType` classes, providing a new set of types readily " @@ -2173,15 +2173,15 @@ msgstr "" "NotImplementedType` 類別,提供一組易於型別檢查器直譯的新型別。(由 Bas van " "Beek 在 :issue:`41810` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1451 +#: ../../whatsnew/3.10.rst:1452 msgid "typing" msgstr "typing" -#: ../../whatsnew/3.10.rst:1453 +#: ../../whatsnew/3.10.rst:1454 msgid "For major changes, see :ref:`new-feat-related-type-hints`." msgstr "有關重大更改,請參閱\\ :ref:`new-feat-related-type-hints`。" -#: ../../whatsnew/3.10.rst:1455 +#: ../../whatsnew/3.10.rst:1456 msgid "" "The behavior of :class:`typing.Literal` was changed to conform with :pep:" "`586` and to match the behavior of static type checkers specified in the PEP." @@ -2189,16 +2189,16 @@ msgstr "" ":class:`typing.Literal` 的行為已更改為符合 :pep:`586` 並匹配 PEP 中指定的靜態" "型別檢查器的行為。" -#: ../../whatsnew/3.10.rst:1458 +#: ../../whatsnew/3.10.rst:1459 msgid "``Literal`` now de-duplicates parameters." msgstr "``Literal`` 現在可以刪除重複參數。" -#: ../../whatsnew/3.10.rst:1459 +#: ../../whatsnew/3.10.rst:1460 msgid "" "Equality comparisons between ``Literal`` objects are now order independent." msgstr "``Literal`` 物件之間的相等性比較現在與順序無關。" -#: ../../whatsnew/3.10.rst:1460 +#: ../../whatsnew/3.10.rst:1461 msgid "" "``Literal`` comparisons now respect types. For example, ``Literal[0] == " "Literal[False]`` previously evaluated to ``True``. It is now ``False``. To " @@ -2209,7 +2209,7 @@ msgstr "" "Literal[False]`` 先前之求值為 ``True``,但現在它是 ``False``。為了支援此更" "改,內部使用的型別快取現在支援了型別的辨認。" -#: ../../whatsnew/3.10.rst:1464 +#: ../../whatsnew/3.10.rst:1465 msgid "" "``Literal`` objects will now raise a :exc:`TypeError` exception during " "equality comparisons if any of their parameters are not :term:`hashable`. " @@ -2220,11 +2220,11 @@ msgstr "" "在將在相等性比較期間引發 :exc:`TypeError` 例外。請注意,使用不可雜湊的參數宣" "告 ``Literal`` 不會引發錯誤:" -#: ../../whatsnew/3.10.rst:1476 +#: ../../whatsnew/3.10.rst:1477 msgid "(Contributed by Yurii Karabas in :issue:`42345`.)" msgstr "(由 Yurii Karabas 在 :issue:`42345` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1478 +#: ../../whatsnew/3.10.rst:1479 msgid "" "Add new function :func:`typing.is_typeddict` to introspect if an annotation " "is a :class:`typing.TypedDict`. (Contributed by Patrick Reader in :issue:" @@ -2233,7 +2233,7 @@ msgstr "" "新增函式 :func:`typing.is_typeddict` 來自我審查 (introspect) 註釋是否為 :" "class:`typing.TypedDict`。(由 Patrick Reader 在 :issue:`41792` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1482 +#: ../../whatsnew/3.10.rst:1483 msgid "" "Subclasses of ``typing.Protocol`` which only have data variables declared " "will now raise a ``TypeError`` when checked with ``isinstance`` unless they " @@ -2248,7 +2248,7 @@ msgstr "" "該使用 :func:`runtime_checkable` 裝飾器來裝飾其子類別。(由 Yurii Karabas " "在 :issue:`38908` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1490 +#: ../../whatsnew/3.10.rst:1491 msgid "" "Importing from the ``typing.io`` and ``typing.re`` submodules will now emit :" "exc:`DeprecationWarning`. These submodules have been deprecated since " @@ -2261,11 +2261,11 @@ msgstr "" "Python 中刪除。屬於這些子模組的任何內容都應該直接從 :mod:`typing` 引入。 " "(由 Sebastian Rittau 在 :issue:`38291` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1498 +#: ../../whatsnew/3.10.rst:1499 msgid "unittest" msgstr "unittest" -#: ../../whatsnew/3.10.rst:1500 +#: ../../whatsnew/3.10.rst:1501 msgid "" "Add new method :meth:`~unittest.TestCase.assertNoLogs` to complement the " "existing :meth:`~unittest.TestCase.assertLogs`. (Contributed by Kit Yan Choi " @@ -2275,11 +2275,11 @@ msgstr "" "`~unittest.TestCase.assertLogs`。(由 Kit Yan Choi 在 :issue:`39385` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1505 +#: ../../whatsnew/3.10.rst:1506 msgid "urllib.parse" msgstr "urllib.parse" -#: ../../whatsnew/3.10.rst:1507 +#: ../../whatsnew/3.10.rst:1508 msgid "" "Python versions earlier than Python 3.10 allowed using both ``;`` and ``&`` " "as query parameter separators in :func:`urllib.parse.parse_qs` and :func:" @@ -2299,11 +2299,11 @@ msgstr "" "訊,請參閱各自的文件。(由 Adam Goldschmidt、Senthil Kumaran 和 Ken Jin 在 :" "issue:`42967` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1518 +#: ../../whatsnew/3.10.rst:1519 msgid "xml" msgstr "xml" -#: ../../whatsnew/3.10.rst:1520 +#: ../../whatsnew/3.10.rst:1521 msgid "" "Add a :class:`~xml.sax.handler.LexicalHandler` class to the :mod:`xml.sax." "handler` module. (Contributed by Jonathan Gossage and Zackery Spytz in :" @@ -2312,11 +2312,11 @@ msgstr "" "新增 :class:`~xml.sax.handler.LexicalHandler` 類別到 :mod:`xml.sax.handler` " "模組。(由 Jonathan Gossage 和 Zackery Spytz 在 :issue:`35018` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1525 +#: ../../whatsnew/3.10.rst:1526 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.10.rst:1526 +#: ../../whatsnew/3.10.rst:1527 msgid "" "Add methods related to :pep:`451`: :meth:`~zipimport.zipimporter." "find_spec`, :meth:`zipimport.zipimporter.create_module`, and :meth:" @@ -2327,7 +2327,7 @@ msgstr "" "meth:`zipimport.zipimporter.create_module` 和 :meth:`zipimport.zipimporter." "exec_module`。(由 Brett Cannon 在 :issue:`42131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1531 +#: ../../whatsnew/3.10.rst:1532 msgid "" "Add :meth:`~zipimport.zipimporter.invalidate_caches` method. (Contributed by " "Desmond Cheong in :issue:`14678`.)" @@ -2335,11 +2335,11 @@ msgstr "" "新增 :meth:`~zipimport.zipimporter.invalidate_caches` 方法。(由 Desmond " "Cheong 在 :issue:`14678` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1536 +#: ../../whatsnew/3.10.rst:1537 msgid "Optimizations" msgstr "最佳化" -#: ../../whatsnew/3.10.rst:1538 +#: ../../whatsnew/3.10.rst:1539 msgid "" "Constructors :func:`str`, :func:`bytes` and :func:`bytearray` are now faster " "(around 30--40% for small objects). (Contributed by Serhiy Storchaka in :" @@ -2348,7 +2348,7 @@ msgstr "" "建構函式 :func:`str`、:func:`bytes` 和 :func:`bytearray` 現在更快了(對於小型" "物件大約快了 30--40%)。(由 Serhiy Storchaka 在 :issue:`41334` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1542 +#: ../../whatsnew/3.10.rst:1543 msgid "" "The :mod:`runpy` module now imports fewer modules. The ``python3 -m module-" "name`` command startup time is 1.4x faster in average. On Linux, ``python3 -" @@ -2361,7 +2361,7 @@ msgstr "" "引入 69 個模組,而在 Python 3.10 上僅引入 51 個模組 (-18)。(由 Victor " "Stinner 在 :issue:`41006` 和 :issue:`41718` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1548 +#: ../../whatsnew/3.10.rst:1549 msgid "" "The ``LOAD_ATTR`` instruction now uses new \"per opcode cache\" mechanism. " "It is about 36% faster now for regular attributes and 44% faster for slots. " @@ -2374,7 +2374,7 @@ msgstr "" "Yury Selivanov 在 :issue:`42093` 中以及 Guido van Rossum 在 :issue:`42927` 中" "貢獻,基於最初在 PyPy 和 MicroPython 中實作的想法。)" -#: ../../whatsnew/3.10.rst:1554 +#: ../../whatsnew/3.10.rst:1555 msgid "" "When building Python with :option:`--enable-optimizations` now ``-fno-" "semantic-interposition`` is added to both the compile and link line. This " @@ -2391,7 +2391,7 @@ msgstr "" "linux-8-2-brings-faster-python-3-8-run-speeds/>`_ 以了解詳情。(由 Victor " "Stinner 和 Pablo Galindo 在 :issue:`38980` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1562 +#: ../../whatsnew/3.10.rst:1563 msgid "" "Use a new output buffer management code for :mod:`bz2` / :mod:`lzma` / :mod:" "`zlib` modules, and add ``.readall()`` function to ``_compression." @@ -2406,7 +2406,7 @@ msgstr "" "``GzipFile.read(-1)`` 速度提高了 1.11x ~ 1.18x。(由 Ma Lin 於 :issue:" "`41486` 貢獻、由 Gregory P. Smith 審閱)" -#: ../../whatsnew/3.10.rst:1568 +#: ../../whatsnew/3.10.rst:1569 msgid "" "When using stringized annotations, annotations dicts for functions are no " "longer created when the function is created. Instead, they are stored as a " @@ -2420,7 +2420,7 @@ msgstr "" "最佳化將定義帶有註釋的函式所需的 CPU 時間減少了一半。(由 Yurii Karabas 和 " "Inada Naoki 在 :issue:`42202` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1575 +#: ../../whatsnew/3.10.rst:1576 msgid "" "Substring search functions such as ``str1 in str2`` and ``str2.find(str1)`` " "now sometimes use Crochemore & Perrin's \"Two-Way\" string searching " @@ -2431,7 +2431,7 @@ msgstr "" "用 Crochemore & Perrin 的「雙向」字串搜索演算法來避免作用於長字串上時發生二次" "方行為 (quadratic behavior)。(由 Dennis Sweeney 在 :issue:`41972` 中貢獻)" -#: ../../whatsnew/3.10.rst:1580 +#: ../../whatsnew/3.10.rst:1581 msgid "" "Add micro-optimizations to ``_PyType_Lookup()`` to improve type attribute " "cache lookup performance in the common case of cache hits. This makes the " @@ -2442,7 +2442,7 @@ msgstr "" "查找性能。這使得直譯器平均速度提高了 1.04 倍。(由 Dino Viehland 在 :issue:" "`43452` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1584 +#: ../../whatsnew/3.10.rst:1585 msgid "" "The following built-in functions now support the faster :pep:`590` " "vectorcall calling convention: :func:`map`, :func:`filter`, :func:" @@ -2455,7 +2455,7 @@ msgstr "" "Na 和 Jeroen Demeyer 在 :issue:`43575`、:issue:`43287`、:issue:`41922`、:" "issue:`41873` 和 :issue:`41870` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1588 +#: ../../whatsnew/3.10.rst:1589 msgid "" ":class:`BZ2File` performance is improved by removing internal ``RLock``. " "This makes :class:`BZ2File` thread unsafe in the face of multiple " @@ -2467,11 +2467,11 @@ msgstr "" "`BZ2File` 在面對多個同時的讀取器或寫入器時執行緒不安全,就像 :mod:`gzip` 和 :" "mod:`lzma` 中的等效類別一樣。(由 Inada Naoki 在 :issue:`43785` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1596 ../../whatsnew/3.10.rst:2202 +#: ../../whatsnew/3.10.rst:1597 ../../whatsnew/3.10.rst:2203 msgid "Deprecated" msgstr "已棄用" -#: ../../whatsnew/3.10.rst:1598 +#: ../../whatsnew/3.10.rst:1599 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -2491,7 +2491,7 @@ msgstr "" "其中之一,則會引發棄用警告。在未來的版本中,它將被變更為語法警告,最後成為為" "語法錯誤。(由 Serhiy Storchaka 在 :issue:`43833` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1609 +#: ../../whatsnew/3.10.rst:1610 msgid "" "Starting in this release, there will be a concerted effort to begin cleaning " "up old import semantics that were kept for Python 2.7 compatibility. " @@ -2517,7 +2517,7 @@ msgstr "" "類別和方法)。將酌情引發 :exc:`ImportWarning` 和/或 :exc:" "`DeprecationWarning` 以幫助識別在此轉換期間需要更新的程式碼。" -#: ../../whatsnew/3.10.rst:1626 +#: ../../whatsnew/3.10.rst:1627 msgid "" "The entire ``distutils`` namespace is deprecated, to be removed in Python " "3.12. Refer to the :ref:`module changes ` section for " @@ -2526,7 +2526,7 @@ msgstr "" "整個 ``distutils`` 命名空間已棄用,將在 Python 3.12 中刪除。請參閱\\ :ref:`模" "組更改 ` 以獲取更多資訊。" -#: ../../whatsnew/3.10.rst:1630 +#: ../../whatsnew/3.10.rst:1631 msgid "" "Non-integer arguments to :func:`random.randrange` are deprecated. The :exc:" "`ValueError` is deprecated in favor of a :exc:`TypeError`. (Contributed by " @@ -2536,7 +2536,7 @@ msgstr "" "代之的是 :exc:`TypeError`。(由 Serhiy Storchaka 和 Raymond Hettinger 在 :" "issue:`37319` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1634 +#: ../../whatsnew/3.10.rst:1635 msgid "" "The various ``load_module()`` methods of :mod:`importlib` have been " "documented as deprecated since Python 3.6, but will now also trigger a :exc:" @@ -2547,7 +2547,7 @@ msgstr "" "用,但現在也會觸發 :exc:`DeprecationWarning`。請改用 :meth:`~importlib.abc." "Loader.exec_module`。(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1640 +#: ../../whatsnew/3.10.rst:1641 msgid "" ":meth:`zimport.zipimporter.load_module` has been deprecated in preference " "for :meth:`~zipimport.zipimporter.exec_module`. (Contributed by Brett Cannon " @@ -2556,7 +2556,7 @@ msgstr "" ":meth:`zimport.zipimporter.load_module` 已被棄用,請用 :meth:`~zipimport." "zipimporter.exec_module`。(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1644 +#: ../../whatsnew/3.10.rst:1645 msgid "" "The use of :meth:`~importlib.abc.Loader.load_module` by the import system " "now triggers an :exc:`ImportWarning` as :meth:`~importlib.abc.Loader." @@ -2566,7 +2566,7 @@ msgstr "" "`ImportWarning`,因為 :meth:`~importlib.abc.Loader.exec_module` 是當前首選。" "(由 Brett Cannon 在 :issue:`26131` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1649 +#: ../../whatsnew/3.10.rst:1650 msgid "" "The use of :meth:`!importlib.abc.MetaPathFinder.find_module` and :meth:`!" "importlib.abc.PathEntryFinder.find_module` by the import system now trigger " @@ -2582,7 +2582,7 @@ msgstr "" "util.spec_from_loader` 來幫助移植。(由 Brett Cannon 在 :issue:`42134` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1658 +#: ../../whatsnew/3.10.rst:1659 msgid "" "The use of :meth:`!importlib.abc.PathEntryFinder.find_loader` by the import " "system now triggers an :exc:`ImportWarning` as :meth:`importlib.abc." @@ -2595,7 +2595,7 @@ msgstr "" "首選。你可以使用 :func:`importlib.util.spec_from_loader` 來幫助移植。(由 " "Brett Cannon 在 :issue:`43672` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1664 +#: ../../whatsnew/3.10.rst:1665 msgid "" "The various implementations of :meth:`!importlib.abc.MetaPathFinder." "find_module` ( :meth:`!importlib.machinery.BuiltinImporter.find_module`, :" @@ -2620,7 +2620,7 @@ msgstr "" "發 :exc:`DeprecationWarning` 並計劃在 Python 3.12 中刪除(之前它們已在 " "Python 3.4 中被記錄為已棄用)。(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1679 +#: ../../whatsnew/3.10.rst:1680 msgid "" ":class:`!importlib.abc.Finder` is deprecated (including its sole method, :" "meth:`!find_module`). Both :class:`importlib.abc.MetaPathFinder` and :class:" @@ -2633,7 +2633,7 @@ msgstr "" "abc.PathEntryFinder` 都不再從該類別繼承。使用者應該根據需求來選擇其一以繼承。" "(由 Brett Cannon 在 :issue:`42135` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1686 +#: ../../whatsnew/3.10.rst:1687 msgid "" "The deprecations of :mod:`!imp`, :func:`!importlib.find_loader`, :func:`!" "importlib.util.set_package_wrapper`, :func:`!importlib.util." @@ -2650,7 +2650,7 @@ msgstr "" "過去版本的 Python 中引發 :exc:`DeprecationWarning`) 。(由 Brett Cannon 在 :" "issue:`43720` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1696 +#: ../../whatsnew/3.10.rst:1697 msgid "" "The import system now uses the ``__spec__`` attribute on modules before " "falling back on :meth:`!module_repr` for a module's ``__repr__()`` method. " @@ -2661,7 +2661,7 @@ msgstr "" "module_repr` 作為模組的 ``__repr__()`` 方法。計劃在 Python 3.12 中刪除 " "``module_repr()`` 的使用。(由 Brett Cannon 在 :issue:`42137` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1702 +#: ../../whatsnew/3.10.rst:1703 msgid "" ":meth:`!importlib.abc.Loader.module_repr`, :meth:`!importlib.machinery." "FrozenLoader.module_repr`, and :meth:`!importlib.machinery.BuiltinLoader." @@ -2673,7 +2673,7 @@ msgstr "" "module_repr` 已棄用並計劃在 Python 3.12 中刪除。(由 Brett Cannon 在 :issue:" "`42136` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1708 +#: ../../whatsnew/3.10.rst:1709 msgid "" "``sqlite3.OptimizedUnicode`` has been undocumented and obsolete since Python " "3.3, when it was made an alias to :class:`str`. It is now deprecated, " @@ -2684,7 +2684,7 @@ msgstr "" "它被用作 :class:`str` 的別名。它現已被棄用,並計劃在 Python 3.12 中刪除。" "(由 Erlend E. Aasland 在 :issue:`42264` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1713 +#: ../../whatsnew/3.10.rst:1714 msgid "" "The undocumented built-in function ``sqlite3.enable_shared_cache`` is now " "deprecated, scheduled for removal in Python 3.12. Its use is strongly " @@ -2699,49 +2699,49 @@ msgstr "" "使用共享快取,請使用 ``cache=shared`` 查詢參數以 URI 模式打開資料庫。(由 " "Erlend E. Aasland 在 :issue:`24464` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1721 +#: ../../whatsnew/3.10.rst:1722 msgid "The following ``threading`` methods are now deprecated:" msgstr "以下 ``threading`` 方法現已棄用:" -#: ../../whatsnew/3.10.rst:1723 +#: ../../whatsnew/3.10.rst:1724 msgid "``threading.currentThread`` => :func:`threading.current_thread`" msgstr "``threading.currentThread`` => :func:`threading.current_thread`" -#: ../../whatsnew/3.10.rst:1725 +#: ../../whatsnew/3.10.rst:1726 msgid "``threading.activeCount`` => :func:`threading.active_count`" msgstr "``threading.activeCount`` => :func:`threading.active_count`" -#: ../../whatsnew/3.10.rst:1727 +#: ../../whatsnew/3.10.rst:1728 msgid "" "``threading.Condition.notifyAll`` => :meth:`threading.Condition.notify_all`" msgstr "" "``threading.Condition.notifyAll`` => :meth:`threading.Condition.notify_all`" -#: ../../whatsnew/3.10.rst:1730 +#: ../../whatsnew/3.10.rst:1731 msgid "``threading.Event.isSet`` => :meth:`threading.Event.is_set`" msgstr "``threading.Event.isSet`` => :meth:`threading.Event.is_set`" -#: ../../whatsnew/3.10.rst:1732 +#: ../../whatsnew/3.10.rst:1733 msgid "``threading.Thread.setName`` => :attr:`threading.Thread.name`" msgstr "``threading.Thread.setName`` => :attr:`threading.Thread.name`" -#: ../../whatsnew/3.10.rst:1734 +#: ../../whatsnew/3.10.rst:1735 msgid "``threading.thread.getName`` => :attr:`threading.Thread.name`" msgstr "``threading.thread.getName`` => :attr:`threading.Thread.name`" -#: ../../whatsnew/3.10.rst:1736 +#: ../../whatsnew/3.10.rst:1737 msgid "``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`" msgstr "``threading.Thread.isDaemon`` => :attr:`threading.Thread.daemon`" -#: ../../whatsnew/3.10.rst:1738 +#: ../../whatsnew/3.10.rst:1739 msgid "``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`" msgstr "``threading.Thread.setDaemon`` => :attr:`threading.Thread.daemon`" -#: ../../whatsnew/3.10.rst:1740 +#: ../../whatsnew/3.10.rst:1741 msgid "(Contributed by Jelle Zijlstra in :gh:`87889`.)" msgstr "(由 Jelle Zijlstra 在 :gh:`87889` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1742 +#: ../../whatsnew/3.10.rst:1743 msgid "" ":meth:`pathlib.Path.link_to` is deprecated and slated for removal in Python " "3.12. Use :meth:`pathlib.Path.hardlink_to` instead. (Contributed by Barney " @@ -2750,7 +2750,7 @@ msgstr "" ":meth:`pathlib.Path.link_to` 已棄用並計劃在 Python 3.12 中刪除。請改用 :meth:" "`pathlib.Path.hardlink_to`。(由 Barney Gale 在 :issue:`39950` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1746 +#: ../../whatsnew/3.10.rst:1747 msgid "" "``cgi.log()`` is deprecated and slated for removal in Python 3.12. " "(Contributed by Inada Naoki in :issue:`41139`.)" @@ -2758,7 +2758,7 @@ msgstr "" "``cgi.log()`` 已棄用並計劃在 Python 3.12 中刪除。(由 Inada Naoki 在 :issue:" "`41139` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1749 +#: ../../whatsnew/3.10.rst:1750 msgid "" "The following :mod:`ssl` features have been deprecated since Python 3.6, " "Python 3.7, or OpenSSL 1.1.0 and will be removed in 3.11:" @@ -2766,7 +2766,7 @@ msgstr "" "自 Python 3.6、Python 3.7 或 OpenSSL 1.1.0 起,以下 :mod:`ssl` 功能已被棄用," "並將在 3.11 中刪除:" -#: ../../whatsnew/3.10.rst:1752 +#: ../../whatsnew/3.10.rst:1753 msgid "" ":data:`~ssl.OP_NO_SSLv2`, :data:`~ssl.OP_NO_SSLv3`, :data:`~ssl." "OP_NO_TLSv1`, :data:`~ssl.OP_NO_TLSv1_1`, :data:`~ssl.OP_NO_TLSv1_2`, and :" @@ -2778,7 +2778,7 @@ msgstr "" "data:`~ssl.OP_NO_TLSv1_3` 已被替換為 :attr:`sslSSLContext.minimum_version` " "和 :attr:`sslSSLContext.maximum_version`。" -#: ../../whatsnew/3.10.rst:1758 +#: ../../whatsnew/3.10.rst:1759 msgid "" ":data:`~ssl.PROTOCOL_SSLv2`, :data:`~ssl.PROTOCOL_SSLv3`, :data:`~ssl." "PROTOCOL_SSLv23`, :data:`~ssl.PROTOCOL_TLSv1`, :data:`~ssl." @@ -2792,20 +2792,20 @@ msgstr "" "PROTOCOL_TLS` 已棄用,取而代之的是 :const:`~ssl.PROTOCOL_TLS_CLIENT` 和 :" "const:`~ssl.PROTOCOL_TLS_SERVER`" -#: ../../whatsnew/3.10.rst:1764 +#: ../../whatsnew/3.10.rst:1765 msgid "" ":func:`~ssl.wrap_socket` is replaced by :meth:`ssl.SSLContext.wrap_socket`" msgstr ":func:`~ssl.wrap_socket` 被替換為 :meth:`ssl.SSLContext.wrap_socket`" -#: ../../whatsnew/3.10.rst:1766 +#: ../../whatsnew/3.10.rst:1767 msgid ":func:`~ssl.match_hostname`" msgstr ":func:`~ssl.match_hostname`" -#: ../../whatsnew/3.10.rst:1768 +#: ../../whatsnew/3.10.rst:1769 msgid ":func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`" msgstr ":func:`~ssl.RAND_pseudo_bytes`, :func:`~ssl.RAND_egd`" -#: ../../whatsnew/3.10.rst:1770 +#: ../../whatsnew/3.10.rst:1771 msgid "" "NPN features like :meth:`ssl.SSLSocket.selected_npn_protocol` and :meth:`ssl." "SSLContext.set_npn_protocols` are replaced by ALPN." @@ -2813,7 +2813,7 @@ msgstr "" "NPN 功能如 :meth:`ssl.SSLSocket.selected_npn_protocol` 和 :meth:`ssl." "SSLContext.set_npn_protocols` 已被 ALPN 取代。" -#: ../../whatsnew/3.10.rst:1773 +#: ../../whatsnew/3.10.rst:1774 msgid "" "The threading debug (:envvar:`PYTHONTHREADDEBUG` environment variable) is " "deprecated in Python 3.10 and will be removed in Python 3.12. This feature " @@ -2824,7 +2824,7 @@ msgstr "" "將在 Python 3.12 中刪除。此功能需要一個 :ref:`Python 的除錯用建置版本 `。(由 Victor Stinner 在 :issue:`44584` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1778 +#: ../../whatsnew/3.10.rst:1779 msgid "" "Importing from the ``typing.io`` and ``typing.re`` submodules will now emit :" "exc:`DeprecationWarning`. These submodules will be removed in a future " @@ -2837,11 +2837,11 @@ msgstr "" "的任何內容都應該直接從 :mod:`typing` 引入。(由 Sebastian Rittau 在 :issue:" "`38291` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1787 ../../whatsnew/3.10.rst:2210 +#: ../../whatsnew/3.10.rst:1788 ../../whatsnew/3.10.rst:2211 msgid "Removed" msgstr "已刪除" -#: ../../whatsnew/3.10.rst:1789 +#: ../../whatsnew/3.10.rst:1790 msgid "" "Removed special methods ``__int__``, ``__float__``, ``__floordiv__``, " "``__mod__``, ``__divmod__``, ``__rfloordiv__``, ``__rmod__`` and " @@ -2853,7 +2853,7 @@ msgstr "" "``__rmod__`` 和 ``__rdivmod__`` 。它們都會引發 :exc:`TypeError`。(由 Serhiy " "Storchaka 在 :issue:`41974` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1795 +#: ../../whatsnew/3.10.rst:1796 msgid "" "The ``ParserBase.error()`` method from the private and undocumented " "``_markupbase`` module has been removed. :class:`html.parser.HTMLParser` is " @@ -2866,7 +2866,7 @@ msgstr "" "``error()`` 實作已在 Python 3.5 中刪除。(由 Berker Peksag 在 :issue:`31844` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:1801 +#: ../../whatsnew/3.10.rst:1802 msgid "" "Removed the ``unicodedata.ucnhash_CAPI`` attribute which was an internal " "PyCapsule object. The related private ``_PyUnicode_Name_CAPI`` structure was " @@ -2877,7 +2877,7 @@ msgstr "" "私有 ``_PyUnicode_Name_CAPI`` 結構已移至內部 C API。(由 Victor Stinner 在 :" "issue:`42157` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1806 +#: ../../whatsnew/3.10.rst:1807 msgid "" "Removed the ``parser`` module, which was deprecated in 3.9 due to the switch " "to the new PEG parser, as well as all the C source and header files that " @@ -2888,7 +2888,7 @@ msgstr "" "析器使用的所有 C 原始碼和標頭檔也已被刪除,包括 ``node.h``、``parser.h``、" "``graminit.h`` 和 ``grammar.h``。" -#: ../../whatsnew/3.10.rst:1811 +#: ../../whatsnew/3.10.rst:1812 msgid "" "Removed the Public C API functions ``PyParser_SimpleParseStringFlags``, " "``PyParser_SimpleParseStringFlagsFilename``, " @@ -2900,7 +2900,7 @@ msgstr "" "``PyParser_SimpleParseFileFlags`` 和 ``PyNode_Compile``,這些函式由於切換到新" "的 PEG 剖析器而在 3.9 中被棄用。" -#: ../../whatsnew/3.10.rst:1816 +#: ../../whatsnew/3.10.rst:1817 msgid "" "Removed the ``formatter`` module, which was deprecated in Python 3.4. It is " "somewhat obsolete, little used, and not tested. It was originally scheduled " @@ -2913,7 +2913,7 @@ msgstr "" "Python 2.7 EOL 之後。現有使用者應該將他們使用的任何類別複製到他們的程式碼中。" "(由 Donghee Na 和 Terry J. Reedy 在 :issue:`42299` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1823 +#: ../../whatsnew/3.10.rst:1824 msgid "" "Removed the :c:func:`!PyModule_GetWarningsModule` function that was useless " "now due to the :mod:`!_warnings` module was converted to a builtin module in " @@ -2923,7 +2923,7 @@ msgstr "" "`!_warnings` 模組在 2.6 中已轉換為內建模組。(由 Hai Shi 在 :issue:`42599` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:1827 +#: ../../whatsnew/3.10.rst:1828 msgid "" "Remove deprecated aliases to :ref:`collections-abstract-base-classes` from " "the :mod:`collections` module. (Contributed by Victor Stinner in :issue:" @@ -2932,7 +2932,7 @@ msgstr "" "從 :mod:`collections` 模組中刪除已棄用的、對 :ref:`collections-abstract-base-" "classes` 的別名。(由 Victor Stinner 在 :issue:`37324` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1831 +#: ../../whatsnew/3.10.rst:1832 msgid "" "The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" "doc:`high-level API <../library/asyncio-api-index>` following deprecation in " @@ -2941,11 +2941,11 @@ msgstr "" "在 Python 3.8 中棄用後,``loop`` 參數已從大多數 :mod:`asyncio` 的\\ :doc:`高" "階 API <../library/asyncio-api-index>` 中刪除。這一變化的背後動機是多方面的:" -#: ../../whatsnew/3.10.rst:1835 +#: ../../whatsnew/3.10.rst:1836 msgid "This simplifies the high-level API." msgstr "這簡化了高階 API。" -#: ../../whatsnew/3.10.rst:1836 +#: ../../whatsnew/3.10.rst:1837 msgid "" "The functions in the high-level API have been implicitly getting the current " "thread's running event loop since Python 3.7. There isn't a need to pass " @@ -2954,13 +2954,13 @@ msgstr "" "自 Python 3.7 以來,高階 API 中的函式一直隱式獲取當前執行緒正在運行的事件循" "環。在大多數正常用例中,不需要將事件循環傳遞給 API。" -#: ../../whatsnew/3.10.rst:1839 +#: ../../whatsnew/3.10.rst:1840 msgid "" "Event loop passing is error-prone especially when dealing with loops running " "in different threads." msgstr "事件循環的傳遞很容易出錯,尤其是在處理在不同執行緒中運行的循環時。" -#: ../../whatsnew/3.10.rst:1842 +#: ../../whatsnew/3.10.rst:1843 msgid "" "Note that the low-level API will still accept ``loop``. See :ref:`changes-" "python-api` for examples of how to replace existing code." @@ -2968,7 +2968,7 @@ msgstr "" "請注意,低階 API 仍會接受 ``loop``。有關如何替換現有程式碼的範例,請參閱 :" "ref:`changes-python-api`。" -#: ../../whatsnew/3.10.rst:1845 ../../whatsnew/3.10.rst:1917 +#: ../../whatsnew/3.10.rst:1846 ../../whatsnew/3.10.rst:1918 msgid "" "(Contributed by Yurii Karabas, Andrew Svetlov, Yury Selivanov and Kyle " "Stanley in :issue:`42392`.)" @@ -2976,21 +2976,21 @@ msgstr "" "(由 Yurii Karabas、Andrew Svetlov、Yury Selivanov 和 Kyle Stanley 在 :issue:" "`42392` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1850 ../../whatsnew/3.10.rst:2137 +#: ../../whatsnew/3.10.rst:1851 ../../whatsnew/3.10.rst:2138 msgid "Porting to Python 3.10" msgstr "移植到 Python 3.10" -#: ../../whatsnew/3.10.rst:1852 +#: ../../whatsnew/3.10.rst:1853 msgid "" "This section lists previously described changes and other bugfixes that may " "require changes to your code." msgstr "本節列出了前面描述的更改以及可能需要更改程式碼的其他錯誤修復。" -#: ../../whatsnew/3.10.rst:1857 +#: ../../whatsnew/3.10.rst:1858 msgid "Changes in the Python syntax" msgstr "Python 語法的變化" -#: ../../whatsnew/3.10.rst:1859 +#: ../../whatsnew/3.10.rst:1860 msgid "" "Deprecation warning is now emitted when compiling previously valid syntax if " "the numeric literal is immediately followed by a keyword (like in ``0in " @@ -3004,11 +3004,11 @@ msgstr "" "要消除警告並使程式碼與未來版本相容,只需在數字字面值和以下關鍵字之間新增一個" "空格即可。(由 Serhiy Storchaka 在 :issue:`43833` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1870 +#: ../../whatsnew/3.10.rst:1871 msgid "Changes in the Python API" msgstr "Python API 的變化" -#: ../../whatsnew/3.10.rst:1872 +#: ../../whatsnew/3.10.rst:1873 msgid "" "The *etype* parameters of the :func:`~traceback.format_exception`, :func:" "`~traceback.format_exception_only`, and :func:`~traceback.print_exception` " @@ -3020,7 +3020,7 @@ msgstr "" "print_exception` 函式的 *etype* 參數已重命名為 *exc*。(由 Zackery Spytz 和 " "Matthias Bussonnier 在 :issue:`26389` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1878 +#: ../../whatsnew/3.10.rst:1879 msgid "" ":mod:`atexit`: At Python exit, if a callback registered with :func:`atexit." "register` fails, its exception is now logged. Previously, only some " @@ -3031,7 +3031,7 @@ msgstr "" "回呼 (callback) 失敗,該例外現在會被記錄下來。在以前只記錄一些例外,並且最後" "一個例外總是被默默地忽略。(由 Victor Stinner 在 :issue:`42639` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1884 +#: ../../whatsnew/3.10.rst:1885 msgid "" ":class:`collections.abc.Callable` generic now flattens type parameters, " "similar to what :data:`typing.Callable` currently does. This means that " @@ -3051,7 +3051,7 @@ msgstr "" "可能會引發 :exc:`TypeError`,而在 Python 3.9 中,該參數可能已被默默地傳遞。" "(由 Ken Jin 在 :issue:`42195` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1894 +#: ../../whatsnew/3.10.rst:1895 msgid "" ":meth:`socket.htons` and :meth:`socket.ntohs` now raise :exc:`OverflowError` " "instead of :exc:`DeprecationWarning` if the given parameter will not fit in " @@ -3063,7 +3063,7 @@ msgstr "" "是 :exc:`DeprecationWarning`。(由 Erlend E. Aasland 在 :issue:`42393` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:1899 +#: ../../whatsnew/3.10.rst:1900 msgid "" "The ``loop`` parameter has been removed from most of :mod:`asyncio`\\ 's :" "doc:`high-level API <../library/asyncio-api-index>` following deprecation in " @@ -3072,21 +3072,21 @@ msgstr "" "在 Python 3.8 中棄用後,``loop`` 參數已從大多數 :mod:`asyncio` 的\\ :doc:`高" "階 API <../library/asyncio-api-index>` 中刪除。" -#: ../../whatsnew/3.10.rst:1903 +#: ../../whatsnew/3.10.rst:1904 msgid "A coroutine that currently looks like this::" msgstr "" "目前如下所示的協程:\n" "\n" "::" -#: ../../whatsnew/3.10.rst:1908 +#: ../../whatsnew/3.10.rst:1909 msgid "Should be replaced with this::" msgstr "" "應替換為:\n" "\n" "::" -#: ../../whatsnew/3.10.rst:1913 +#: ../../whatsnew/3.10.rst:1914 msgid "" "If ``foo()`` was specifically designed *not* to run in the current thread's " "running event loop (e.g. running in another thread's event loop), consider " @@ -3095,7 +3095,7 @@ msgstr "" "如果 ``foo()`` 被專門設計為 *不* 在當前執行緒的事件循環中運行(例如在另一個執" "行緒的事件循環中運行),請考慮改用 :func:`asyncio.run_coroutine_threadsafe`。" -#: ../../whatsnew/3.10.rst:1920 +#: ../../whatsnew/3.10.rst:1921 msgid "" "The :data:`types.FunctionType` constructor now inherits the current builtins " "if the *globals* dictionary has no ``\"__builtins__\"`` key, rather than " @@ -3111,11 +3111,11 @@ msgstr "" "function(...): ...`` 定義函式不受影響,全域變數不能用此語法覆蓋:它也繼承當前" "的內建物件。 (由 Victor Stinner 在 :issue:`42990` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1929 +#: ../../whatsnew/3.10.rst:1930 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.10.rst:1931 +#: ../../whatsnew/3.10.rst:1932 msgid "" "The C API functions ``PyParser_SimpleParseStringFlags``, " "``PyParser_SimpleParseStringFlagsFilename``, " @@ -3128,7 +3128,7 @@ msgstr "" "``PyParser_SimpleParseFileFlags``、``PyNode_Compile`` 和被這些函式使用的型別 " "``struct _node`` 被刪除。" -#: ../../whatsnew/3.10.rst:1937 +#: ../../whatsnew/3.10.rst:1938 msgid "" "Source should be now be compiled directly to a code object using, for " "example, :c:func:`Py_CompileString`. The resulting code object can then be " @@ -3138,11 +3138,11 @@ msgstr "" "件。然後可以(例如透過 :c:func:`PyEval_EvalCode`)為產生的程式碼物件求值 " "(evaluated)。" -#: ../../whatsnew/3.10.rst:1941 +#: ../../whatsnew/3.10.rst:1942 msgid "Specifically:" msgstr "具體來說:" -#: ../../whatsnew/3.10.rst:1943 +#: ../../whatsnew/3.10.rst:1944 msgid "" "A call to ``PyParser_SimpleParseStringFlags`` followed by ``PyNode_Compile`` " "can be replaced by calling :c:func:`Py_CompileString`." @@ -3150,7 +3150,7 @@ msgstr "" "後跟有 ``PyNode_Compile`` 呼叫的 ``PyParser_SimpleParseStringFlags`` 呼叫,可" "以替換為呼叫 :c:func:`Py_CompileString`。" -#: ../../whatsnew/3.10.rst:1946 +#: ../../whatsnew/3.10.rst:1947 msgid "" "There is no direct replacement for ``PyParser_SimpleParseFileFlags``. To " "compile code from a ``FILE *`` argument, you will need to read the file in C " @@ -3159,7 +3159,7 @@ msgstr "" "沒有 ``PyParser_SimpleParseFileFlags`` 的直接替代品。要從 ``FILE *`` 引數編譯" "程式碼,你需要用 C 讀取檔案並將結果緩衝區傳遞給 :c:func:`Py_CompileString`。" -#: ../../whatsnew/3.10.rst:1950 +#: ../../whatsnew/3.10.rst:1951 msgid "" "To compile a file given a ``char *`` filename, explicitly open the file, " "read it and compile the result. One way to do this is using the :py:mod:`io` " @@ -3172,7 +3172,7 @@ msgstr "" "`PyObject_CallMethod`、:c:func:`PyBytes_AsString` 和 :c:func:" "`Py_CompileString`,如下所示。(宣告和錯誤處理在此被省略。):" -#: ../../whatsnew/3.10.rst:1963 +#: ../../whatsnew/3.10.rst:1964 msgid "" "For ``FrameObject`` objects, the :attr:`~frame.f_lasti` member now " "represents a wordcode offset instead of a simple offset into the bytecode " @@ -3188,11 +3188,11 @@ msgstr "" "還要注意,``FrameObject`` 物件的 :attr:`!f_lasti` 成員不被認為是穩定的:請改" "用 :c:func:`PyFrame_GetLineNumber`。" -#: ../../whatsnew/3.10.rst:1971 +#: ../../whatsnew/3.10.rst:1972 msgid "CPython bytecode changes" msgstr "CPython 位元組碼更改" -#: ../../whatsnew/3.10.rst:1973 +#: ../../whatsnew/3.10.rst:1974 msgid "" "The ``MAKE_FUNCTION`` instruction now accepts either a dict or a tuple of " "strings as the function's annotations. (Contributed by Yurii Karabas and " @@ -3201,11 +3201,11 @@ msgstr "" "``MAKE_FUNCTION`` 指令現在接受字典或字串元組作為函式的註釋。(由 Yurii " "Karabas 和 Inada Naoki 在 :issue:`42202` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1978 +#: ../../whatsnew/3.10.rst:1979 msgid "Build Changes" msgstr "建置變更" -#: ../../whatsnew/3.10.rst:1980 +#: ../../whatsnew/3.10.rst:1981 msgid "" ":pep:`644`: Python now requires OpenSSL 1.1.1 or newer. OpenSSL 1.0.2 is no " "longer supported. (Contributed by Christian Heimes in :issue:`43669`.)" @@ -3213,7 +3213,7 @@ msgstr "" ":pep:`644`:Python 現在需要 OpenSSL 1.1.1 或更高版本。不再支援 OpenSSL " "1.0.2。(由 Christian Heimes 在 :issue:`43669` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1984 +#: ../../whatsnew/3.10.rst:1985 msgid "" "The C99 functions :c:func:`snprintf` and :c:func:`vsnprintf` are now " "required to build Python. (Contributed by Victor Stinner in :issue:`36020`.)" @@ -3221,7 +3221,7 @@ msgstr "" "現在需要 C99 函式 :c:func:`snprintf` 和 :c:func:`vsnprintf` 來建置 Python。 " "(由 Victor Stinner 在 :issue:`36020` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1988 +#: ../../whatsnew/3.10.rst:1989 msgid "" ":mod:`sqlite3` requires SQLite 3.7.15 or higher. (Contributed by Sergey " "Fedoseev and Erlend E. Aasland in :issue:`40744` and :issue:`40810`.)" @@ -3229,7 +3229,7 @@ msgstr "" ":mod:`sqlite3` 需要 SQLite 3.7.15 或更新版本。(由 Sergey Fedoseev 和 Erlend " "E. Aasland 在 :issue:`40744` 和 :issue:`40810` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1991 +#: ../../whatsnew/3.10.rst:1992 msgid "" "The :mod:`atexit` module must now always be built as a built-in module. " "(Contributed by Victor Stinner in :issue:`42639`.)" @@ -3237,7 +3237,7 @@ msgstr "" ":mod:`atexit` 模組現在必須都被建置為內建模組。(由 Victor Stinner 在 :issue:" "`42639` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1994 +#: ../../whatsnew/3.10.rst:1995 msgid "" "Add :option:`--disable-test-modules` option to the ``configure`` script: " "don't build nor install test modules. (Contributed by Xavier de Gaye, Thomas " @@ -3247,7 +3247,7 @@ msgstr "" "不安裝測試模組。(由 Xavier de Gaye、Thomas Petazzoni 和 Peixing Xin 在 :" "issue:`27640` 中貢獻。)" -#: ../../whatsnew/3.10.rst:1998 +#: ../../whatsnew/3.10.rst:1999 msgid "" "Add :option:`--with-wheel-pkg-dir=PATH option <--with-wheel-pkg-dir>` to the " "``./configure`` script. If specified, the :mod:`ensurepip` module looks for " @@ -3260,7 +3260,7 @@ msgstr "" "``setuptools`` 和 ``pip`` wheel 套件:如果兩者都存在,則使用這些 wheel 套件而" "不是 ensurepip 捆綁的 wheel 套件。" -#: ../../whatsnew/3.10.rst:2004 +#: ../../whatsnew/3.10.rst:2005 msgid "" "Some Linux distribution packaging policies recommend against bundling " "dependencies. For example, Fedora installs wheel packages in the ``/usr/" @@ -3271,11 +3271,11 @@ msgstr "" "share/python-wheels/`` 目錄中安裝 wheel 套件,並且不安裝 ``ensurepip." "_bundled`` 套件。" -#: ../../whatsnew/3.10.rst:2009 +#: ../../whatsnew/3.10.rst:2010 msgid "(Contributed by Victor Stinner in :issue:`42856`.)" msgstr "(由 Victor Stinner 在 :issue:`42856` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2011 +#: ../../whatsnew/3.10.rst:2012 msgid "" "Add a new :option:`configure --without-static-libpython option <--without-" "static-libpython>` to not build the ``libpythonMAJOR.MINOR.a`` static " @@ -3285,11 +3285,11 @@ msgstr "" "libpython>` 以不建置 ``libpythonMAJOR.MINOR.a`` 靜態函式庫且不安裝 ``python." "o`` 目標檔案。" -#: ../../whatsnew/3.10.rst:2015 +#: ../../whatsnew/3.10.rst:2016 msgid "(Contributed by Victor Stinner in :issue:`43103`.)" msgstr "(由 Victor Stinner 在 :issue:`43103` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2017 +#: ../../whatsnew/3.10.rst:2018 msgid "" "The ``configure`` script now uses the ``pkg-config`` utility, if available, " "to detect the location of Tcl/Tk headers and libraries. As before, those " @@ -3302,7 +3302,7 @@ msgstr "" "includes`` 和 ``--with-tcltk-libs`` 配置選項顯式指定這些位置。(由 Manolis " "Stamatogiannakis 在 :issue:`42603` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2023 +#: ../../whatsnew/3.10.rst:2024 msgid "" "Add :option:`--with-openssl-rpath` option to ``configure`` script. The " "option simplifies building Python with a custom OpenSSL installation, e.g. " @@ -3314,15 +3314,15 @@ msgstr "" "openssl=/path/to/openssl --with-openssl-rpath=auto``。(由 Christian Heimes " "在 :issue:`43466` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2030 +#: ../../whatsnew/3.10.rst:2031 msgid "C API Changes" msgstr "C API 變更" -#: ../../whatsnew/3.10.rst:2033 +#: ../../whatsnew/3.10.rst:2034 msgid "PEP 652: Maintaining the Stable ABI" msgstr "PEP 652:維護穩定 ABI" -#: ../../whatsnew/3.10.rst:2035 +#: ../../whatsnew/3.10.rst:2036 msgid "" "The Stable ABI (Application Binary Interface) for extension modules or " "embedding Python is now explicitly defined. :ref:`stable` describes C API " @@ -3332,11 +3332,11 @@ msgstr "" "用於擴充模組或嵌入 Python 的穩定 ABI(應用程式二進位介面)現已明確定義。 :" "ref:`stable` 描述了 C API 和 ABI 穩定性保證以及使用穩定 ABI 的最佳實踐。" -#: ../../whatsnew/3.10.rst:2040 +#: ../../whatsnew/3.10.rst:2041 msgid "(Contributed by Petr Viktorin in :pep:`652` and :issue:`43795`.)" msgstr "(由 Petr Viktorin 在 :pep:`652` 和 :issue:`43795` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2045 +#: ../../whatsnew/3.10.rst:2046 msgid "" "The result of :c:func:`PyNumber_Index` now always has exact type :class:" "`int`. Previously, the result could have been an instance of a subclass of " @@ -3346,7 +3346,7 @@ msgstr "" "果可能是 ``int`` 子類別的實例。(由 Serhiy Storchaka 在 :issue:`40792` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:2049 +#: ../../whatsnew/3.10.rst:2050 msgid "" "Add a new :c:member:`~PyConfig.orig_argv` member to the :c:type:`PyConfig` " "structure: the list of the original command line arguments passed to the " @@ -3356,7 +3356,7 @@ msgstr "" "遞給 Python 可執行檔案的原始命令列參數列表。(由 Victor Stinner 在 :issue:" "`23427` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2054 +#: ../../whatsnew/3.10.rst:2055 msgid "" "The :c:func:`PyDateTime_DATE_GET_TZINFO` and :c:func:" "`PyDateTime_TIME_GET_TZINFO` macros have been added for accessing the " @@ -3368,7 +3368,7 @@ msgstr "" "class:`datetime.time` 物件的 ``tzinfo`` 屬性。(由 Zackery Spytz 在 :issue:" "`30155` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2060 +#: ../../whatsnew/3.10.rst:2061 msgid "" "Add a :c:func:`PyCodec_Unregister` function to unregister a codec search " "function. (Contributed by Hai Shi in :issue:`41842`.)" @@ -3376,7 +3376,7 @@ msgstr "" "新增 :c:func:`PyCodec_Unregister` 函式來取消註冊編解碼器搜索函式。(由 Hai " "Shi 在 :issue:`41842` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2064 +#: ../../whatsnew/3.10.rst:2065 msgid "" "The :c:func:`PyIter_Send` function was added to allow sending value into " "iterator without raising ``StopIteration`` exception. (Contributed by " @@ -3385,7 +3385,7 @@ msgstr "" "新增了 :c:func:`PyIter_Send` 函式,以允許將值發送到疊代器中,而不會引發 " "``StopIteration`` 例外。(由 Vladimir Matveev 在 :issue:`41756` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2068 +#: ../../whatsnew/3.10.rst:2069 msgid "" "Add :c:func:`PyUnicode_AsUTF8AndSize` to the limited C API. (Contributed by " "Alex Gaynor in :issue:`41784`.)" @@ -3393,7 +3393,7 @@ msgstr "" "將 :c:func:`PyUnicode_AsUTF8AndSize` 新增到受限 C API (limited C API) 中。" "(由 Alex Gaynor 在 :issue:`41784` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2071 +#: ../../whatsnew/3.10.rst:2072 msgid "" "Add :c:func:`PyModule_AddObjectRef` function: similar to :c:func:" "`PyModule_AddObject` but don't steal a reference to the value on success. " @@ -3403,7 +3403,7 @@ msgstr "" "`PyModule_AddObject` 但成功時不竊取對值的參照。(由 Victor Stinner 在 :issue:" "`1635741` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2076 +#: ../../whatsnew/3.10.rst:2077 msgid "" "Add :c:func:`Py_NewRef` and :c:func:`Py_XNewRef` functions to increment the " "reference count of an object and return the object. (Contributed by Victor " @@ -3412,7 +3412,7 @@ msgstr "" "新增 :c:func:`Py_NewRef` 和 :c:func:`Py_XNewRef` 函式來增加物件的參照計數並回" "傳物件。 (由 Victor Stinner 在 :issue:`42262` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2080 +#: ../../whatsnew/3.10.rst:2081 msgid "" "The :c:func:`PyType_FromSpecWithBases` and :c:func:" "`PyType_FromModuleAndSpec` functions now accept a single class as the " @@ -3422,7 +3422,7 @@ msgstr "" "現在接受單個類別作為 *bases* 引數。(由 Serhiy Storchaka 在 :issue:`42423` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:2084 +#: ../../whatsnew/3.10.rst:2085 msgid "" "The :c:func:`PyType_FromModuleAndSpec` function now accepts NULL ``tp_doc`` " "slot. (Contributed by Hai Shi in :issue:`41832`.)" @@ -3430,7 +3430,7 @@ msgstr "" ":c:func:`PyType_FromModuleAndSpec` 函式現在接受 NULL ``tp_doc`` 槽位。(由 " "Hai Shi 在 :issue:`41832` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2088 +#: ../../whatsnew/3.10.rst:2089 msgid "" "The :c:func:`PyType_GetSlot` function can accept :ref:`static types `. (Contributed by Hai Shi and Petr Viktorin in :issue:`41073`.)" @@ -3438,7 +3438,7 @@ msgstr "" ":c:func:`PyType_GetSlot` 函式可以接受\\ :ref:`靜態型別 (static type) `。(由 Hai Shi 和 Petr Viktorin 在 :issue:`41073` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2092 +#: ../../whatsnew/3.10.rst:2093 msgid "" "Add a new :c:func:`PySet_CheckExact` function to the C-API to check if an " "object is an instance of :class:`set` but not an instance of a subtype. " @@ -3447,7 +3447,7 @@ msgstr "" "向 C-API 新增 :c:func:`PySet_CheckExact` 函式,以檢查物件是否是 :class:`set` " "的實例而不是子型別的實例。(由 Pablo Galindo 在 :issue:`43277` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2096 +#: ../../whatsnew/3.10.rst:2097 msgid "" "Add :c:func:`PyErr_SetInterruptEx` which allows passing a signal number to " "simulate. (Contributed by Antoine Pitrou in :issue:`43356`.)" @@ -3455,7 +3455,7 @@ msgstr "" "新增 :c:func:`PyErr_SetInterruptEx`,它允許傳遞信號編號來進行模擬。 (由 " "Antoine Pitrou 在 :issue:`43356` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2100 +#: ../../whatsnew/3.10.rst:2101 msgid "" "The limited C API is now supported if :ref:`Python is built in debug mode " "` (if the ``Py_DEBUG`` macro is defined). In the limited C API, " @@ -3475,7 +3475,7 @@ msgstr "" "C API 成為可能,因為自 Python 3.8 以來,:c:type:`PyObject` 結構在發布和除錯模" "式下是相同的(請參閱:issue:`36465`)。" -#: ../../whatsnew/3.10.rst:2110 +#: ../../whatsnew/3.10.rst:2111 msgid "" "The limited C API is still not supported in the :option:`--with-trace-refs` " "special build (``Py_TRACE_REFS`` macro). (Contributed by Victor Stinner in :" @@ -3484,7 +3484,7 @@ msgstr "" ":option:`--with-trace-refs` 特殊建置(``Py_TRACE_REFS`` 巨集)仍不支援受限 C " "API。(由 Victor Stinner 在 :issue:`43688` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2114 +#: ../../whatsnew/3.10.rst:2115 msgid "" "Add the :c:func:`Py_Is(x, y) ` function to test if the *x* object is " "the *y* object, the same as ``x is y`` in Python. Add also the :c:func:" @@ -3499,7 +3499,7 @@ msgstr "" "``True`` 單例或 ``False`` 單例。(由 Victor Stinner 在 :issue:`43753` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:2121 +#: ../../whatsnew/3.10.rst:2122 msgid "" "Add new functions to control the garbage collector from C code: :c:func:" "`PyGC_Enable()`, :c:func:`PyGC_Disable()`, :c:func:`PyGC_IsEnabled()`. These " @@ -3510,7 +3510,7 @@ msgstr "" "`PyGC_Disable()`、:c:func:`PyGC_IsEnabled()`。這些函式使得能夠從 C 程式碼啟" "用、停用和查詢垃圾收集器的狀態,而無需引入 :mod:`gc` 模組。" -#: ../../whatsnew/3.10.rst:2128 +#: ../../whatsnew/3.10.rst:2129 msgid "" "Add a new :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` type flag to disallow " "creating type instances. (Contributed by Victor Stinner in :issue:`43916`.)" @@ -3518,7 +3518,7 @@ msgstr "" "新增 :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` 型別旗標以禁止建立型別實" "例。(由 Victor Stinner 在 :issue:`43916` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2132 +#: ../../whatsnew/3.10.rst:2133 msgid "" "Add a new :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` type flag for creating " "immutable type objects: type attributes cannot be set nor deleted. " @@ -3528,7 +3528,7 @@ msgstr "" "設定或刪除型別屬性。(由 Victor Stinner 和 Erlend E. Aasland 在 :issue:" "`43908` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2139 +#: ../../whatsnew/3.10.rst:2140 msgid "" "The ``PY_SSIZE_T_CLEAN`` macro must now be defined to use :c:func:" "`PyArg_ParseTuple` and :c:func:`Py_BuildValue` formats which use ``#``: " @@ -3541,7 +3541,7 @@ msgstr "" "``u#``、``y#``、``z#``、``U#`` 和 ``Z#``。請參閱 :ref:`arg-parsing` 和 :pep:" "`353`。(由 Victor Stinner 在 :issue:`40943` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2145 +#: ../../whatsnew/3.10.rst:2146 msgid "" "Since :c:func:`Py_REFCNT()` is changed to the inline static function, " "``Py_REFCNT(obj) = new_refcnt`` must be replaced with ``Py_SET_REFCNT(obj, " @@ -3553,11 +3553,11 @@ msgstr "" "new_refcnt)`` :參見 :c:func:`Py_SET_REFCNT()` (自 Python 3.9 起可用)。為了" "向後相容,可以使用該巨集:" -#: ../../whatsnew/3.10.rst:2154 +#: ../../whatsnew/3.10.rst:2155 msgid "(Contributed by Victor Stinner in :issue:`39573`.)" msgstr "(由 Victor Stinner 在 :issue:`39573` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2156 +#: ../../whatsnew/3.10.rst:2157 msgid "" "Calling :c:func:`PyDict_GetItem` without :term:`GIL` held had been allowed " "for historical reason. It is no longer allowed. (Contributed by Victor " @@ -3567,7 +3567,7 @@ msgstr "" "`PyDict_GetItem` 是被允許的。目前已被禁止。(由 Victor Stinner 在 :issue:" "`40839` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2160 +#: ../../whatsnew/3.10.rst:2161 msgid "" "``PyUnicode_FromUnicode(NULL, size)`` and " "``PyUnicode_FromStringAndSize(NULL, size)`` raise ``DeprecationWarning`` " @@ -3579,7 +3579,7 @@ msgstr "" "分配沒有初始資料的 Unicode 物件。(由 Inada Naoki 在 :issue:`36346` 中貢" "獻。)" -#: ../../whatsnew/3.10.rst:2165 +#: ../../whatsnew/3.10.rst:2166 msgid "" "The private ``_PyUnicode_Name_CAPI`` structure of the PyCapsule API " "``unicodedata.ucnhash_CAPI`` has been moved to the internal C API. " @@ -3588,7 +3588,7 @@ msgstr "" "PyCapsule API ``unicodedata.ucnhash_CAPI`` 的私有 ``_PyUnicode_Name_CAPI`` 結" "構已移至內部 C API。(由 Victor Stinner 在 :issue:`42157` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2169 +#: ../../whatsnew/3.10.rst:2170 msgid "" ":c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`, :c:func:`Py_GetExecPrefix`, :c:" "func:`Py_GetProgramFullPath`, :c:func:`Py_GetPythonHome` and :c:func:" @@ -3603,7 +3603,7 @@ msgstr "" "`Py_GetProgramName` 現在會回傳 ``NULL``。使用新的 :ref:`init-config` API 來獲" "取 :ref:`init-path-config`。(由 Victor Stinner 在 :issue:`42260` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2176 +#: ../../whatsnew/3.10.rst:2177 msgid "" ":c:func:`PyList_SET_ITEM`, :c:func:`PyTuple_SET_ITEM` and :c:func:" "`PyCell_SET` macros can no longer be used as l-value or r-value. For " @@ -3618,7 +3618,7 @@ msgstr "" "現編譯器錯誤。它可以防止如 ``if (PyList_SET_ITEM (a, b, c) < 0) ...`` 測試之" "類的錯誤。(由 Zackery Spytz 和 Victor Stinner 在 :issue:`30459` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2183 +#: ../../whatsnew/3.10.rst:2184 msgid "" "The non-limited API files ``odictobject.h``, ``parser_interface.h``, " "``picklebufobject.h``, ``pyarena.h``, ``pyctype.h``, ``pydebug.h``, ``pyfpe." @@ -3634,7 +3634,7 @@ msgstr "" "``Python.h`` 中引入;請參閱 :ref:`api-includes`。如果直接引入它們,請考慮改為" "引入 ``Python.h``。(由 Nicholas Sim 在 :issue:`35134` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2191 +#: ../../whatsnew/3.10.rst:2192 msgid "" "Use the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` type flag to create immutable " "type objects. Do not rely on :c:macro:`Py_TPFLAGS_HEAPTYPE` to decide if a " @@ -3647,7 +3647,7 @@ msgstr "" "了 :c:macro:`Py_TPFLAGS_IMMUTABLETYPE`。(由 Victor Stinner 和 Erlend E. " "Aasland 在 :issue:`35134` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2197 +#: ../../whatsnew/3.10.rst:2198 msgid "" "The undocumented function ``Py_FrozenMain`` has been removed from the " "limited API. The function is mainly useful for custom builds of Python. " @@ -3656,7 +3656,7 @@ msgstr "" "未以說明文件記錄的函式 ``Py_FrozenMain`` 已從受限 API 中刪除。該函式主要用於 " "Python 的自定義建置。(由 Petr Viktorin 在 :issue:`26241` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2204 +#: ../../whatsnew/3.10.rst:2205 msgid "" "The ``PyUnicode_InternImmortal()`` function is now deprecated and will be " "removed in Python 3.12: use :c:func:`PyUnicode_InternInPlace` instead. " @@ -3666,7 +3666,7 @@ msgstr "" "用 :c:func:`PyUnicode_InternInPlace`。(由 Victor Stinner 在 :issue:`41692` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:2212 +#: ../../whatsnew/3.10.rst:2213 msgid "" "Removed ``Py_UNICODE_str*`` functions manipulating ``Py_UNICODE*`` strings. " "(Contributed by Inada Naoki in :issue:`41123`.)" @@ -3674,7 +3674,7 @@ msgstr "" "刪除了操作 ``Py_UNICODE*`` 字串的 ``Py_UNICODE_str*`` 函式。(由 Inada Naoki " "在 :issue:`41123` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2215 +#: ../../whatsnew/3.10.rst:2216 msgid "" "``Py_UNICODE_strlen``: use :c:func:`PyUnicode_GetLength` or :c:macro:" "`PyUnicode_GET_LENGTH`" @@ -3682,7 +3682,7 @@ msgstr "" "``Py_UNICODE_strlen``:使用 :c:func:`PyUnicode_GetLength` 或 :c:macro:" "`PyUnicode_GET_LENGTH`" -#: ../../whatsnew/3.10.rst:2217 +#: ../../whatsnew/3.10.rst:2218 msgid "" "``Py_UNICODE_strcat``: use :c:func:`PyUnicode_CopyCharacters` or :c:func:" "`PyUnicode_FromFormat`" @@ -3690,7 +3690,7 @@ msgstr "" "``Py_UNICODE_strcat``:使用 :c:func:`PyUnicode_CopyCharacters` 或 :c:func:" "`PyUnicode_FromFormat`" -#: ../../whatsnew/3.10.rst:2219 +#: ../../whatsnew/3.10.rst:2220 msgid "" "``Py_UNICODE_strcpy``, ``Py_UNICODE_strncpy``: use :c:func:" "`PyUnicode_CopyCharacters` or :c:func:`PyUnicode_Substring`" @@ -3698,15 +3698,15 @@ msgstr "" "``Py_UNICODE_strcpy``、``Py_UNICODE_strncpy``:使用 :c:func:" "`PyUnicode_CopyCharacters` 或 :c:func:`PyUnicode_Substring`" -#: ../../whatsnew/3.10.rst:2221 +#: ../../whatsnew/3.10.rst:2222 msgid "``Py_UNICODE_strcmp``: use :c:func:`PyUnicode_Compare`" msgstr "``Py_UNICODE_strcmp``:使用 :c:func:`PyUnicode_Compare`" -#: ../../whatsnew/3.10.rst:2222 +#: ../../whatsnew/3.10.rst:2223 msgid "``Py_UNICODE_strncmp``: use :c:func:`PyUnicode_Tailmatch`" msgstr "``Py_UNICODE_strncmp``:使用 :c:func:`PyUnicode_Tailmatch`" -#: ../../whatsnew/3.10.rst:2223 +#: ../../whatsnew/3.10.rst:2224 msgid "" "``Py_UNICODE_strchr``, ``Py_UNICODE_strrchr``: use :c:func:" "`PyUnicode_FindChar`" @@ -3714,7 +3714,7 @@ msgstr "" "``Py_UNICODE_strchr``、``Py_UNICODE_strrchr``:使用 :c:func:" "`PyUnicode_FindChar`" -#: ../../whatsnew/3.10.rst:2226 +#: ../../whatsnew/3.10.rst:2227 msgid "" "Removed ``PyUnicode_GetMax()``. Please migrate to new (:pep:`393`) APIs. " "(Contributed by Inada Naoki in :issue:`41103`.)" @@ -3722,7 +3722,7 @@ msgstr "" "刪除了 ``PyUnicode_GetMax()``。請改用新的 (:pep:`393`) API。(由 Inada Naoki " "在 :issue:`41103` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2229 +#: ../../whatsnew/3.10.rst:2230 msgid "" "Removed ``PyLong_FromUnicode()``. Please migrate to :c:func:" "`PyLong_FromUnicodeObject`. (Contributed by Inada Naoki in :issue:`41103`.)" @@ -3730,7 +3730,7 @@ msgstr "" "刪除了 ``PyLong_FromUnicode()``。請改用 :c:func:`PyLong_FromUnicodeObject`。" "(由 Inada Naoki 在 :issue:`41103` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2232 +#: ../../whatsnew/3.10.rst:2233 msgid "" "Removed ``PyUnicode_AsUnicodeCopy()``. Please use :c:func:" "`PyUnicode_AsUCS4Copy` or :c:func:`PyUnicode_AsWideCharString` (Contributed " @@ -3740,7 +3740,7 @@ msgstr "" "或 :c:func:`PyUnicode_AsWideCharString` (由 Inada Naoki 在 :issue:`41103` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:2236 +#: ../../whatsnew/3.10.rst:2237 msgid "" "Removed ``_Py_CheckRecursionLimit`` variable: it has been replaced by " "``ceval.recursion_limit`` of the :c:type:`PyInterpreterState` structure. " @@ -3750,7 +3750,7 @@ msgstr "" "結構的 ``ceval.recursion_limit`` 取代。(由 Victor Stinner 在 :issue:`41834` " "中貢獻。)" -#: ../../whatsnew/3.10.rst:2240 +#: ../../whatsnew/3.10.rst:2241 msgid "" "Removed undocumented macros ``Py_ALLOW_RECURSION`` and " "``Py_END_ALLOW_RECURSION`` and the ``recursion_critical`` field of the :c:" @@ -3761,7 +3761,7 @@ msgstr "" "``Py_END_ALLOW_RECURSION`` 以及 :c:type:`PyInterpreterState` 結構的 " "``recursion_ritic`` 欄位。(由 Serhiy Storchaka 在 :issue:`41936` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2245 +#: ../../whatsnew/3.10.rst:2246 msgid "" "Removed the undocumented ``PyOS_InitInterrupts()`` function. Initializing " "Python already implicitly installs signal handlers: see :c:member:`PyConfig." @@ -3771,7 +3771,7 @@ msgstr "" "式安裝信號處理程式:請參閱 :c:member:`PyConfig.install_signal_handlers`。" "(由 Victor Stinner 在 :issue:`41713` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2250 +#: ../../whatsnew/3.10.rst:2251 msgid "" "Remove the ``PyAST_Validate()`` function. It is no longer possible to build " "a AST object (``mod_ty`` type) with the public C API. The function was " @@ -3782,35 +3782,35 @@ msgstr "" "(``mod_ty`` 類型)。該函式已被排除在受限 C API 之外 (:pep:`384`)。(由 " "Victor Stinner 在 :issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2255 +#: ../../whatsnew/3.10.rst:2256 msgid "Remove the ``symtable.h`` header file and the undocumented functions:" msgstr "刪除 ``symtable.h`` 標頭檔和未被說明文件記錄的函式:" -#: ../../whatsnew/3.10.rst:2257 +#: ../../whatsnew/3.10.rst:2258 msgid "``PyST_GetScope()``" msgstr "``PyST_GetScope()``" -#: ../../whatsnew/3.10.rst:2258 +#: ../../whatsnew/3.10.rst:2259 msgid "``PySymtable_Build()``" msgstr "``PySymtable_Build()``" -#: ../../whatsnew/3.10.rst:2259 +#: ../../whatsnew/3.10.rst:2260 msgid "``PySymtable_BuildObject()``" msgstr "``PySymtable_BuildObject()``" -#: ../../whatsnew/3.10.rst:2260 +#: ../../whatsnew/3.10.rst:2261 msgid "``PySymtable_Free()``" msgstr "``PySymtable_Free()``" -#: ../../whatsnew/3.10.rst:2261 +#: ../../whatsnew/3.10.rst:2262 msgid "``Py_SymtableString()``" msgstr "``Py_SymtableString()``" -#: ../../whatsnew/3.10.rst:2262 +#: ../../whatsnew/3.10.rst:2263 msgid "``Py_SymtableStringObject()``" msgstr "``Py_SymtableStringObject()``" -#: ../../whatsnew/3.10.rst:2264 +#: ../../whatsnew/3.10.rst:2265 msgid "" "The ``Py_SymtableString()`` function was part the stable ABI by mistake but " "it could not be used, because the ``symtable.h`` header file was excluded " @@ -3819,7 +3819,7 @@ msgstr "" "``Py_SymtableString()`` 函式錯誤地成為穩定 ABI 的一部分,但它因為 ``symtable." "h`` 標頭檔被排除在受限 C API 之外而無法使用。" -#: ../../whatsnew/3.10.rst:2268 +#: ../../whatsnew/3.10.rst:2269 msgid "" "Use Python :mod:`symtable` module instead. (Contributed by Victor Stinner " "in :issue:`43244`.)" @@ -3827,7 +3827,7 @@ msgstr "" "請改用 Python :mod:`symtable` 模組。(由 Victor Stinner 在 :issue:`43244` 中" "貢獻。)" -#: ../../whatsnew/3.10.rst:2271 +#: ../../whatsnew/3.10.rst:2272 msgid "" "Remove :c:func:`PyOS_ReadlineFunctionPointer` from the limited C API headers " "and from ``python3.dll``, the library that provides the stable ABI on " @@ -3838,7 +3838,7 @@ msgstr "" "刪除 :c:func:`PyOS_ReadlineFunctionPointer`。由於該函式採用 FILE* 引數,因此" "無法保證其 ABI 穩定性。(由 Petr Viktorin 在 :issue:`43868` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2277 +#: ../../whatsnew/3.10.rst:2278 msgid "" "Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header files. These " "functions were undocumented and excluded from the limited C API. Most names " @@ -3854,54 +3854,54 @@ msgstr "" "Windows ```` 標頭使用的 ``Yield`` 有名稱衝突。請改用 Python :mod:" "`ast` 模組。(由 Victor Stinner 在 :issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2285 +#: ../../whatsnew/3.10.rst:2286 msgid "" "Remove the compiler and parser functions using ``struct _mod`` type, because " "the public AST C API was removed:" msgstr "" "刪除編譯器和使用 ``struct _mod`` 的剖析器函式,因為公開 AST C API 已被刪除:" -#: ../../whatsnew/3.10.rst:2288 +#: ../../whatsnew/3.10.rst:2289 msgid "``PyAST_Compile()``" msgstr "``PyAST_Compile()``" -#: ../../whatsnew/3.10.rst:2289 +#: ../../whatsnew/3.10.rst:2290 msgid "``PyAST_CompileEx()``" msgstr "``PyAST_CompileEx()``" -#: ../../whatsnew/3.10.rst:2290 +#: ../../whatsnew/3.10.rst:2291 msgid "``PyAST_CompileObject()``" msgstr "``PyAST_CompileObject()``" -#: ../../whatsnew/3.10.rst:2291 +#: ../../whatsnew/3.10.rst:2292 msgid "``PyFuture_FromAST()``" msgstr "``PyFuture_FromAST()``" -#: ../../whatsnew/3.10.rst:2292 +#: ../../whatsnew/3.10.rst:2293 msgid "``PyFuture_FromASTObject()``" msgstr "``PyFuture_FromASTObject()``" -#: ../../whatsnew/3.10.rst:2293 +#: ../../whatsnew/3.10.rst:2294 msgid "``PyParser_ASTFromFile()``" msgstr "``PyParser_ASTFromFile()``" -#: ../../whatsnew/3.10.rst:2294 +#: ../../whatsnew/3.10.rst:2295 msgid "``PyParser_ASTFromFileObject()``" msgstr "``PyParser_ASTFromFileObject()``" -#: ../../whatsnew/3.10.rst:2295 +#: ../../whatsnew/3.10.rst:2296 msgid "``PyParser_ASTFromFilename()``" msgstr "``PyParser_ASTFromFilename()``" -#: ../../whatsnew/3.10.rst:2296 +#: ../../whatsnew/3.10.rst:2297 msgid "``PyParser_ASTFromString()``" msgstr "``PyParser_ASTFromString()``" -#: ../../whatsnew/3.10.rst:2297 +#: ../../whatsnew/3.10.rst:2298 msgid "``PyParser_ASTFromStringObject()``" msgstr "``PyParser_ASTFromStringObject()``" -#: ../../whatsnew/3.10.rst:2299 +#: ../../whatsnew/3.10.rst:2300 msgid "" "These functions were undocumented and excluded from the limited C API. " "(Contributed by Victor Stinner in :issue:`43244`.)" @@ -3909,27 +3909,27 @@ msgstr "" "這些函式沒有文件記錄,並且被排除在受限 C API 之外。(由 Victor Stinner 在 :" "issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2302 +#: ../../whatsnew/3.10.rst:2303 msgid "Remove the ``pyarena.h`` header file with functions:" msgstr "刪除包含以下函式的 ``pyarena.h`` 標頭檔:" -#: ../../whatsnew/3.10.rst:2304 +#: ../../whatsnew/3.10.rst:2305 msgid "``PyArena_New()``" msgstr "``PyArena_New()``" -#: ../../whatsnew/3.10.rst:2305 +#: ../../whatsnew/3.10.rst:2306 msgid "``PyArena_Free()``" msgstr "``PyArena_Free()``" -#: ../../whatsnew/3.10.rst:2306 +#: ../../whatsnew/3.10.rst:2307 msgid "``PyArena_Malloc()``" msgstr "``PyArena_Malloc()``" -#: ../../whatsnew/3.10.rst:2307 +#: ../../whatsnew/3.10.rst:2308 msgid "``PyArena_AddPyObject()``" msgstr "``PyArena_AddPyObject()``" -#: ../../whatsnew/3.10.rst:2309 +#: ../../whatsnew/3.10.rst:2310 msgid "" "These functions were undocumented, excluded from the limited C API, and were " "only used internally by the compiler. (Contributed by Victor Stinner in :" @@ -3938,7 +3938,7 @@ msgstr "" "這些函式沒有文件記錄、被排除在受限 C API 之外,並僅被編譯器於內部使用。(由 " "Victor Stinner 在 :issue:`43244` 中貢獻。)" -#: ../../whatsnew/3.10.rst:2313 +#: ../../whatsnew/3.10.rst:2314 msgid "" "The ``PyThreadState.use_tracing`` member has been removed to optimize " "Python. (Contributed by Mark Shannon in :issue:`43760`.)" diff --git a/whatsnew/3.12.po b/whatsnew/3.12.po index 424ca1636d..fc3ee49b47 100644 --- a/whatsnew/3.12.po +++ b/whatsnew/3.12.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-04 00:03+0000\n" +"POT-Creation-Date: 2023-12-08 00:03+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -257,7 +257,7 @@ msgid "" "`_." msgstr "" -#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1942 +#: ../../whatsnew/3.12.rst:176 ../../whatsnew/3.12.rst:1952 msgid "New Features" msgstr "新增特性" @@ -1124,7 +1124,7 @@ msgid "" "Windows. (Contributed by Charles Machalow in :gh:`103179`.)" msgstr "" -#: ../../whatsnew/3.12.rst:860 ../../whatsnew/3.12.rst:1654 +#: ../../whatsnew/3.12.rst:860 ../../whatsnew/3.12.rst:1655 msgid "sqlite3" msgstr "sqlite3" @@ -1199,7 +1199,7 @@ msgid "" "Katriel in :gh:`102778`.)" msgstr "" -#: ../../whatsnew/3.12.rst:911 ../../whatsnew/3.12.rst:1850 +#: ../../whatsnew/3.12.rst:911 ../../whatsnew/3.12.rst:1851 msgid "" ":func:`sys._current_exceptions` now returns a mapping from thread-id to an " "exception instance, rather than to a ``(typ, exc, tb)`` tuple. (Contributed " @@ -1344,7 +1344,7 @@ msgid "" "Benjamin Peterson in :gh:`96734`)." msgstr "" -#: ../../whatsnew/3.12.rst:1025 ../../whatsnew/3.12.rst:1695 +#: ../../whatsnew/3.12.rst:1025 ../../whatsnew/3.12.rst:1696 msgid "unittest" msgstr "unittest" @@ -1520,7 +1520,7 @@ msgid "" "demos>`_. (Contributed by Victor Stinner in :gh:`97669`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1142 ../../whatsnew/3.12.rst:2244 +#: ../../whatsnew/3.12.rst:1142 ../../whatsnew/3.12.rst:2254 msgid "Deprecated" msgstr "已棄用" @@ -1539,23 +1539,23 @@ msgid "" "Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1153 ../../whatsnew/3.12.rst:1386 +#: ../../whatsnew/3.12.rst:1153 ../../whatsnew/3.12.rst:1387 msgid ":class:`!ast.Num`" msgstr ":class:`!ast.Num`" -#: ../../whatsnew/3.12.rst:1154 ../../whatsnew/3.12.rst:1387 +#: ../../whatsnew/3.12.rst:1154 ../../whatsnew/3.12.rst:1388 msgid ":class:`!ast.Str`" msgstr ":class:`!ast.Str`" -#: ../../whatsnew/3.12.rst:1155 ../../whatsnew/3.12.rst:1388 +#: ../../whatsnew/3.12.rst:1155 ../../whatsnew/3.12.rst:1389 msgid ":class:`!ast.Bytes`" msgstr ":class:`!ast.Bytes`" -#: ../../whatsnew/3.12.rst:1156 ../../whatsnew/3.12.rst:1389 +#: ../../whatsnew/3.12.rst:1156 ../../whatsnew/3.12.rst:1390 msgid ":class:`!ast.NameConstant`" msgstr ":class:`!ast.NameConstant`" -#: ../../whatsnew/3.12.rst:1157 ../../whatsnew/3.12.rst:1390 +#: ../../whatsnew/3.12.rst:1157 ../../whatsnew/3.12.rst:1391 msgid ":class:`!ast.Ellipsis`" msgstr ":class:`!ast.Ellipsis`" @@ -1565,7 +1565,7 @@ msgid "" "`90953`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1162 ../../whatsnew/3.12.rst:1392 +#: ../../whatsnew/3.12.rst:1162 ../../whatsnew/3.12.rst:1393 msgid ":mod:`asyncio`:" msgstr ":mod:`asyncio`:" @@ -1630,15 +1630,15 @@ msgid "" "removal in Python 3.14:" msgstr "" -#: ../../whatsnew/3.12.rst:1204 ../../whatsnew/3.12.rst:1409 +#: ../../whatsnew/3.12.rst:1204 ../../whatsnew/3.12.rst:1410 msgid ":class:`!importlib.abc.ResourceReader`" msgstr ":class:`!importlib.abc.ResourceReader`" -#: ../../whatsnew/3.12.rst:1205 ../../whatsnew/3.12.rst:1410 +#: ../../whatsnew/3.12.rst:1205 ../../whatsnew/3.12.rst:1411 msgid ":class:`!importlib.abc.Traversable`" msgstr ":class:`!importlib.abc.Traversable`" -#: ../../whatsnew/3.12.rst:1206 ../../whatsnew/3.12.rst:1411 +#: ../../whatsnew/3.12.rst:1206 ../../whatsnew/3.12.rst:1412 msgid ":class:`!importlib.abc.TraversableResources`" msgstr ":class:`!importlib.abc.TraversableResources`" @@ -1728,14 +1728,13 @@ msgid "" msgstr "" #: ../../whatsnew/3.12.rst:1263 -#, fuzzy msgid "" ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree` is " "deprecated; use *onexc* instead. (Contributed by Irit Katriel in :gh:" "`102828`.)" msgstr "" -"``_PyErr_ChainExceptions`` 已棄用,請改用 ``_PyErr_ChainExceptions1``。(由 " -"Irit Katriel 於 :gh:`102192` 中貢獻。)" +":mod:`shutil`::func:`shutil.rmtree` 的 *onerror* 引數已被棄用,請改用 " +"*onexc*。(由 Irit Katriel 於 :gh:`102828` 中貢獻。)" #: ../../whatsnew/3.12.rst:1266 msgid ":mod:`sqlite3`:" @@ -1832,295 +1831,295 @@ msgstr "" #: ../../whatsnew/3.12.rst:1326 msgid "" -"Accessing ``co_lnotab`` on code objects was deprecated in Python 3.10 via :" -"pep:`626`, but it only got a proper :exc:`DeprecationWarning` in 3.12, " -"therefore it will be removed in 3.14. (Contributed by Nikita Sobolev in :gh:" -"`101866`.)" +"Accessing :attr:`~codeobject.co_lnotab` on code objects was deprecated in " +"Python 3.10 via :pep:`626`, but it only got a proper :exc:" +"`DeprecationWarning` in 3.12, therefore it will be removed in 3.14. " +"(Contributed by Nikita Sobolev in :gh:`101866`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1332 +#: ../../whatsnew/3.12.rst:1333 msgid "Pending Removal in Python 3.13" msgstr "Python 3.13 中待決議的移除項目" -#: ../../whatsnew/3.12.rst:1334 +#: ../../whatsnew/3.12.rst:1335 msgid "" "The following modules and APIs have been deprecated in earlier Python " "releases, and will be removed in Python 3.13." msgstr "" -#: ../../whatsnew/3.12.rst:1337 +#: ../../whatsnew/3.12.rst:1338 msgid "Modules (see :pep:`594`):" msgstr "" -#: ../../whatsnew/3.12.rst:1339 +#: ../../whatsnew/3.12.rst:1340 msgid ":mod:`aifc`" msgstr ":mod:`aifc`" -#: ../../whatsnew/3.12.rst:1340 +#: ../../whatsnew/3.12.rst:1341 msgid ":mod:`audioop`" msgstr ":mod:`audioop`" -#: ../../whatsnew/3.12.rst:1341 +#: ../../whatsnew/3.12.rst:1342 msgid ":mod:`cgi`" msgstr ":mod:`cgi`" -#: ../../whatsnew/3.12.rst:1342 +#: ../../whatsnew/3.12.rst:1343 msgid ":mod:`cgitb`" msgstr ":mod:`cgitb`" -#: ../../whatsnew/3.12.rst:1343 +#: ../../whatsnew/3.12.rst:1344 msgid ":mod:`chunk`" msgstr ":mod:`chunk`" -#: ../../whatsnew/3.12.rst:1344 +#: ../../whatsnew/3.12.rst:1345 msgid ":mod:`crypt`" msgstr ":mod:`crypt`" -#: ../../whatsnew/3.12.rst:1345 +#: ../../whatsnew/3.12.rst:1346 msgid ":mod:`imghdr`" msgstr ":mod:`imghdr`" -#: ../../whatsnew/3.12.rst:1346 +#: ../../whatsnew/3.12.rst:1347 msgid ":mod:`mailcap`" msgstr ":mod:`mailcap`" -#: ../../whatsnew/3.12.rst:1347 +#: ../../whatsnew/3.12.rst:1348 msgid ":mod:`msilib`" msgstr ":mod:`msilib`" -#: ../../whatsnew/3.12.rst:1348 +#: ../../whatsnew/3.12.rst:1349 msgid ":mod:`nis`" msgstr ":mod:`nis`" -#: ../../whatsnew/3.12.rst:1349 +#: ../../whatsnew/3.12.rst:1350 msgid ":mod:`nntplib`" msgstr ":mod:`nntplib`" -#: ../../whatsnew/3.12.rst:1350 +#: ../../whatsnew/3.12.rst:1351 msgid ":mod:`ossaudiodev`" msgstr ":mod:`ossaudiodev`" -#: ../../whatsnew/3.12.rst:1351 +#: ../../whatsnew/3.12.rst:1352 msgid ":mod:`pipes`" msgstr ":mod:`pipes`" -#: ../../whatsnew/3.12.rst:1352 +#: ../../whatsnew/3.12.rst:1353 msgid ":mod:`sndhdr`" msgstr ":mod:`sndhdr`" -#: ../../whatsnew/3.12.rst:1353 +#: ../../whatsnew/3.12.rst:1354 msgid ":mod:`spwd`" msgstr ":mod:`spwd`" -#: ../../whatsnew/3.12.rst:1354 +#: ../../whatsnew/3.12.rst:1355 msgid ":mod:`sunau`" msgstr ":mod:`sunau`" -#: ../../whatsnew/3.12.rst:1355 +#: ../../whatsnew/3.12.rst:1356 msgid ":mod:`telnetlib`" msgstr ":mod:`telnetlib`" -#: ../../whatsnew/3.12.rst:1356 +#: ../../whatsnew/3.12.rst:1357 msgid ":mod:`uu`" msgstr ":mod:`uu`" -#: ../../whatsnew/3.12.rst:1357 +#: ../../whatsnew/3.12.rst:1358 msgid ":mod:`xdrlib`" msgstr ":mod:`xdrlib`" -#: ../../whatsnew/3.12.rst:1359 +#: ../../whatsnew/3.12.rst:1360 msgid "Other modules:" msgstr "其他模組:" -#: ../../whatsnew/3.12.rst:1361 +#: ../../whatsnew/3.12.rst:1362 msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" msgstr "" -#: ../../whatsnew/3.12.rst:1363 ../../whatsnew/3.12.rst:1441 +#: ../../whatsnew/3.12.rst:1364 ../../whatsnew/3.12.rst:1442 msgid "APIs:" msgstr "" -#: ../../whatsnew/3.12.rst:1365 +#: ../../whatsnew/3.12.rst:1366 msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -#: ../../whatsnew/3.12.rst:1366 +#: ../../whatsnew/3.12.rst:1367 msgid "``locale.resetlocale()`` (:gh:`90817`)" msgstr "``locale.resetlocale()`` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1367 +#: ../../whatsnew/3.12.rst:1368 msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1368 +#: ../../whatsnew/3.12.rst:1369 msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1369 +#: ../../whatsnew/3.12.rst:1370 msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1370 +#: ../../whatsnew/3.12.rst:1371 msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" -#: ../../whatsnew/3.12.rst:1371 +#: ../../whatsnew/3.12.rst:1372 msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" msgstr ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -#: ../../whatsnew/3.12.rst:1372 +#: ../../whatsnew/3.12.rst:1373 msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -#: ../../whatsnew/3.12.rst:1373 +#: ../../whatsnew/3.12.rst:1374 msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" msgstr "" -#: ../../whatsnew/3.12.rst:1376 ../../whatsnew/3.12.rst:2331 +#: ../../whatsnew/3.12.rst:1377 ../../whatsnew/3.12.rst:2341 msgid "Pending Removal in Python 3.14" msgstr "Python 3.14 中待決議的移除項目" -#: ../../whatsnew/3.12.rst:1378 +#: ../../whatsnew/3.12.rst:1379 msgid "" "The following APIs have been deprecated and will be removed in Python 3.14." msgstr "" -#: ../../whatsnew/3.12.rst:1381 +#: ../../whatsnew/3.12.rst:1382 msgid "" ":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" "argparse.BooleanOptionalAction`" msgstr "" -#: ../../whatsnew/3.12.rst:1384 +#: ../../whatsnew/3.12.rst:1385 msgid ":mod:`ast`:" msgstr ":mod:`ast`:" -#: ../../whatsnew/3.12.rst:1394 +#: ../../whatsnew/3.12.rst:1395 msgid ":class:`!asyncio.MultiLoopChildWatcher`" msgstr ":class:`!asyncio.MultiLoopChildWatcher`" -#: ../../whatsnew/3.12.rst:1395 +#: ../../whatsnew/3.12.rst:1396 msgid ":class:`!asyncio.FastChildWatcher`" msgstr ":class:`!asyncio.FastChildWatcher`" -#: ../../whatsnew/3.12.rst:1396 +#: ../../whatsnew/3.12.rst:1397 msgid ":class:`!asyncio.AbstractChildWatcher`" msgstr ":class:`!asyncio.AbstractChildWatcher`" -#: ../../whatsnew/3.12.rst:1397 +#: ../../whatsnew/3.12.rst:1398 msgid ":class:`!asyncio.SafeChildWatcher`" msgstr ":class:`!asyncio.SafeChildWatcher`" -#: ../../whatsnew/3.12.rst:1398 +#: ../../whatsnew/3.12.rst:1399 msgid ":func:`!asyncio.set_child_watcher`" msgstr ":func:`!asyncio.set_child_watcher`" -#: ../../whatsnew/3.12.rst:1399 +#: ../../whatsnew/3.12.rst:1400 msgid ":func:`!asyncio.get_child_watcher`," msgstr ":func:`!asyncio.get_child_watcher`、" -#: ../../whatsnew/3.12.rst:1400 +#: ../../whatsnew/3.12.rst:1401 msgid ":meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher`" msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher`" -#: ../../whatsnew/3.12.rst:1401 +#: ../../whatsnew/3.12.rst:1402 msgid ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" msgstr ":meth:`!asyncio.AbstractEventLoopPolicy.get_child_watcher`" -#: ../../whatsnew/3.12.rst:1403 +#: ../../whatsnew/3.12.rst:1404 msgid ":mod:`collections.abc`: :class:`!collections.abc.ByteString`." msgstr ":mod:`collections.abc`: :class:`!collections.abc.ByteString`。" -#: ../../whatsnew/3.12.rst:1405 +#: ../../whatsnew/3.12.rst:1406 msgid ":mod:`email`: the *isdst* parameter in :func:`email.utils.localtime`." msgstr "" -#: ../../whatsnew/3.12.rst:1407 +#: ../../whatsnew/3.12.rst:1408 msgid ":mod:`importlib.abc`:" msgstr ":mod:`importlib.abc`:" -#: ../../whatsnew/3.12.rst:1413 +#: ../../whatsnew/3.12.rst:1414 msgid ":mod:`itertools`: Support for copy, deepcopy, and pickle operations." msgstr "" -#: ../../whatsnew/3.12.rst:1415 +#: ../../whatsnew/3.12.rst:1416 msgid ":mod:`pkgutil`:" msgstr ":mod:`pkgutil`:" -#: ../../whatsnew/3.12.rst:1417 +#: ../../whatsnew/3.12.rst:1418 msgid ":func:`!pkgutil.find_loader`" msgstr ":func:`!pkgutil.find_loader`" -#: ../../whatsnew/3.12.rst:1418 +#: ../../whatsnew/3.12.rst:1419 msgid ":func:`!pkgutil.get_loader`." msgstr ":func:`!pkgutil.get_loader`。" -#: ../../whatsnew/3.12.rst:1420 +#: ../../whatsnew/3.12.rst:1421 msgid ":mod:`pty`:" msgstr ":mod:`pty`:" -#: ../../whatsnew/3.12.rst:1422 +#: ../../whatsnew/3.12.rst:1423 msgid ":func:`!pty.master_open`" msgstr ":func:`!pty.master_open`" -#: ../../whatsnew/3.12.rst:1423 +#: ../../whatsnew/3.12.rst:1424 msgid ":func:`!pty.slave_open`" msgstr ":func:`!pty.slave_open`" -#: ../../whatsnew/3.12.rst:1425 +#: ../../whatsnew/3.12.rst:1426 msgid ":mod:`shutil`: The *onerror* argument of :func:`shutil.rmtree`" msgstr "" -#: ../../whatsnew/3.12.rst:1427 +#: ../../whatsnew/3.12.rst:1428 msgid ":mod:`typing`: :class:`!typing.ByteString`" msgstr ":mod:`typing`::class:`!typing.ByteString`" -#: ../../whatsnew/3.12.rst:1429 +#: ../../whatsnew/3.12.rst:1430 msgid "" ":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`xml." "etree.ElementTree.Element`." msgstr "" -#: ../../whatsnew/3.12.rst:1431 +#: ../../whatsnew/3.12.rst:1432 msgid "The ``__package__`` and ``__cached__`` attributes on module objects." msgstr "" -#: ../../whatsnew/3.12.rst:1433 -msgid "The ``co_lnotab`` attribute of code objects." +#: ../../whatsnew/3.12.rst:1434 +msgid "The :attr:`~codeobject.co_lnotab` attribute of code objects." msgstr "" -#: ../../whatsnew/3.12.rst:1436 ../../whatsnew/3.12.rst:2368 +#: ../../whatsnew/3.12.rst:1437 ../../whatsnew/3.12.rst:2378 msgid "Pending Removal in Python 3.15" msgstr "Python 3.15 中待決議的移除項目" -#: ../../whatsnew/3.12.rst:1438 +#: ../../whatsnew/3.12.rst:1439 msgid "" "The following APIs have been deprecated and will be removed in Python 3.15." msgstr "" -#: ../../whatsnew/3.12.rst:1443 +#: ../../whatsnew/3.12.rst:1444 msgid ":func:`locale.getdefaultlocale` (:gh:`90817`)" msgstr ":func:`locale.getdefaultlocale` (:gh:`90817`)" -#: ../../whatsnew/3.12.rst:1447 ../../whatsnew/3.12.rst:2386 +#: ../../whatsnew/3.12.rst:1448 ../../whatsnew/3.12.rst:2396 msgid "Pending Removal in Future Versions" msgstr "未來版本中待決議的移除項目" -#: ../../whatsnew/3.12.rst:1449 +#: ../../whatsnew/3.12.rst:1450 msgid "" "The following APIs were deprecated in earlier Python versions and will be " "removed, although there is currently no date scheduled for their removal." msgstr "" -#: ../../whatsnew/3.12.rst:1452 +#: ../../whatsnew/3.12.rst:1453 msgid ":mod:`array`'s ``'u'`` format code (:gh:`57281`)" msgstr "" -#: ../../whatsnew/3.12.rst:1454 +#: ../../whatsnew/3.12.rst:1455 msgid ":class:`typing.Text` (:gh:`92332`)" msgstr ":class:`typing.Text` (:gh:`92332`)" -#: ../../whatsnew/3.12.rst:1456 +#: ../../whatsnew/3.12.rst:1457 msgid "" "Currently Python accepts numeric literals immediately followed by keywords, " "for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " @@ -2132,54 +2131,54 @@ msgid "" "syntax error. (:gh:`87999`)" msgstr "" -#: ../../whatsnew/3.12.rst:1467 ../../whatsnew/3.12.rst:2418 +#: ../../whatsnew/3.12.rst:1468 ../../whatsnew/3.12.rst:2428 msgid "Removed" msgstr "已移除" -#: ../../whatsnew/3.12.rst:1470 +#: ../../whatsnew/3.12.rst:1471 msgid "asynchat and asyncore" msgstr "asynchat 和 asyncore" -#: ../../whatsnew/3.12.rst:1472 +#: ../../whatsnew/3.12.rst:1473 msgid "" "These two modules have been removed according to the schedule in :pep:`594`, " "having been deprecated in Python 3.6. Use :mod:`asyncio` instead. " "(Contributed by Nikita Sobolev in :gh:`96580`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1479 +#: ../../whatsnew/3.12.rst:1480 msgid "configparser" msgstr "configparser" -#: ../../whatsnew/3.12.rst:1481 +#: ../../whatsnew/3.12.rst:1482 msgid "" "Several names deprecated in the :mod:`configparser` way back in 3.2 have " "been removed per :gh:`89336`:" msgstr "" -#: ../../whatsnew/3.12.rst:1484 +#: ../../whatsnew/3.12.rst:1485 msgid "" ":class:`configparser.ParsingError` no longer has a ``filename`` attribute or " "argument. Use the ``source`` attribute and argument instead." msgstr "" -#: ../../whatsnew/3.12.rst:1486 +#: ../../whatsnew/3.12.rst:1487 msgid "" ":mod:`configparser` no longer has a ``SafeConfigParser`` class. Use the " "shorter :class:`~configparser.ConfigParser` name instead." msgstr "" -#: ../../whatsnew/3.12.rst:1488 +#: ../../whatsnew/3.12.rst:1489 msgid "" ":class:`configparser.ConfigParser` no longer has a ``readfp`` method. Use :" "meth:`~configparser.ConfigParser.read_file` instead." msgstr "" -#: ../../whatsnew/3.12.rst:1492 +#: ../../whatsnew/3.12.rst:1493 msgid "distutils" msgstr "distutils" -#: ../../whatsnew/3.12.rst:1494 +#: ../../whatsnew/3.12.rst:1495 msgid "" "Remove the :py:mod:`!distutils` package. It was deprecated in Python 3.10 " "by :pep:`632` \"Deprecate distutils module\". For projects still using " @@ -2188,17 +2187,17 @@ msgid "" "Victor Stinner in :gh:`92584`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1501 +#: ../../whatsnew/3.12.rst:1502 msgid "ensurepip" msgstr "ensurepip" -#: ../../whatsnew/3.12.rst:1503 +#: ../../whatsnew/3.12.rst:1504 msgid "" "Remove the bundled setuptools wheel from :mod:`ensurepip`, and stop " "installing setuptools in environments created by :mod:`venv`." msgstr "" -#: ../../whatsnew/3.12.rst:1506 +#: ../../whatsnew/3.12.rst:1507 msgid "" "``pip (>= 22.1)`` does not require setuptools to be installed in the " "environment. ``setuptools``-based (and ``distutils``-based) packages can " @@ -2206,7 +2205,7 @@ msgid "" "the build environment it uses for building a package." msgstr "" -#: ../../whatsnew/3.12.rst:1512 +#: ../../whatsnew/3.12.rst:1513 msgid "" "``easy_install``, ``pkg_resources``, ``setuptools`` and ``distutils`` are no " "longer provided by default in environments created with ``venv`` or " @@ -2216,35 +2215,35 @@ msgid "" "(typically, using pip)." msgstr "" -#: ../../whatsnew/3.12.rst:1519 +#: ../../whatsnew/3.12.rst:1520 msgid "(Contributed by Pradyun Gedam in :gh:`95299`.)" msgstr "(由 Pradyun Gedam 於 :gh:`95299` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1522 +#: ../../whatsnew/3.12.rst:1523 msgid "enum" msgstr "enum" -#: ../../whatsnew/3.12.rst:1524 +#: ../../whatsnew/3.12.rst:1525 msgid "" "Remove :mod:`enum`'s ``EnumMeta.__getattr__``, which is no longer needed for " "enum attribute access. (Contributed by Ethan Furman in :gh:`95083`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1529 +#: ../../whatsnew/3.12.rst:1530 msgid "ftplib" msgstr "ftplib" -#: ../../whatsnew/3.12.rst:1531 +#: ../../whatsnew/3.12.rst:1532 msgid "" "Remove :mod:`ftplib`'s ``FTP_TLS.ssl_version`` class attribute: use the " "*context* parameter instead. (Contributed by Victor Stinner in :gh:`94172`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1536 +#: ../../whatsnew/3.12.rst:1537 msgid "gzip" msgstr "gzip" -#: ../../whatsnew/3.12.rst:1538 +#: ../../whatsnew/3.12.rst:1539 msgid "" "Remove the ``filename`` attribute of :mod:`gzip`'s :class:`gzip.GzipFile`, " "deprecated since Python 2.6, use the :attr:`~gzip.GzipFile.name` attribute " @@ -2253,11 +2252,11 @@ msgid "" "`94196`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1545 +#: ../../whatsnew/3.12.rst:1546 msgid "hashlib" msgstr "hashlib" -#: ../../whatsnew/3.12.rst:1547 +#: ../../whatsnew/3.12.rst:1548 msgid "" "Remove the pure Python implementation of :mod:`hashlib`'s :func:`hashlib." "pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and newer requires " @@ -2266,191 +2265,191 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1554 ../../whatsnew/3.12.rst:1581 +#: ../../whatsnew/3.12.rst:1555 ../../whatsnew/3.12.rst:1582 msgid "importlib" msgstr "importlib" -#: ../../whatsnew/3.12.rst:1556 +#: ../../whatsnew/3.12.rst:1557 msgid "" "Many previously deprecated cleanups in :mod:`importlib` have now been " "completed:" msgstr "" -#: ../../whatsnew/3.12.rst:1559 +#: ../../whatsnew/3.12.rst:1560 msgid "" "References to, and support for :meth:`!module_repr()` has been removed. " "(Contributed by Barry Warsaw in :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1562 +#: ../../whatsnew/3.12.rst:1563 msgid "" "``importlib.util.set_package``, ``importlib.util.set_loader`` and " "``importlib.util.module_for_loader`` have all been removed. (Contributed by " "Brett Cannon and Nikita Sobolev in :gh:`65961` and :gh:`97850`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1566 +#: ../../whatsnew/3.12.rst:1567 msgid "" "Support for ``find_loader()`` and ``find_module()`` APIs have been removed. " "(Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1569 +#: ../../whatsnew/3.12.rst:1570 msgid "" "``importlib.abc.Finder``, ``pkgutil.ImpImporter``, and ``pkgutil.ImpLoader`` " "have been removed. (Contributed by Barry Warsaw in :gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1573 ../../whatsnew/3.12.rst:1581 +#: ../../whatsnew/3.12.rst:1574 ../../whatsnew/3.12.rst:1582 msgid "imp" msgstr "imp" -#: ../../whatsnew/3.12.rst:1575 +#: ../../whatsnew/3.12.rst:1576 msgid "" "The :mod:`!imp` module has been removed. (Contributed by Barry Warsaw in :" "gh:`98040`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1578 +#: ../../whatsnew/3.12.rst:1579 msgid "To migrate, consult the following correspondence table:" msgstr "" -#: ../../whatsnew/3.12.rst:1583 +#: ../../whatsnew/3.12.rst:1584 msgid "``imp.NullImporter``" msgstr "``imp.NullImporter``" -#: ../../whatsnew/3.12.rst:1583 +#: ../../whatsnew/3.12.rst:1584 msgid "Insert ``None`` into ``sys.path_importer_cache``" msgstr "將 ``None`` 插入 ``sys.path_importer_cache``" -#: ../../whatsnew/3.12.rst:1584 +#: ../../whatsnew/3.12.rst:1585 msgid "``imp.cache_from_source()``" msgstr "``imp.cache_from_source()``" -#: ../../whatsnew/3.12.rst:1584 +#: ../../whatsnew/3.12.rst:1585 msgid ":func:`importlib.util.cache_from_source`" msgstr ":func:`importlib.util.cache_from_source`" -#: ../../whatsnew/3.12.rst:1585 +#: ../../whatsnew/3.12.rst:1586 msgid "``imp.find_module()``" msgstr "``imp.find_module()``" -#: ../../whatsnew/3.12.rst:1585 +#: ../../whatsnew/3.12.rst:1586 msgid ":func:`importlib.util.find_spec`" msgstr ":func:`importlib.util.find_spec`" -#: ../../whatsnew/3.12.rst:1586 +#: ../../whatsnew/3.12.rst:1587 msgid "``imp.get_magic()``" msgstr "``imp.get_magic()``" -#: ../../whatsnew/3.12.rst:1586 +#: ../../whatsnew/3.12.rst:1587 msgid ":attr:`importlib.util.MAGIC_NUMBER`" msgstr ":attr:`importlib.util.MAGIC_NUMBER`" -#: ../../whatsnew/3.12.rst:1587 +#: ../../whatsnew/3.12.rst:1588 msgid "``imp.get_suffixes()``" msgstr "``imp.get_suffixes()``" -#: ../../whatsnew/3.12.rst:1587 +#: ../../whatsnew/3.12.rst:1588 msgid "" ":attr:`importlib.machinery.SOURCE_SUFFIXES`, :attr:`importlib.machinery." "EXTENSION_SUFFIXES`, and :attr:`importlib.machinery.BYTECODE_SUFFIXES`" msgstr "" -#: ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1589 msgid "``imp.get_tag()``" msgstr "``imp.get_tag()``" -#: ../../whatsnew/3.12.rst:1588 +#: ../../whatsnew/3.12.rst:1589 msgid ":attr:`sys.implementation.cache_tag `" msgstr ":attr:`sys.implementation.cache_tag `" -#: ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:1590 msgid "``imp.load_module()``" msgstr "``imp.load_module()``" -#: ../../whatsnew/3.12.rst:1589 +#: ../../whatsnew/3.12.rst:1590 msgid ":func:`importlib.import_module`" msgstr ":func:`importlib.import_module`" -#: ../../whatsnew/3.12.rst:1590 +#: ../../whatsnew/3.12.rst:1591 msgid "``imp.new_module(name)``" msgstr "``imp.new_module(name)``" -#: ../../whatsnew/3.12.rst:1590 +#: ../../whatsnew/3.12.rst:1591 msgid "``types.ModuleType(name)``" msgstr "``types.ModuleType(name)``" -#: ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1592 msgid "``imp.reload()``" msgstr "``imp.reload()``" -#: ../../whatsnew/3.12.rst:1591 +#: ../../whatsnew/3.12.rst:1592 msgid ":func:`importlib.reload`" msgstr ":func:`importlib.reload`" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1593 msgid "``imp.source_from_cache()``" msgstr "``imp.source_from_cache()``" -#: ../../whatsnew/3.12.rst:1592 +#: ../../whatsnew/3.12.rst:1593 msgid ":func:`importlib.util.source_from_cache`" msgstr ":func:`importlib.util.source_from_cache`" -#: ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1594 msgid "``imp.load_source()``" msgstr "``imp.load_source()``" -#: ../../whatsnew/3.12.rst:1593 +#: ../../whatsnew/3.12.rst:1594 msgid "*See below*" msgstr "" -#: ../../whatsnew/3.12.rst:1596 +#: ../../whatsnew/3.12.rst:1597 msgid "Replace ``imp.load_source()`` with::" msgstr "" -#: ../../whatsnew/3.12.rst:1611 +#: ../../whatsnew/3.12.rst:1612 msgid "Remove :mod:`!imp` functions and attributes with no replacements:" msgstr "" -#: ../../whatsnew/3.12.rst:1613 +#: ../../whatsnew/3.12.rst:1614 msgid "Undocumented functions:" msgstr "未以文件記錄的函式:" -#: ../../whatsnew/3.12.rst:1615 +#: ../../whatsnew/3.12.rst:1616 msgid "``imp.init_builtin()``" msgstr "``imp.init_builtin()``" -#: ../../whatsnew/3.12.rst:1616 +#: ../../whatsnew/3.12.rst:1617 msgid "``imp.load_compiled()``" msgstr "``imp.load_compiled()``" -#: ../../whatsnew/3.12.rst:1617 +#: ../../whatsnew/3.12.rst:1618 msgid "``imp.load_dynamic()``" msgstr "``imp.load_dynamic()``" -#: ../../whatsnew/3.12.rst:1618 +#: ../../whatsnew/3.12.rst:1619 msgid "``imp.load_package()``" msgstr "``imp.load_package()``" -#: ../../whatsnew/3.12.rst:1620 +#: ../../whatsnew/3.12.rst:1621 msgid "" "``imp.lock_held()``, ``imp.acquire_lock()``, ``imp.release_lock()``: the " "locking scheme has changed in Python 3.3 to per-module locks." msgstr "" -#: ../../whatsnew/3.12.rst:1622 +#: ../../whatsnew/3.12.rst:1623 msgid "" "``imp.find_module()`` constants: ``SEARCH_ERROR``, ``PY_SOURCE``, " "``PY_COMPILED``, ``C_EXTENSION``, ``PY_RESOURCE``, ``PKG_DIRECTORY``, " "``C_BUILTIN``, ``PY_FROZEN``, ``PY_CODERESOURCE``, ``IMP_HOOK``." msgstr "" -#: ../../whatsnew/3.12.rst:1627 +#: ../../whatsnew/3.12.rst:1628 msgid "io" msgstr "io" -#: ../../whatsnew/3.12.rst:1629 +#: ../../whatsnew/3.12.rst:1630 msgid "" "Remove :mod:`io`'s ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated " "in Python 3.10: just use :func:`open` instead. The :func:`open` (:func:`io." @@ -2459,22 +2458,22 @@ msgid "" "`94169`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1636 +#: ../../whatsnew/3.12.rst:1637 msgid "locale" msgstr "locale" -#: ../../whatsnew/3.12.rst:1638 +#: ../../whatsnew/3.12.rst:1639 msgid "" "Remove :mod:`locale`'s :func:`!locale.format` function, deprecated in Python " "3.7: use :func:`locale.format_string` instead. (Contributed by Victor " "Stinner in :gh:`94226`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1643 +#: ../../whatsnew/3.12.rst:1644 msgid "smtpd" msgstr "" -#: ../../whatsnew/3.12.rst:1645 +#: ../../whatsnew/3.12.rst:1646 msgid "" "The ``smtpd`` module has been removed according to the schedule in :pep:" "`594`, having been deprecated in Python 3.4.7 and 3.5.4. Use aiosmtpd_ PyPI " @@ -2482,27 +2481,27 @@ msgid "" "Oleg Iarygin in :gh:`93243`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1656 +#: ../../whatsnew/3.12.rst:1657 msgid "" "The following undocumented :mod:`sqlite3` features, deprecated in Python " "3.10, are now removed:" msgstr "" -#: ../../whatsnew/3.12.rst:1659 +#: ../../whatsnew/3.12.rst:1660 msgid "``sqlite3.enable_shared_cache()``" msgstr "``sqlite3.enable_shared_cache()``" -#: ../../whatsnew/3.12.rst:1660 +#: ../../whatsnew/3.12.rst:1661 msgid "``sqlite3.OptimizedUnicode``" msgstr "``sqlite3.OptimizedUnicode``" -#: ../../whatsnew/3.12.rst:1662 +#: ../../whatsnew/3.12.rst:1663 msgid "" "If a shared cache must be used, open the database in URI mode using the " "``cache=shared`` query parameter." msgstr "" -#: ../../whatsnew/3.12.rst:1665 +#: ../../whatsnew/3.12.rst:1666 msgid "" "The ``sqlite3.OptimizedUnicode`` text factory has been an alias for :class:" "`str` since Python 3.3. Code that previously set the text factory to " @@ -2510,22 +2509,22 @@ msgid "" "default value which is also ``str``." msgstr "" -#: ../../whatsnew/3.12.rst:1670 +#: ../../whatsnew/3.12.rst:1671 msgid "(Contributed by Erlend E. Aasland in :gh:`92548`.)" msgstr "(由 Erlend E. Aasland 於 :gh:`92548` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1673 +#: ../../whatsnew/3.12.rst:1674 msgid "ssl" msgstr "ssl" -#: ../../whatsnew/3.12.rst:1675 +#: ../../whatsnew/3.12.rst:1676 msgid "" "Remove :mod:`ssl`'s :func:`!ssl.RAND_pseudo_bytes` function, deprecated in " "Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead. " "(Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1679 +#: ../../whatsnew/3.12.rst:1680 msgid "" "Remove the :func:`!ssl.match_hostname` function. It was deprecated in Python " "3.7. OpenSSL performs hostname matching since Python 3.7, Python no longer " @@ -2533,7 +2532,7 @@ msgid "" "Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1685 +#: ../../whatsnew/3.12.rst:1686 msgid "" "Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7: " "instead, create a :class:`ssl.SSLContext` object and call its :class:`ssl." @@ -2544,189 +2543,189 @@ msgid "" "Validation. (Contributed by Victor Stinner in :gh:`94199`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1697 +#: ../../whatsnew/3.12.rst:1698 msgid "Remove many long-deprecated :mod:`unittest` features:" msgstr "" -#: ../../whatsnew/3.12.rst:1701 +#: ../../whatsnew/3.12.rst:1702 msgid "A number of :class:`~unittest.TestCase` method aliases:" msgstr "" -#: ../../whatsnew/3.12.rst:1704 +#: ../../whatsnew/3.12.rst:1705 msgid "Deprecated alias" msgstr "已棄用的別名" -#: ../../whatsnew/3.12.rst:1704 +#: ../../whatsnew/3.12.rst:1705 msgid "Method Name" msgstr "方法名稱" -#: ../../whatsnew/3.12.rst:1704 +#: ../../whatsnew/3.12.rst:1705 msgid "Deprecated in" msgstr "" -#: ../../whatsnew/3.12.rst:1706 +#: ../../whatsnew/3.12.rst:1707 msgid "``failUnless``" msgstr "``failUnless``" -#: ../../whatsnew/3.12.rst:1706 ../../whatsnew/3.12.rst:1713 +#: ../../whatsnew/3.12.rst:1707 ../../whatsnew/3.12.rst:1714 msgid ":meth:`.assertTrue`" msgstr ":meth:`.assertTrue`" -#: ../../whatsnew/3.12.rst:1706 ../../whatsnew/3.12.rst:1707 -#: ../../whatsnew/3.12.rst:1708 ../../whatsnew/3.12.rst:1709 -#: ../../whatsnew/3.12.rst:1710 ../../whatsnew/3.12.rst:1711 -#: ../../whatsnew/3.12.rst:1712 +#: ../../whatsnew/3.12.rst:1707 ../../whatsnew/3.12.rst:1708 +#: ../../whatsnew/3.12.rst:1709 ../../whatsnew/3.12.rst:1710 +#: ../../whatsnew/3.12.rst:1711 ../../whatsnew/3.12.rst:1712 +#: ../../whatsnew/3.12.rst:1713 msgid "3.1" msgstr "3.1" -#: ../../whatsnew/3.12.rst:1707 +#: ../../whatsnew/3.12.rst:1708 msgid "``failIf``" msgstr "``failIf``" -#: ../../whatsnew/3.12.rst:1707 +#: ../../whatsnew/3.12.rst:1708 msgid ":meth:`.assertFalse`" msgstr ":meth:`.assertFalse`" -#: ../../whatsnew/3.12.rst:1708 +#: ../../whatsnew/3.12.rst:1709 msgid "``failUnlessEqual``" msgstr "``failUnlessEqual``" -#: ../../whatsnew/3.12.rst:1708 ../../whatsnew/3.12.rst:1714 +#: ../../whatsnew/3.12.rst:1709 ../../whatsnew/3.12.rst:1715 msgid ":meth:`.assertEqual`" msgstr ":meth:`.assertEqual`" -#: ../../whatsnew/3.12.rst:1709 +#: ../../whatsnew/3.12.rst:1710 msgid "``failIfEqual``" msgstr "``failIfEqual``" -#: ../../whatsnew/3.12.rst:1709 ../../whatsnew/3.12.rst:1715 +#: ../../whatsnew/3.12.rst:1710 ../../whatsnew/3.12.rst:1716 msgid ":meth:`.assertNotEqual`" msgstr ":meth:`.assertNotEqual`" -#: ../../whatsnew/3.12.rst:1710 +#: ../../whatsnew/3.12.rst:1711 msgid "``failUnlessAlmostEqual``" msgstr "``failUnlessAlmostEqual``" -#: ../../whatsnew/3.12.rst:1710 ../../whatsnew/3.12.rst:1716 +#: ../../whatsnew/3.12.rst:1711 ../../whatsnew/3.12.rst:1717 msgid ":meth:`.assertAlmostEqual`" msgstr ":meth:`.assertAlmostEqual`" -#: ../../whatsnew/3.12.rst:1711 +#: ../../whatsnew/3.12.rst:1712 msgid "``failIfAlmostEqual``" msgstr "``failIfAlmostEqual``" -#: ../../whatsnew/3.12.rst:1711 ../../whatsnew/3.12.rst:1717 +#: ../../whatsnew/3.12.rst:1712 ../../whatsnew/3.12.rst:1718 msgid ":meth:`.assertNotAlmostEqual`" msgstr ":meth:`.assertNotAlmostEqual`" -#: ../../whatsnew/3.12.rst:1712 +#: ../../whatsnew/3.12.rst:1713 msgid "``failUnlessRaises``" msgstr "``failUnlessRaises``" -#: ../../whatsnew/3.12.rst:1712 +#: ../../whatsnew/3.12.rst:1713 msgid ":meth:`.assertRaises`" msgstr ":meth:`.assertRaises`" -#: ../../whatsnew/3.12.rst:1713 +#: ../../whatsnew/3.12.rst:1714 msgid "``assert_``" msgstr "``assert_``" -#: ../../whatsnew/3.12.rst:1713 ../../whatsnew/3.12.rst:1714 -#: ../../whatsnew/3.12.rst:1715 ../../whatsnew/3.12.rst:1716 -#: ../../whatsnew/3.12.rst:1717 ../../whatsnew/3.12.rst:1718 -#: ../../whatsnew/3.12.rst:1719 +#: ../../whatsnew/3.12.rst:1714 ../../whatsnew/3.12.rst:1715 +#: ../../whatsnew/3.12.rst:1716 ../../whatsnew/3.12.rst:1717 +#: ../../whatsnew/3.12.rst:1718 ../../whatsnew/3.12.rst:1719 +#: ../../whatsnew/3.12.rst:1720 msgid "3.2" msgstr "3.2" -#: ../../whatsnew/3.12.rst:1714 +#: ../../whatsnew/3.12.rst:1715 msgid "``assertEquals``" msgstr "``assertEquals``" -#: ../../whatsnew/3.12.rst:1715 +#: ../../whatsnew/3.12.rst:1716 msgid "``assertNotEquals``" msgstr "``assertNotEquals``" -#: ../../whatsnew/3.12.rst:1716 +#: ../../whatsnew/3.12.rst:1717 msgid "``assertAlmostEquals``" msgstr "``assertAlmostEquals``" -#: ../../whatsnew/3.12.rst:1717 +#: ../../whatsnew/3.12.rst:1718 msgid "``assertNotAlmostEquals``" msgstr "``assertNotAlmostEquals``" -#: ../../whatsnew/3.12.rst:1718 +#: ../../whatsnew/3.12.rst:1719 msgid "``assertRegexpMatches``" msgstr "``assertRegexpMatches``" -#: ../../whatsnew/3.12.rst:1718 +#: ../../whatsnew/3.12.rst:1719 msgid ":meth:`.assertRegex`" msgstr ":meth:`.assertRegex`" -#: ../../whatsnew/3.12.rst:1719 +#: ../../whatsnew/3.12.rst:1720 msgid "``assertRaisesRegexp``" msgstr "``assertRaisesRegexp``" -#: ../../whatsnew/3.12.rst:1719 +#: ../../whatsnew/3.12.rst:1720 msgid ":meth:`.assertRaisesRegex`" msgstr ":meth:`.assertRaisesRegex`" -#: ../../whatsnew/3.12.rst:1720 +#: ../../whatsnew/3.12.rst:1721 msgid "``assertNotRegexpMatches``" msgstr "``assertNotRegexpMatches``" -#: ../../whatsnew/3.12.rst:1720 +#: ../../whatsnew/3.12.rst:1721 msgid ":meth:`.assertNotRegex`" msgstr ":meth:`.assertNotRegex`" -#: ../../whatsnew/3.12.rst:1720 +#: ../../whatsnew/3.12.rst:1721 msgid "3.5" msgstr "3.5" -#: ../../whatsnew/3.12.rst:1723 +#: ../../whatsnew/3.12.rst:1724 msgid "" "You can use https://github.com/isidentical/teyit to automatically modernise " "your unit tests." msgstr "" -#: ../../whatsnew/3.12.rst:1726 +#: ../../whatsnew/3.12.rst:1727 msgid "" "Undocumented and broken :class:`~unittest.TestCase` method " "``assertDictContainsSubset`` (deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1729 +#: ../../whatsnew/3.12.rst:1730 msgid "" "Undocumented :meth:`TestLoader.loadTestsFromModule ` parameter *use_load_tests* (deprecated and ignored " "since Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1733 +#: ../../whatsnew/3.12.rst:1734 msgid "" "An alias of the :class:`~unittest.TextTestResult` class: ``_TextTestResult`` " "(deprecated in Python 3.2)." msgstr "" -#: ../../whatsnew/3.12.rst:1736 +#: ../../whatsnew/3.12.rst:1737 msgid "(Contributed by Serhiy Storchaka in :gh:`89325`.)" msgstr "(由 Serhiy Storchaka 於 :gh:`89325` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1739 +#: ../../whatsnew/3.12.rst:1740 msgid "webbrowser" msgstr "webbrowser" -#: ../../whatsnew/3.12.rst:1741 +#: ../../whatsnew/3.12.rst:1742 msgid "" "Remove support for obsolete browsers from :mod:`webbrowser`. The removed " "browsers include: Grail, Mosaic, Netscape, Galeon, Skipstone, Iceape, " "Firebird, and Firefox versions 35 and below (:gh:`102871`)." msgstr "" -#: ../../whatsnew/3.12.rst:1746 +#: ../../whatsnew/3.12.rst:1747 msgid "xml.etree.ElementTree" msgstr "xml.etree.ElementTree" -#: ../../whatsnew/3.12.rst:1748 +#: ../../whatsnew/3.12.rst:1749 msgid "" "Remove the ``ElementTree.Element.copy()`` method of the pure Python " "implementation, deprecated in Python 3.10, use the :func:`copy.copy` " @@ -2735,22 +2734,22 @@ msgid "" "Stinner in :gh:`94383`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1755 +#: ../../whatsnew/3.12.rst:1756 msgid "zipimport" msgstr "zipimport" -#: ../../whatsnew/3.12.rst:1757 +#: ../../whatsnew/3.12.rst:1758 msgid "" "Remove :mod:`zipimport`'s ``find_loader()`` and ``find_module()`` methods, " "deprecated in Python 3.10: use the ``find_spec()`` method instead. See :pep:" "`451` for the rationale. (Contributed by Victor Stinner in :gh:`94379`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1763 +#: ../../whatsnew/3.12.rst:1764 msgid "Others" msgstr "其他" -#: ../../whatsnew/3.12.rst:1765 +#: ../../whatsnew/3.12.rst:1766 msgid "" "Remove the ``suspicious`` rule from the documentation :file:`Makefile` and :" "file:`Doc/tools/rstlint.py`, both in favor of `sphinx-lint `, " "intended for low-level tools like debuggers and JIT compilers. This API may " @@ -3011,84 +3023,84 @@ msgid "" "contents are marked by the ``PyUnstable_`` prefix in names." msgstr "" -#: ../../whatsnew/3.12.rst:1952 +#: ../../whatsnew/3.12.rst:1962 msgid "Code object constructors:" msgstr "" -#: ../../whatsnew/3.12.rst:1954 +#: ../../whatsnew/3.12.rst:1964 msgid "``PyUnstable_Code_New()`` (renamed from ``PyCode_New``)" msgstr "" -#: ../../whatsnew/3.12.rst:1955 +#: ../../whatsnew/3.12.rst:1965 msgid "" "``PyUnstable_Code_NewWithPosOnlyArgs()`` (renamed from " "``PyCode_NewWithPosOnlyArgs``)" msgstr "" -#: ../../whatsnew/3.12.rst:1957 +#: ../../whatsnew/3.12.rst:1967 msgid "Extra storage for code objects (:pep:`523`):" msgstr "" -#: ../../whatsnew/3.12.rst:1959 +#: ../../whatsnew/3.12.rst:1969 msgid "" "``PyUnstable_Eval_RequestCodeExtraIndex()`` (renamed from " "``_PyEval_RequestCodeExtraIndex``)" msgstr "" -#: ../../whatsnew/3.12.rst:1960 +#: ../../whatsnew/3.12.rst:1970 msgid "``PyUnstable_Code_GetExtra()`` (renamed from ``_PyCode_GetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1961 +#: ../../whatsnew/3.12.rst:1971 msgid "``PyUnstable_Code_SetExtra()`` (renamed from ``_PyCode_SetExtra``)" msgstr "" -#: ../../whatsnew/3.12.rst:1963 +#: ../../whatsnew/3.12.rst:1973 msgid "" "The original names will continue to be available until the respective API " "changes." msgstr "" -#: ../../whatsnew/3.12.rst:1966 +#: ../../whatsnew/3.12.rst:1976 msgid "(Contributed by Petr Viktorin in :gh:`101101`.)" msgstr "(由 Petr Viktorin 於 :gh:`101101` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1968 +#: ../../whatsnew/3.12.rst:1978 msgid "" ":pep:`697`: Add an API for extending types whose instance memory layout is " "opaque:" msgstr "" -#: ../../whatsnew/3.12.rst:1971 +#: ../../whatsnew/3.12.rst:1981 msgid "" ":c:member:`PyType_Spec.basicsize` can be zero or negative to specify " "inheriting or extending the base class size." msgstr "" -#: ../../whatsnew/3.12.rst:1973 +#: ../../whatsnew/3.12.rst:1983 msgid "" ":c:func:`PyObject_GetTypeData` and :c:func:`PyType_GetTypeDataSize` added to " "allow access to subclass-specific instance data." msgstr "" -#: ../../whatsnew/3.12.rst:1975 +#: ../../whatsnew/3.12.rst:1985 msgid "" ":c:macro:`Py_TPFLAGS_ITEMS_AT_END` and :c:func:`PyObject_GetItemData` added " "to allow safely extending certain variable-sized types, including :c:var:" "`PyType_Type`." msgstr "" -#: ../../whatsnew/3.12.rst:1978 +#: ../../whatsnew/3.12.rst:1988 msgid "" ":c:macro:`Py_RELATIVE_OFFSET` added to allow defining :c:type:`members " "` in terms of a subclass-specific struct." msgstr "" -#: ../../whatsnew/3.12.rst:1981 +#: ../../whatsnew/3.12.rst:1991 msgid "(Contributed by Petr Viktorin in :gh:`103509`.)" msgstr "(由 Petr Viktorin 於 :gh:`103509` 中貢獻。)" -#: ../../whatsnew/3.12.rst:1983 +#: ../../whatsnew/3.12.rst:1993 msgid "" "Add the new :ref:`limited C API ` function :c:func:" "`PyType_FromMetaclass`, which generalizes the existing :c:func:" @@ -3096,29 +3108,29 @@ msgid "" "(Contributed by Wenzel Jakob in :gh:`93012`.)" msgstr "" -#: ../../whatsnew/3.12.rst:1988 +#: ../../whatsnew/3.12.rst:1998 msgid "" "API for creating objects that can be called using :ref:`the vectorcall " "protocol ` was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:1992 +#: ../../whatsnew/3.12.rst:2002 msgid ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" msgstr ":c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`" -#: ../../whatsnew/3.12.rst:1993 +#: ../../whatsnew/3.12.rst:2003 msgid ":c:func:`PyVectorcall_NARGS`" msgstr ":c:func:`PyVectorcall_NARGS`" -#: ../../whatsnew/3.12.rst:1994 +#: ../../whatsnew/3.12.rst:2004 msgid ":c:func:`PyVectorcall_Call`" msgstr ":c:func:`PyVectorcall_Call`" -#: ../../whatsnew/3.12.rst:1995 +#: ../../whatsnew/3.12.rst:2005 msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../whatsnew/3.12.rst:1997 +#: ../../whatsnew/3.12.rst:2007 msgid "" "The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " "when the class's :py:meth:`~object.__call__` method is reassigned. This " @@ -3129,7 +3141,7 @@ msgid "" "`93274`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2005 +#: ../../whatsnew/3.12.rst:2015 msgid "" "The :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" "`Py_TPFLAGS_MANAGED_WEAKREF` flags have been added. This allows extensions " @@ -3137,32 +3149,32 @@ msgid "" "using less memory and with faster access." msgstr "" -#: ../../whatsnew/3.12.rst:2010 +#: ../../whatsnew/3.12.rst:2020 msgid "" "API for performing calls using :ref:`the vectorcall protocol ` " "was added to the :ref:`Limited API `:" msgstr "" -#: ../../whatsnew/3.12.rst:2014 +#: ../../whatsnew/3.12.rst:2024 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../whatsnew/3.12.rst:2015 +#: ../../whatsnew/3.12.rst:2025 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../whatsnew/3.12.rst:2016 +#: ../../whatsnew/3.12.rst:2026 msgid ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" msgstr ":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`" -#: ../../whatsnew/3.12.rst:2018 +#: ../../whatsnew/3.12.rst:2028 msgid "" "This means that both the incoming and outgoing ends of the vector call " "protocol are now available in the :ref:`Limited API `. (Contributed " "by Wenzel Jakob in :gh:`98586`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2022 +#: ../../whatsnew/3.12.rst:2032 msgid "" "Add two new public functions, :c:func:`PyEval_SetProfileAllThreads` and :c:" "func:`PyEval_SetTraceAllThreads`, that allow to set tracing and profiling " @@ -3170,14 +3182,14 @@ msgid "" "(Contributed by Pablo Galindo in :gh:`93503`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2028 +#: ../../whatsnew/3.12.rst:2038 msgid "" "Add new function :c:func:`PyFunction_SetVectorcall` to the C API which sets " "the vectorcall field of a given :c:type:`PyFunctionObject`. (Contributed by " "Andrew Frost in :gh:`92257`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2032 +#: ../../whatsnew/3.12.rst:2042 msgid "" "The C API now permits registering callbacks via :c:func:" "`PyDict_AddWatcher`, :c:func:`PyDict_Watch` and related APIs to be called " @@ -3186,28 +3198,28 @@ msgid "" "`91052`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2038 +#: ../../whatsnew/3.12.rst:2048 msgid "" "Add :c:func:`PyType_AddWatcher` and :c:func:`PyType_Watch` API to register " "callbacks to receive notification on changes to a type. (Contributed by Carl " "Meyer in :gh:`91051`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2042 +#: ../../whatsnew/3.12.rst:2052 msgid "" "Add :c:func:`PyCode_AddWatcher` and :c:func:`PyCode_ClearWatcher` APIs to " "register callbacks to receive notification on creation and destruction of " "code objects. (Contributed by Itamar Oren in :gh:`91054`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2047 +#: ../../whatsnew/3.12.rst:2057 msgid "" "Add :c:func:`PyFrame_GetVar` and :c:func:`PyFrame_GetVarString` functions to " "get a frame variable by its name. (Contributed by Victor Stinner in :gh:" "`91248`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2051 +#: ../../whatsnew/3.12.rst:2061 msgid "" "Add :c:func:`PyErr_GetRaisedException` and :c:func:" "`PyErr_SetRaisedException` for saving and restoring the current exception. " @@ -3217,14 +3229,14 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2059 +#: ../../whatsnew/3.12.rst:2069 msgid "" "Add ``_PyErr_ChainExceptions1``, which takes an exception instance, to " "replace the legacy-API ``_PyErr_ChainExceptions``, which is now deprecated. " "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2063 +#: ../../whatsnew/3.12.rst:2073 msgid "" "Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as " "convenience functions for retrieving and modifying the :attr:`~BaseException." @@ -3232,71 +3244,71 @@ msgid "" "in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2068 +#: ../../whatsnew/3.12.rst:2078 msgid "" "Add :c:func:`PyErr_DisplayException`, which takes an exception instance, to " "replace the legacy-api :c:func:`!PyErr_Display`. (Contributed by Irit " "Katriel in :gh:`102755`)." msgstr "" -#: ../../whatsnew/3.12.rst:2074 +#: ../../whatsnew/3.12.rst:2084 msgid "" ":pep:`683`: Introduce *Immortal Objects*, which allows objects to bypass " "reference counts, and related changes to the C-API:" msgstr "" -#: ../../whatsnew/3.12.rst:2077 +#: ../../whatsnew/3.12.rst:2087 msgid "``_Py_IMMORTAL_REFCNT``: The reference count that defines an object" msgstr "" -#: ../../whatsnew/3.12.rst:2078 +#: ../../whatsnew/3.12.rst:2088 msgid "as immortal." msgstr "" -#: ../../whatsnew/3.12.rst:2079 +#: ../../whatsnew/3.12.rst:2089 msgid "" "``_Py_IsImmortal`` Checks if an object has the immortal reference count." msgstr "" -#: ../../whatsnew/3.12.rst:2080 +#: ../../whatsnew/3.12.rst:2090 msgid "``PyObject_HEAD_INIT`` This will now initialize reference count to" msgstr "" -#: ../../whatsnew/3.12.rst:2081 +#: ../../whatsnew/3.12.rst:2091 msgid "``_Py_IMMORTAL_REFCNT`` when used with ``Py_BUILD_CORE``." msgstr "" -#: ../../whatsnew/3.12.rst:2082 +#: ../../whatsnew/3.12.rst:2092 msgid "``SSTATE_INTERNED_IMMORTAL`` An identifier for interned unicode objects" msgstr "" -#: ../../whatsnew/3.12.rst:2083 +#: ../../whatsnew/3.12.rst:2093 msgid "that are immortal." msgstr "" -#: ../../whatsnew/3.12.rst:2084 +#: ../../whatsnew/3.12.rst:2094 msgid "``SSTATE_INTERNED_IMMORTAL_STATIC`` An identifier for interned unicode" msgstr "" -#: ../../whatsnew/3.12.rst:2085 +#: ../../whatsnew/3.12.rst:2095 msgid "objects that are immortal and static" msgstr "" -#: ../../whatsnew/3.12.rst:2088 +#: ../../whatsnew/3.12.rst:2098 msgid "``sys.getunicodeinternedsize`` This returns the total number of unicode" msgstr "" -#: ../../whatsnew/3.12.rst:2087 +#: ../../whatsnew/3.12.rst:2097 msgid "" "objects that have been interned. This is now needed for :file:`refleak.py` " "to correctly track reference counts and allocated blocks" msgstr "" -#: ../../whatsnew/3.12.rst:2090 +#: ../../whatsnew/3.12.rst:2100 msgid "(Contributed by Eddie Elizondo in :gh:`84436`.)" msgstr "(由 Eddie Elizondo 於 :gh:`84436` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2092 +#: ../../whatsnew/3.12.rst:2102 msgid "" ":pep:`684`: Add the new :c:func:`Py_NewInterpreterFromConfig` function and :" "c:type:`PyInterpreterConfig`, which may be used to create sub-interpreters " @@ -3304,27 +3316,27 @@ msgid "" "(Contributed by Eric Snow in :gh:`104110`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2098 +#: ../../whatsnew/3.12.rst:2108 msgid "" "In the limited C API version 3.12, :c:func:`Py_INCREF` and :c:func:" "`Py_DECREF` functions are now implemented as opaque function calls to hide " "implementation details. (Contributed by Victor Stinner in :gh:`105387`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2106 +#: ../../whatsnew/3.12.rst:2116 msgid "" "Legacy Unicode APIs based on ``Py_UNICODE*`` representation has been " "removed. Please migrate to APIs based on UTF-8 or ``wchar_t*``." msgstr "" -#: ../../whatsnew/3.12.rst:2109 +#: ../../whatsnew/3.12.rst:2119 msgid "" "Argument parsing functions like :c:func:`PyArg_ParseTuple` doesn't support " "``Py_UNICODE*`` based format (e.g. ``u``, ``Z``) anymore. Please migrate to " "other formats for Unicode like ``s``, ``z``, ``es``, and ``U``." msgstr "" -#: ../../whatsnew/3.12.rst:2113 +#: ../../whatsnew/3.12.rst:2123 msgid "" "``tp_weaklist`` for all static builtin types is always ``NULL``. This is an " "internal-only field on ``PyTypeObject`` but we're pointing out the change in " @@ -3333,7 +3345,7 @@ msgid "" "necessary, the (internal-only) ``_PyObject_GET_WEAKREFS_LISTPTR()`` macro." msgstr "" -#: ../../whatsnew/3.12.rst:2120 +#: ../../whatsnew/3.12.rst:2130 msgid "" "This internal-only :c:member:`PyTypeObject.tp_subclasses` may now not be a " "valid object pointer. Its type was changed to :c:expr:`void *` to reflect " @@ -3341,13 +3353,13 @@ msgid "" "only field directly." msgstr "" -#: ../../whatsnew/3.12.rst:2125 +#: ../../whatsnew/3.12.rst:2135 msgid "" "To get a list of subclasses, call the Python method :py:meth:`~class." "__subclasses__` (using :c:func:`PyObject_CallMethod`, for example)." msgstr "" -#: ../../whatsnew/3.12.rst:2129 +#: ../../whatsnew/3.12.rst:2139 msgid "" "Add support of more formatting options (left aligning, octals, uppercase " "hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`, :c:type:`wchar_t` C " @@ -3356,7 +3368,7 @@ msgid "" "`98836`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2135 +#: ../../whatsnew/3.12.rst:2145 msgid "" "An unrecognized format character in :c:func:`PyUnicode_FromFormat` and :c:" "func:`PyUnicode_FromFormatV` now sets a :exc:`SystemError`. In previous " @@ -3365,13 +3377,13 @@ msgid "" "Storchaka in :gh:`95781`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2141 +#: ../../whatsnew/3.12.rst:2151 msgid "" "Fix wrong sign placement in :c:func:`PyUnicode_FromFormat` and :c:func:" "`PyUnicode_FromFormatV`. (Contributed by Philip Georgi in :gh:`95504`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2145 +#: ../../whatsnew/3.12.rst:2155 msgid "" "Extension classes wanting to add a ``__dict__`` or weak reference slot " "should use :c:macro:`Py_TPFLAGS_MANAGED_DICT` and :c:macro:" @@ -3385,7 +3397,7 @@ msgid "" "func:`PyObject_ClearWeakRefs`, as before." msgstr "" -#: ../../whatsnew/3.12.rst:2157 +#: ../../whatsnew/3.12.rst:2167 msgid "" "The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like " "paths, like :class:`bytearray` and :class:`memoryview` types: only the " @@ -3393,7 +3405,7 @@ msgid "" "Victor Stinner in :gh:`98393`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2162 +#: ../../whatsnew/3.12.rst:2172 msgid "" "The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and :c:macro:`Py_XSETREF` " "macros now only evaluate their arguments once. If an argument has side " @@ -3401,7 +3413,7 @@ msgid "" "Stinner in :gh:`98724`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2167 +#: ../../whatsnew/3.12.rst:2177 msgid "" "The interpreter's error indicator is now always normalized. This means that :" "c:func:`PyErr_SetObject`, :c:func:`PyErr_SetString` and the other functions " @@ -3409,7 +3421,7 @@ msgid "" "(Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2172 +#: ../../whatsnew/3.12.rst:2182 msgid "" "``_Py_RefTotal`` is no longer authoritative and only kept around for ABI " "compatibility. Note that it is an internal global and only available on " @@ -3417,25 +3429,25 @@ msgid "" "``_Py_GetGlobalRefTotal()``." msgstr "" -#: ../../whatsnew/3.12.rst:2177 +#: ../../whatsnew/3.12.rst:2187 msgid "" "The following functions now select an appropriate metaclass for the newly " "created type:" msgstr "" -#: ../../whatsnew/3.12.rst:2180 +#: ../../whatsnew/3.12.rst:2190 msgid ":c:func:`PyType_FromSpec`" msgstr ":c:func:`PyType_FromSpec`" -#: ../../whatsnew/3.12.rst:2181 +#: ../../whatsnew/3.12.rst:2191 msgid ":c:func:`PyType_FromSpecWithBases`" msgstr ":c:func:`PyType_FromSpecWithBases`" -#: ../../whatsnew/3.12.rst:2182 +#: ../../whatsnew/3.12.rst:2192 msgid ":c:func:`PyType_FromModuleAndSpec`" msgstr ":c:func:`PyType_FromModuleAndSpec`" -#: ../../whatsnew/3.12.rst:2184 +#: ../../whatsnew/3.12.rst:2194 msgid "" "Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " "is deprecated, and in Python 3.14+ it will be disallowed. Note that these " @@ -3443,14 +3455,14 @@ msgid "" "initialization." msgstr "" -#: ../../whatsnew/3.12.rst:2189 +#: ../../whatsnew/3.12.rst:2199 msgid "" "Note that :c:func:`PyType_FromMetaclass` (added in Python 3.12) already " "disallows creating classes whose metaclass overrides ``tp_new`` (:meth:" "`~object.__new__` in Python)." msgstr "" -#: ../../whatsnew/3.12.rst:2193 +#: ../../whatsnew/3.12.rst:2203 msgid "" "Since ``tp_new`` overrides almost everything ``PyType_From*`` functions do, " "the two are incompatible with each other. The existing behavior -- ignoring " @@ -3459,17 +3471,17 @@ msgid "" "general workaround. One of the following may work for you:" msgstr "" -#: ../../whatsnew/3.12.rst:2200 +#: ../../whatsnew/3.12.rst:2210 msgid "If you control the metaclass, avoid using ``tp_new`` in it:" msgstr "" -#: ../../whatsnew/3.12.rst:2202 +#: ../../whatsnew/3.12.rst:2212 msgid "" "If initialization can be skipped, it can be done in :c:member:`~PyTypeObject." "tp_init` instead." msgstr "" -#: ../../whatsnew/3.12.rst:2204 +#: ../../whatsnew/3.12.rst:2214 msgid "" "If the metaclass doesn't need to be instantiated from Python, set its " "``tp_new`` to ``NULL`` using the :c:macro:" @@ -3477,20 +3489,20 @@ msgid "" "``PyType_From*`` functions." msgstr "" -#: ../../whatsnew/3.12.rst:2209 +#: ../../whatsnew/3.12.rst:2219 msgid "" "Avoid ``PyType_From*`` functions: if you don't need C-specific features " "(slots or setting the instance size), create types by :ref:`calling ` " "the metaclass." msgstr "" -#: ../../whatsnew/3.12.rst:2213 +#: ../../whatsnew/3.12.rst:2223 msgid "" "If you *know* the ``tp_new`` can be skipped safely, filter the deprecation " "warning out using :func:`warnings.catch_warnings` from Python." msgstr "" -#: ../../whatsnew/3.12.rst:2216 +#: ../../whatsnew/3.12.rst:2226 msgid "" ":c:var:`PyOS_InputHook` and :c:var:`PyOS_ReadlineFunctionPointer` are no " "longer called in :ref:`subinterpreters `. This is " @@ -3498,14 +3510,14 @@ msgid "" "callbacks have no way of recovering extension module state)." msgstr "" -#: ../../whatsnew/3.12.rst:2221 +#: ../../whatsnew/3.12.rst:2231 msgid "" "This also avoids situations where extensions may find themselves running in " "a subinterpreter that they don't support (or haven't yet been loaded in). " "See :gh:`104668` for more info." msgstr "" -#: ../../whatsnew/3.12.rst:2225 +#: ../../whatsnew/3.12.rst:2235 msgid "" ":c:struct:`PyLongObject` has had its internals changed for better " "performance. Although the internals of :c:struct:`PyLongObject` are private, " @@ -3516,15 +3528,15 @@ msgid "" "a single machine word:" msgstr "" -#: ../../whatsnew/3.12.rst:2233 +#: ../../whatsnew/3.12.rst:2243 msgid ":c:func:`PyUnstable_Long_IsCompact`" msgstr ":c:func:`PyUnstable_Long_IsCompact`" -#: ../../whatsnew/3.12.rst:2234 +#: ../../whatsnew/3.12.rst:2244 msgid ":c:func:`PyUnstable_Long_CompactValue`" msgstr ":c:func:`PyUnstable_Long_CompactValue`" -#: ../../whatsnew/3.12.rst:2236 +#: ../../whatsnew/3.12.rst:2246 msgid "" "Custom allocators, set via :c:func:`PyMem_SetAllocator`, are now required to " "be thread-safe, regardless of memory domain. Allocators that don't have " @@ -3533,7 +3545,7 @@ msgid "" "create a new GitHub issue and CC ``@ericsnowcurrently``." msgstr "" -#: ../../whatsnew/3.12.rst:2246 +#: ../../whatsnew/3.12.rst:2256 msgid "" "In accordance with :pep:`699`, the ``ma_version_tag`` field in :c:type:" "`PyDictObject` is deprecated for extension modules. Accessing this field " @@ -3542,76 +3554,76 @@ msgid "" "PEP by Ken Jin.)" msgstr "" -#: ../../whatsnew/3.12.rst:2251 +#: ../../whatsnew/3.12.rst:2261 msgid "Deprecate global configuration variable:" msgstr "" -#: ../../whatsnew/3.12.rst:2253 ../../whatsnew/3.12.rst:2338 +#: ../../whatsnew/3.12.rst:2263 ../../whatsnew/3.12.rst:2348 msgid ":c:var:`Py_DebugFlag`: use :c:member:`PyConfig.parser_debug`" msgstr ":c:var:`Py_DebugFlag`: 請改用 :c:member:`PyConfig.parser_debug`" -#: ../../whatsnew/3.12.rst:2254 ../../whatsnew/3.12.rst:2339 +#: ../../whatsnew/3.12.rst:2264 ../../whatsnew/3.12.rst:2349 msgid ":c:var:`Py_VerboseFlag`: use :c:member:`PyConfig.verbose`" msgstr ":c:var:`Py_VerboseFlag`: 請改用 :c:member:`PyConfig.verbose`" -#: ../../whatsnew/3.12.rst:2255 ../../whatsnew/3.12.rst:2340 +#: ../../whatsnew/3.12.rst:2265 ../../whatsnew/3.12.rst:2350 msgid ":c:var:`Py_QuietFlag`: use :c:member:`PyConfig.quiet`" msgstr ":c:var:`Py_QuietFlag`: 請改用 :c:member:`PyConfig.quiet`" -#: ../../whatsnew/3.12.rst:2256 ../../whatsnew/3.12.rst:2341 +#: ../../whatsnew/3.12.rst:2266 ../../whatsnew/3.12.rst:2351 msgid ":c:var:`Py_InteractiveFlag`: use :c:member:`PyConfig.interactive`" msgstr ":c:var:`Py_InteractiveFlag`: 請改用 :c:member:`PyConfig.interactive`" -#: ../../whatsnew/3.12.rst:2257 ../../whatsnew/3.12.rst:2342 +#: ../../whatsnew/3.12.rst:2267 ../../whatsnew/3.12.rst:2352 msgid ":c:var:`Py_InspectFlag`: use :c:member:`PyConfig.inspect`" msgstr ":c:var:`Py_InspectFlag`: 請改用 :c:member:`PyConfig.inspect`" -#: ../../whatsnew/3.12.rst:2258 ../../whatsnew/3.12.rst:2343 +#: ../../whatsnew/3.12.rst:2268 ../../whatsnew/3.12.rst:2353 msgid ":c:var:`Py_OptimizeFlag`: use :c:member:`PyConfig.optimization_level`" msgstr "" ":c:var:`Py_OptimizeFlag`: 請改用 :c:member:`PyConfig.optimization_level`" -#: ../../whatsnew/3.12.rst:2259 ../../whatsnew/3.12.rst:2344 +#: ../../whatsnew/3.12.rst:2269 ../../whatsnew/3.12.rst:2354 msgid ":c:var:`Py_NoSiteFlag`: use :c:member:`PyConfig.site_import`" msgstr ":c:var:`Py_NoSiteFlag`: 請改用 :c:member:`PyConfig.site_import`" -#: ../../whatsnew/3.12.rst:2260 ../../whatsnew/3.12.rst:2345 +#: ../../whatsnew/3.12.rst:2270 ../../whatsnew/3.12.rst:2355 msgid ":c:var:`Py_BytesWarningFlag`: use :c:member:`PyConfig.bytes_warning`" msgstr "" ":c:var:`Py_BytesWarningFlag`: 請改用 :c:member:`PyConfig.bytes_warning`" -#: ../../whatsnew/3.12.rst:2261 ../../whatsnew/3.12.rst:2346 +#: ../../whatsnew/3.12.rst:2271 ../../whatsnew/3.12.rst:2356 msgid ":c:var:`Py_FrozenFlag`: use :c:member:`PyConfig.pathconfig_warnings`" msgstr "" ":c:var:`Py_FrozenFlag`: 請改用 :c:member:`PyConfig.pathconfig_warnings`" -#: ../../whatsnew/3.12.rst:2262 ../../whatsnew/3.12.rst:2347 +#: ../../whatsnew/3.12.rst:2272 ../../whatsnew/3.12.rst:2357 msgid "" ":c:var:`Py_IgnoreEnvironmentFlag`: use :c:member:`PyConfig.use_environment`" msgstr "" ":c:var:`Py_IgnoreEnvironmentFlag`: 請改用 :c:member:`PyConfig." "use_environment`" -#: ../../whatsnew/3.12.rst:2263 ../../whatsnew/3.12.rst:2348 +#: ../../whatsnew/3.12.rst:2273 ../../whatsnew/3.12.rst:2358 msgid "" ":c:var:`Py_DontWriteBytecodeFlag`: use :c:member:`PyConfig.write_bytecode`" msgstr "" ":c:var:`Py_DontWriteBytecodeFlag`: 請改用 :c:member:`PyConfig.write_bytecode`" -#: ../../whatsnew/3.12.rst:2264 ../../whatsnew/3.12.rst:2349 +#: ../../whatsnew/3.12.rst:2274 ../../whatsnew/3.12.rst:2359 msgid "" ":c:var:`Py_NoUserSiteDirectory`: use :c:member:`PyConfig.user_site_directory`" msgstr "" ":c:var:`Py_NoUserSiteDirectory`: 請改用 :c:member:`PyConfig." "user_site_directory`" -#: ../../whatsnew/3.12.rst:2265 ../../whatsnew/3.12.rst:2350 +#: ../../whatsnew/3.12.rst:2275 ../../whatsnew/3.12.rst:2360 msgid "" ":c:var:`Py_UnbufferedStdioFlag`: use :c:member:`PyConfig.buffered_stdio`" msgstr "" ":c:var:`Py_UnbufferedStdioFlag`: 請改用 :c:member:`PyConfig.buffered_stdio`" -#: ../../whatsnew/3.12.rst:2266 ../../whatsnew/3.12.rst:2351 +#: ../../whatsnew/3.12.rst:2276 ../../whatsnew/3.12.rst:2361 msgid "" ":c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed` " "and :c:member:`PyConfig.hash_seed`" @@ -3619,11 +3631,11 @@ msgstr "" ":c:var:`Py_HashRandomizationFlag`: 請改用 :c:member:`PyConfig.use_hash_seed` " "和 :c:member:`PyConfig.hash_seed`" -#: ../../whatsnew/3.12.rst:2268 ../../whatsnew/3.12.rst:2353 +#: ../../whatsnew/3.12.rst:2278 ../../whatsnew/3.12.rst:2363 msgid ":c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`" msgstr ":c:var:`Py_IsolatedFlag`: 請改用 :c:member:`PyConfig.isolated`" -#: ../../whatsnew/3.12.rst:2269 ../../whatsnew/3.12.rst:2354 +#: ../../whatsnew/3.12.rst:2279 ../../whatsnew/3.12.rst:2364 msgid "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" @@ -3631,7 +3643,7 @@ msgstr "" ":c:var:`Py_LegacyWindowsFSEncodingFlag`: 請改用 :c:member:`PyPreConfig." "legacy_windows_fs_encoding`" -#: ../../whatsnew/3.12.rst:2270 ../../whatsnew/3.12.rst:2355 +#: ../../whatsnew/3.12.rst:2280 ../../whatsnew/3.12.rst:2365 msgid "" ":c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig." "legacy_windows_stdio`" @@ -3639,7 +3651,7 @@ msgstr "" ":c:var:`Py_LegacyWindowsStdioFlag`: 請改用 :c:member:`PyConfig." "legacy_windows_stdio`" -#: ../../whatsnew/3.12.rst:2271 ../../whatsnew/3.12.rst:2356 +#: ../../whatsnew/3.12.rst:2281 ../../whatsnew/3.12.rst:2366 msgid "" ":c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" @@ -3647,7 +3659,7 @@ msgstr "" ":c:var:`!Py_FileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." "filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2272 ../../whatsnew/3.12.rst:2357 +#: ../../whatsnew/3.12.rst:2282 ../../whatsnew/3.12.rst:2367 msgid "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: use :c:member:`PyConfig." "filesystem_encoding`" @@ -3655,7 +3667,7 @@ msgstr "" ":c:var:`!Py_HasFileSystemDefaultEncoding`: 請改用 :c:member:`PyConfig." "filesystem_encoding`" -#: ../../whatsnew/3.12.rst:2273 ../../whatsnew/3.12.rst:2358 +#: ../../whatsnew/3.12.rst:2283 ../../whatsnew/3.12.rst:2368 msgid "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig." "filesystem_errors`" @@ -3663,7 +3675,7 @@ msgstr "" ":c:var:`!Py_FileSystemDefaultEncodeErrors`: 請改用 :c:member:`PyConfig." "filesystem_errors`" -#: ../../whatsnew/3.12.rst:2274 ../../whatsnew/3.12.rst:2359 +#: ../../whatsnew/3.12.rst:2284 ../../whatsnew/3.12.rst:2369 msgid "" ":c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:" "`Py_PreInitialize`)" @@ -3671,7 +3683,7 @@ msgstr "" ":c:var:`!Py_UTF8Mode`: 請改用 :c:member:`PyPreConfig.utf8_mode`\\ (參見 :c:" "func:`Py_PreInitialize`)" -#: ../../whatsnew/3.12.rst:2276 +#: ../../whatsnew/3.12.rst:2286 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead. (Contributed by Victor Stinner in :gh:`77782`.)" @@ -3679,25 +3691,25 @@ msgstr "" ":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" "(由 Victor Stinner 於 :gh:`77782` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2280 +#: ../../whatsnew/3.12.rst:2290 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases is deprecated and will be disabled in Python 3.14. (:gh:`95388`)" msgstr "" -#: ../../whatsnew/3.12.rst:2283 +#: ../../whatsnew/3.12.rst:2293 msgid "" "The :file:`structmember.h` header is deprecated, though it continues to be " "available and there are no plans to remove it." msgstr ":file:`structmember.h` 標頭已棄用,但仍可使用,且還沒有移除它的計畫。" -#: ../../whatsnew/3.12.rst:2286 +#: ../../whatsnew/3.12.rst:2296 msgid "" "Its contents are now available just by including :file:`Python.h`, with a " "``Py`` prefix added if it was missing:" msgstr "" -#: ../../whatsnew/3.12.rst:2289 +#: ../../whatsnew/3.12.rst:2299 msgid "" ":c:struct:`PyMemberDef`, :c:func:`PyMember_GetOne` and :c:func:" "`PyMember_SetOne`" @@ -3705,13 +3717,13 @@ msgstr "" ":c:struct:`PyMemberDef`、:c:func:`PyMember_GetOne` 和 :c:func:" "`PyMember_SetOne`" -#: ../../whatsnew/3.12.rst:2291 +#: ../../whatsnew/3.12.rst:2301 msgid "" "Type macros like :c:macro:`Py_T_INT`, :c:macro:`Py_T_DOUBLE`, etc. " "(previously ``T_INT``, ``T_DOUBLE``, etc.)" msgstr "" -#: ../../whatsnew/3.12.rst:2293 +#: ../../whatsnew/3.12.rst:2303 msgid "" "The flags :c:macro:`Py_READONLY` (previously ``READONLY``) and :c:macro:" "`Py_AUDIT_READ` (previously all uppercase)" @@ -3719,23 +3731,23 @@ msgstr "" ":c:macro:`Py_READONLY`\\ (先前為 ``READONLY``)和 :c:macro:" "`Py_AUDIT_READ`\\ (先前全大寫)旗標" -#: ../../whatsnew/3.12.rst:2296 +#: ../../whatsnew/3.12.rst:2306 msgid "Several items are not exposed from :file:`Python.h`:" msgstr "數個項目不再從 :file:`Python.h` 中公開:" -#: ../../whatsnew/3.12.rst:2298 +#: ../../whatsnew/3.12.rst:2308 msgid ":c:macro:`T_OBJECT` (use :c:macro:`Py_T_OBJECT_EX`)" msgstr ":c:macro:`T_OBJECT`\\ (請改用 :c:macro:`Py_T_OBJECT_EX`)" -#: ../../whatsnew/3.12.rst:2299 +#: ../../whatsnew/3.12.rst:2309 msgid ":c:macro:`T_NONE` (previously undocumented, and pretty quirky)" msgstr ":c:macro:`T_NONE`\\ (先前未記錄於文件上,且相當古怪)" -#: ../../whatsnew/3.12.rst:2300 +#: ../../whatsnew/3.12.rst:2310 msgid "The macro ``WRITE_RESTRICTED`` which does nothing." msgstr "不做任何事的巨集 ``WRITE_RESTRICTED``。" -#: ../../whatsnew/3.12.rst:2301 +#: ../../whatsnew/3.12.rst:2311 msgid "" "The macros ``RESTRICTED`` and ``READ_RESTRICTED``, equivalents of :c:macro:" "`Py_AUDIT_READ`." @@ -3743,33 +3755,33 @@ msgstr "" "``RESTRICTED`` 和 ``READ_RESTRICTED`` 這兩個巨集,相當於 :c:macro:" "`Py_AUDIT_READ`。" -#: ../../whatsnew/3.12.rst:2303 +#: ../../whatsnew/3.12.rst:2313 msgid "" "In some configurations, ```` is not included from :file:`Python." "h`. It should be included manually when using ``offsetof()``." msgstr "" -#: ../../whatsnew/3.12.rst:2306 +#: ../../whatsnew/3.12.rst:2316 msgid "" "The deprecated header continues to provide its original contents under the " "original names. Your old code can stay unchanged, unless the extra include " "and non-namespaced macros bother you greatly." msgstr "" -#: ../../whatsnew/3.12.rst:2311 +#: ../../whatsnew/3.12.rst:2321 msgid "" "(Contributed in :gh:`47146` by Petr Viktorin, based on earlier work by " "Alexander Belopolsky and Matthias Braun.)" msgstr "" -#: ../../whatsnew/3.12.rst:2314 +#: ../../whatsnew/3.12.rst:2324 msgid "" ":c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore` are deprecated. Use :c:" "func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` " "instead. (Contributed by Mark Shannon in :gh:`101578`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2319 +#: ../../whatsnew/3.12.rst:2329 msgid "" ":c:func:`!PyErr_Display` is deprecated. Use :c:func:`PyErr_DisplayException` " "instead. (Contributed by Irit Katriel in :gh:`102755`)." @@ -3777,7 +3789,7 @@ msgstr "" ":c:func:`!PyErr_Display` 已棄用,請改用 :c:func:`PyErr_DisplayException`。" "(由 Irit Katriel 於 :gh:`102755` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2322 +#: ../../whatsnew/3.12.rst:2332 msgid "" "``_PyErr_ChainExceptions`` is deprecated. Use ``_PyErr_ChainExceptions1`` " "instead. (Contributed by Irit Katriel in :gh:`102192`.)" @@ -3785,56 +3797,56 @@ msgstr "" "``_PyErr_ChainExceptions`` 已棄用,請改用 ``_PyErr_ChainExceptions1``。(由 " "Irit Katriel 於 :gh:`102192` 中貢獻。)" -#: ../../whatsnew/3.12.rst:2325 +#: ../../whatsnew/3.12.rst:2335 msgid "" "Using :c:func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases` or :c:" "func:`PyType_FromModuleAndSpec` to create a class whose metaclass overrides :" "c:member:`~PyTypeObject.tp_new` is deprecated. Call the metaclass instead." msgstr "" -#: ../../whatsnew/3.12.rst:2333 +#: ../../whatsnew/3.12.rst:2343 msgid "" "The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " "(:pep:`699`; :gh:`101193`)." msgstr "" -#: ../../whatsnew/3.12.rst:2336 +#: ../../whatsnew/3.12.rst:2346 msgid "Global configuration variables:" msgstr "" -#: ../../whatsnew/3.12.rst:2361 +#: ../../whatsnew/3.12.rst:2371 msgid "" "The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" "`PyConfig` instead." msgstr "" ":c:func:`Py_InitializeFromConfig` API 應改為與 :c:type:`PyConfig` 一起使用。" -#: ../../whatsnew/3.12.rst:2364 +#: ../../whatsnew/3.12.rst:2374 msgid "" "Creating :c:data:`immutable types ` with mutable " "bases (:gh:`95388`)." msgstr "" -#: ../../whatsnew/3.12.rst:2370 +#: ../../whatsnew/3.12.rst:2380 msgid "" ":c:func:`PyImport_ImportModuleNoBlock`: use :c:func:`PyImport_ImportModule`" msgstr "" ":c:func:`PyImport_ImportModuleNoBlock`:請改用 :c:func:" "`PyImport_ImportModule`" -#: ../../whatsnew/3.12.rst:2371 +#: ../../whatsnew/3.12.rst:2381 msgid ":c:type:`!Py_UNICODE_WIDE` type: use :c:type:`wchar_t`" msgstr ":c:type:`!Py_UNICODE_WIDE` 型別:請改用 :c:type:`wchar_t`" -#: ../../whatsnew/3.12.rst:2372 +#: ../../whatsnew/3.12.rst:2382 msgid ":c:type:`Py_UNICODE` type: use :c:type:`wchar_t`" msgstr ":c:type:`Py_UNICODE` 型別:請改用 :c:type:`wchar_t`" -#: ../../whatsnew/3.12.rst:2373 +#: ../../whatsnew/3.12.rst:2383 msgid "Python initialization functions:" msgstr "Python 初始化函式:" -#: ../../whatsnew/3.12.rst:2375 +#: ../../whatsnew/3.12.rst:2385 msgid "" ":c:func:`PySys_ResetWarnOptions`: clear :data:`sys.warnoptions` and :data:`!" "warnings.filters`" @@ -3842,27 +3854,27 @@ msgstr "" ":c:func:`PySys_ResetWarnOptions`:清除 :data:`sys.warnoptions` 和 :data:`!" "warnings.filters`" -#: ../../whatsnew/3.12.rst:2377 +#: ../../whatsnew/3.12.rst:2387 msgid ":c:func:`Py_GetExecPrefix`: get :data:`sys.exec_prefix`" msgstr ":c:func:`Py_GetExecPrefix`:取得 :data:`sys.exec_prefix`" -#: ../../whatsnew/3.12.rst:2378 +#: ../../whatsnew/3.12.rst:2388 msgid ":c:func:`Py_GetPath`: get :data:`sys.path`" msgstr ":c:func:`Py_GetPath`:取得 :data:`sys.path`" -#: ../../whatsnew/3.12.rst:2379 +#: ../../whatsnew/3.12.rst:2389 msgid ":c:func:`Py_GetPrefix`: get :data:`sys.prefix`" msgstr ":c:func:`Py_GetPrefix`:取得 :data:`sys.prefix`" -#: ../../whatsnew/3.12.rst:2380 +#: ../../whatsnew/3.12.rst:2390 msgid ":c:func:`Py_GetProgramFullPath`: get :data:`sys.executable`" msgstr ":c:func:`Py_GetProgramFullPath`:取得 :data:`sys.executable`" -#: ../../whatsnew/3.12.rst:2381 +#: ../../whatsnew/3.12.rst:2391 msgid ":c:func:`Py_GetProgramName`: get :data:`sys.executable`" msgstr ":c:func:`Py_GetProgramName`:取得 :data:`sys.executable`" -#: ../../whatsnew/3.12.rst:2382 +#: ../../whatsnew/3.12.rst:2392 msgid "" ":c:func:`Py_GetPythonHome`: get :c:member:`PyConfig.home` or the :envvar:" "`PYTHONHOME` environment variable" @@ -3870,41 +3882,41 @@ msgstr "" ":c:func:`Py_GetPythonHome`:取得 :c:member:`PyConfig.home` 或 :envvar:" "`PYTHONHOME` 環境變數" -#: ../../whatsnew/3.12.rst:2388 +#: ../../whatsnew/3.12.rst:2398 msgid "" "The following APIs are deprecated and will be removed, although there is " "currently no date scheduled for their removal." msgstr "以下 API 已棄用,且將會被移除,雖目前尚未定下移除日期。" -#: ../../whatsnew/3.12.rst:2391 +#: ../../whatsnew/3.12.rst:2401 msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: unneeded since Python 3.8" msgstr ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`:自 Python 3.8 起不再需要" -#: ../../whatsnew/3.12.rst:2392 +#: ../../whatsnew/3.12.rst:2402 msgid ":c:func:`PyErr_Fetch`: use :c:func:`PyErr_GetRaisedException`" msgstr ":c:func:`PyErr_Fetch`:請改用 :c:func:`PyErr_GetRaisedException`" -#: ../../whatsnew/3.12.rst:2393 +#: ../../whatsnew/3.12.rst:2403 msgid "" ":c:func:`PyErr_NormalizeException`: use :c:func:`PyErr_GetRaisedException`" msgstr "" ":c:func:`PyErr_NormalizeException`:請改用 :c:func:`PyErr_GetRaisedException`" -#: ../../whatsnew/3.12.rst:2394 +#: ../../whatsnew/3.12.rst:2404 msgid ":c:func:`PyErr_Restore`: use :c:func:`PyErr_SetRaisedException`" msgstr ":c:func:`PyErr_Restore`:請改用 :c:func:`PyErr_SetRaisedException`" -#: ../../whatsnew/3.12.rst:2395 +#: ../../whatsnew/3.12.rst:2405 msgid "" ":c:func:`PyModule_GetFilename`: use :c:func:`PyModule_GetFilenameObject`" msgstr "" ":c:func:`PyModule_GetFilename`:請改用 :c:func:`PyModule_GetFilenameObject`" -#: ../../whatsnew/3.12.rst:2396 +#: ../../whatsnew/3.12.rst:2406 msgid ":c:func:`PyOS_AfterFork`: use :c:func:`PyOS_AfterFork_Child`" msgstr ":c:func:`PyOS_AfterFork`:請改用 :c:func:`PyOS_AfterFork_Child`" -#: ../../whatsnew/3.12.rst:2397 +#: ../../whatsnew/3.12.rst:2407 msgid "" ":c:func:`PySlice_GetIndicesEx`: use :c:func:`PySlice_Unpack` and :c:func:" "`PySlice_AdjustIndices`" @@ -3912,122 +3924,122 @@ msgstr "" ":c:func:`PySlice_GetIndicesEx`:請改用 :c:func:`PySlice_Unpack` 和 :c:func:" "`PySlice_AdjustIndices`" -#: ../../whatsnew/3.12.rst:2398 +#: ../../whatsnew/3.12.rst:2408 msgid ":c:func:`!PyUnicode_AsDecodedObject`: use :c:func:`PyCodec_Decode`" msgstr ":c:func:`!PyUnicode_AsDecodedObject`:請改用 :c:func:`PyCodec_Decode`" -#: ../../whatsnew/3.12.rst:2399 +#: ../../whatsnew/3.12.rst:2409 msgid ":c:func:`!PyUnicode_AsDecodedUnicode`: use :c:func:`PyCodec_Decode`" msgstr ":c:func:`!PyUnicode_AsDecodedUnicode`:請改用 :c:func:`PyCodec_Decode`" -#: ../../whatsnew/3.12.rst:2400 +#: ../../whatsnew/3.12.rst:2410 msgid ":c:func:`!PyUnicode_AsEncodedObject`: use :c:func:`PyCodec_Encode`" msgstr ":c:func:`!PyUnicode_AsEncodedObject`:請改用 :c:func:`PyCodec_Encode`" -#: ../../whatsnew/3.12.rst:2401 +#: ../../whatsnew/3.12.rst:2411 msgid ":c:func:`!PyUnicode_AsEncodedUnicode`: use :c:func:`PyCodec_Encode`" msgstr ":c:func:`!PyUnicode_AsEncodedUnicode`:請改用 :c:func:`PyCodec_Encode`" -#: ../../whatsnew/3.12.rst:2402 +#: ../../whatsnew/3.12.rst:2412 msgid ":c:func:`PyUnicode_READY`: unneeded since Python 3.12" msgstr ":c:func:`PyUnicode_READY`:自 Python 3.12 起不再需要" -#: ../../whatsnew/3.12.rst:2403 +#: ../../whatsnew/3.12.rst:2413 msgid ":c:func:`!PyErr_Display`: use :c:func:`PyErr_DisplayException`" msgstr ":c:func:`!PyErr_Display`:請改用 :c:func:`PyErr_DisplayException`" -#: ../../whatsnew/3.12.rst:2404 +#: ../../whatsnew/3.12.rst:2414 msgid ":c:func:`!_PyErr_ChainExceptions`: use ``_PyErr_ChainExceptions1``" msgstr ":c:func:`!_PyErr_ChainExceptions`:請改用 ``_PyErr_ChainExceptions1``" -#: ../../whatsnew/3.12.rst:2405 +#: ../../whatsnew/3.12.rst:2415 msgid "" ":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " "instead" msgstr "" ":c:member:`!PyBytesObject.ob_shash` 成員:請改用 :c:func:`PyObject_Hash`" -#: ../../whatsnew/3.12.rst:2407 +#: ../../whatsnew/3.12.rst:2417 msgid ":c:member:`!PyDictObject.ma_version_tag` member" msgstr ":c:member:`!PyDictObject.ma_version_tag` 成員" -#: ../../whatsnew/3.12.rst:2408 +#: ../../whatsnew/3.12.rst:2418 msgid "Thread Local Storage (TLS) API:" msgstr "" -#: ../../whatsnew/3.12.rst:2410 +#: ../../whatsnew/3.12.rst:2420 msgid ":c:func:`PyThread_create_key`: use :c:func:`PyThread_tss_alloc`" msgstr ":c:func:`PyThread_create_key`:請改用 :c:func:`PyThread_tss_alloc`" -#: ../../whatsnew/3.12.rst:2411 +#: ../../whatsnew/3.12.rst:2421 msgid ":c:func:`PyThread_delete_key`: use :c:func:`PyThread_tss_free`" msgstr ":c:func:`PyThread_delete_key`:請改用 :c:func:`PyThread_tss_free`" -#: ../../whatsnew/3.12.rst:2412 +#: ../../whatsnew/3.12.rst:2422 msgid ":c:func:`PyThread_set_key_value`: use :c:func:`PyThread_tss_set`" msgstr ":c:func:`PyThread_set_key_value`:請改用 :c:func:`PyThread_tss_set`" -#: ../../whatsnew/3.12.rst:2413 +#: ../../whatsnew/3.12.rst:2423 msgid ":c:func:`PyThread_get_key_value`: use :c:func:`PyThread_tss_get`" msgstr ":c:func:`PyThread_get_key_value`:請改用 :c:func:`PyThread_tss_get`" -#: ../../whatsnew/3.12.rst:2414 +#: ../../whatsnew/3.12.rst:2424 msgid ":c:func:`PyThread_delete_key_value`: use :c:func:`PyThread_tss_delete`" msgstr "" ":c:func:`PyThread_delete_key_value`:請改用 :c:func:`PyThread_tss_delete`" -#: ../../whatsnew/3.12.rst:2415 +#: ../../whatsnew/3.12.rst:2425 msgid ":c:func:`PyThread_ReInitTLS`: unneeded since Python 3.7" msgstr ":c:func:`PyThread_ReInitTLS`:自 Python 3.7 起不再需要" -#: ../../whatsnew/3.12.rst:2420 +#: ../../whatsnew/3.12.rst:2430 msgid "" "Remove the :file:`token.h` header file. There was never any public tokenizer " "C API. The :file:`token.h` header file was only designed to be used by " "Python internals. (Contributed by Victor Stinner in :gh:`92651`.)" msgstr "" -#: ../../whatsnew/3.12.rst:2425 +#: ../../whatsnew/3.12.rst:2435 msgid "Legacy Unicode APIs have been removed. See :pep:`623` for detail." msgstr "" -#: ../../whatsnew/3.12.rst:2427 +#: ../../whatsnew/3.12.rst:2437 msgid ":c:macro:`!PyUnicode_WCHAR_KIND`" msgstr ":c:macro:`!PyUnicode_WCHAR_KIND`" -#: ../../whatsnew/3.12.rst:2428 +#: ../../whatsnew/3.12.rst:2438 msgid ":c:func:`!PyUnicode_AS_UNICODE`" msgstr ":c:func:`!PyUnicode_AS_UNICODE`" -#: ../../whatsnew/3.12.rst:2429 +#: ../../whatsnew/3.12.rst:2439 msgid ":c:func:`!PyUnicode_AsUnicode`" msgstr ":c:func:`!PyUnicode_AsUnicode`" -#: ../../whatsnew/3.12.rst:2430 +#: ../../whatsnew/3.12.rst:2440 msgid ":c:func:`!PyUnicode_AsUnicodeAndSize`" msgstr ":c:func:`!PyUnicode_AsUnicodeAndSize`" -#: ../../whatsnew/3.12.rst:2431 +#: ../../whatsnew/3.12.rst:2441 msgid ":c:func:`!PyUnicode_AS_DATA`" msgstr ":c:func:`!PyUnicode_AS_DATA`" -#: ../../whatsnew/3.12.rst:2432 +#: ../../whatsnew/3.12.rst:2442 msgid ":c:func:`!PyUnicode_FromUnicode`" msgstr ":c:func:`!PyUnicode_FromUnicode`" -#: ../../whatsnew/3.12.rst:2433 +#: ../../whatsnew/3.12.rst:2443 msgid ":c:func:`!PyUnicode_GET_SIZE`" msgstr ":c:func:`!PyUnicode_GET_SIZE`" -#: ../../whatsnew/3.12.rst:2434 +#: ../../whatsnew/3.12.rst:2444 msgid ":c:func:`!PyUnicode_GetSize`" msgstr ":c:func:`!PyUnicode_GetSize`" -#: ../../whatsnew/3.12.rst:2435 +#: ../../whatsnew/3.12.rst:2445 msgid ":c:func:`!PyUnicode_GET_DATA_SIZE`" msgstr ":c:func:`!PyUnicode_GET_DATA_SIZE`" -#: ../../whatsnew/3.12.rst:2437 +#: ../../whatsnew/3.12.rst:2447 msgid "" "Remove the ``PyUnicode_InternImmortal()`` function macro. (Contributed by " "Victor Stinner in :gh:`85858`.)" diff --git a/whatsnew/3.6.po b/whatsnew/3.6.po index 6677affcfa..fdef7d49a5 100644 --- a/whatsnew/3.6.po +++ b/whatsnew/3.6.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-06 00:03+0000\n" +"POT-Creation-Date: 2023-12-07 00:03+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" "tw)\n" @@ -1140,7 +1140,7 @@ msgid "" "Hettinger in :issue:`17941`.)" msgstr "" -#: ../../whatsnew/3.6.rst:940 ../../whatsnew/3.6.rst:2281 +#: ../../whatsnew/3.6.rst:940 ../../whatsnew/3.6.rst:2282 msgid "" "The *verbose* and *rename* arguments for :func:`~collections.namedtuple` are " "now keyword-only. (Contributed by Raymond Hettinger in :issue:`25628`.)" @@ -2825,18 +2825,18 @@ msgstr "" #: ../../whatsnew/3.6.rst:2163 msgid "" -"The format of the ``co_lnotab`` attribute of code objects changed to support " -"a negative line number delta. By default, Python does not emit bytecode with " -"a negative line number delta. Functions using :attr:`frame.f_lineno`, " -"``PyFrame_GetLineNumber()`` or ``PyCode_Addr2Line()`` are not affected. " -"Functions directly decoding ``co_lnotab`` should be updated to use a signed " -"8-bit integer type for the line number delta, but this is only required to " -"support applications using a negative line number delta. See ``Objects/" -"lnotab_notes.txt`` for the ``co_lnotab`` format and how to decode it, and " -"see the :pep:`511` for the rationale." +"The format of the :attr:`~codeobject.co_lnotab` attribute of code objects " +"changed to support a negative line number delta. By default, Python does not " +"emit bytecode with a negative line number delta. Functions using :attr:" +"`frame.f_lineno`, ``PyFrame_GetLineNumber()`` or ``PyCode_Addr2Line()`` are " +"not affected. Functions directly decoding :attr:`!co_lnotab` should be " +"updated to use a signed 8-bit integer type for the line number delta, but " +"this is only required to support applications using a negative line number " +"delta. See ``Objects/lnotab_notes.txt`` for the :attr:`!co_lnotab` format " +"and how to decode it, and see the :pep:`511` for the rationale." msgstr "" -#: ../../whatsnew/3.6.rst:2173 +#: ../../whatsnew/3.6.rst:2174 msgid "" "The functions in the :mod:`compileall` module now return booleans instead of " "``1`` or ``0`` to represent success or failure, respectively. Thanks to " @@ -2844,7 +2844,7 @@ msgid "" "were doing identity checks for ``1`` or ``0``. See :issue:`25768`." msgstr "" -#: ../../whatsnew/3.6.rst:2178 +#: ../../whatsnew/3.6.rst:2179 msgid "" "Reading the :attr:`~urllib.parse.SplitResult.port` attribute of :func:" "`urllib.parse.urlsplit` and :func:`~urllib.parse.urlparse` results now " @@ -2852,13 +2852,13 @@ msgid "" "const:`None`. See :issue:`20059`." msgstr "" -#: ../../whatsnew/3.6.rst:2183 +#: ../../whatsnew/3.6.rst:2184 msgid "" "The :mod:`!imp` module now raises a :exc:`DeprecationWarning` instead of :" "exc:`PendingDeprecationWarning`." msgstr "" -#: ../../whatsnew/3.6.rst:2186 +#: ../../whatsnew/3.6.rst:2187 msgid "" "The following modules have had missing APIs added to their :attr:`__all__` " "attributes to match the documented APIs: :mod:`calendar`, :mod:`cgi`, :mod:" @@ -2870,21 +2870,21 @@ msgid "" "Kołodziej in :issue:`23883`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2197 +#: ../../whatsnew/3.6.rst:2198 msgid "" "When performing a relative import, if ``__package__`` does not compare equal " "to ``__spec__.parent`` then :exc:`ImportWarning` is raised. (Contributed by " "Brett Cannon in :issue:`25791`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2201 +#: ../../whatsnew/3.6.rst:2202 msgid "" "When a relative import is performed and no parent package is known, then :" "exc:`ImportError` will be raised. Previously, :exc:`SystemError` could be " "raised. (Contributed by Brett Cannon in :issue:`18018`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2205 +#: ../../whatsnew/3.6.rst:2206 msgid "" "Servers based on the :mod:`socketserver` module, including those defined in :" "mod:`http.server`, :mod:`xmlrpc.server` and :mod:`wsgiref.simple_server`, " @@ -2895,20 +2895,20 @@ msgid "" "(Contributed by Martin Panter in :issue:`23430`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2214 +#: ../../whatsnew/3.6.rst:2215 msgid "" ":func:`spwd.getspnam` now raises a :exc:`PermissionError` instead of :exc:" "`KeyError` if the user doesn't have privileges." msgstr "" -#: ../../whatsnew/3.6.rst:2217 +#: ../../whatsnew/3.6.rst:2218 msgid "" "The :meth:`socket.socket.close` method now raises an exception if an error " "(e.g. ``EBADF``) was reported by the underlying system call. (Contributed by " "Martin Panter in :issue:`26685`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2221 +#: ../../whatsnew/3.6.rst:2222 msgid "" "The *decode_data* argument for the :class:`smtpd.SMTPChannel` and :class:" "`smtpd.SMTPServer` constructors is now ``False`` by default. This means that " @@ -2918,7 +2918,7 @@ msgid "" "deprecation warning generated by 3.5 will not be affected." msgstr "" -#: ../../whatsnew/3.6.rst:2229 +#: ../../whatsnew/3.6.rst:2230 msgid "" "All optional arguments of the :func:`~json.dump`, :func:`~json.dumps`, :func:" "`~json.load` and :func:`~json.loads` functions and :class:`~json." @@ -2927,13 +2927,13 @@ msgid "" "(Contributed by Serhiy Storchaka in :issue:`18726`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2236 +#: ../../whatsnew/3.6.rst:2237 msgid "" "Subclasses of :class:`type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." msgstr "" -#: ../../whatsnew/3.6.rst:2239 +#: ../../whatsnew/3.6.rst:2240 msgid "" "As part of :pep:`487`, the handling of keyword arguments passed to :class:" "`type` (other than the metaclass hint, ``metaclass``) is now consistently " @@ -2945,7 +2945,7 @@ msgid "" "__new__` (whether direct or via :class:`super`) accordingly." msgstr "" -#: ../../whatsnew/3.6.rst:2248 +#: ../../whatsnew/3.6.rst:2249 msgid "" "In ``distutils.command.sdist.sdist``, the ``default_format`` attribute has " "been removed and is no longer honored. Instead, the gzipped tarfile format " @@ -2955,13 +2955,13 @@ msgid "" "containing the following:" msgstr "" -#: ../../whatsnew/3.6.rst:2261 +#: ../../whatsnew/3.6.rst:2262 msgid "" "This behavior has also been backported to earlier Python versions by " "Setuptools 26.0.0." msgstr "" -#: ../../whatsnew/3.6.rst:2264 +#: ../../whatsnew/3.6.rst:2265 msgid "" "In the :mod:`urllib.request` module and the :meth:`http.client." "HTTPConnection.request` method, if no Content-Length header field has been " @@ -2972,47 +2972,47 @@ msgid "" "`12319`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2273 +#: ../../whatsnew/3.6.rst:2274 msgid "" "The :class:`~csv.DictReader` now returns rows of type :class:`~collections." "OrderedDict`. (Contributed by Steve Holden in :issue:`27842`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2277 +#: ../../whatsnew/3.6.rst:2278 msgid "" "The :const:`crypt.METHOD_CRYPT` will no longer be added to ``crypt.methods`` " "if unsupported by the platform. (Contributed by Victor Stinner in :issue:" "`25287`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2285 +#: ../../whatsnew/3.6.rst:2286 msgid "" "On Linux, :func:`ctypes.util.find_library` now looks in ``LD_LIBRARY_PATH`` " "for shared libraries. (Contributed by Vinay Sajip in :issue:`9998`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2289 +#: ../../whatsnew/3.6.rst:2290 msgid "" "The :class:`imaplib.IMAP4` class now handles flags containing the ``']'`` " "character in messages sent from the server to improve real-world " "compatibility. (Contributed by Lita Cho in :issue:`21815`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2294 +#: ../../whatsnew/3.6.rst:2295 msgid "" "The :func:`mmap.write() ` function now returns the number of " "bytes written like other write methods. (Contributed by Jakub Stasiak in :" "issue:`26335`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2298 +#: ../../whatsnew/3.6.rst:2299 msgid "" "The :func:`pkgutil.iter_modules` and :func:`pkgutil.walk_packages` functions " "now return :class:`~pkgutil.ModuleInfo` named tuples. (Contributed by " "Ramchandra Apte in :issue:`17211`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2302 +#: ../../whatsnew/3.6.rst:2303 msgid "" ":func:`re.sub` now raises an error for invalid numerical group references in " "replacement templates even if the pattern is not found in the string. The " @@ -3021,7 +3021,7 @@ msgid "" "in :issue:`25953`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2308 +#: ../../whatsnew/3.6.rst:2309 msgid "" ":class:`zipfile.ZipFile` will now raise :exc:`NotImplementedError` for " "unrecognized compression values. Previously a plain :exc:`RuntimeError` was " @@ -3031,7 +3031,7 @@ msgid "" "`RuntimeError` was raised in those scenarios." msgstr "" -#: ../../whatsnew/3.6.rst:2315 +#: ../../whatsnew/3.6.rst:2316 msgid "" "when custom metaclasses are combined with zero-argument :func:`super` or " "direct references from methods to the implicit ``__class__`` closure " @@ -3041,7 +3041,7 @@ msgid "" "Python 3.8." msgstr "" -#: ../../whatsnew/3.6.rst:2322 +#: ../../whatsnew/3.6.rst:2323 msgid "" "With the introduction of :exc:`ModuleNotFoundError`, import system consumers " "may start expecting import system replacements to raise that more specific " @@ -3054,11 +3054,11 @@ msgid "" "the default import system will raise the new subclass when appropriate." msgstr "" -#: ../../whatsnew/3.6.rst:2334 +#: ../../whatsnew/3.6.rst:2335 msgid "Changes in the C API" msgstr "C API 中的改動" -#: ../../whatsnew/3.6.rst:2336 +#: ../../whatsnew/3.6.rst:2337 msgid "" "The :c:func:`PyMem_Malloc` allocator family now uses the :ref:`pymalloc " "allocator ` rather than the system :c:func:`malloc`. Applications " @@ -3067,29 +3067,29 @@ msgid "" "usage of memory allocators in your application. See :issue:`26249`." msgstr "" -#: ../../whatsnew/3.6.rst:2342 +#: ../../whatsnew/3.6.rst:2343 msgid "" ":c:func:`Py_Exit` (and the main interpreter) now override the exit status " "with 120 if flushing buffered data failed. See :issue:`5319`." msgstr "" -#: ../../whatsnew/3.6.rst:2347 +#: ../../whatsnew/3.6.rst:2348 msgid "CPython bytecode changes" msgstr "" -#: ../../whatsnew/3.6.rst:2349 +#: ../../whatsnew/3.6.rst:2350 msgid "" "There have been several major changes to the :term:`bytecode` in Python 3.6." msgstr "" -#: ../../whatsnew/3.6.rst:2351 +#: ../../whatsnew/3.6.rst:2352 msgid "" "The Python interpreter now uses a 16-bit wordcode instead of bytecode. " "(Contributed by Demur Rumed with input and reviews from Serhiy Storchaka and " "Victor Stinner in :issue:`26647` and :issue:`28050`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2355 +#: ../../whatsnew/3.6.rst:2356 msgid "" "The new :opcode:`FORMAT_VALUE` and :opcode:`BUILD_STRING` opcodes as part of " "the :ref:`formatted string literal ` implementation. " @@ -3097,14 +3097,14 @@ msgid "" "`27078`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2360 +#: ../../whatsnew/3.6.rst:2361 msgid "" "The new :opcode:`BUILD_CONST_KEY_MAP` opcode to optimize the creation of " "dictionaries with constant keys. (Contributed by Serhiy Storchaka in :issue:" "`27140`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2364 +#: ../../whatsnew/3.6.rst:2365 msgid "" "The function call opcodes have been heavily reworked for better performance " "and simpler implementation. The :opcode:`MAKE_FUNCTION`, :opcode:" @@ -3116,22 +3116,22 @@ msgid "" "issue:`27095`, and Serhiy Storchaka in :issue:`27213`, :issue:`28257`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2375 +#: ../../whatsnew/3.6.rst:2376 msgid "" "The new :opcode:`SETUP_ANNOTATIONS` and :opcode:`STORE_ANNOTATION` opcodes " "have been added to support the new :term:`variable annotation` syntax. " "(Contributed by Ivan Levkivskyi in :issue:`27985`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2381 +#: ../../whatsnew/3.6.rst:2382 msgid "Notable changes in Python 3.6.2" msgstr "" -#: ../../whatsnew/3.6.rst:2384 +#: ../../whatsnew/3.6.rst:2385 msgid "New ``make regen-all`` build target" msgstr "" -#: ../../whatsnew/3.6.rst:2386 +#: ../../whatsnew/3.6.rst:2387 msgid "" "To simplify cross-compilation, and to ensure that CPython can reliably be " "compiled without requiring an existing version of Python to already be " @@ -3139,43 +3139,43 @@ msgid "" "recompile generated files based on file modification times." msgstr "" -#: ../../whatsnew/3.6.rst:2391 +#: ../../whatsnew/3.6.rst:2392 msgid "" "Instead, a new ``make regen-all`` command has been added to force " "regeneration of these files when desired (e.g. after an initial version of " "Python has already been built based on the pregenerated versions)." msgstr "" -#: ../../whatsnew/3.6.rst:2395 +#: ../../whatsnew/3.6.rst:2396 msgid "" "More selective regeneration targets are also defined - see :source:`Makefile." "pre.in` for details." msgstr "" -#: ../../whatsnew/3.6.rst:2398 ../../whatsnew/3.6.rst:2411 +#: ../../whatsnew/3.6.rst:2399 ../../whatsnew/3.6.rst:2412 msgid "(Contributed by Victor Stinner in :issue:`23404`.)" msgstr "(由 Victor Stinner 於 :issue:`23404` 中貢獻。)" -#: ../../whatsnew/3.6.rst:2404 +#: ../../whatsnew/3.6.rst:2405 msgid "Removal of ``make touch`` build target" msgstr "" -#: ../../whatsnew/3.6.rst:2406 +#: ../../whatsnew/3.6.rst:2407 msgid "" "The ``make touch`` build target previously used to request implicit " "regeneration of generated files by updating their modification times has " "been removed." msgstr "" -#: ../../whatsnew/3.6.rst:2409 +#: ../../whatsnew/3.6.rst:2410 msgid "It has been replaced by the new ``make regen-all`` target." msgstr "" -#: ../../whatsnew/3.6.rst:2417 +#: ../../whatsnew/3.6.rst:2418 msgid "Notable changes in Python 3.6.4" msgstr "" -#: ../../whatsnew/3.6.rst:2419 +#: ../../whatsnew/3.6.rst:2420 msgid "" "The ``PyExc_RecursionErrorInst`` singleton that was part of the public API " "has been removed as its members being never cleared may cause a segfault " @@ -3183,22 +3183,22 @@ msgid "" "issue:`22898` and :issue:`30697`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2426 +#: ../../whatsnew/3.6.rst:2427 msgid "Notable changes in Python 3.6.5" msgstr "" -#: ../../whatsnew/3.6.rst:2428 +#: ../../whatsnew/3.6.rst:2429 msgid "" "The :func:`locale.localeconv` function now sets temporarily the ``LC_CTYPE`` " "locale to the ``LC_NUMERIC`` locale in some cases. (Contributed by Victor " "Stinner in :issue:`31900`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2433 +#: ../../whatsnew/3.6.rst:2434 msgid "Notable changes in Python 3.6.7" msgstr "" -#: ../../whatsnew/3.6.rst:2435 +#: ../../whatsnew/3.6.rst:2436 msgid "" "In 3.6.7 the :mod:`tokenize` module now implicitly emits a ``NEWLINE`` token " "when provided with input that does not have a trailing new line. This " @@ -3206,11 +3206,11 @@ msgid "" "Ammar Askar in :issue:`33899`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2441 +#: ../../whatsnew/3.6.rst:2442 msgid "Notable changes in Python 3.6.10" msgstr "" -#: ../../whatsnew/3.6.rst:2443 +#: ../../whatsnew/3.6.rst:2444 msgid "" "Due to significant security concerns, the *reuse_address* parameter of :meth:" "`asyncio.loop.create_datagram_endpoint` is no longer supported. This is " @@ -3220,11 +3220,11 @@ msgid "" "`37228`.)" msgstr "" -#: ../../whatsnew/3.6.rst:2451 +#: ../../whatsnew/3.6.rst:2452 msgid "Notable changes in Python 3.6.13" msgstr "" -#: ../../whatsnew/3.6.rst:2453 +#: ../../whatsnew/3.6.rst:2454 msgid "" "Earlier Python versions allowed using both ``;`` and ``&`` as query " "parameter separators in :func:`urllib.parse.parse_qs` and :func:`urllib." diff --git a/whatsnew/3.7.po b/whatsnew/3.7.po index 49623ba010..7b26e070f6 100644 --- a/whatsnew/3.7.po +++ b/whatsnew/3.7.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.12\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-06 00:03+0000\n" +"POT-Creation-Date: 2023-12-08 00:03+0000\n" "PO-Revision-Date: 2018-07-15 18:56+0800\n" "Last-Translator: \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -3024,9 +3024,8 @@ msgstr "" #: ../../whatsnew/3.7.rst:2147 msgid "" -"The ``splitunc()`` function in the :mod:`ntpath` module was deprecated in " -"Python 3.1, and has now been removed. Use the :func:`~os.path.splitdrive` " -"function instead." +"The :func:`!ntpath.splitunc` function was deprecated in Python 3.1, and has " +"now been removed. Use :func:`~os.path.splitdrive` instead." msgstr "" #: ../../whatsnew/3.7.rst:2151